lm#

Lattice Microbes Python Bindings

Functions

SimulationFile_create(filename)

create(filename, initializeModel, numberSpecies=0)

SimulationFile_isValidFile(filename)

isValidFile(filename) -> bool

getCompiledLatticeMaxOccupancy()

runSimulation(simulationFilename, replicate, ...)

runSimulation(simulationFilename, replicate, solverClass, cudaDevices, checkpointInterval)

runSolver(simulationFilename, replicate, ...)

runSolver(simulationFilename, replicate, solver, cudaDevices, checkpointInterval)

setVerbosityLevel(x)

Classes

ByteLattice(*args)

A Lattice that is based on packed bytes of memory, i.e. one byte per lattice site to hold particles.

CMESolver(*args, **kwargs)

C++ includes: CMESolver.h

Capsule(p1, p2, radius, type)

A Shape representing a cylinder with hemispherical ends.

CapsuleShell(p1, p2, innerRadius, ...)

A capsule shell Shape with a hollow inside.

Cone(*args)

A Shape that represents a Cone.

Cuboid(*args)

A cube-like Shape.

CudaByteLattice(*args)

C++ includes: CudaByteLattice.h

CudaIntLattice(*args)

C++ includes: CudaIntLattice.h

Cylinder(p1, p2, radius, type)

A Shape representing a cylinder.

Difference(s1, s2, type[, symmetric])

A Shape that represents a Difference between the first and second object.

DiffusionModel()

Ellipse(*args)

C++ includes: Ellipse.h

GillespieDSolver()

C++ includes: GillespieDSolver.h

Hemisphere(center, radius, orientation, type)

A hemisphere Shape.

IntLattice(*args)

A Lattice that is based on one particle per word, with sites strided per particle.

IntMpdRdmeSolver()

C++ includes: IntMpdRdmeSolver.h

Intersection(s1, s2, type)

A Shape that represents a Intersection of two shapes.

Lattice(*args, **kwargs)

Base class for lattice type objects.

LatticeBuilder(xLen, yLen, zLen, ...)

A class that defines regions of a lattice based on a set of geometries defined by shapes.

MESolver(*args, **kwargs)

An abstract base class for all Master Equation solvers, this is essentially a representation of "the simulation instance".

MGPUIntMpdRdmeSolver()

C++ includes: MGPUIntMpdRdmeSolver.h

MGPUMpdRdmeSolver()

C++ includes: MGPUMpdRdmeSolver.h

MpdRdmeSolver()

C++ includes: MpdRdmeSolver.h

NextReactionSolver(*args)

C++ includes: NextReactionSolver.h

ReactionModel()

ReactionModel_Reaction()

Shape(*args, **kwargs)

Abstract base class for all the shapes in Lattice Microbes simulation builder.

SimulationFile(filename)

A representation of the simulation that is used to input or output from an HDF5 file.

SpatialModel()

Sphere(center, radius, type)

A Shape that represents a Sphere.

SwigPyIterator(*args, **kwargs)

Torus(*args)

A Shape that represents a Torus.

Union(s1, s2, type)

A Shape that represents a Union between two shapes.

UnionSet(type)

A Shape that represents a Union of many shapes.

bounding_box(*args)

The bounds for a shape represented as a rectangular box.

point([x, y, z])

Type to store a position in space.

stdVectorInt(*args)

vector([x, y, z])

A vector which points in a direction.

class lm.ByteLattice(*args)[source]#

Bases: Lattice

A Lattice that is based on packed bytes of memory, i.e. one byte per lattice site to hold particles.

C++ includes: ByteLattice.h

ByteLattice(xSize, ySize, zSize, spacing, particlesPerSite)

addParticle(x, y, z, particle)[source]#

addParticle(index, particle)

Add a particle to the specified site.

findParticles(minParticleType, maxParticleType)[source]#

findParticles(minParticleType, maxParticleType) -> std::vector< particle_loc_t >

Get the number of the specified particles types in the lattice.

getMaxOccupancy()#

getMaxOccupancy() -> site_size_t

Get the maximum number of particles that can live in a site.

getNumberSites()#

getNumberSites() -> lattice_size_t

Get total number of sites in the Lattice.

getOccupancy(x, y, z)[source]#

getOccupancy(index) -> site_size_t

Get the number of particles in the specified lattice site.

getParticle(x, y, z, particleIndex)[source]#

getParticle(index, particleIndex) -> particle_t

Get the particle at the specified site with at the specified number in the particle list.

getParticleCounts()[source]#

getParticleCounts() -> std::map< particle_t, uint >

Get the number of each particle type in the lattice.

Particle searching methods.

getParticleLatticeView()[source]#

getParticleLatticeView(particleLattice, Nw, Nz, Ny, Nx, Np)

getSiteLatticeView()[source]#

getSiteLatticeView(siteLattice, Nz, Ny, Nx)

getSiteType(x, y, z)[source]#

getSiteType(index) -> site_t

Get the site type at the specified location.

getSize()#

getSize() -> lattice_coord_t

Get size of the Lattice.

getSpacing()#

getSpacing() -> si_dist_t

Get spacing between lattice sites.

getXSize()#

getXSize() -> lattice_size_t

Get x dimension of the Lattice.

getYSize()#

getYSize() -> lattice_size_t

Get y dimension of the Lattice.

getZSize()#

getZSize() -> lattice_size_t

Get z dimension of the Lattice.

removeParticles(x, y, z)[source]#

removeParticles(index)

Remove a particle to the specified site.

setSiteType(x, y, z, siteType)[source]#

setSiteType(index, site)

Set the site type at the specified location.

property thisown#

The membership flag

class lm.CMESolver(*args, **kwargs)[source]#

Bases: MESolver

C++ includes: CMESolver.h

getReactionRateConstantsView(reactionNumber)[source]#

getReactionRateConstantsView(reactionNumber, rates, rateConstantCount)

getSpeciesCountView()[source]#

getSpeciesCountView(counts, number)

initialize(replicate, parameters, resources)[source]#

initialize(replicate, parameters, resources)

Initialize the simulation.

Parameters:
  • replicate (*) – Replicate number out of total replicates

  • parameters (*) – A map of all the parameters for the simulation

  • A (*) – list of resources assigned to the simulation

property thisown#

The membership flag

class lm.Capsule(p1, p2, radius, type)[source]#

Bases: Shape

A Shape representing a cylinder with hemispherical ends.

C++ includes: Capsule.h

Capsule(p1, p2, radius, type)

Create a Capsule.

Parameters:
  • p1 (*) – Point of first end of cylinder

  • p2 (*) – Point of second end of cylinder

  • radius (*) – Radius of the capsule cylinder/hemispheres ends

  • type (*) – Site type of the capsule

