C++ API#
This section provides direct access to the C++ source code documentation using Doxygen and breathe.
Core Functions#
Lattice Classes#
-
class IntLattice : public lm::rdme::Lattice#
A Lattice that is based on one particle per word, with sites strided per particle.
Subclassed by lm::rdme::CudaIntLattice
Public Functions
-
virtual site_t getMaxSiteType() const#
Get the maximum number of site types possible in the lattice.
-
virtual particle_t getMaxParticle() const#
Get the maximum number of particle types possible in the lattice.
-
virtual site_size_t getMaxOccupancy() const#
Get the maximum number of particles that can live in a site.
-
IntLattice(lattice_coord_t size, si_dist_t spacing, uint particlesPerSite)#
-
IntLattice(lattice_size_t xSize, lattice_size_t ySize, lattice_size_t zSize, si_dist_t spacing, uint particlesPerSite)#
-
virtual ~IntLattice()#
-
virtual void getNeighboringSites(lattice_size_t index, lattice_size_t *neighboringIndices)#
Get the sites that are neighbor to the indicated site.
- Parameters:
index – Index of the site for which to get neighbors
neighboringIndicies – An array to hold the indicies of the neighbor sites
-
virtual site_t getSiteType(lattice_size_t x, lattice_size_t y, lattice_size_t z) const#
Get the site type at the specified location.
-
virtual site_t getSiteType(lattice_size_t index) const#
Get the site type at the specified location.
-
virtual void setSiteType(lattice_size_t x, lattice_size_t y, lattice_size_t z, site_t siteType)#
Set the site type at the specified location.
-
virtual void setSiteType(lattice_size_t index, site_t site)#
Set the site type at the specified location.
-
virtual void *getSiteTypes()#
-
virtual site_size_t getOccupancy(lattice_size_t x, lattice_size_t y, lattice_size_t z) const#
Get the number of particles in the specified lattice site.
-
virtual site_size_t getOccupancy(lattice_size_t subvolume) const#
Get the number of particles in the specified lattice site.
-
virtual particle_t getParticle(lattice_size_t x, lattice_size_t y, lattice_size_t z, site_size_t particleIndex) const#
Get the particle at the specified site with at the specified number in the particle list.
-
virtual particle_t getParticle(lattice_size_t subvolume, site_size_t particleIndex) const#
Get the particle at the specified site with at the specified number in the particle list.
-
virtual void addParticle(lattice_size_t x, lattice_size_t y, lattice_size_t z, particle_t particle)#
Add a particle to the specified site.
-
virtual void addParticle(lattice_size_t subvolume, particle_t particle)#
Add a particle to the specified site.
-
virtual void removeParticles(lattice_size_t x, lattice_size_t y, lattice_size_t z)#
Remove a particle to the specified site.
-
virtual void removeParticles(lattice_size_t subvolume)#
Remove a particle to the specified site.
-
virtual void removeAllParticles()#
Empty all particles from the specified site.
-
virtual std::map<particle_t, uint> getParticleCounts()#
Get the number of each particle type in the lattice.
Particle searching methods.
-
virtual std::vector<particle_loc_t> findParticles(particle_t minParticleType, particle_t maxParticleType)#
Get the number of the specified particles types in the lattice.
-
virtual void setFromRowMajorByteData(void *buffer, size_t bufferSize)#
-
virtual void setFromRowMajorData(void *buffer, size_t bufferSize)#
-
virtual void setSitesFromRowMajorByteData(void *buffer, size_t bufferSize)#
-
virtual void getParticleLatticeView(uint32_t **particleLattice, int *Nw, int *Nz, int *Ny, int *Nx, int *Np)#
-
virtual void getSiteLatticeView(uint8_t **siteLattice, int *Nz, int *Ny, int *Nx)#
-
virtual size_t getLatticeMemorySize() const#
Public Static Functions
-
static void nativeSerialize(void *destBuffer, void *lattice, size_t latticeSize)#
-
static void copyNativeToRowMajor(void *destBuffer, void *sourceBuffer, lattice_size_t xSize, lattice_size_t ySize, lattice_size_t zSize, uint particlesPerSite, size_t bufferSize)#
-
static void copyRowMajorToNative(void *destBuffer, void *sourceBuffer, lattice_size_t xSize, lattice_size_t ySize, lattice_size_t zSize, uint particlesPerSite, size_t bufferSize)#
-
static void copySitesRowMajorByteToNative(void *destBuffer, void *sourceBuffer, lattice_size_t xSize, lattice_size_t ySize, lattice_size_t zSize, size_t bufferSize)#
-
virtual site_t getMaxSiteType() const#
-
class CudaByteLattice : public lm::rdme::ByteLattice#
Public Functions
-
CudaByteLattice(lattice_coord_t size, si_dist_t spacing, uint particlesPerSite)#
-
CudaByteLattice(lattice_size_t xSize, lattice_size_t ySize, lattice_size_t zSize, si_dist_t spacing, uint particlesPerSite)#
-
virtual ~CudaByteLattice()#
-
virtual void copyToGPU()#
-
virtual void copyFromGPU()#
-
virtual void *getGPUMemorySrc()#
-
virtual void *getGPUMemoryDest()#
-
virtual void swapSrcDest()#
-
virtual void *getGPUMemorySiteTypes()#
-
inline virtual size_t getParticleMemorySize() const#
-
virtual void setSiteType(lattice_size_t x, lattice_size_t y, lattice_size_t z, site_t site)#
Set the site type at the specified location.
-
virtual void setSiteType(lattice_size_t index, site_t site)#
Set the site type at the specified location.
-
virtual void addParticle(lattice_size_t x, lattice_size_t y, lattice_size_t z, particle_t particle)#
Add a particle to the specified site.
-
virtual void addParticle(lattice_size_t index, particle_t particle)#
Add a particle to the specified site.
-
virtual void removeParticles(lattice_size_t x, lattice_size_t y, lattice_size_t z)#
Remove a particle to the specified site.
-
virtual void removeParticles(lattice_size_t index)#
Remove a particle to the specified site.
-
virtual void removeAllParticles()#
Empty all particles from the specified site.
-
virtual void setFromRowMajorByteData(void *buffer, size_t bufferSize)#
-
virtual void getSiteLatticeView(uint8_t **siteLattice, int *Nz, int *Ny, int *Nx)#
-
virtual void getParticleLatticeView(uint8_t **particleLattice, int *Nw, int *Nz, int *Ny, int *Nx, int *Np)#
-
CudaByteLattice(lattice_coord_t size, si_dist_t spacing, uint particlesPerSite)#
-
class CudaIntLattice : public lm::rdme::IntLattice#
Public Functions
-
CudaIntLattice(lattice_coord_t size, si_dist_t spacing, uint particlesPerSite)#
-
CudaIntLattice(lattice_size_t xSize, lattice_size_t ySize, lattice_size_t zSize, si_dist_t spacing, uint particlesPerSite)#
-
virtual ~CudaIntLattice()#
-
virtual void copyToGPU()#
-
virtual void copyFromGPU()#
-
virtual void *getGPUMemorySrc()#
-
virtual void *getGPUMemoryDest()#
-
virtual void swapSrcDest()#
-
virtual void *getGPUMemorySiteTypes()#
-
virtual void setSiteType(lattice_size_t x, lattice_size_t y, lattice_size_t z, site_t site)#
Set the site type at the specified location.
-
virtual void setSiteType(lattice_size_t index, site_t site)#
Set the site type at the specified location.
-
virtual void addParticle(lattice_size_t x, lattice_size_t y, lattice_size_t z, particle_t particle)#
Add a particle to the specified site.
-
virtual void addParticle(lattice_size_t index, particle_t particle)#
Add a particle to the specified site.
-
virtual void removeParticles(lattice_size_t x, lattice_size_t y, lattice_size_t z)#
Remove a particle to the specified site.
-
virtual void removeParticles(lattice_size_t index)#
Remove a particle to the specified site.
-
virtual void removeAllParticles()#
Empty all particles from the specified site.
-
virtual void setFromRowMajorByteData(void *buffer, size_t bufferSize)#
-
CudaIntLattice(lattice_coord_t size, si_dist_t spacing, uint particlesPerSite)#
Solver Classes#
-
class MESolver#
An abstract base class for all Master Equation solvers, this is essentially a representation of “the simulation instance”.
Subclassed by lm::cme::CMESolver
Public Functions
-
virtual ~MESolver()#
-
virtual void initialize(unsigned int replicate, map<string, string> *parameters, ResourceAllocator::ComputeResources *resources) = 0#
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
-
virtual bool needsReactionModel() = 0#
Tells whether the solver needs a reaction model.
-
virtual bool needsDiffusionModel() = 0#
Tells whether the solver needs a reaction model.
-
virtual void generateTrajectory() = 0#
Actually run the simulation.
-
virtual ~MESolver()#
Warning
doxygenclass: Cannot find class “lm::me::CMESolver” in doxygen xml output for project “LatticeMicrobes” from directory: ./xml
Warning
doxygenclass: Cannot find class “lm::me::GillespieDSolver” in doxygen xml output for project “LatticeMicrobes” from directory: ./xml
Warning
doxygenclass: Cannot find class “lm::me::NextReactionSolver” in doxygen xml output for project “LatticeMicrobes” from directory: ./xml
RDME Solver Classes#
-
class RDMESolver : public lm::cme::CMESolver#
Subclassed by lm::rdme::IntMpdRdmeSolver, lm::rdme::MGPUIntMpdRdmeSolver, lm::rdme::MGPUMpdRdmeSolver, lm::rdme::MPIMpdRdmeSolver, lm::rdme::MpdRdmeSolver, lm::rdme::NextSubvolumeSolver
Public Functions
-
RDMESolver(RandomGenerator::Distributions neededDists)#
-
virtual ~RDMESolver()#
-
virtual void setDiffusionModel(DiffusionModel *dm, const uint8_t *lattice, size_t latticeSize, const uint8_t *latticeSites, size_t latticeSitesSize)#
-
virtual void buildDiffusionModel(const uint numberSiteTypesA, const double *DFA, const uint *RLA, lattice_size_t latticeXSize, lattice_size_t latticeYSize, lattice_size_t latticeZSize, site_size_t particlesPerSite, const unsigned int bytes_per_particle, si_dist_t latticeSpacing, const uint8_t *latticeData, const uint8_t *latticeSitesData, bool rowMajorData = true)#
-
RDMESolver(RandomGenerator::Distributions neededDists)#
-
class MpdRdmeSolver : public lm::rdme::RDMESolver#
Subclassed by lm::rdme::MpdTestHarness
Public Functions
-
MpdRdmeSolver()#
-
virtual ~MpdRdmeSolver()#
-
virtual void initialize(unsigned int replicate, map<string, string> *parameters, ResourceAllocator::ComputeResources *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
-
inline virtual bool needsReactionModel()#
Tells whether the solver needs a reaction model.
-
inline virtual bool needsDiffusionModel()#
Tells whether the solver needs a reaction model.
-
virtual void buildModel(const uint numberSpeciesA, const uint numberReactionsA, const uint *initialSpeciesCountsA, const uint *reactionTypeA, const double *kA, const int *SA, const uint *DA, const uint kCols = 1)#
-
virtual void buildDiffusionModel(const uint numberSiteTypesA, const double *DFA, const uint *RLA, lattice_size_t latticeXSize, lattice_size_t latticeYSize, lattice_size_t latticeZSize, site_size_t particlesPerSite, const unsigned int bytes_per_particle, si_dist_t latticeSpacing, const uint8_t *latticeData, const uint8_t *latticeSitesData, bool rowMajorData = true)#
-
virtual void generateTrajectory()#
Actually run the simulation.
-
virtual void setReactionRate(unsigned int rxid, float rate)#
-
MpdRdmeSolver()#
-
class IntMpdRdmeSolver : public lm::rdme::RDMESolver#
Public Functions
-
IntMpdRdmeSolver()#
-
virtual ~IntMpdRdmeSolver()#
-
virtual void initialize(unsigned int replicate, map<string, string> *parameters, ResourceAllocator::ComputeResources *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
-
inline virtual bool needsReactionModel()#
Tells whether the solver needs a reaction model.
-
inline virtual bool needsDiffusionModel()#
Tells whether the solver needs a reaction model.
-
virtual void buildModel(const uint numberSpeciesA, const uint numberReactionsA, const uint *initialSpeciesCountsA, const uint *reactionTypeA, const double *kA, const int *SA, const uint *DA, const uint kCols = 1)#
-
virtual void buildDiffusionModel(const uint numberSiteTypesA, const double *DFA, const uint *RLA, lattice_size_t latticeXSize, lattice_size_t latticeYSize, lattice_size_t latticeZSize, site_size_t particlesPerSite, const unsigned int bytes_per_particle, si_dist_t latticeSpacing, const uint8_t *latticeData, const uint8_t *latticeSitesData, bool rowMajorData = true)#
-
virtual void generateTrajectory()#
Actually run the simulation.
-
virtual void setReactionRate(unsigned int rxid, float rate)#
-
IntMpdRdmeSolver()#
-
class MGPUMpdRdmeSolver : public lm::rdme::RDMESolver#
Public Functions
-
MGPUMpdRdmeSolver()#
-
virtual ~MGPUMpdRdmeSolver()#
-
virtual void initialize(unsigned int replicate, map<string, string> *parameters, ResourceAllocator::ComputeResources *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
-
inline virtual bool needsReactionModel()#
Tells whether the solver needs a reaction model.
-
inline virtual bool needsDiffusionModel()#
Tells whether the solver needs a reaction model.
-
virtual void buildModel(const uint numberSpeciesA, const uint numberReactionsA, const uint *initialSpeciesCountsA, const uint *reactionTypeA, const double *kA, const int *SA, const uint *DA, const uint kCols = 1)#
-
virtual void buildDiffusionModel(const uint numberSiteTypesA, const double *DFA, const uint *RLA, lattice_size_t latticeXSize, lattice_size_t latticeYSize, lattice_size_t latticeZSize, site_size_t particlesPerSite, const unsigned int bytes_per_particle, si_dist_t latticeSpacing, const uint8_t *latticeData, const uint8_t *latticeSitesData, bool rowMajorData = true)#
-
virtual void generateTrajectory()#
Actually run the simulation.
-
virtual void setReactionRate(unsigned int rxid, float rate)#
-
MGPUMpdRdmeSolver()#
-
class MGPUIntMpdRdmeSolver : public lm::rdme::RDMESolver#
Public Functions
-
MGPUIntMpdRdmeSolver()#
-
virtual ~MGPUIntMpdRdmeSolver()#
-
virtual void initialize(unsigned int replicate, map<string, string> *parameters, ResourceAllocator::ComputeResources *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
-
inline virtual bool needsReactionModel()#
Tells whether the solver needs a reaction model.
-
inline virtual bool needsDiffusionModel()#
Tells whether the solver needs a reaction model.
-
virtual void buildModel(const uint numberSpeciesA, const uint numberReactionsA, const uint *initialSpeciesCountsA, const uint *reactionTypeA, const double *kA, const int *SA, const uint *DA, const uint kCols = 1)#
-
virtual void buildDiffusionModel(const uint numberSiteTypesA, const double *DFA, const uint *RLA, lattice_size_t latticeXSize, lattice_size_t latticeYSize, lattice_size_t latticeZSize, site_size_t particlesPerSite, const unsigned int bytes_per_particle, si_dist_t latticeSpacing, const uint8_t *latticeData, const uint8_t *latticeSitesData, bool rowMajorData = true)#
-
virtual void generateTrajectory()#
Actually run the simulation.
-
virtual void setReactionRate(unsigned int rxid, float rate)#
-
MGPUIntMpdRdmeSolver()#
Shape Classes#
-
class Shape#
Abstract base class for all the shapes in Lattice Microbes simulation builder.
Subclassed by lm::builder::Capsule, lm::builder::CapsuleShell, lm::builder::Cone, lm::builder::Cuboid, lm::builder::Cylinder, lm::builder::Difference, lm::builder::Ellipse, lm::builder::Hemisphere, lm::builder::Intersection, lm::builder::Mesh, lm::builder::Sphere, lm::builder::Torus, lm::builder::Union, lm::builder::UnionSet
Public Types
-
enum ShapeType#
Possible shape types that can be used in Lattice Microbes.
Values:
-
enumerator SPHERE = 1#
-
enumerator HEMISPHERE = 2#
-
enumerator CYLINDER = 3#
-
enumerator CAPSULE = 4#
-
enumerator CUBOID = 5#
-
enumerator CAPSULE_SHELL = 6#
-
enumerator UNION = 7#
-
enumerator DIFFERENCE = 8#
-
enumerator INTERSECTION = 9#
-
enumerator MESH = 10#
-
enumerator TORUS = 11#
-
enumerator ELLIPSE = 12#
-
enumerator CONE = 13#
-
enumerator UNIONSET = 14#
-
enumerator SPHERE = 1#
Public Functions
-
Shape(ShapeType shapeType, bounding_box boundingBox, site_t type, vector at = vector(0.0, 0.0, 1.0), vector up = vector(0.0, 1.0, 0.0))#
Create a Shape.
- Parameters:
shapeType – The type of shape should be of type ShapeType
boundingBox – The extents of the object used for fast collision/contains checking
type – The type of site that the object represents
at – A vector describing what direction the object is pointing “at”; default: (0,0,1)
up – A vector describing what direction is “up” relative to “at”; default: (0,1,0)
-
virtual bool boundingBoxesIntersect(Shape *query)#
Checks if another shape’s bounding box interstects with this shape’s bounding box.
- Parameters:
query – The other shape to test
- Returns:
true/false
-
virtual bool intersects(Shape *query) = 0#
Check if two shapes intersect.
- Parameters:
query – The other shape to check
- Returns:
true/false
-
virtual bool contains(point query) = 0#
Determine if the shape contains the specified point.
- Parameters:
query – Point to test
- Returns:
true/false
-
virtual bool contains(Shape *query) = 0#
Determine if the shape contains the specified shape.
- Parameters:
query – Shape to test
- Returns:
true/false
-
inline virtual bounding_box getBoundingBox()#
Get the bounding box.
-
inline virtual site_t getType()#
Get the site type associated with the shape.
-
virtual double getVolume() = 0#
Get the total internal volume of the shape.
-
virtual void discretizeTo(lm::rdme::Lattice *lattice)#
Discretize the object to the specified lattice.
- Parameters:
lattice – Lattice in which to discretize the shape
-
enum ShapeType#
-
class Sphere : public lm::builder::Shape#
A Shape that represents a Sphere.
Public Functions
-
Sphere(point center, si_dist_t radius, site_t 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
-
virtual bool intersects(Shape *query)#
Check if two shapes intersect.
- Parameters:
query – The other shape to check
- Returns:
true/false
-
virtual bool contains(point query)#
Determine if the shape contains the specified point.
- Parameters:
query – Point to test
- Returns:
true/false
-
virtual bool contains(Shape *query)#
Determine if the shape contains the specified shape.
- Parameters:
query – Shape to test
- Returns:
true/false
-
virtual void setCenter(point center)#
Set the center of the sphere.
- Parameters:
center – Point of the center
-
inline virtual point getCenter()#
Get the center of the sphere.
-
inline virtual si_dist_t getRadius()#
Get the radius of the sphere.
-
virtual double getVolume()#
Get the volume bounded by the sphere.
-
Sphere(point center, si_dist_t radius, site_t type)#
-
class Cylinder : public lm::builder::Shape#
A Shape representing a cylinder.
Public Functions
-
Cylinder(point p1, point p2, si_dist_t radius, site_t 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
-
virtual bool intersects(Shape *query)#
Check if two shapes intersect.
- Parameters:
query – The other shape to check
- Returns:
true/false
-
virtual bool contains(point query)#
Determine if the shape contains the specified point.
- Parameters:
query – Point to test
- Returns:
true/false
-
virtual bool contains(Shape *query)#
Determine if the shape contains the specified shape.
- Parameters:
query – Shape to test
- Returns:
true/false
-
inline virtual point getP1()#
Get point of first end of cylinder.
-
inline virtual point getP2()#
Get point of second end of cylinder.
-
inline virtual si_dist_t getRadius()#
Get the radius of the cylinder/hemisphere ends.
-
Cylinder(point p1, point p2, si_dist_t radius, site_t type)#
-
class Capsule : public lm::builder::Shape#
A Shape representing a cylinder with hemispherical ends.
Public Functions
-
Capsule(point p1, point p2, si_dist_t radius, site_t 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
-
virtual bool intersects(Shape *query)#
Check if two shapes intersect.
- Parameters:
query – The other shape to check
- Returns:
true/false
-
virtual bool contains(point query)#
Determine if the shape contains the specified point.
- Parameters:
query – Point to test
- Returns:
true/false
-
virtual bool contains(Shape *query)#
Determine if the shape contains the specified shape.
- Parameters:
query – Shape to test
- Returns:
true/false
-
inline virtual point getP1()#
Get point of first end of cylinder.
-
inline virtual point getP2()#
Get point of second end of cylinder.
-
inline virtual si_dist_t getRadius()#
Get the radius of the cylinder/hemisphere ends.
-
Capsule(point p1, point p2, si_dist_t radius, site_t type)#
-
class Cuboid : public lm::builder::Shape#
A cube-like Shape.
Public Functions
-
Cuboid(point p1, point p2, site_t type)#
Create a Cuboid that is axis aligned.
- Parameters:
p1 – Point of the lower corner
p2 – Point of the upper corner
type – The type of the sites within the cuboid
-
Cuboid(point center, si_dist_t w, si_dist_t h, si_dist_t d, site_t type, vector at = vector(1.0, 0.0, 0.0), vector 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)
-
virtual bool intersects(Shape *query)#
Check if two shapes intersect.
- Parameters:
query – The other shape to check
- Returns:
true/false
-
virtual bool contains(point query)#
Determine if the shape contains the specified point.
- Parameters:
query – Point to test
- Returns:
true/false
-
virtual bool contains(Shape *query)#
Determine if the shape contains the specified shape.
- Parameters:
query – Shape to test
- Returns:
true/false
-
inline virtual point getP1()#
Get the lower point.
-
inline virtual point getP2()#
Get the upper point.
-
virtual double getVolume()#
Get the volume bounded by the cuboid shape.
-
Cuboid(point p1, point p2, site_t type)#
-
class Cone : public lm::builder::Shape#
A Shape that represents a Cone.
Public Functions
-
Cone(point center, si_dist_t radius, si_dist_t height, site_t type, vector 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
-
virtual bool intersects(Shape *query)#
Check if two shapes intersect.
- Parameters:
query – The other shape to check
- Returns:
true/false
-
virtual bool contains(point query)#
Determine if the shape contains the specified point.
- Parameters:
query – Point to test
- Returns:
true/false
-
virtual bool contains(Shape *query)#
Determine if the shape contains the specified shape.
- Parameters:
query – Shape to test
- Returns:
true/false
-
inline virtual point getCenter()#
Get the center of the cone.
-
inline virtual si_dist_t getRadius()#
Get the radius of the cone.
-
inline virtual si_dist_t getHeight()#
Get the height of the cone.
-
virtual double getVolume()#
Get the volume bounded by the cone.
-
Cone(point center, si_dist_t radius, si_dist_t height, site_t type, vector normal = vector(1.0, 0.0, 0.0))#
-
class Hemisphere : public lm::builder::Shape#
A hemisphere Shape.
Public Functions
-
Hemisphere(point center, si_dist_t radius, vector orientation, site_t 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
-
virtual ~Hemisphere()#
Destroy the Hemisphere.
-
virtual bool intersects(Shape *query)#
Check if two shapes intersect.
- Parameters:
query – The other shape to check
- Returns:
true/false
-
virtual bool contains(point query)#
Determine if the shape contains the specified point.
- Parameters:
query – Point to test
- Returns:
true/false
-
virtual bool contains(Shape *query)#
Determine if the shape contains the specified shape.
- Parameters:
query – Shape to test
- Returns:
true/false
-
inline virtual point getCenter()#
Get the center of the Hemisphere.
-
inline virtual si_dist_t getRadius()#
Get the radius of the Hemisphere.
-
inline virtual vector getOrientation()#
Get the orientation vector of the Hemisphere.
-
virtual double getVolume()#
Get the volume contained by the Hemisphere.
-
Hemisphere(point center, si_dist_t radius, vector orientation, site_t type)#
Builder Classes#
-
class LatticeBuilder#
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.
Public Functions
-
LatticeBuilder(si_dist_t xLen, si_dist_t yLen, si_dist_t zLen, si_dist_t collisionGridSpacing, uint32_t seedTop, uint32_t 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
-
virtual ~LatticeBuilder()#
-
virtual void addRegion(Shape *shape)#
Add a region to the lattice.
- Parameters:
shape – A Shape object to add as a region
-
virtual bool placeObject(Shape *shape)#
Add an shape to the lattice.
- Parameters:
shape – A Shape object to add as a region
- Returns:
true if the object to place does not intersect another object
-
virtual bool placeSphere(point center, si_dist_t radius, site_t type)#
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
- Returns:
true if the sphere did not intersect
-
virtual void removeSphere(point center, si_dist_t radius, site_t 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
-
virtual uint placeRandomSphere(si_dist_t radius, site_t type, site_t region)#
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
- Returns:
number of times a placement operation occured
-
virtual void placeRandomSpheres(uint count, si_dist_t radius, site_t type, site_t 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
- Returns:
number of times a placement operation occured
-
virtual void fillWithRandomSpheres(double volumeFraction, si_dist_t radius, site_t type, site_t 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
-
virtual void getSpatialModel(lm::io::SpatialModel *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
-
virtual void addParticles(particle_t particleType, site_t siteType, uint 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
-
virtual void discretizeTo(lm::rdme::Lattice *lattice, site_t obstacleSiteType, double 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
-
LatticeBuilder(si_dist_t xLen, si_dist_t yLen, si_dist_t zLen, si_dist_t collisionGridSpacing, uint32_t seedTop, uint32_t seedBottom = 0)#
Warning
doxygenclass: Cannot find class “lm::builder::bounding_box” in doxygen xml output for project “LatticeMicrobes” from directory: ./xml
Warning
doxygenclass: Cannot find class “lm::builder::point” in doxygen xml output for project “LatticeMicrobes” from directory: ./xml
Threading Classes#
-
class WorkerManager#
A singleton manager that creates and manages workers that run on a processing node.
Public Functions
-
WorkerManager()#
Create the WorkerManager.
-
~WorkerManager()#
Destroy the WorkerManager.
-
void removeWorker(Worker *worker)#
Removes a worker from the manager.
- Parameters:
worker – Worker handle for which to remove
-
void abortWorkers()#
Aborts all the worker threads.
-
void checkpointWorkers()#
Causes all the worker threads to checkpoint (checkpointing is currently unimplemented)
-
void stopWorkers()#
Stops all the worker threads (e.g. merges them with the master)
Public Static Functions
-
static WorkerManager *getInstance()#
Get the global worker manager.
- Returns:
globalWorkerManager Global thread manager instance handle
-
WorkerManager()#
-
class Worker : public lm::thread::Thread#
An actual worker Thread that runs a simulation replicate.
Subclassed by lm::main::CheckpointSignaler, lm::main::LocalDataOutputWorker, lm::main::ReplicateRunner, lm::main::SignalHandler
-
class Thread#
A base class wrapping pthreads.
Subclassed by lm::thread::Worker
Public Functions
-
Thread()#
Creates a pthread locking mechanism and initializes “Thread”.
-
virtual void start()#
If no thread exists, creates a new thread and begins execution.
-
virtual void stop()#
Joins the thread with the parent waiting if necessary.
-
virtual void wake() = 0#
Wakes a sleeping thead.
-
inline virtual pthread_t getId()#
Returns the pthread based id for the Thread.
- Returns:
pthread assigned id
-
virtual void setAffinity(int cpuNumber)#
Binds the thread to a CPU core.
- Parameters:
The – cpu core for which to bind the thread
-
Thread()#
Utility Classes#
Warning
doxygenclass: Cannot find class “Timer” in doxygen xml output for project “LatticeMicrobes” from directory: ./xml