19 "Sends updated voxel volume out to Ksolve, Gsolve, and Dsolve."
20 "Used to request a recalculation of rates and of initial numbers."
32 "Volume of entire chemical domain."
33 "Assigning this only works if the chemical compartment has"
34 "only a single voxel. Otherwise ignored."
35 "This function goes through all objects below this on the"
36 "tree, and rescales their molecule #s and rates as per the"
37 "volume change. This keeps concentration the same, and also"
38 "maintains rates as expressed in volume units.",
46 "Vector of volumes of each of the voxels.",
53 "Vector of midpoint coordinates of each of the voxels. The "
54 "size of this vector is 3N, where N is the number of voxels. "
55 "The first N entries are for x, next N for y, last N are z. ",
63 "Volume of specified voxel.",
70 "Number of spatial dimensions of this compartment. Usually 3 or 2",
76 "vector of diffusion rates in the stencil for specified voxel."
77 "The identity of the coupled voxels is given by the partner "
78 "field 'stencilIndex'."
79 "Returns an empty vector for non-voxelized compartments.",
85 "vector of voxels diffusively coupled to the specified voxel."
86 "The diffusion rates into the coupled voxels is given by the "
87 "partner field 'stencilRate'."
88 "Returns an empty vector for non-voxelized compartments.",
94 "Flag, set to True for meshes where each voxel is membrane "
96 "NeuroMesh and SpineMesh are false. \n"
97 "CubeMesh, CylMesh, and EndoMesh can be either. If they are "
98 "membrane bound they can still interact via channels and "
99 "cross-compartment reactions. ",
109 "Tells ChemCompt derived class to build a default mesh with the"
110 "specified volume and number of meshEntries.",
116 "Changes volume but does not notify any child objects."
117 "Only works if the ChemCompt has just one voxel."
118 "This function will invalidate any concentration term in"
119 "the model. If you don't know why you would want to do this,"
120 "then you shouldn't use this function.",
126 "Tells ChemCompt how many nodes and threads per node it is "
127 "allowed to use. Triggers a return meshSplitOut message.",
133 "Resets the diffusion stencil to the core stencil that only "
134 "includes the within-mesh diffusion. This is needed prior to "
135 "building up the cross-mesh diffusion through junctions.",
147 "Field Element for mesh entries",
155 static Finfo* chemMeshFinfos[] = {
171 static string doc[] = {
173 "Author",
"Upi Bhalla",
174 "Description",
"Pure virtual base class for chemical compartments"
182 sizeof( chemMeshFinfos ) /
sizeof (
Finfo* ),
185 sizeof(doc)/
sizeof(
string ),
201 isMembraneBound_( false )
227 unsigned int numNodes,
unsigned int numThreads )
245 vector< ObjId > tgtVec =
247 if ( tgtVec.size() == 0 ) {
248 vector< double > childConcs;
269 for ( vector < Id >::iterator i = kids.begin(); i != kids.end(); ++i )
271 if ( i->element()->cinfo()->isA(
"PoolBase" ) ) {
274 }
else if ( i->element()->cinfo()->isA(
"ReacBase" ) ) {
277 }
else if ( i->element()->cinfo()->isA(
"EnzBase" ) ) {
279 }
else if ( i->element()->cinfo()->isA(
"ChemCompt" ) ) {
289 const vector< double >& conc,
unsigned int start )
const
293 for ( vector < Id >::iterator i = kids.begin(); i != kids.end(); ++i )
295 if ( i->element()->cinfo()->isA(
"PoolBase" ) ) {
298 }
else if ( i->element()->cinfo()->isA(
"ReacBase" ) ) {
301 }
else if ( i->element()->cinfo()->isA(
"EnzBase" ) ) {
303 }
else if ( i->element()->cinfo()->isA(
"ChemCompt" ) ) {
337 cout <<
"Warning: ChemCompt::setMeshEntryVolume: Undefined except for PSD and spine mesh.\n";
408 vector< VoxelJunction >::iterator i;
409 for ( i = ret.begin(); i != ret.end(); ++i ) {
410 unsigned int temp = i->first;
411 i->first = i->second;
413 double vol = i->firstVol;
414 i->firstVol = i->secondVol;
424 return sqrt( x * x + y * y + z * z );
static const Cinfo * initCinfo()
void setIsMembraneBound(bool v)
vector< double > getVoxelMidpoint() const
Returns vector of all voxel midpoints in compartment.
vector< ObjId > getMsgTargets(DataId srcDataId, const SrcFinfo *finfo) const
virtual bool vSetVolumeNotRates(double volume)=0
Virtual function for actually doing this.
virtual void innerHandleNodeInfo(const Eref &e, unsigned int numNodes, unsigned int numThreads)=0
void setVolumeNotRates(double volume)
MeshEntry * lookupEntry(unsigned int index)
vector< double > getVoxelVolume() const
Returns vector of all voxel volumes in compartment.
vector< double > getStencilRate(unsigned int row) const
unsigned int dataIndex() const
vector< unsigned int > getStencilIndex(unsigned int row) const
void setEntireVolume(const Eref &e, double volume)
void setOneVoxelVolume(const Eref &e, unsigned int voxel, double volume)
double getEntireVolume(const Eref &e) const
double getOneVoxelVolume(const Eref &e, unsigned int voxel) const
void buildJunction(ChemCompt *other, vector< VoxelJunction > &ret)
static void children(const Eref &e, vector< Id > &ret)
Element * element() const
static bool set(const ObjId &dest, const string &field, A arg)
virtual void innerResetStencil()=0
static SrcFinfo1< vector< double > > * voxelVolOut()
unsigned int getNumEntries() const
unsigned int getDimensions() const
virtual vector< double > innerGetStencilRate(unsigned int row) const =0
Virtual func for getting stencil rates for the derived classes.
virtual vector< unsigned int > getNeighbors(unsigned int fid) const =0
Virtual function to return info on Entries connected to this one.
virtual unsigned int innerGetDimensions() const =0
virtual double vGetEntireVolume() const =0
static double distance(double x, double y, double z)
void getChildConcs(const Eref &e, vector< double > &childConcs) const
virtual const vector< double > & vGetVoxelVolume() const =0
Virtual func so that derived classes can pass voxel volume back.
virtual unsigned int innerGetNumEntries() const =0
bool getIsMembraneBound() const
void buildDefaultMesh(const Eref &e, double volume, unsigned int numEntries)
virtual void extendStencil(const ChemCompt *other, const vector< VoxelJunction > &vj)=0
unsigned int setChildConcs(const Eref &e, const vector< double > &childConcs, unsigned int start) const
void setNumEntries(unsigned int num)
static unsigned int numNodes
virtual void setMeshEntryVolume(unsigned int fid, double volume)
virtual const vector< double > & vGetVoxelMidpoint() const =0
Virtual func so that derived classes can return voxel midpoint.
virtual void matchMeshEntries(const ChemCompt *other, vector< VoxelJunction > &ret) const =0
static const Cinfo * initCinfo()
void handleNodeInfo(const Eref &e, unsigned int numNodes, unsigned int numThreads)
static const Cinfo * initCinfo()
virtual double getMeshEntryVolume(unsigned int fid) const =0
Virtual function to return volume of mesh Entry.
void flipRet(vector< VoxelJunction > &ret) const
Utility function for swapping first and second in VoxelJunctions.
virtual void innerSetNumEntries(unsigned int n)=0
static const Cinfo * chemMeshCinfo
virtual void innerBuildDefaultMesh(const Eref &e, double volume, unsigned int numEntries)=0