boundingBoxesIntersect(query)#

boundingBoxesIntersect(query) -> bool

Checks if another shape’s bounding box interstects with this shape’s bounding box.

Parameters:

query (*) – The other shape to test

Return type:

true/false

contains(query)[source]#

contains(query) -> bool

Determine if the shape contains the specified shape.

Parameters:

query (*) – Shape to test

Return type:

true/false

getBoundingBox()#

getBoundingBox() -> bounding_box

Get the bounding box.

getP1()[source]#

getP1() -> point

Get point of first end of cylinder.

getP2()[source]#

getP2() -> point

Get point of second end of cylinder.

getRadius()[source]#

getRadius() -> si_dist_t

Get the radius of the cylinder/hemisphere ends.

getType()#

getType() -> site_t

Get the site type associated with the shape.

getVolume()#

getVolume() -> double

Get the total internal volume of the shape.

intersects(query)[source]#

intersects(query) -> bool

Check if two shapes intersect.

Parameters:

query (*) – The other shape to check

Return type:

true/false

property thisown#

The membership flag

class lm.CapsuleShell(p1, p2, innerRadius, outerRadius, type)[source]#

Bases: Shape

A capsule shell Shape with a hollow inside.

C++ includes: CapsuleShell.h

CapsuleShell(p1, p2, innerRadius, outerRadius, type)

Create a Capsule.

Parameters:
  • p1 (*) – Point of first end of cylinder

  • p2 (*) – Point of second end of cylinder

  • innerRadius (*) – Inner radius of the capsule shell

  • outerRadius (*) – Outer radius of the capsule shell

  • type (*) – Type of the sites in the capsule shell

boundingBoxesIntersect(query)#

boundingBoxesIntersect(query) -> bool

Checks if another shape’s bounding box interstects with this shape’s bounding box.

Parameters:

query (*) – The other shape to test

Return type:

true/false

contains(query)[source]#

contains(query) -> bool

Determine if the shape contains the specified shape.

Parameters:

query (*) – Shape to test

Return type:

true/false

getBoundingBox()#

getBoundingBox() -> bounding_box

Get the bounding box.

getInnerRadius()[source]#

getInnerRadius() -> si_dist_t

Get the inner radius of the cylinder.

getOuterRadius()[source]#

getOuterRadius() -> si_dist_t

Get the outer radius of the cylinder.

getP1()[source]#

getP1() -> point

Get point of first end of cylinder.

getP2()[source]#

getP2() -> point

Get point of second end of cylinder.

getType()#

getType() -> site_t

Get the site type associated with the shape.

getVolume()#

getVolume() -> double

Get the total internal volume of the shape.

intersects(query)[source]#

intersects(query) -> bool

Check if two shapes intersect.

Parameters:

query (*) – The other shape to check

Return type:

true/false

property thisown#

The membership flag

class lm.Cone(*args)[source]#

Bases: Shape

A Shape that represents a Cone.

C++ includes: Cone.h

Cone(center, radius, height, type, normal=vector(1.0, 0.0, 0.0))

Create a Cone.

Parameters:
  • center (*) – Point center of the circle of the base

  • radius (*) – Radius of the base

  • height (*) – Height of the cone

  • type (*) – The type of the sites within the cone

  • normal (*) – Normal to the center of the cone base

boundingBoxesIntersect(query)#

boundingBoxesIntersect(query) -> bool

Checks if another shape’s bounding box interstects with this shape’s bounding box.

Parameters:

query (*) – The other shape to test

Return type:

true/false

contains(query)[source]#

contains(query) -> bool

Determine if the shape contains the specified shape.

Parameters:

query (*) – Shape to test

Return type:

true/false

getBoundingBox()#

getBoundingBox() -> bounding_box

Get the bounding box.

getCenter()[source]#

getCenter() -> point

Get the center of the cone.

getHeight()[source]#

getHeight() -> si_dist_t

Get the height of the cone.

getRadius()[source]#

getRadius() -> si_dist_t

Get the radius of the cone.

getType()#

getType() -> site_t

Get the site type associated with the shape.

getVolume()#

getVolume() -> double

Get the total internal volume of the shape.

intersects(query)[source]#

intersects(query) -> bool

Check if two shapes intersect.

Parameters:

query (*) – The other shape to check

Return type:

true/false

property thisown#

The membership flag

class lm.Cuboid(*args)[source]#

Bases: Shape

A cube-like Shape.

C++ includes: Cuboid.h

Cuboid(center, w, h, d, type, at=vector(1.0, 0.0, 0.0), up=vector(0.0, 1.0, 0.0))

Create a Cuboid based on two orientations, and a width, height, depth.

center The definition of the center of the cuboid

Parameters:
  • w (*) – Width (along x axis when unrotated)

  • h (*) – Height (along y axis when unrotated)

  • d (*) – Depth (along z axis when unrotated)

  • at (*) – A vector representing where the cuboid is pointing (default along x axis)

  • at – A vector representing where the cuboid up is (default along y axis)

boundingBoxesIntersect(query)#

boundingBoxesIntersect(query) -> bool

Checks if another shape’s bounding box interstects with this shape’s bounding box.

Parameters:

query (*) – The other shape to test

Return type:

true/false

contains(query)[source]#

contains(query) -> bool

Determine if the shape contains the specified shape.

Parameters:

query (*) – Shape to test

Return type:

true/false

getBoundingBox()#

getBoundingBox() -> bounding_box

Get the bounding box.

getP1()[source]#

getP1() -> point

Get the lower point.

getP2()[source]#

getP2() -> point

Get the upper point.

getType()#

getType() -> site_t

Get the site type associated with the shape.

getVolume()#

getVolume() -> double

Get the total internal volume of the shape.

intersects(query)[source]#

intersects(query) -> bool

Check if two shapes intersect.

Parameters:

query (*) – The other shape to check

Return type:

true/false

property thisown#

The membership flag

class lm.CudaByteLattice(*args)[source]#

Bases: ByteLattice

C++ includes: CudaByteLattice.h

CudaByteLattice(xSize, ySize, zSize, spacing, particlesPerSite)

addParticle(x, y, z, particle)#

addParticle(index, particle)

Add a particle to the specified site.

findParticles(minParticleType, maxParticleType)#

findParticles(minParticleType, maxParticleType) -> std::vector< particle_loc_t >

Get the number of the specified particles types in the lattice.

getGPUMemoryDest()[source]#

getGPUMemoryDest() -> void *

getGPUMemorySiteTypes()[source]#

getGPUMemorySiteTypes() -> void *

getGPUMemorySrc()[source]#

getGPUMemorySrc() -> void *

getMaxOccupancy()#

getMaxOccupancy() -> site_size_t

Get the maximum number of particles that can live in a site.

getNumberSites()#

