Lattice Microbes 2.5
This is for whole cell modeling
Loading...
Searching...
No Matches
lm::builder::LatticeBuilder Class Reference

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. More...

#include <LatticeBuilder.h>

Collaboration diagram for lm::builder::LatticeBuilder:
[legend]

Classes

struct  ParticlePlacement
 A representation of a placement operation that needs to occur (i.e. where to place (siteType), what to place (particleType) and how many (count)) More...

Public Member 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.
virtual ~LatticeBuilder ()
virtual void addRegion (Shape *shape)
 Add a region to the lattice.
virtual bool placeObject (Shape *shape)
 Add an shape to the lattice.
virtual void removeObject (Shape *s)
 Remove the shape from the lattice.
virtual bool placeSphere (point center, si_dist_t radius, site_t type)
 Place a sphere in the lattice (for obstacles)
virtual void removeSphere (point center, si_dist_t radius, site_t type)
 Remove a sphere in the lattice (for obstacles)
virtual uint placeRandomSphere (si_dist_t radius, site_t type, site_t region)
 Place a sphere randomly in the lattice (for obstacles)
virtual void placeRandomSpheres (uint count, si_dist_t radius, site_t type, site_t region)
 Place many spheres randomly in the lattice (for obstacles)
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.
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.
virtual void addParticles (particle_t particleType, site_t siteType, uint count)
 Add particles of a given type.
virtual void discretizeTo (lm::rdme::Lattice *lattice, site_t obstacleSiteType, double fractionObstacleSitesOccupied)
 Discretizes the regions to a square lattice.

Protected Member Functions

virtual void discretizeObstaclesTo (lm::rdme::Lattice *lattice, site_t obstacleSiteType, double fractionObstacleSitesOccupied)
 Discretizes the obstacles to a square lattice.

Protected Attributes

si_dist_t xLen
si_dist_t yLen
si_dist_t zLen
std::vector< site_tdefinedRegions
std::map< site_t, std::vector< Shape * > > regionShapes
std::map< site_t, bounding_boxregionBounds
std::vector< Shape * > objects
std::vector< ParticlePlacementparticles
Shape *** collisionGrid
uintcollisionGridSize
uintcollisionGridOccupancy
si_dist_t collisionGridSpacing
double recipCollisionGridSpacing
uint collisionGridXSize
uint collisionGridYSize
uint collisionGridZSize
RandomGeneratorrng

Detailed Description

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.

Constructor & Destructor Documentation

◆ LatticeBuilder()

lm::builder::LatticeBuilder::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
xLenLength of the domain along x-axis
yLenLength of the domain along y-axis
zLenLength of the domain along z-axis
collisionGridSpacingThe spacing for collision objects
seedTopHigh 32 bits of the seed (allows a constant seed for debugging)
seedBottomLow 32 bits of the seed
Here is the call graph for this function:

◆ ~LatticeBuilder()

lm::builder::LatticeBuilder::~LatticeBuilder ( )
virtual

Member Function Documentation

◆ addParticles()

void lm::builder::LatticeBuilder::addParticles ( particle_t particleType,
site_t siteType,
uint count )
virtual

Add particles of a given type.

Parameters
particleTypeThe type of particles to randomly place in the lattice
siteTypeType of lattice site into which to place
countNumber of particles to place

◆ addRegion()

void lm::builder::LatticeBuilder::addRegion ( Shape * shape)
virtual

Add a region to the lattice.

Parameters
shapeA Shape object to add as a region
Here is the call graph for this function:
Here is the caller graph for this function:

◆ discretizeObstaclesTo()

void lm::builder::LatticeBuilder::discretizeObstaclesTo ( lm::rdme::Lattice * lattice,
site_t obstacleSiteType,
double fractionObstacleSitesOccupied )
protectedvirtual

Discretizes the obstacles to a square lattice.

Parameters
latticeLattice object into which to place
obstacleSiteTypeAn identifier for obstacle sites in the lattice
fractionObstacleSitesOccupiedPercentage of obstacle sites to be filled
Here is the call graph for this function:
Here is the caller graph for this function:

◆ discretizeTo()

void lm::builder::LatticeBuilder::discretizeTo ( lm::rdme::Lattice * lattice,
site_t obstacleSiteType,
double fractionObstacleSitesOccupied )
virtual

Discretizes the regions to a square lattice.

Parameters
latticeLattice object into which to place
obstacleSiteTypeAn identifier for obstacle sites in the lattice
fractionObstacleSitesOccupiedPercentage of obstacle sites to be filled
Here is the call graph for this function:

◆ fillWithRandomSpheres()

