pySTDLM.Distributions#

Functions

setLMLogConsole([level])

Set the logger to write to the console as the code is working

setLMLogFile(filename[, level])

Set up file handler to print log to file

setLMLoggerLevel(level)

Set the level of the logger for the application

Classes

ParticleGenerator(gen, ptype)

A particle generator that adds particles to a particular region of a simulation.

class pySTDLM.Distributions.ParticleGenerator(gen, ptype)[source]#

Bases: object

A particle generator that adds particles to a particular region of a simulation.

Parameters:
  • gen – A PDF set for x,y,z that on the domain [-1,1] and range [0,1) where x is the range of interest

  • ptype – The name of the particle

addParticlesToRegion(rdmesim, region, number, directions, spatial=None)[source]#

Add a number of particles to a region based on Monte-Carlo sampling of the generator

Parameters:
  • rdmesim – An RDME simulation object that has already been “discretized”

  • region – A region name of the simulation to add particles to

  • number – The number of the particle to add

  • directions – A list of the form (x,y,z) where a 0 indicates a uniform distribution in that direction and a 1 indicates the particles are sampled from the generator in that direction

  • spatial (OPTIONAL) – A definition of a subsection of the domain that this generation should occur in as a list of lists [[xl,yl,zl],[xh,yh,zh]], otherwise the generator is scaled from (0,0,0) to domain extends (w,h,d)