getNumberSites() -> lattice_size_t

Get total number of sites in the Lattice.

getOccupancy(x, y, z)#

getOccupancy(index) -> site_size_t

Get the number of particles in the specified lattice site.

getParticle(x, y, z, particleIndex)#

getParticle(index, particleIndex) -> particle_t

Get the particle at the specified site with at the specified number in the particle list.

getParticleCounts()[source]#

getParticleCounts() -> std::map< particle_t, uint >

Get the number of each particle type in the lattice.

Particle searching methods.

getParticleLatticeView()#

getParticleLatticeView(particleLattice, Nw, Nz, Ny, Nx, Np)

getSiteLatticeView()#

getSiteLatticeView(siteLattice, Nz, Ny, Nx)

getSiteType(x, y, z)#

getSiteType(index) -> site_t

Get the site type at the specified location.

getSize()#

getSize() -> lattice_coord_t

Get size of the Lattice.

getSpacing()#

getSpacing() -> si_dist_t

Get spacing between lattice sites.

getXSize()#

getXSize() -> lattice_size_t

Get x dimension of the Lattice.

getYSize()#

getYSize() -> lattice_size_t

Get y dimension of the Lattice.

getZSize()#

getZSize() -> lattice_size_t

Get z dimension of the Lattice.

removeParticles(x, y, z)#

removeParticles(index)

Remove a particle to the specified site.

setSiteType(x, y, z, siteType)#

setSiteType(index, site)

Set the site type at the specified location.

swapSrcDest()[source]#

swapSrcDest()

property thisown#

The membership flag

class lm.CudaIntLattice(*args)[source]#

Bases: IntLattice

C++ includes: CudaIntLattice.h

CudaIntLattice(xSize, ySize, zSize, spacing, particlesPerSite)

addParticle(x, y, z, particle)#

addParticle(index, particle)

Add a particle to the specified site.

findParticles(minParticleType, maxParticleType)#

findParticles(minParticleType, maxParticleType) -> std::vector< particle_loc_t >

Get the number of the specified particles types in the lattice.

getGPUMemoryDest()[source]#

getGPUMemoryDest() -> void *

getGPUMemorySiteTypes()[source]#

getGPUMemorySiteTypes() -> void *

getGPUMemorySrc()[source]#

getGPUMemorySrc() -> void *

getMaxOccupancy()#

getMaxOccupancy() -> site_size_t

Get the maximum number of particles that can live in a site.

getNumberSites()#

getNumberSites() -> lattice_size_t

Get total number of sites in the Lattice.

getOccupancy(x, y, z)#

getOccupancy(index) -> site_size_t

Get the number of particles in the specified lattice site.

getParticle(x, y, z, particleIndex)#

getParticle(index, particleIndex) -> particle_t

Get the particle at the specified site with at the specified number in the particle list.

getParticleCounts()#

getParticleCounts() -> std::map< particle_t, uint >

Get the number of each particle type in the lattice.

Particle searching methods.

getParticleLatticeView()#

getParticleLatticeView(particleLattice, Nw, Nz, Ny, Nx, Np)

getSiteLatticeView()#

getSiteLatticeView(siteLattice, Nz, Ny, Nx)

getSiteType(x, y, z)#

getSiteType(index) -> site_t

Get the site type at the specified location.

getSize()#

getSize() -> lattice_coord_t

Get size of the Lattice.

getSpacing()#

getSpacing() -> si_dist_t

Get spacing between lattice sites.

getXSize()#

getXSize() -> lattice_size_t

Get x dimension of the Lattice.

getYSize()#

getYSize() -> lattice_size_t

Get y dimension of the Lattice.

getZSize()#

getZSize() -> lattice_size_t

Get z dimension of the Lattice.

removeParticles(x, y, z)#

removeParticles(index)

Remove a particle to the specified site.

setSiteType(x, y, z, siteType)#

setSiteType(index, site)

Set the site type at the specified location.

swapSrcDest()[source]#

swapSrcDest()

property thisown#

The membership flag

class lm.Cylinder(p1, p2, radius, type)[source]#

Bases: Shape

A Shape representing a cylinder.

C++ includes: Cylinder.h

Cylinder(p1, p2, radius, type)

Create a Cylinder.

Parameters:
  • p1 (*) – Point of first end of cylinder

  • p2 (*) – Point of second end of cylinder

  • radius (*) – Radius of the capsule cylinder/hemispheres ends

  • type (*) – Site type of the capsule

boundingBoxesIntersect(query)#

boundingBoxesIntersect(query) -> bool

Checks if another shape’s bounding box interstects with this shape’s bounding box.

Parameters:

query (*) – The other shape to test

Return type:

true/false

contains(query)[source]#

contains(query) -> bool

Determine if the shape contains the specified shape.

Parameters:

query (*) – Shape to test

Return type:

true/false

getBoundingBox()#

getBoundingBox() -> bounding_box

Get the bounding box.

getP1()[source]#

getP1() -> point

Get point of first end of cylinder.

getP2()[source]#

getP2() -> point

Get point of second end of cylinder.

getRadius()[source]#

getRadius() -> si_dist_t

Get the radius of the cylinder/hemisphere ends.

getType()#

getType() -> site_t

Get the site type associated with the shape.

getVolume()#

getVolume() -> double

Get the total internal volume of the shape.

intersects(query)[source]#

intersects(query) -> bool

Check if two shapes intersect.

Parameters:

query (*) – The other shape to check

Return type:

true/false

property thisown#

The membership flag

class lm.Difference(s1, s2, type, symmetric=False)[source]#

Bases: Shape

A Shape that represents a Difference between the first and second object.

C++ includes: Difference.h

Difference(s1, s2, type, symmetric=false)

Create a Difference.

Parameters:
  • s1 (*) – The first shape to Difference

  • s2 (*) – The second shape to Difference

  • type (*) – The type of the sites within the difference

  • symmetric (*) – Determine if the difference is symmetric. If false, difference is the 1st shape minus the second shape

boundingBoxesIntersect(query)#

boundingBoxesIntersect(query) -> bool

Checks if another shape’s bounding box interstects with this shape’s bounding box.

Parameters:

query (*) – The other shape to test

Return type:

true/false

contains(query)[source]#

contains(query) -> bool

Determine if the shape contains the specified shape.

Parameters:

query (*) – Shape to test

Return type:

true/false

getBoundingBox()#

getBoundingBox() -> bounding_box

Get the bounding box.

getType()#

getType() -> site_t

Get the site type associated with the shape.

getVolume()#

getVolume() -> double

Get the total internal volume of the shape.

intersects(query)[source]#

intersects(query) -> bool

Check if two shapes intersect.

Parameters:

query (*) – The other shape to check

Return type:

true/false

property thisown#

The membership flag

class lm.DiffusionModel[source]#

Bases: object

add_diffusion_matrix(arg2)[source]#
add_reaction_location_matrix(arg2)[source]#
bytes_per_particle()[source]#
diffusion_matrix(arg2)[source]#
lattice_spacing()[source]#
lattice_x_size()[source]#
lattice_y_size()[source]#
lattice_z_size()[source]#
number_site_types()[source]#
number_species()[source]#
particles_per_site()[source]#
reaction_location_matrix(arg2)[source]#
set_bytes_per_particle(arg2)[source]#
set_diffusion_matrix(arg2, arg3)[source]#
set_lattice_spacing(arg2)[source]#
set_lattice_x_size(arg2)[source]#
set_lattice_y_size(arg2)[source]#
set_lattice_z_size(arg2)[source]#
set_number_reactions(arg2)[source]#
set_number_site_types(arg2)[source]#
set_number_species(arg2)[source]#
set_particles_per_site(arg2)[source]#
set_reaction_location_matrix(arg2, arg3)[source]#
property thisown#

The membership flag

class lm.Ellipse(*args)[source]#

Bases: Shape

C++ includes: Ellipse.h

Ellipse(center, r1, r2, r3, type, orientation1=vector(0.0, 0.0, 1.0), orientation2=vector(0.0, 1.0, 0.0))

Create a Ellipse.

Parameters:
  • center (*) – Point center of the circle of the slice plane through the sphere

  • r1 (*) – First axis radius of the Ellipse

  • r2 (*) – Second axis radius of the Ellipse

  • r3 (*) – Third axis radius of the Ellipse

  • type (*) – The type of the sites within the sphere

  • orientation1 (*) – The direction along which to lay the first axis, default: along the z-axis

  • orientation2 (*) – The direction along which to lay the second axis, default: along the y-axis

boundingBoxesIntersect(query)#

boundingBoxesIntersect(query) -> bool

Checks if another shape’s bounding box interstects with this shape’s bounding box.

Parameters:

query (*) – The other shape to test

Return type:

true/false

contains(query)[source]#

contains(query) -> bool

Determine if the shape contains the specified shape.

Parameters:

query (*) – Shape to test

Return type:

true/false

getBoundingBox()#

getBoundingBox() -> bounding_box

Get the bounding box.

getCenter()[source]#

getCenter() -> point

Get the center of the sphere.

getRadius1()[source]#

getRadius1() -> si_dist_t

Get the first radius of the sphere.

getRadius2()[source]#

getRadius2() -> si_dist_t

Get the second radius of the sphere.

getRadius3()[source]#

getRadius3() -> si_dist_t

Get the third radius of the sphere.

getType()#

getType() -> site_t

Get the site type associated with the shape.

getVolume()#

getVolume() -> double

Get the total internal volume of the shape.

intersects(query)[source]#

intersects(query) -> bool

Check if two shapes intersect.

Parameters:

query (*) – The other shape to check

Return type:

true/false

setCenter(center)[source]#

setCenter(center)

Set the center of the sphere.

Parameters:

center (*) – Point of the center

property thisown#

The membership flag

class lm.GillespieDSolver[source]#

Bases: CMESolver

C++ includes: GillespieDSolver.h

GillespieDSolver()

getReactionRateConstantsView(reactionNumber)[source]#

getReactionRateConstantsView(reactionNumber, rates, rateConstantCount)

getSpeciesCountView()[source]#

getSpeciesCountView(counts, number)

hookSimulation(time)[source]#
initialize(replicate, parameters, resources)[source]#

initialize(replicate, parameters, resources)

Initialize the simulation.

Parameters:
  • replicate (*) – Replicate number out of total replicates

  • parameters (*) – A map of all the parameters for the simulation

  • A (*) – list of resources assigned to the simulation

needsDiffusionModel()[source]#

needsDiffusionModel() -> bool

Tells whether the solver needs a reaction model.

needsReactionModel()[source]#

needsReactionModel() -> bool

Tells whether the solver needs a reaction model.

onBeginTrajectory()[source]#
onEndTrajectory()[source]#
property thisown#

The membership flag

class lm.Hemisphere(center, radius, orientation, type)[source]#

Bases: Shape

A hemisphere Shape.

C++ includes: Hemisphere.h

Hemisphere(center, radius, orientation, type)

Create a Hemisphere.

Parameters:
  • center (*) – Point center of the circle of the slice plane through the Hemisphere

  • radius (*) – Radius of the Hemisphere

  • orientation (*) – Orientation normal to the center point of the center point in the direction of the curved part of the hemisphere

  • type (*) – The type of the sites within the hemisphere

boundingBoxesIntersect(query)#

boundingBoxesIntersect(query) -> bool

Checks if another shape’s bounding box interstects with this shape’s bounding box.

Parameters:

query (*) – The other shape to test

Return type:

true/false

contains(query)[source]#

contains(query) -> bool

Determine if the shape contains the specified shape.

Parameters:

query (*) – Shape to test

Return type:

true/false

getBoundingBox()#

getBoundingBox() -> bounding_box

Get the bounding box.

getCenter()[source]#

getCenter() -> point

Get the center of the Hemisphere.

getOrientation()[source]#

getOrientation() -> vector

Get the orientation vector of the Hemisphere.

getRadius()[source]#

getRadius() -> si_dist_t

Get the radius of the Hemisphere.

getType()#

getType() -> site_t

Get the site type associated with the shape.

getVolume()#

getVolume() -> double

Get the total internal volume of the shape.

intersects(query)[source]#

intersects(query) -> bool

Check if two shapes intersect.

Parameters:

query (*) – The other shape to check

Return type:

true/false

property thisown#

The membership flag

class lm.IntLattice(*args)[source]#

Bases: Lattice

A Lattice that is based on one particle per word, with sites strided per particle.

C++ includes: IntLattice.h

IntLattice(xSize, ySize, zSize, spacing, particlesPerSite)

addParticle(x, y, z, particle)[source]#

addParticle(index, particle)

Add a particle to the specified site.

findParticles(minParticleType, maxParticleType)[source]#

findParticles(minParticleType, maxParticleType) -> std::vector< particle_loc_t >

Get the number of the specified particles types in the lattice.

getMaxOccupancy()#

getMaxOccupancy() -> site_size_t

Get the maximum number of particles that can live in a site.

getNumberSites()#

getNumberSites() -> lattice_size_t

Get total number of sites in the Lattice.

getOccupancy(x, y, z)[source]#

getOccupancy(index) -> site_size_t

Get the number of particles in the specified lattice site.

getParticle(x, y, z, particleIndex)[source]#

getParticle(index, particleIndex) -> particle_t

Get the particle at the specified site with at the specified number in the particle list.

getParticleCounts()[source]#

getParticleCounts() -> std::map< particle_t, uint >

Get the number of each particle type in the lattice.

Particle searching methods.

getParticleLatticeView()[source]#

getParticleLatticeView(particleLattice, Nw, Nz, Ny, Nx, Np)

getSiteLatticeView()[source]#

getSiteLatticeView(siteLattice, Nz, Ny, Nx)

getSiteType(x, y, z)[source]#

getSiteType(index) -> site_t

Get the site type at the specified location.

getSize()#

getSize() -> lattice_coord_t

Get size of the Lattice.

getSpacing()#

getSpacing() -> si_dist_t

Get spacing between lattice sites.

getXSize()#

getXSize() -> lattice_size_t

Get x dimension of the Lattice.

getYSize()#

getYSize() -> lattice_size_t

Get y dimension of the Lattice.

getZSize()#

getZSize() -> lattice_size_t

Get z dimension of the Lattice.

removeParticles(x, y, z)[source]#

removeParticles(index)

Remove a particle to the specified site.

setSiteType(x, y, z, siteType)[source]#

setSiteType(index, site)

Set the site type at the specified location.

property thisown#

The membership flag

class lm.IntMpdRdmeSolver[source]#

Bases: MESolver

C++ includes: IntMpdRdmeSolver.h

IntMpdRdmeSolver()

hookSimulation(time, lattice)[source]#
initialize(replicate, parameters, resources)[source]#

initialize(replicate, parameters, resources)

Initialize the simulation.

Parameters:
  • replicate (*) – Replicate number out of total replicates

  • parameters (*) – A map of all the parameters for the simulation

  • A (*) – list of resources assigned to the simulation

needsDiffusionModel()[source]#

needsDiffusionModel() -> bool

Tells whether the solver needs a reaction model.

needsReactionModel()[source]#

needsReactionModel() -> bool

Tells whether the solver needs a reaction model.

setReactionRate(rxid, rate)[source]#

setReactionRate(rxid, rate)

property thisown#

The membership flag

class lm.Intersection(s1, s2, type)[source]#

Bases: Shape

A Shape that represents a Intersection of two shapes.

C++ includes: Intersection.h

Intersection(s1, s2, type)

Create a Intersection.

Parameters:
  • s1 (*) – The first shape to Intersection

  • s2 (*) – The second shape to Intersection

  • type (*) – The type of the sites within the intersection

boundingBoxesIntersect(query)#

boundingBoxesIntersect(query) -> bool

Checks if another shape’s bounding box interstects with this shape’s bounding box.

Parameters:

query (*) – The other shape to test

Return type:

true/false

contains(query)[source]#

contains(query) -> bool

Determine if the shape contains the specified shape.

Parameters:

query (*) – Shape to test

Return type:

true/false

getBoundingBox()#

getBoundingBox() -> bounding_box

Get the bounding box.

getType()#

getType() -> site_t

Get the site type associated with the shape.

getVolume()#

getVolume() -> double

Get the total internal volume of the shape.

intersects(query)[source]#

intersects(query) -> bool

Check if two shapes intersect.

Parameters:

query (*) – The other shape to check

Return type:

true/false

property thisown#

The membership flag

class lm.Lattice(*args, **kwargs)[source]#

Bases: object

Base class for lattice type objects.

C++ includes: Lattice.h

addParticle(x, y, z, particle)[source]#

addParticle(index, particle)

Add a particle to the specified site.

findParticles(minParticleType, maxParticleType)[source]#

findParticles(minParticleType, maxParticleType) -> std::vector< particle_loc_t >

Get the number of the specified particles types in the lattice.

getMaxOccupancy()[source]#

getMaxOccupancy() -> site_size_t

Get the maximum number of particles that can live in a site.

getNumberSites()[source]#

getNumberSites() -> lattice_size_t

Get total number of sites in the Lattice.

getOccupancy(x, y, z)[source]#

getOccupancy(index) -> site_size_t

Get the number of particles in the specified lattice site.

getParticle(x, y, z, particleIndex)[source]#

getParticle(index, particleIndex) -> particle_t

Get the particle at the specified site with at the specified number in the particle list.

getParticleCounts()[source]#

getParticleCounts() -> std::map< particle_t, uint >

Get the number of each particle type in the lattice.

Particle searching methods.

getSiteType(x, y, z)[source]#

getSiteType(index) -> site_t

Get the site type at the specified location.

getSize()[source]#

getSize() -> lattice_coord_t

Get size of the Lattice.

getSpacing()[source]#

getSpacing() -> si_dist_t

Get spacing between lattice sites.

getXSize()[source]#

getXSize() -> lattice_size_t

Get x dimension of the Lattice.

getYSize()[source]#

getYSize() -> lattice_size_t

Get y dimension of the Lattice.

getZSize()[source]#

getZSize() -> lattice_size_t

Get z dimension of the Lattice.

removeParticles(x, y, z)[source]#

removeParticles(index)

Remove a particle to the specified site.

setSiteType(x, y, z, siteType)[source]#

setSiteType(index, site)

Set the site type at the specified location.

property thisown#

The membership flag

class lm.LatticeBuilder(xLen, yLen, zLen, collisionGridSpacing, seedTop, seedBottom)[source]#

Bases: object

A class that defines regions of a lattice based on a set of geometries defined by shapes. It also allows packing different types of particles into different regions.

C++ includes: LatticeBuilder.h

LatticeBuilder(xLen, yLen, zLen, collisionGridSpacing, seedTop, seedBottom=0)

Create a Lattice Builder.

Parameters:
  • xLen (*) – Length of the domain along x-axis

  • yLen (*) – Length of the domain along y-axis

  • zLen (*) – Length of the domain along z-axis

  • collisionGridSpacing (*) – The spacing for collision objects

  • seedTop (*) – High 32 bits of the seed (allows a constant seed for debugging)

  • seedBottom (*) – Low 32 bits of the seed

addParticles(particleType, siteType, count)[source]#

addParticles(particleType, siteType, count)

Add particles of a given type.

Parameters:
  • particleType (*) – The type of particles to randomly place in the lattice

  • siteType (*) – Type of lattice site into which to place

  • count (*) – Number of particles to place

addRegion(shape)[source]#

addRegion(shape)

Add a region to the lattice.

Parameters:

shape (*) – A Shape object to add as a region

discretizeTo(lattice, obstacleSiteType, fractionObstacleSitesOccupied)[source]#

discretizeTo(lattice, obstacleSiteType, fractionObstacleSitesOccupied)

Discretizes the regions to a square lattice.

Parameters:
  • lattice (*) – Lattice object into which to place

  • obstacleSiteType (*) – An identifier for obstacle sites in the lattice

  • fractionObstacleSitesOccupied (*) – Percentage of obstacle sites to be filled

fillWithRandomSpheres(volumeFraction, radius, type, region)[source]#

fillWithRandomSpheres(volumeFraction, radius, type, region)

Fill a region with random spheres to a specified volume fraction.

Parameters:
  • volumeFraction (*) – Total fraction of volume that should be filled with spheres

  • radius (*) – Radius of spheres

  • type (*) – The type of site to fill (i.e. the type of site to exclude other objects from)

  • region (*) – The region of the lattice to place spheres into

getSpatialModel(model)[source]#

getSpatialModel(spatialModel)

Gets a spatial model of the lattice for interface with python. NOTE: this operation clears the object passed in from python.

Parameters:

spatialModel (*) – An object of a spatial model for interaction in python or HDF5. The model will be filled with the current lattice

placeRandomSphere(radius, type, region)[source]#

placeRandomSphere(radius, type, region) -> uint

Place a sphere randomly in the lattice (for obstacles)

Parameters:
  • radius (*) – Radius of the sphere obstacle

  • type (*) – The type of site in which to place sphere

  • region (*) – The region in which to place obstacle randomly

Return type:

number of times a placement operation occured

placeRandomSpheres(count, radius, type, region)[source]#

placeRandomSpheres(count, radius, type, region)

Place many spheres randomly in the lattice (for obstacles)

Parameters:
  • radius (*) – Radius of the sphere obstacle

  • type (*) – The type of site in which to place sphere

  • region (*) – The region in which to place obstacle randomly

Return type:

number of times a placement operation occured

placeSphere(position, radius, type)[source]#

placeSphere(center, radius, type) -> bool

Place a sphere in the lattice (for obstacles)

Parameters:
  • center (*) – The center point of sphere obstacle

  • radius (*) – Radius of the sphere obstacle

  • type (*) – The type of site in which to place sphere

Return type:

true if the sphere did not intersect

removeSphere(position, radius, type)[source]#

removeSphere(center, radius, type)

Remove a sphere in the lattice (for obstacles)

Parameters:
  • center (*) – The center point of sphere obstacle

  • radius (*) – Radius of the sphere obstacle

  • type (*) – The type of site in which to place sphere

property thisown#

The membership flag

class lm.MESolver(*args, **kwargs)[source]#

Bases: object

An abstract base class for all Master Equation solvers, this is essentially a representation of “the simulation instance”.

C++ includes: MESolver.h

property thisown#

The membership flag

class lm.MGPUIntMpdRdmeSolver[source]#

Bases: MESolver

C++ includes: MGPUIntMpdRdmeSolver.h

MGPUIntMpdRdmeSolver()

hookSimulation(time, lattice)[source]#
initialize(replicate, parameters, resources)[source]#

initialize(replicate, parameters, resources)

Initialize the simulation.

Parameters:
  • replicate (*) – Replicate number out of total replicates

  • parameters (*) – A map of all the parameters for the simulation

  • A (*) – list of resources assigned to the simulation

needsDiffusionModel()[source]#

needsDiffusionModel() -> bool

Tells whether the solver needs a reaction model.

needsReactionModel()[source]#

needsReactionModel() -> bool

Tells whether the solver needs a reaction model.

setReactionRate(rxid, rate)[source]#

setReactionRate(rxid, rate)

property thisown#

The membership flag

class lm.MGPUMpdRdmeSolver[source]#

Bases: MESolver

C++ includes: MGPUMpdRdmeSolver.h

MGPUMpdRdmeSolver()

hookSimulation(time, lattice)[source]#
initialize(replicate, parameters, resources)[source]#

initialize(replicate, parameters, resources)

Initialize the simulation.

Parameters:
  • replicate (*) – Replicate number out of total replicates

  • parameters (*) – A map of all the parameters for the simulation

  • A (*) – list of resources assigned to the simulation

needsDiffusionModel()[source]#

needsDiffusionModel() -> bool

Tells whether the solver needs a reaction model.

needsReactionModel()[source]#

needsReactionModel() -> bool

Tells whether the solver needs a reaction model.

setReactionRate(rxid, rate)[source]#

setReactionRate(rxid, rate)

property thisown#

The membership flag

class lm.MpdRdmeSolver[source]#

Bases: MESolver

C++ includes: MpdRdmeSolver.h

MpdRdmeSolver()

hookSimulation(time, lattice)[source]#
initialize(replicate, parameters, resources)[source]#

initialize(replicate, parameters, resources)

Initialize the simulation.

Parameters:
  • replicate (*) – Replicate number out of total replicates

  • parameters (*) – A map of all the parameters for the simulation

  • A (*) – list of resources assigned to the simulation

needsDiffusionModel()[source]#

needsDiffusionModel() -> bool

Tells whether the solver needs a reaction model.

needsReactionModel()[source]#

needsReactionModel() -> bool

Tells whether the solver needs a reaction model.

onBeginTrajectory(lattice)[source]#
onEndTrajectory(lattice)[source]#
onWriteLattice(time, lattice)[source]#
setReactionRate(rxid, rate)[source]#

setReactionRate(rxid, rate)

writeLatticeSites(time, lattice)[source]#
property thisown#

The membership flag

class lm.NextReactionSolver(*args)[source]#

Bases: CMESolver

C++ includes: NextReactionSolver.h

NextReactionSolver(neededDists)

getReactionRateConstantsView(reactionNumber)[source]#

getReactionRateConstantsView(reactionNumber, rates, rateConstantCount)

getSpeciesCountView()[source]#

getSpeciesCountView(counts, number)

hookSimulation(time)[source]#
initialize(replicate, parameters, resources)[source]#

initialize(replicate, parameters, resources)

Initialize the simulation.

Parameters:
  • replicate (*) – Replicate number out of total replicates

  • parameters (*) – A map of all the parameters for the simulation

  • A (*) – list of resources assigned to the simulation

needsDiffusionModel()[source]#

needsDiffusionModel() -> bool

Tells whether the solver needs a reaction model.

needsReactionModel()[source]#

needsReactionModel() -> bool

Tells whether the solver needs a reaction model.

onBeginTrajectory()[source]#
onEndTrajectory()[source]#
property thisown#

The membership flag

class lm.ReactionModel[source]#

Bases: object

add_dependency_matrix(arg2)[source]#
add_initial_species_count(arg2)[source]#
add_reaction()[source]#
add_stoichiometric_matrix(arg2)[source]#
initial_species_count_size()[source]#
mutable_reaction(arg2)[source]#
number_reactions()[source]#
number_species()[source]#
reaction(arg2)[source]#
reaction_size()[source]#
set_initial_species_count(arg2, arg3)[source]#
set_number_reactions(arg2)[source]#
set_number_species(arg2)[source]#
property thisown#