void lm::builder::LatticeBuilder::fillWithRandomSpheres ( double volumeFraction,
si_dist_t radius,
site_t type,
site_t region )
virtual

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

Parameters
volumeFractionTotal fraction of volume that should be filled with spheres
radiusRadius of spheres
typeThe type of site to fill (i.e. the type of site to exclude other objects from)
regionThe region of the lattice to place spheres into
Here is the call graph for this function:

◆ getSpatialModel()

void lm::builder::LatticeBuilder::getSpatialModel ( lm::io::SpatialModel * spatialModel)
virtual

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

Parameters
spatialModelAn object of a spatial model for interaction in python or HDF5. The model will be filled with the current lattice
Here is the call graph for this function:

◆ placeObject()

bool lm::builder::LatticeBuilder::placeObject ( Shape * shape)
virtual

Add an shape to the lattice.

Parameters
shapeA Shape object to add as a region
Returns
true if the object to place does not intersect another object
Here is the call graph for this function:
Here is the caller graph for this function:

◆ placeRandomSphere()

uint lm::builder::LatticeBuilder::placeRandomSphere ( si_dist_t radius,
site_t type,
site_t region )
virtual

Place a sphere randomly in the lattice (for obstacles)

Parameters
radiusRadius of the sphere obstacle
typeThe type of site in which to place sphere
regionThe region in which to place obstacle randomly
Returns
number of times a placement operation occured
Here is the call graph for this function:
Here is the caller graph for this function:

◆ placeRandomSpheres()

void lm::builder::LatticeBuilder::placeRandomSpheres ( uint count,
si_dist_t radius,
site_t type,
site_t region )
virtual

Place many spheres randomly in the lattice (for obstacles)

Parameters
radiusRadius of the sphere obstacle
typeThe type of site in which to place sphere
regionThe region in which to place obstacle randomly
Returns
number of times a placement operation occured
Here is the call graph for this function:
Here is the caller graph for this function:

◆ placeSphere()

bool lm::builder::LatticeBuilder::placeSphere ( point center,
si_dist_t radius,
site_t type )
virtual

Place a sphere in the lattice (for obstacles)

Parameters
centerThe center point of sphere obstacle
radiusRadius of the sphere obstacle
typeThe type of site in which to place sphere
Returns
true if the sphere did not intersect
Here is the call graph for this function:

◆ removeObject()

void lm::builder::LatticeBuilder::removeObject ( Shape * s)
virtual

Remove the shape from the lattice.

s Shape to remove

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeSphere()

void lm::builder::LatticeBuilder::removeSphere ( point center,
si_dist_t radius,
site_t type )
virtual

Remove a sphere in the lattice (for obstacles)

Parameters
centerThe center point of sphere obstacle
radiusRadius of the sphere obstacle
typeThe type of site in which to place sphere
Here is the call graph for this function:

Member Data Documentation

◆ collisionGrid

Shape*** lm::builder::LatticeBuilder::collisionGrid
protected

◆ collisionGridOccupancy

uint* lm::builder::LatticeBuilder::collisionGridOccupancy
protected

◆ collisionGridSize

uint* lm::builder::LatticeBuilder::collisionGridSize
protected

◆ collisionGridSpacing

si_dist_t lm::builder::LatticeBuilder::collisionGridSpacing
protected

◆ collisionGridXSize

uint lm::builder::LatticeBuilder::collisionGridXSize
protected

◆ collisionGridYSize

uint lm::builder::LatticeBuilder::collisionGridYSize
protected

◆ collisionGridZSize

uint lm::builder::LatticeBuilder::collisionGridZSize
protected

◆ definedRegions

std::vector<site_t> lm::builder::LatticeBuilder::definedRegions
protected

◆ objects

std::vector<Shape *> lm::builder::LatticeBuilder::objects
protected

◆ particles

std::vector<ParticlePlacement> lm::builder::LatticeBuilder::particles
protected

◆ recipCollisionGridSpacing

double lm::builder::LatticeBuilder::recipCollisionGridSpacing
protected

◆ regionBounds

std::map<site_t,bounding_box> lm::builder::LatticeBuilder::regionBounds
protected

◆ regionShapes

std::map<site_t,std::vector<Shape *> > lm::builder::LatticeBuilder::regionShapes
protected

◆ rng

RandomGenerator* lm::builder::LatticeBuilder::rng
protected

◆ xLen

si_dist_t lm::builder::LatticeBuilder::xLen
protected

◆ yLen

si_dist_t lm::builder::LatticeBuilder::yLen
protected

◆ zLen

si_dist_t lm::builder::LatticeBuilder::zLen
protected

The documentation for this class was generated from the following files: