#include <ChemCompt.h>
Public Member Functions | |
ChemCompt () | |
virtual | ~ChemCompt () |
double | getEntireVolume (const Eref &e) const |
virtual double | vGetEntireVolume () const =0 |
void | setEntireVolume (const Eref &e, double volume) |
double | getOneVoxelVolume (const Eref &e, unsigned int voxel) const |
void | setOneVoxelVolume (const Eref &e, unsigned int voxel, double volume) |
unsigned int | getDimensions () const |
virtual unsigned int | innerGetDimensions () const =0 |
void | setMethod (string method) |
string | getMethod () const |
vector< double > | getStencilRate (unsigned int row) const |
virtual vector< double > | innerGetStencilRate (unsigned int row) const =0 |
Virtual func for getting stencil rates for the derived classes. | |
vector< unsigned int > | getStencilIndex (unsigned int row) const |
vector< double > | getVoxelVolume () const |
Returns vector of all voxel volumes in compartment. | |
virtual const vector< double > & | vGetVoxelVolume () const =0 |
Virtual func so that derived classes can pass voxel volume back. | |
vector< double > | getVoxelMidpoint () const |
Returns vector of all voxel midpoints in compartment. | |
virtual const vector< double > & | vGetVoxelMidpoint () const =0 |
Virtual func so that derived classes can return voxel midpoint. | |
void | setVolumeNotRates (double volume) |
virtual bool | vSetVolumeNotRates (double volume)=0 |
Virtual function for actually doing this. | |
void | buildDefaultMesh (const Eref &e, double volume, unsigned int numEntries) |
virtual void | innerBuildDefaultMesh (const Eref &e, double volume, unsigned int numEntries)=0 |
void | handleNodeInfo (const Eref &e, unsigned int numNodes, unsigned int numThreads) |
virtual void | innerHandleNodeInfo (const Eref &e, unsigned int numNodes, unsigned int numThreads)=0 |
void | resetStencil () |
virtual void | innerResetStencil ()=0 |
unsigned int | getNumEntries () const |
virtual unsigned int | innerGetNumEntries () const =0 |
void | setNumEntries (unsigned int num) |
virtual void | innerSetNumEntries (unsigned int n)=0 |
MeshEntry * | lookupEntry (unsigned int index) |
void | getChildConcs (const Eref &e, vector< double > &childConcs) const |
unsigned int | setChildConcs (const Eref &e, const vector< double > &childConcs, unsigned int start) const |
void | buildJunction (ChemCompt *other, vector< VoxelJunction > &ret) |
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 |
virtual void | indexToSpace (unsigned int index, double &x, double &y, double &z) const =0 |
void | flipRet (vector< VoxelJunction > &ret) const |
Utility function for swapping first and second in VoxelJunctions. | |
virtual unsigned int | getMeshType (unsigned int fid) const =0 |
virtual unsigned int | getMeshDimensions (unsigned int fid) const =0 |
Virtual function to return dimensions of specified entry. | |
virtual double | getMeshEntryVolume (unsigned int fid) const =0 |
Virtual function to return volume of mesh Entry. | |
virtual void | setMeshEntryVolume (unsigned int fid, double volume) |
virtual vector< double > | getCoordinates (unsigned int fid) const =0 |
Virtual function to return coords of mesh Entry. | |
virtual vector< unsigned int > | getNeighbors (unsigned int fid) const =0 |
Virtual function to return info on Entries connected to this one. | |
virtual vector< double > | getDiffusionArea (unsigned int fid) const =0 |
Virtual function to return diffusion X-section area per neighbor. | |
virtual vector< double > | getDiffusionScaling (unsigned int fid) const =0 |
Virtual function to return scale factor for diffusion. 1 here. | |
virtual double | extendedMeshEntryVolume (unsigned int fid) const =0 |
Volume of mesh Entry including abutting diff-coupled voxels. | |
virtual void | clearExtendedMeshEntryVolume ()=0 |
clear out extended mesh entries for rebuilding. | |
virtual unsigned int | getStencilRow (unsigned int meshIndex, const double **entry, const unsigned int **colIndex) const =0 |
virtual void | extendStencil (const ChemCompt *other, const vector< VoxelJunction > &vj)=0 |
Static Public Member Functions | |
static double | distance (double x, double y, double z) |
static SrcFinfo1< vector < double > > * | voxelVolOut () |
static const Cinfo * | initCinfo () |
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.
ChemCompt::ChemCompt | ( | ) |
ChemCompt::~ChemCompt | ( | ) | [virtual] |
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.
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.
virtual void ChemCompt::clearExtendedMeshEntryVolume | ( | ) | [pure virtual] |
clear out extended mesh entries for rebuilding.
Implemented in MeshCompt.
double ChemCompt::distance | ( | double | x, | |
double | y, | |||
double | z | |||
) | [static] |
Referenced by CylMesh::nearest(), and CubeMesh::nearest().
virtual double ChemCompt::extendedMeshEntryVolume | ( | unsigned int | fid | ) | const [pure virtual] |
virtual void ChemCompt::extendStencil | ( | const ChemCompt * | other, | |
const vector< VoxelJunction > & | vj | |||
) | [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.
void ChemCompt::flipRet | ( | vector< VoxelJunction > & | ret | ) | const |
Utility function for swapping first and second in VoxelJunctions.
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
Referenced by CylMesh::setDiffLength(), setEntireVolume(), CylMesh::setR0(), CylMesh::setR1(), CylMesh::setX0(), CylMesh::setX1(), CylMesh::setY0(), CylMesh::setY1(), CylMesh::setZ0(), and CylMesh::setZ1().
virtual vector< double > ChemCompt::getCoordinates | ( | unsigned int | fid | ) | const [pure virtual] |
virtual vector< double > ChemCompt::getDiffusionArea | ( | unsigned int | fid | ) | const [pure virtual] |
virtual vector< double > ChemCompt::getDiffusionScaling | ( | unsigned int | fid | ) | const [pure virtual] |
unsigned int ChemCompt::getDimensions | ( | ) | const |
Returns # of dimensions of mesh. This is 3 for cube, and 1 for cylinder or neurons.
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.
References vGetEntireVolume().
Referenced by initCinfo().
virtual unsigned int ChemCompt::getMeshDimensions | ( | unsigned int | fid | ) | const [pure virtual] |
virtual double ChemCompt::getMeshEntryVolume | ( | unsigned int | fid | ) | const [pure virtual] |
Virtual function to return volume of mesh Entry.
Implemented in CubeMesh, CylMesh, NeuroMesh, PsdMesh, and SpineMesh.
Referenced by getOneVoxelVolume(), and MeshEntry::getVolume().
virtual unsigned int ChemCompt::getMeshType | ( | unsigned int | fid | ) | const [pure virtual] |
string ChemCompt::getMethod | ( | ) | const |
virtual vector< unsigned int > ChemCompt::getNeighbors | ( | unsigned int | fid | ) | 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
References innerGetNumEntries().
Referenced by initCinfo().
double ChemCompt::getOneVoxelVolume | ( | const Eref & | e, | |
unsigned int | voxel | |||
) | const |
Returns volume of specified voxel
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.
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.
References innerGetStencilRate().
Referenced by initCinfo().
virtual unsigned int ChemCompt::getStencilRow | ( | unsigned int | meshIndex, | |
const double ** | entry, | |||
const unsigned int ** | colIndex | |||
) | const [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.
References vGetVoxelMidpoint().
Referenced by initCinfo().
vector< double > ChemCompt::getVoxelVolume | ( | ) | const |
Returns vector of all voxel volumes in compartment.
References vGetVoxelVolume().
Referenced by initCinfo().
void ChemCompt::handleNodeInfo | ( | const Eref & | e, | |
unsigned int | numNodes, | |||
unsigned int | numThreads | |||
) |
References innerHandleNodeInfo().
Referenced by initCinfo().
virtual void ChemCompt::indexToSpace | ( | unsigned int | index, | |
double & | x, | |||
double & | y, | |||
double & | z | |||
) | const [pure virtual] |
const Cinfo * ChemCompt::initCinfo | ( | ) | [static] |
Reimplemented in CubeMesh, CylMesh, NeuroMesh, PsdMesh, and SpineMesh.
References buildDefaultMesh(), getDimensions(), getEntireVolume(), getNumEntries(), getOneVoxelVolume(), getStencilIndex(), getStencilRate(), getVoxelMidpoint(), getVoxelVolume(), handleNodeInfo(), Neutral::initCinfo(), MeshEntry::initCinfo(), lookupEntry(), resetStencil(), setEntireVolume(), setNumEntries(), setOneVoxelVolume(), setVolumeNotRates(), and voxelVolOut().
Referenced by SpineMesh::initCinfo(), PsdMesh::initCinfo(), NeuroMesh::initCinfo(), CylMesh::initCinfo(), and CubeMesh::initCinfo().
virtual void ChemCompt::innerBuildDefaultMesh | ( | const Eref & | e, | |
double | volume, | |||
unsigned int | numEntries | |||
) | [pure virtual] |
virtual unsigned int ChemCompt::innerGetDimensions | ( | ) | const [pure virtual] |
virtual unsigned int ChemCompt::innerGetNumEntries | ( | ) | const [pure virtual] |
virtual vector< double > ChemCompt::innerGetStencilRate | ( | unsigned int | row | ) | const [pure virtual] |
Virtual func for getting stencil rates for the derived classes.
Implemented in MeshCompt.
Referenced by getStencilRate().
virtual void ChemCompt::innerHandleNodeInfo | ( | const Eref & | e, | |
unsigned int | numNodes, | |||
unsigned int | numThreads | |||
) | [pure virtual] |
virtual void ChemCompt::innerResetStencil | ( | ) | [pure virtual] |
Implemented in MeshCompt.
Referenced by resetStencil().
virtual void ChemCompt::innerSetNumEntries | ( | unsigned int | n | ) | [pure virtual] |
MeshEntry * ChemCompt::lookupEntry | ( | unsigned int | index | ) |
Returns the matched lookupEntry
Referenced by initCinfo().
virtual void ChemCompt::matchMeshEntries | ( | const ChemCompt * | other, | |
vector< VoxelJunction > & | ret | |||
) | const [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.
virtual double ChemCompt::nearest | ( | double | x, | |
double | y, | |||
double | z, | |||
unsigned int & | index | |||
) | const [pure virtual] |
void ChemCompt::resetStencil | ( | ) |
Reset stencil m_ to coreStencil_. This is needed as a prelude to rebuilding the junctions using extendStencil.
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.
Referenced by setEntireVolume().
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.
References Eref::dataIndex(), Eref::element(), getChildConcs(), Element::getMsgTargets(), setChildConcs(), vGetVoxelVolume(), voxelVolOut(), and vSetVolumeNotRates().
Referenced by initCinfo().
void ChemCompt::setMeshEntryVolume | ( | unsigned int | fid, | |
double | volume | |||
) | [virtual] |
Virtual function to assign volume of mesh Entry. Does nothing in most cases, but is operational in SpineMesh and PsdMesh.
Reimplemented in PsdMesh, and SpineMesh.
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.
References innerSetNumEntries().
Referenced by initCinfo().
void ChemCompt::setOneVoxelVolume | ( | const Eref & | e, | |
unsigned int | voxel, | |||
double | volume | |||
) |
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.,
References vSetVolumeNotRates().
Referenced by initCinfo().
virtual double ChemCompt::vGetEntireVolume | ( | ) | const [pure virtual] |
virtual const vector< double >& ChemCompt::vGetVoxelMidpoint | ( | ) | const [pure virtual] |
virtual const vector< double >& ChemCompt::vGetVoxelVolume | ( | ) | const [pure virtual] |
Virtual func so that derived classes can pass voxel volume back.
Implemented in CubeMesh, CylMesh, NeuroMesh, PsdMesh, and SpineMesh.
Referenced by getVoxelVolume(), and setEntireVolume().
SrcFinfo1< vector< double > > * ChemCompt::voxelVolOut | ( | ) | [static] |
Referenced by initCinfo(), and setEntireVolume().
virtual bool ChemCompt::vSetVolumeNotRates | ( | double | volume | ) | [pure virtual] |
Virtual function for actually doing this.
Implemented in CubeMesh, CylMesh, NeuroMesh, PsdMesh, and SpineMesh.
Referenced by setEntireVolume(), and setVolumeNotRates().