The membership flag

class lm.ReactionModel_Reaction[source]#

Bases: object

add_rate_constant(arg2)[source]#
rate_constant_size()[source]#
set_rate_constant(arg2, arg3)[source]#
set_type(arg2)[source]#
type()[source]#
property thisown#

The membership flag

class lm.Shape(*args, **kwargs)[source]#

Bases: object

Abstract base class for all the shapes in Lattice Microbes simulation builder.

C++ includes: Shape.h

boundingBoxesIntersect(query)[source]#

boundingBoxesIntersect(query) -> bool

Checks if another shape’s bounding box interstects with this shape’s bounding box.

Parameters:

query (*) – The other shape to test

Return type:

true/false

contains(query)[source]#

contains(query) -> bool

Determine if the shape contains the specified shape.

Parameters:

query (*) – Shape to test

Return type:

true/false

getBoundingBox()[source]#

getBoundingBox() -> bounding_box

Get the bounding box.

getType()[source]#

getType() -> site_t

Get the site type associated with the shape.

getVolume()[source]#

getVolume() -> double

Get the total internal volume of the shape.

intersects(query)[source]#

intersects(query) -> bool

Check if two shapes intersect.

Parameters:

query (*) – The other shape to check

Return type:

true/false

property thisown#

The membership flag

class lm.SimulationFile(filename)[source]#

Bases: object

A representation of the simulation that is used to input or output from an HDF5 file.

C++ includes: SimulationFile.h

SimulationFile(filename)

Create a SimulationFile with the specified filename.

close()[source]#

close()

Close the file.

static create(filename)[source]#

create(filename, initializeModel, numberSpecies=0)

Create an HDF5 file and initialize the model with an optional number of species.

getDiffusionModel(model)[source]#

getDiffusionModel(diffusionModel)

Pops the diffusion model from the HDF5 file.

Parameters:

diffusionModel (*) – Memory at which to place the diffusionModel

getDiffusionModelLattice(m, lattice)[source]#

getDiffusionModelLattice(diffusionModel, lattice)

Pops the diffusion lattice from the HDF5 file.

Parameters:
  • diffusionModel (*) – Memoryfrom which to get the lattice

  • lattice (*) – Memory at which to place the lattice

getLattice(replicate, latticeIndex, lattice)[source]#

getLattice(replicate, latticeIndex, lattice)

Get the lattice for the replicate.

Parameters:
  • replicate (*) – Replicate number

  • latticeIndex (*) – Seems to be unused…

  • lattice (*) – The lattice object in which to store the data

getLatticeTimes(replicate)[source]#

getLatticeTimes(replicate) -> vector< double >

Get the timestep times for the replicate.

Parameters:

replicate (*) – Replicate number

Return type:

A set of timestep times

getParameter(key)[source]#

getParameter(key, defaultValue=””) -> string

Get the specified parameter from the current replicate.

getReactionModel(model)[source]#

getReactionModel(reactionModel)

Pops the reaction model from the HDF5 file.

Parameters:

reactionModel (*) – Memory at which to place the reactionModel

getSpatialModel(model)[source]#

getSpatialModel(model)

Pops the spacial model (i.e. obstacles) from the HDF5 file.

Parameters:

model (*) – The model in which to store the object

getSpeciesCountTimes(replicate)[source]#

getSpeciesCountTimes(replicate) -> vector< double >

getSpeciesCounts(replicate)[source]#

getSpeciesCounts(replicate) -> std::map< double, vector< int > >

getSpeciesNames()[source]#

getSpeciesNames() -> std::map< uint, string >

static isValidFile(filename)[source]#

isValidFile(filename) -> bool

Check that the HDF5 file is valid.

setDiffusionModel(diffusionModel)[source]#

setDiffusionModel(diffusionModel)

Pushes the diffusion model into the HDF5 file.

Parameters:

diffusionModel (*) – Memory from which to place the diffusionModel

setDiffusionModelLattice(*args)[source]#

setDiffusionModelLattice(m, lattice)

Pushes the diffusion lattice into the HDF5 file.

Parameters:
  • diffusionModel (*) – Memory from which to get the lattice

  • lattice (*) – Memory from which to place the lattice

setParameter(k, v)[source]#

setParameter(key, value)

Set the specified parameter to the value.

setReactionModel(reactionModel)[source]#

setReactionModel(reactionModel)

Pushes the reaction model into the HDF5 file.

Parameters:

reactionModel (*) – Memory from which to place the reactionModel

setSpatialModel(model)[source]#

setSpatialModel(model)

Pushes the spacial model (i.e. obstacles) into the HDF5 file.

Parameters:

model (*) – The model object

property thisown#

The membership flag

class lm.SpatialModel[source]#

Bases: object

property thisown#

The membership flag

class lm.Sphere(center, radius, type)[source]#

Bases: Shape

A Shape that represents a Sphere.

C++ includes: Sphere.h

Sphere(center, radius, type)

Create a Sphere.

Parameters:
  • center (*) – Point center of the circle of the slice plane through the sphere

  • radius (*) – Radius of the sphere

  • type (*) – The type of the sites within the sphere

boundingBoxesIntersect(query)#

boundingBoxesIntersect(query) -> bool

Checks if another shape’s bounding box interstects with this shape’s bounding box.

Parameters:

query (*) – The other shape to test

Return type:

true/false

contains(query)[source]#

contains(query) -> bool

Determine if the shape contains the specified shape.

Parameters:

query (*) – Shape to test

Return type:

true/false

getBoundingBox()#

getBoundingBox() -> bounding_box

Get the bounding box.

getCenter()[source]#

getCenter() -> point

Get the center of the sphere.

getRadius()[source]#

getRadius() -> si_dist_t

Get the radius of the sphere.

getType()#

getType() -> site_t

Get the site type associated with the shape.

getVolume()#

getVolume() -> double

Get the total internal volume of the shape.

intersects(query)[source]#

intersects(query) -> bool

Check if two shapes intersect.

Parameters:

query (*) – The other shape to check

Return type:

true/false

setCenter(center)[source]#

setCenter(center)

Set the center of the sphere.

Parameters:

center (*) – Point of the center

property thisown#

The membership flag

class lm.SwigPyIterator(*args, **kwargs)[source]#

Bases: object

advance(n)[source]#
copy()[source]#
decr(n=1)[source]#
distance(x)[source]#
equal(x)[source]#
incr(n=1)[source]#
next()[source]#
previous()[source]#
value()[source]#
property thisown#

The membership flag

class lm.Torus(*args)[source]#

Bases: Shape

A Shape that represents a Torus.

C++ includes: Torus.h

Torus(center, r1, r2, type, orientation=vector(0.0, 0.0, 1.0), up=vector(0.0, 1.0, 0.0))

