MOOSE - Multiscale Object Oriented Simulation Environment
|
#include <ChemCompt.h>
Public Member Functions | |
void | buildDefaultMesh (const Eref &e, double volume, unsigned int numEntries) |
void | buildJunction (ChemCompt *other, vector< VoxelJunction > &ret) |
ChemCompt () | |
virtual void | clearExtendedMeshEntryVolume ()=0 |
clear out extended mesh entries for rebuilding. More... | |
virtual double | extendedMeshEntryVolume (unsigned int fid) const =0 |
Volume of mesh Entry including abutting diff-coupled voxels. More... | |
virtual void | extendStencil (const ChemCompt *other, const vector< VoxelJunction > &vj)=0 |
void | flipRet (vector< VoxelJunction > &ret) const |
Utility function for swapping first and second in VoxelJunctions. More... | |
void | getChildConcs (const Eref &e, vector< double > &childConcs) const |
virtual vector< double > | getCoordinates (unsigned int fid) const =0 |
Virtual function to return coords of mesh Entry. More... | |
virtual vector< double > | getDiffusionArea (unsigned int fid) const =0 |
Virtual function to return diffusion X-section area per neighbor. More... | |
virtual vector< double > | getDiffusionScaling (unsigned int fid) const =0 |
Virtual function to return scale factor for diffusion. 1 here. More... | |
unsigned int | getDimensions () const |
double | getEntireVolume (const Eref &e) const |
bool | getIsMembraneBound () const |
virtual unsigned int | getMeshDimensions (unsigned int fid) const =0 |
Virtual function to return dimensions of specified entry. More... | |
virtual double | getMeshEntryVolume (unsigned int fid) const =0 |
Virtual function to return volume of mesh Entry. More... | |
virtual unsigned int | getMeshType (unsigned int fid) const =0 |
Virtual function to return MeshType of specified entry. More... | |
string | getMethod () const |
virtual vector< unsigned int > | getNeighbors (unsigned int fid) const =0 |
Virtual function to return info on Entries connected to this one. More... | |
unsigned int | getNumEntries () const |
double | getOneVoxelVolume (const Eref &e, unsigned int voxel) const |
vector< unsigned int > | getStencilIndex (unsigned int row) const |
vector< double > | getStencilRate (unsigned int row) const |
virtual unsigned int | getStencilRow (unsigned int meshIndex, const double **entry, const unsigned int **colIndex) const =0 |
vector< double > | getVoxelMidpoint () const |
Returns vector of all voxel midpoints in compartment. More... | |
vector< double > | getVoxelVolume () const |
Returns vector of all voxel volumes in compartment. More... | |
void | handleNodeInfo (const Eref &e, unsigned int numNodes, unsigned int numThreads) |
virtual void | indexToSpace (unsigned int index, double &x, double &y, double &z) const =0 |
virtual void | innerBuildDefaultMesh (const Eref &e, double volume, unsigned int numEntries)=0 |
virtual unsigned int | innerGetDimensions () const =0 |
virtual unsigned int | innerGetNumEntries () const =0 |
virtual vector< double > | innerGetStencilRate (unsigned int row) const =0 |
Virtual func for getting stencil rates for the derived classes. More... | |
virtual void | innerHandleNodeInfo (const Eref &e, unsigned int numNodes, unsigned int numThreads)=0 |
virtual void | innerResetStencil ()=0 |
virtual void | innerSetNumEntries (unsigned int n)=0 |
MeshEntry * | lookupEntry (unsigned int index) |
virtual void | matchMeshEntries (const ChemCompt *other, vector< VoxelJunction > &ret) const =0 |
virtual double | nearest (double x, double y, double z, unsigned int &index) const =0 |
void | resetStencil () |
unsigned int | setChildConcs (const Eref &e, const vector< double > &childConcs, unsigned int start) const |
void | setEntireVolume (const Eref &e, double volume) |
void | setIsMembraneBound (bool v) |
virtual void | setMeshEntryVolume (unsigned int fid, double volume) |
void | setMethod (string method) |
void | setNumEntries (unsigned int num) |
void | setOneVoxelVolume (const Eref &e, unsigned int voxel, double volume) |
void | setVolumeNotRates (double volume) |
virtual double | vGetEntireVolume () const =0 |
virtual const vector< double > & | vGetVoxelMidpoint () const =0 |
Virtual func so that derived classes can return voxel midpoint. More... | |
virtual const vector< double > & | vGetVoxelVolume () const =0 |
Virtual func so that derived classes can pass voxel volume back. More... | |
virtual bool | vSetVolumeNotRates (double volume)=0 |
Virtual function for actually doing this. More... | |
virtual | ~ChemCompt () |
Static Public Member Functions | |
static double | distance (double x, double y, double z) |
static const Cinfo * | initCinfo () |
static SrcFinfo1< vector < double > > * | voxelVolOut () |
Private Attributes | |
vector< Boundary > | boundaries_ |
Wrapper for self ptr. More... | |
MeshEntry | entry_ |
bool | isMembraneBound_ |
string | method_ |
The ChemCompt represents a chemically identified compartment. This may be spatially extended, and may even be discontinuous. The same set of reactions and molecules populates any given compartment. Examples of compartments might be: nucleus, cell membrane, early endosomes, spine heads. Connects to one or more 'Geometry' elements to define its boundaries.
Definition at line 23 of file ChemCompt.h.
ChemCompt::ChemCompt | ( | ) |
Definition at line 198 of file ChemCompt.cpp.
Referenced by initCinfo().
|
virtual |
Definition at line 206 of file ChemCompt.cpp.
void ChemCompt::buildDefaultMesh | ( | const Eref & | e, |
double | volume, | ||
unsigned int | numEntries | ||
) |
buildDefaultMesh tells the ChemCompt to make a standard mesh partitioning with the specified total volume and the specified number of subdivisions. For example, a CubeMesh of volume 8 and subdivisions 8 would make a 2x2x2 mesh. This function is specialized in each derived class.
Definition at line 220 of file ChemCompt.cpp.
References innerBuildDefaultMesh().
Referenced by initCinfo().
void ChemCompt::buildJunction | ( | ChemCompt * | other, |
vector< VoxelJunction > & | ret | ||
) |
Wrapper function to buld junction between two meshes, and to extend the meshes so that their stencils also handle update to the voxels abutting the boundary on the neighbor mesh.
Definition at line 400 of file ChemCompt.cpp.
References extendStencil(), and matchMeshEntries().
|
pure virtual |
clear out extended mesh entries for rebuilding.
Implemented in MeshCompt.
|
static |
Definition at line 422 of file ChemCompt.cpp.
Referenced by CylMesh::matchCylMeshEntries(), CylMesh::nearest(), and CubeMesh::nearest().
|
pure virtual |
|
pure virtual |
Function to add voxels for boundaries. This is done so that the solver can do reaction-diffusion computations on the entire mesh including voxels of neighboring solvers abutting the boundary. It uses these to stitch together the computations that span multiple solvers and compartments.
Implemented in MeshCompt.
Referenced by buildJunction().
void ChemCompt::flipRet | ( | vector< VoxelJunction > & | ret | ) | const |
Utility function for swapping first and second in VoxelJunctions.
Definition at line 406 of file ChemCompt.cpp.
Referenced by CubeMesh::matchCubeMeshEntries(), CubeMesh::matchCylMeshEntries(), CylMesh::matchMeshEntries(), SpineMesh::matchMeshEntries(), CubeMesh::matchMeshEntries(), and NeuroMesh::matchMeshEntries().
void ChemCompt::getChildConcs | ( | const Eref & | e, |
vector< double > & | childConcs | ||
) | const |
Recursively traverses all children, depth_first, scooping up concentration terms: conc and concInit for pools, Kf and Kb for Reacs, and Km for enzymes. These are inserted in order into the vector of childConcs. Does not traverse into children of other ChemCompts
Definition at line 264 of file ChemCompt.cpp.
References Neutral::children().
Referenced by CylMesh::innerSetCoords(), CylMesh::setDiffLength(), setEntireVolume(), CylMesh::setR0(), CylMesh::setR1(), CylMesh::setX0(), CylMesh::setX1(), CylMesh::setY0(), CylMesh::setY1(), CylMesh::setZ0(), and CylMesh::setZ1().
|
pure virtual |
Virtual function to return coords of mesh Entry.
Implemented in NeuroMesh, CubeMesh, SpineMesh, PsdMesh, CylMesh, and EndoMesh.
Referenced by EndoMesh::getCoordinates(), and MeshEntry::getCoordinates().
|
pure virtual |
|
pure virtual |
unsigned int ChemCompt::getDimensions | ( | ) | const |
Returns # of dimensions of mesh. This is 3 for cube, and 1 for cylinder or neurons.
Definition at line 340 of file ChemCompt.cpp.
References innerGetDimensions().
Referenced by initCinfo(), testCubeMesh(), and testCubeMeshExtendStencil().
double ChemCompt::getEntireVolume | ( | const Eref & | e | ) | const |
Returns volume, area, or length of compartment, depending on dimensionality.
Definition at line 259 of file ChemCompt.cpp.
References vGetEntireVolume().
Referenced by initCinfo().
bool ChemCompt::getIsMembraneBound | ( | ) | const |
Definition at line 355 of file ChemCompt.cpp.
References isMembraneBound_.
Referenced by initCinfo().
|
pure virtual |
|
pure virtual |
Virtual function to return volume of mesh Entry.
Implemented in NeuroMesh, CubeMesh, SpineMesh, CylMesh, PsdMesh, and EndoMesh.
Referenced by MeshCompt::extendStencil(), EndoMesh::getMeshEntryVolume(), getOneVoxelVolume(), and MeshEntry::getVolume().
|
pure virtual |
string ChemCompt::getMethod | ( | ) | const |
|
pure virtual |
Virtual function to return info on Entries connected to this one.
Implemented in MeshCompt.
Referenced by MeshEntry::getNeighbors(), and getStencilIndex().
unsigned int ChemCompt::getNumEntries | ( | ) | const |
Returns the number of MeshEntries on this ChemCompt
Definition at line 390 of file ChemCompt.cpp.
References innerGetNumEntries().
Referenced by Dsolve::build(), EndoMesh::getDiffusionArea(), EndoMesh::getDiffusionScaling(), initCinfo(), EndoMesh::innerHandleRequestMeshStats(), CylBase::matchCubeMeshEntries(), CylMesh::matchCubeMeshEntries(), and MeshEntry::triggerRemesh().
double ChemCompt::getOneVoxelVolume | ( | const Eref & | e, |
unsigned int | voxel | ||
) | const |
Returns volume of specified voxel
Definition at line 323 of file ChemCompt.cpp.
References getMeshEntryVolume().
Referenced by initCinfo().
vector< unsigned int > ChemCompt::getStencilIndex | ( | unsigned int | row | ) | const |
Function to return the stencil indices used in the diffusion calculations for voxelized compartments. Refers to the getNeighbors virtual function.
Definition at line 350 of file ChemCompt.cpp.
References getNeighbors().
Referenced by initCinfo().
vector< double > ChemCompt::getStencilRate | ( | unsigned int | row | ) | const |
Function to return the stencil values used in the diffusion calculations for voxelized compartments.
Definition at line 345 of file ChemCompt.cpp.
References innerGetStencilRate().
Referenced by initCinfo().
|
pure virtual |
Function to look up scale factor derived from area and length of compartment junction, for all the mesh entries connected to the specified one. Modeled on equivalent function in SparseMatrix. meshIndex: index of reference mesh entry entry: array of values of scale factor colIndex: array of relative indices for each entry. The values returned here are the offset from the meshIndex. Returns number of entries and colIndexes. For a 1-D mesh, there will be 2 except at boundaries For a 2-D mesh, there will be 4 except at boundaries For a 3-D mesh, there will be 6 except at boundaries For a neuromesh, there will be a variable number depending on branching. For a CylMesh there are 2 except at boundaries.
Implemented in MeshCompt.
vector< double > ChemCompt::getVoxelMidpoint | ( | ) | const |
Returns vector of all voxel midpoints in compartment.
Definition at line 318 of file ChemCompt.cpp.
References vGetVoxelMidpoint().
Referenced by initCinfo().
vector< double > ChemCompt::getVoxelVolume | ( | ) | const |
Returns vector of all voxel volumes in compartment.
Definition at line 313 of file ChemCompt.cpp.
References vGetVoxelVolume().
Referenced by Dsolve::build(), initCinfo(), and mapVoxelsBetweenMeshes().
void ChemCompt::handleNodeInfo | ( | const Eref & | e, |
unsigned int | numNodes, | ||
unsigned int | numThreads | ||
) |
Definition at line 226 of file ChemCompt.cpp.
References innerHandleNodeInfo().
Referenced by initCinfo().
|
pure virtual |
|
static |
Definition at line 25 of file ChemCompt.cpp.
References buildDefaultMesh(), ChemCompt(), chemMeshCinfo, getDimensions(), getEntireVolume(), getIsMembraneBound(), getNumEntries(), getOneVoxelVolume(), getStencilIndex(), getStencilRate(), getVoxelMidpoint(), getVoxelVolume(), handleNodeInfo(), MeshEntry::initCinfo(), Neutral::initCinfo(), lookupEntry(), resetStencil(), setEntireVolume(), setIsMembraneBound(), setNumEntries(), setOneVoxelVolume(), setVolumeNotRates(), and voxelVolOut().
Referenced by EndoMesh::initCinfo(), CylMesh::initCinfo(), PsdMesh::initCinfo(), SpineMesh::initCinfo(), NeuroMesh::initCinfo(), and CubeMesh::initCinfo().
|
pure virtual |
|
pure virtual |
|
pure virtual |
Implemented in NeuroMesh, CubeMesh, SpineMesh, PsdMesh, CylMesh, and EndoMesh.
Referenced by getNumEntries(), EndoMesh::getParentVoxel(), and EndoMesh::innerGetNumEntries().
|
pure virtual |
Virtual func for getting stencil rates for the derived classes.
Implemented in MeshCompt.
Referenced by getStencilRate().
|
pure virtual |
|
pure virtual |
|
pure virtual |
MeshEntry * ChemCompt::lookupEntry | ( | unsigned int | index | ) |
Returns the matched lookupEntry
Definition at line 379 of file ChemCompt.cpp.
References entry_.
Referenced by PsdMesh::handlePsdList(), SpineMesh::handleSpineList(), and initCinfo().
|
pure virtual |
Returns the meshIndices (NOT spatial indices) of all adjacent mesh entry pairs on ether side of the (self, other) junction. meshIndices are the indices that look up entries in the vector of pools. spatialIndices are (iz * ny + iy) * nx + ix, that is, a linear conversion of cartesian spatial indices. So, for two touching cubes, the return vector is the paired meshIndices on either side of the plane of contact. If one mesh has a finer mesh than the other, or if there are more than one contact points from self to other (for example, at a corner), then we just have multiple pairs using the same meshIndex of the repeated voxel.
Implemented in NeuroMesh, CubeMesh, SpineMesh, PsdMesh, CylMesh, and EndoMesh.
Referenced by buildJunction(), mapVoxelsBetweenMeshes(), and CubeMesh::matchCylMeshEntries().
|
pure virtual |
Returns distance and index of nearest mesh entry. Computes each mesh entry position as its geometric centre. If the current location is not inside a valid mesh entry, distance returned is negative.
Implemented in NeuroMesh, CubeMesh, SpineMesh, PsdMesh, CylMesh, and EndoMesh.
Referenced by EndoMesh::nearest().
void ChemCompt::resetStencil | ( | ) |
Reset stencil m_ to coreStencil_. This is needed as a prelude to rebuilding the junctions using extendStencil.
Definition at line 233 of file ChemCompt.cpp.
References innerResetStencil().
Referenced by initCinfo().
unsigned int ChemCompt::setChildConcs | ( | const Eref & | e, |
const vector< double > & | childConcs, | ||
unsigned int | start | ||
) | const |
Recursively traverses all children, depth_first, restoring concentration terms as scooped up by getChildConcs. Does conc and concInit for pools, Kf and Kb for Reacs, and Km for enzymes. These are restored in order into the vector of childConcs. Does not traverse into children of other ChemCompts.
Definition at line 288 of file ChemCompt.cpp.
References Neutral::children(), and Field< A >::set().
Referenced by setEntireVolume(), and CylMesh::updateCoords().
void ChemCompt::setEntireVolume | ( | const Eref & | e, |
double | volume | ||
) |
This is a little nasty. It calls buildDefaultMesh with the current numEntries. Should not be used if the mesh has been changed to something more interesting. Perhaps I need to do something like changeVolOfExistingMesh.
Definition at line 242 of file ChemCompt.cpp.
References Eref::dataIndex(), Eref::element(), getChildConcs(), Element::getMsgTargets(), setChildConcs(), vGetVoxelVolume(), voxelVolOut(), and vSetVolumeNotRates().
Referenced by initCinfo().
void ChemCompt::setIsMembraneBound | ( | bool | v | ) |
Definition at line 360 of file ChemCompt.cpp.
References isMembraneBound_.
Referenced by initCinfo().
|
virtual |
Virtual function to assign volume of mesh Entry. Does nothing in most cases, but is operational in SpineMesh and PsdMesh.
Reimplemented in SpineMesh, and PsdMesh.
Definition at line 335 of file ChemCompt.cpp.
Referenced by setOneVoxelVolume().
void ChemCompt::setMethod | ( | string | method | ) |
Hint to system indicating method to be used on this compartment. Defaults to blank, which then leaves the decision to the calling function. Doesn't do anything unless the ChemCompt is parsed by the SimManager.
void ChemCompt::setNumEntries | ( | unsigned int | num | ) |
Dummy function. The numEntries is only set by other functions that define compartment decomposition.
Definition at line 384 of file ChemCompt.cpp.
References innerSetNumEntries().
Referenced by initCinfo().
void ChemCompt::setOneVoxelVolume | ( | const Eref & | e, |
unsigned int | voxel, | ||
double | volume | ||
) |
Definition at line 328 of file ChemCompt.cpp.
References setMeshEntryVolume().
Referenced by initCinfo().
void ChemCompt::setVolumeNotRates | ( | double | volume | ) |
Returns true on success. Changes volume but does not notify any child objects. For some classes, this only works if the ChemCompt has just one voxel. It will return false if it can't handle it. This function will invalidate any concentration term in the model. If you don't know why you would want to do this, then you shouldn't use this function.",
Definition at line 370 of file ChemCompt.cpp.
References vSetVolumeNotRates().
Referenced by initCinfo().
|
pure virtual |
|
pure virtual |
Virtual func so that derived classes can return voxel midpoint.
Implemented in CubeMesh, SpineMesh, NeuroMesh, PsdMesh, CylMesh, and EndoMesh.
Referenced by getVoxelMidpoint(), and EndoMesh::vGetVoxelMidpoint().
|
pure virtual |
Virtual func so that derived classes can pass voxel volume back.
Implemented in CubeMesh, SpineMesh, NeuroMesh, PsdMesh, CylMesh, and EndoMesh.
Referenced by EndoMesh::getVoxelArea(), EndoMesh::getVoxelLength(), getVoxelVolume(), EndoMesh::matchMeshEntries(), setEntireVolume(), and EndoMesh::vGetVoxelVolume().
|
static |
Definition at line 17 of file ChemCompt.cpp.
Referenced by initCinfo(), CubeMesh::setCoords(), and setEntireVolume().
|
pure virtual |
Virtual function for actually doing this.
Implemented in NeuroMesh, CubeMesh, PsdMesh, SpineMesh, CylMesh, and EndoMesh.
Referenced by setEntireVolume(), and setVolumeNotRates().
|
private |
Wrapper for self ptr.
The Boundaries are Element Fields. They appear as distinct Elements, though they are controlled by the ChemCompt. These are the interfaces between compartments, or just the boundaries of the current one. Each Boundary can be diffusive, reflective, or an interface where molecules in different compartments can talk to each other. All boundaries have a message to a Geometry. The Geometries may be shared, which is why the boundary isn't a Geometry itself. If it is an interface (diffusive or other) then the boundary also contains a message to the adjacent compartment.
Definition at line 347 of file ChemCompt.h.
|
private |
Definition at line 333 of file ChemCompt.h.
Referenced by lookupEntry().
|
private |
Flag, set to True for meshes where each voxel is membrane bound. NeuroMesh and SpineMesh are false CubeMesh, CylMesh, and EndoMesh can be either. If they are membrane bound they can still interact via channels and cross-compartment reactions.
Definition at line 363 of file ChemCompt.h.
Referenced by getIsMembraneBound(), and setIsMembraneBound().
|
private |
Hint to system indicating method to be used on this compartment. Defaults to blank, which then leaves the decision to the calling function.
Definition at line 354 of file ChemCompt.h.