Create a Torus.

Parameters:
  • center (*) – Point center of the circle of the slice plane through the sphere

  • r1 (*) – Large radius of the Torus

  • r2 (*) – Small radius of the Torus

  • type (*) – The type of the sites within the sphere

  • orientation (*) – The direction vector around which the ring is made, default: (0,0,1)

  • up (*) – A vector to define the y axis of the object’s coordinate system , default: (0,1,0)

boundingBoxesIntersect(query)#

boundingBoxesIntersect(query) -> bool

Checks if another shape’s bounding box interstects with this shape’s bounding box.

Parameters:

query (*) – The other shape to test

Return type:

true/false

contains(query)[source]#

contains(query) -> bool

Determine if the shape contains the specified shape.

Parameters:

query (*) – Shape to test

Return type:

true/false

getBoundingBox()#

getBoundingBox() -> bounding_box

Get the bounding box.

getCenter()[source]#

getCenter() -> point

Get the center of the sphere.

getRadius1()[source]#

getRadius1() -> si_dist_t

Get the large radius of the sphere.

getRadius2()[source]#

getRadius2() -> si_dist_t

Get the small radius of the sphere.

getType()#

getType() -> site_t

Get the site type associated with the shape.

getVolume()#

getVolume() -> double

Get the total internal volume of the shape.

intersects(query)[source]#

intersects(query) -> bool

Check if two shapes intersect.

Parameters:

query (*) – The other shape to check

Return type:

true/false

setCenter(center)[source]#

setCenter(center)

Set the center of the sphere.

Parameters:

center (*) – Point of the center

property thisown#

The membership flag

class lm.Union(s1, s2, type)[source]#

Bases: Shape

A Shape that represents a Union between two shapes.

C++ includes: Union.h

Union(s1, s2, type)

Create a Union.

Parameters:
  • s1 (*) – The first shape to Union

  • s2 (*) – The second shape to Union

  • type (*) – The type of the sites within the union

boundingBoxesIntersect(query)#

boundingBoxesIntersect(query) -> bool

Checks if another shape’s bounding box interstects with this shape’s bounding box.

Parameters:

query (*) – The other shape to test

Return type:

true/false

contains(query)[source]#

contains(query) -> bool

Determine if the shape contains the specified shape.

Parameters:

query (*) – Shape to test

Return type:

true/false

getBoundingBox()#

getBoundingBox() -> bounding_box

Get the bounding box.

getType()#

getType() -> site_t

Get the site type associated with the shape.

getVolume()#

getVolume() -> double

Get the total internal volume of the shape.

intersects(query)[source]#

intersects(query) -> bool

Check if two shapes intersect.

Parameters:

query (*) – The other shape to check

Return type:

true/false

property thisown#

The membership flag

class lm.UnionSet(type)[source]#

Bases: Shape

A Shape that represents a Union of many shapes.

C++ includes: UnionSet.h

UnionSet(type)

Create a UnionSet.

Parameters:

type (*) – The type of the sites within the union

addShape(s)[source]#

addShape(s)

Add a shape to the union.

Parameters:

shape (*) – A Shape object

boundingBoxesIntersect(query)#

boundingBoxesIntersect(query) -> bool

Checks if another shape’s bounding box interstects with this shape’s bounding box.

Parameters:

query (*) – The other shape to test

Return type:

true/false

contains(query)[source]#

contains(query) -> bool

Determine if the shape contains the specified shape.

Parameters:

query (*) – Shape to test

Return type:

true/false

getBoundingBox()#

getBoundingBox() -> bounding_box

Get the bounding box.

getType()#

getType() -> site_t

Get the site type associated with the shape.

getVolume()#

getVolume() -> double

Get the total internal volume of the shape.

intersects(query)[source]#

intersects(query) -> bool

Check if two shapes intersect.

Parameters:

query (*) – The other shape to check

Return type:

true/false

property thisown#

The membership flag

class lm.bounding_box(*args)[source]#

Bases: object

The bounds for a shape represented as a rectangular box.

C++ includes: Shape.h

bounding_box(min, max)

Create a bounding box from points.

Parameters:
  • min (*) – Minimum coordinate

  • max (*) – Maximum coordinate

joinWith(j)[source]#

joinWith(j) -> bounding_box

Return a bounding box spanning the two bounding boxes.

Parameters:

j (*) – Other bounding box

Return type:

new bounding box

property max#
property min#
property thisown#

The membership flag

class lm.point(x=0.0, y=0.0, z=0.0)[source]#

Bases: object

Type to store a position in space.

C++ includes: Shape.h

point(p2)

Create a point from another point.

Parameters:

p2 (*) – The point to copy

distance(p2)[source]#

distance(p2) -> si_dist_t

Determine the distance to another point.

Parameters:

p2 (*) – Second point

Return type:

scalar distance

distanceSquared(p2)[source]#

distanceSquared(p2) -> si_dist_t

Determine the distance squared between two points.

Parameters:

p2 (*) – Second point

Return type:

scalar distance squared

property thisown#

The membership flag

property x#
property y#
property z#
class lm.stdVectorInt(*args)[source]#

Bases: object

append(x)[source]#
assign(n, x)[source]#
back()[source]#
begin()[source]#
capacity()[source]#
clear()[source]#
empty()[source]#
end()[source]#
erase(*args)[source]#
front()[source]#
get_allocator()[source]#
insert(*args)[source]#
iterator()[source]#
pop()[source]#
pop_back()[source]#
push_back(x)[source]#
rbegin()[source]#
rend()[source]#
reserve(n)[source]#
resize(*args)[source]#
size()[source]#
swap(v)[source]#
property thisown#

The membership flag

class lm.vector(x=0.0, y=0.0, z=0.0)[source]#

Bases: object

A vector which points in a direction.

C++ includes: Shape.h

vector(p)

Construct a vector from a point.

Parameters:

p (*) – The point to cast

property thisown#

The membership flag

property x#
property y#
property z#
lm.SimulationFile_create(filename)[source]#

create(filename, initializeModel, numberSpecies=0)

Create an HDF5 file and initialize the model with an optional number of species.

lm.SimulationFile_isValidFile(filename)[source]#

isValidFile(filename) -> bool

Check that the HDF5 file is valid.

lm.getCompiledLatticeMaxOccupancy()[source]#
lm.runSimulation(simulationFilename, replicate, solverClass, cudaDevices, checkpointInterval)[source]#

runSimulation(simulationFilename, replicate, solverClass, cudaDevices, checkpointInterval)

lm.runSolver(simulationFilename, replicate, solver, cudaDevices, checkpointInterval)[source]#

runSolver(simulationFilename, replicate, solver, cudaDevices, checkpointInterval)

lm.setVerbosityLevel(x)[source]#