MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
EndoMesh Class Reference

#include <EndoMesh.h>

+ Inheritance diagram for EndoMesh:
+ Collaboration diagram for EndoMesh:

Public Member Functions

 EndoMesh ()
 
double extendedMeshEntryVolume (unsigned int fid) const
 Volume of mesh Entry including abutting diff-coupled voxels. More...
 
double getApower (const Eref &e) const
 
double getAscale (const Eref &e) const
 
vector< double > getCoordinates (unsigned int fid) const
 Virtual function to return coords of mesh Entry. More...
 
vector< double > getDiffusionArea (unsigned int fid) const
 Virtual function to return diffusion X-section area. More...
 
vector< double > getDiffusionScaling (unsigned int fid) const
 Virtual function to return scale factor for diffusion. 1 here. More...
 
bool getDoAxialDiffusion (const Eref &e) const
 
unsigned int getMeshDimensions (unsigned int fid) const
 Virtual function to return dimensions of specified entry. More...
 
double getMeshEntryVolume (unsigned int fid) const
 Virtual function to return volume of mesh Entry. More...
 
unsigned int getMeshType (unsigned int fid) const
 Virtual function to return MeshType of specified entry. More...
 
vector< unsigned int > getParentVoxel () const
 Inherited virtual, do nothing for now. More...
 
double getRpower (const Eref &e) const
 
double getRscale (const Eref &e) const
 
ObjId getSurround (const Eref &e) const
 
const vector< double > & getVoxelArea () const
 
const vector< double > & getVoxelLength () const
 
double getVpower (const Eref &e) const
 
double getVscale (const Eref &e) const
 
void indexToSpace (unsigned int index, double &x, double &y, double &z) const
 
void innerBuildDefaultMesh (const Eref &e, double volume, unsigned int numEntries)
 Virtual func to make a mesh with specified Volume and numEntries. More...
 
unsigned int innerGetDimensions () const
 Virtual function to return # of spatial dimensions of mesh. More...
 
unsigned int innerGetNumEntries () const
 
void innerHandleNodeInfo (const Eref &e, unsigned int numNodes, unsigned int numThreads)
 
void innerHandleRequestMeshStats (const Eref &e, const SrcFinfo2< unsigned int, vector< double > > *meshStatsFinfo)
 More inherited virtual funcs: request comes in for mesh stats. More...
 
void innerSetNumEntries (unsigned int n)
 Inherited virtual func. More...
 
void matchMeshEntries (const ChemCompt *other, vector< VoxelJunction > &ret) const
 
double nearest (double x, double y, double z, unsigned int &index) const
 
void setApower (const Eref &e, double v)
 
void setAscale (const Eref &e, double v)
 
void setDoAxialDiffusion (const Eref &e, bool v)
 
void setRpower (const Eref &e, double v)
 
void setRscale (const Eref &e, double v)
 
void setSurround (const Eref &e, ObjId v)
 
void setVpower (const Eref &e, double v)
 
void setVscale (const Eref &e, double v)
 
double vGetEntireVolume () const
 Inherited virtual. Returns entire volume of compartment. More...
 
const vector< double > & vGetVoxelMidpoint () const
 Virtual func so that derived classes can return voxel midpoint. More...
 
const vector< double > & vGetVoxelVolume () const
 Virtual func so that derived classes can pass voxel volume back. More...
 
bool vSetVolumeNotRates (double volume)
 Inherited virtual. Resizes len and dia of each voxel. More...
 
 ~EndoMesh ()
 
- Public Member Functions inherited from MeshCompt
void addRow (unsigned int index, const vector< double > &entry, const vector< unsigned int > &colIndex)
 
void clearExtendedMeshEntryVolume ()
 Inherited virtual function to clear the vector of MeshEntryVolume. More...
 
double extendedMeshEntryVolume (unsigned int fid) const
 Virtual function to return volume of mesh Entry, including. More...
 
void extendStencil (const ChemCompt *other, const vector< VoxelJunction > &vj)
 Add boundary voxels to stencil for cross-solver junctions. More...
 
vector< unsigned int > getNeighbors (unsigned int fid) const
 Looks up stencil to return vector of indices of coupled voxels. More...
 
const SparseMatrix< double > & getStencil () const
 Returns entire sparse matrix of mesh. Used by diffusion solver. More...
 
unsigned int getStencilRow (unsigned int meshIndex, const double **entry, const unsigned int **colIndex) const
 
vector< double > innerGetStencilRate (unsigned int row) const
 
void innerResetStencil ()
 virtual func implemented here. More...
 
 MeshCompt ()
 
void setStencilSize (unsigned int numRows, unsigned int numCols)
 
 ~MeshCompt ()
 
- Public Member Functions inherited from ChemCompt
void buildDefaultMesh (const Eref &e, double volume, unsigned int numEntries)
 
void buildJunction (ChemCompt *other, vector< VoxelJunction > &ret)
 
 ChemCompt ()
 
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
 
unsigned int getDimensions () const
 
double getEntireVolume (const Eref &e) const
 
bool getIsMembraneBound () const
 
string getMethod () const
 
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
 
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)
 
MeshEntrylookupEntry (unsigned int index)
 
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 ~ChemCompt ()
 

Static Public Member Functions

static const CinfoinitCinfo ()
 
- Static Public Member Functions inherited from ChemCompt
static double distance (double x, double y, double z)
 
static const CinfoinitCinfo ()
 
static SrcFinfo1< vector
< double > > * 
voxelVolOut ()
 

Private Attributes

double aPower_
 rEndo = rScale * pow( surroundVol, rPower_) More...
 
double aScale_
 aEndo = aScale * pow( surroundVol, aPower_) More...
 
bool doAxialDiffusion_
 vEndo = vScale * pow( surroundVol, vPower_) More...
 
Id insideMeshes_
 
const MeshComptparent_
 
double rPower_
 EndoMeshes inside. Used to update. More...
 
double rScale_
 rEndo = rScale * pow( surroundVol, rPower_) More...
 
ObjId surround_
 
double vPower_
 aEndo = aScale * pow( surroundVol, aPower_) More...
 
double vScale_
 vEndo = vScale * pow( surroundVol, vPower_) More...
 

Detailed Description

The EndoMesh is a cellular compartment entirely contained within another compartment. It supports diffusion only with its immediate surround, of which there can only be one, and with its immediate interior, which can be one or more EndoMeshes. Each voxel in the EndoMesh is well mixed, and does not exchange with any other voxels. Typically used in modelling endosomes, ER, mitochondria, and other organelles.

Definition at line 23 of file EndoMesh.h.

Constructor & Destructor Documentation

EndoMesh::EndoMesh ( )

Definition at line 138 of file EndoMesh.cpp.

139  :
140  parent_( 0 ),
141  rPower_( 1.0 / 3.0 ),
142  rScale_( 0.5 ),
143  aPower_( 0.5 ),
144  aScale_( 0.25 ),
145  vPower_( 1.0 ),
146  vScale_( 0.125 ),
147  doAxialDiffusion_( false )
148 {
149  ;
150 }
const MeshCompt * parent_
Definition: EndoMesh.h:131
bool doAxialDiffusion_
vEndo = vScale * pow( surroundVol, vPower_)
Definition: EndoMesh.h:147
double aPower_
rEndo = rScale * pow( surroundVol, rPower_)
Definition: EndoMesh.h:142
double vScale_
vEndo = vScale * pow( surroundVol, vPower_)
Definition: EndoMesh.h:145
double rPower_
EndoMeshes inside. Used to update.
Definition: EndoMesh.h:140
double vPower_
aEndo = aScale * pow( surroundVol, aPower_)
Definition: EndoMesh.h:144
double aScale_
aEndo = aScale * pow( surroundVol, aPower_)
Definition: EndoMesh.h:143
double rScale_
rEndo = rScale * pow( surroundVol, rPower_)
Definition: EndoMesh.h:141
EndoMesh::~EndoMesh ( )

Definition at line 152 of file EndoMesh.cpp.

153 {
154  ;
155 }

Member Function Documentation

double EndoMesh::extendedMeshEntryVolume ( unsigned int  fid) const
virtual

Volume of mesh Entry including abutting diff-coupled voxels.

Virtual function to return volume of mesh Entry, including for diffusively coupled voxels from other solvers.

Implements ChemCompt.

Definition at line 307 of file EndoMesh.cpp.

References MeshCompt::extendedMeshEntryVolume(), parent_, vPower_, and vScale_.

308 {
309  double vpa = parent_->extendedMeshEntryVolume( fid );
310  return vScale_ * pow( vpa, vPower_ );
311 }
const MeshCompt * parent_
Definition: EndoMesh.h:131
double extendedMeshEntryVolume(unsigned int fid) const
Virtual function to return volume of mesh Entry, including.
Definition: MeshCompt.cpp:36
double vScale_
vEndo = vScale * pow( surroundVol, vPower_)
Definition: EndoMesh.h:145
double vPower_
aEndo = aScale * pow( surroundVol, aPower_)
Definition: EndoMesh.h:144

+ Here is the call graph for this function:

double EndoMesh::getApower ( const Eref e) const

Definition at line 186 of file EndoMesh.cpp.

References aPower_.

Referenced by initCinfo().

187 {
188  return aPower_;
189 }
double aPower_
rEndo = rScale * pow( surroundVol, rPower_)
Definition: EndoMesh.h:142

+ Here is the caller graph for this function:

double EndoMesh::getAscale ( const Eref e) const

Definition at line 196 of file EndoMesh.cpp.

References aScale_.

Referenced by initCinfo().

197 {
198  return aScale_;
199 }
double aScale_
aEndo = aScale * pow( surroundVol, aPower_)
Definition: EndoMesh.h:143

+ Here is the caller graph for this function:

vector< double > EndoMesh::getCoordinates ( unsigned int  fid) const
virtual

Virtual function to return coords of mesh Entry.

Virtual function to return coords of mesh Entry. For Endo mesh, coords are just middle of parent.

Implements ChemCompt.

Definition at line 277 of file EndoMesh.cpp.

References ChemCompt::getCoordinates(), and parent_.

278 {
279  vector< double > temp = parent_->getCoordinates( fid );
280  vector< double > ret;
281  if ( temp.size() > 6 ) {
282  ret.resize( 4 );
283  ret[0] = 0.5 * (temp[0] + temp[3] );
284  ret[1] = 0.5 * (temp[1] + temp[4] );
285  ret[2] = 0.5 * (temp[2] + temp[5] );
286  ret[3] = 0;
287  }
288  return ret;
289 }
const MeshCompt * parent_
Definition: EndoMesh.h:131
virtual vector< double > getCoordinates(unsigned int fid) const =0
Virtual function to return coords of mesh Entry.

+ Here is the call graph for this function:

vector< double > EndoMesh::getDiffusionArea ( unsigned int  fid) const
virtual

Virtual function to return diffusion X-section area.

Virtual function to return diffusion X-section area for each neighbor This applies if we have endo mesh voxels diffusing with each other

Implements ChemCompt.

Definition at line 293 of file EndoMesh.cpp.

References ChemCompt::getNumEntries(), and parent_.

294 {
295  return vector< double >( parent_->getNumEntries(), 0.0 );
296 }
const MeshCompt * parent_
Definition: EndoMesh.h:131
unsigned int getNumEntries() const
Definition: ChemCompt.cpp:390

+ Here is the call graph for this function:

vector< double > EndoMesh::getDiffusionScaling ( unsigned int  fid) const
virtual

Virtual function to return scale factor for diffusion. 1 here.

Virtual function to return scale factor for diffusion. 1 here. This applies if we have endo mesh voxels diffusing with each other

Implements ChemCompt.

Definition at line 300 of file EndoMesh.cpp.

References ChemCompt::getNumEntries(), and parent_.

301 {
302  return vector< double >( parent_->getNumEntries(), 0.0 );
303 }
const MeshCompt * parent_
Definition: EndoMesh.h:131
unsigned int getNumEntries() const
Definition: ChemCompt.cpp:390

+ Here is the call graph for this function:

bool EndoMesh::getDoAxialDiffusion ( const Eref e) const

Definition at line 242 of file EndoMesh.cpp.

References doAxialDiffusion_.

Referenced by initCinfo().

243 {
244  return doAxialDiffusion_;
245 }
bool doAxialDiffusion_
vEndo = vScale * pow( surroundVol, vPower_)
Definition: EndoMesh.h:147

+ Here is the caller graph for this function:

unsigned int EndoMesh::getMeshDimensions ( unsigned int  fid) const
virtual

Virtual function to return dimensions of specified entry.

Implements ChemCompt.

Definition at line 258 of file EndoMesh.cpp.

259 {
260  return 3;
261 }
double EndoMesh::getMeshEntryVolume ( unsigned int  fid) const
virtual

Virtual function to return volume of mesh Entry.

Implements ChemCompt.

Definition at line 269 of file EndoMesh.cpp.

References ChemCompt::getMeshEntryVolume(), parent_, vPower_, and vScale_.

270 {
271  double vpa = parent_->getMeshEntryVolume( fid );
272  return vScale_ * pow( vpa, vPower_ );
273 }
const MeshCompt * parent_
Definition: EndoMesh.h:131
double vScale_
vEndo = vScale * pow( surroundVol, vPower_)
Definition: EndoMesh.h:145
double vPower_
aEndo = aScale * pow( surroundVol, aPower_)
Definition: EndoMesh.h:144
virtual double getMeshEntryVolume(unsigned int fid) const =0
Virtual function to return volume of mesh Entry.

+ Here is the call graph for this function:

unsigned int EndoMesh::getMeshType ( unsigned int  fid) const
virtual

Virtual function to return MeshType of specified entry.

Implements ChemCompt.

Definition at line 252 of file EndoMesh.cpp.

References ENDO.

253 {
254  return ENDO;
255 }
Definition: MeshEntry.h:22
vector< unsigned int > EndoMesh::getParentVoxel ( ) const
virtual

Inherited virtual, do nothing for now.

This means the sibling voxel immediately adjacent to it, not the voxel surrounding it. Should we wish to do diffusion we would need to use the parent voxel of the surround voxel. Otherewise use EMTPY_VOXEL == -1U.

Implements MeshCompt.

Definition at line 361 of file EndoMesh.cpp.

References doAxialDiffusion_, MeshCompt::getParentVoxel(), ChemCompt::innerGetNumEntries(), and parent_.

362 {
363  if ( doAxialDiffusion_ )
364  return parent_->getParentVoxel();
365 
366  vector< unsigned int > ret( parent_->innerGetNumEntries(), -1U );
367  return ret;
368 }
const MeshCompt * parent_
Definition: EndoMesh.h:131
bool doAxialDiffusion_
vEndo = vScale * pow( surroundVol, vPower_)
Definition: EndoMesh.h:147
virtual vector< unsigned int > getParentVoxel() const =0
virtual unsigned int innerGetNumEntries() const =0

+ Here is the call graph for this function:

double EndoMesh::getRpower ( const Eref e) const

Definition at line 166 of file EndoMesh.cpp.

References rPower_.

Referenced by initCinfo().

167 {
168  return rPower_;
169 }
double rPower_
EndoMeshes inside. Used to update.
Definition: EndoMesh.h:140

+ Here is the caller graph for this function:

double EndoMesh::getRscale ( const Eref e) const

Definition at line 176 of file EndoMesh.cpp.

References rScale_.

Referenced by initCinfo().

177 {
178  return rScale_;
179 }
double rScale_
rEndo = rScale * pow( surroundVol, rPower_)
Definition: EndoMesh.h:141

+ Here is the caller graph for this function:

ObjId EndoMesh::getSurround ( const Eref e) const

Definition at line 232 of file EndoMesh.cpp.

References surround_.

Referenced by initCinfo().

233 {
234  return surround_;
235 }
ObjId surround_
Definition: EndoMesh.h:130

+ Here is the caller graph for this function:

const vector< double > & EndoMesh::getVoxelArea ( ) const
virtual

Implements MeshCompt.

Definition at line 384 of file EndoMesh.cpp.

References aPower_, aScale_, parent_, and ChemCompt::vGetVoxelVolume().

Referenced by matchMeshEntries().

385 {
386  static vector< double > ret;
387  ret = parent_->vGetVoxelVolume();
388  for ( auto i = ret.begin(); i != ret.end(); ++i )
389  *i = aScale_ * pow( *i, aPower_ );
390  return ret;
391 }
const MeshCompt * parent_
Definition: EndoMesh.h:131
double aPower_
rEndo = rScale * pow( surroundVol, rPower_)
Definition: EndoMesh.h:142
virtual const vector< double > & vGetVoxelVolume() const =0
Virtual func so that derived classes can pass voxel volume back.
double aScale_
aEndo = aScale * pow( surroundVol, aPower_)
Definition: EndoMesh.h:143

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const vector< double > & EndoMesh::getVoxelLength ( ) const
virtual

Implements MeshCompt.

Definition at line 393 of file EndoMesh.cpp.

References parent_, ChemCompt::vGetVoxelVolume(), vPower_, and vScale_.

394 {
395  static vector< double > ret;
396  ret = parent_->vGetVoxelVolume();
397  for ( auto i = ret.begin(); i != ret.end(); ++i )
398  *i = vScale_ * pow( *i, vPower_ );
399  return ret;
400 }
const MeshCompt * parent_
Definition: EndoMesh.h:131
double vScale_
vEndo = vScale * pow( surroundVol, vPower_)
Definition: EndoMesh.h:145
virtual const vector< double > & vGetVoxelVolume() const =0
Virtual func so that derived classes can pass voxel volume back.
double vPower_
aEndo = aScale * pow( surroundVol, aPower_)
Definition: EndoMesh.h:144

+ Here is the call graph for this function:

double EndoMesh::getVpower ( const Eref e) const

Definition at line 206 of file EndoMesh.cpp.

References vPower_.

Referenced by initCinfo().

207 {
208  return vPower_;
209 }
double vPower_
aEndo = aScale * pow( surroundVol, aPower_)
Definition: EndoMesh.h:144

+ Here is the caller graph for this function:

double EndoMesh::getVscale ( const Eref e) const

Definition at line 216 of file EndoMesh.cpp.

References vScale_.

Referenced by initCinfo().

217 {
218  return vScale_;
219 }
double vScale_
vEndo = vScale * pow( surroundVol, vPower_)
Definition: EndoMesh.h:145

+ Here is the caller graph for this function:

void EndoMesh::indexToSpace ( unsigned int  index,
double &  x,
double &  y,
double &  z 
) const
virtual

Converts specified index to xyz coords of middle of voxel Values out of range return original xyz

Implements ChemCompt.

Definition at line 460 of file EndoMesh.cpp.

References ChemCompt::indexToSpace(), and parent_.

462 {
463  parent_->indexToSpace( index, x, y, z );
464 }
const MeshCompt * parent_
Definition: EndoMesh.h:131
virtual void indexToSpace(unsigned int index, double &x, double &y, double &z) const =0

+ Here is the call graph for this function:

const Cinfo * EndoMesh::initCinfo ( )
static

Definition at line 26 of file EndoMesh.cpp.

References endoMeshCinfo, getApower(), getAscale(), getDoAxialDiffusion(), getRpower(), getRscale(), getSurround(), getVpower(), getVscale(), ChemCompt::initCinfo(), setApower(), setAscale(), setDoAxialDiffusion(), setRpower(), setRscale(), setSurround(), setVpower(), and setVscale().

27 {
29  // Field Definitions
32  "rPower",
33  "Used in rEndo = rScale * pow(surroundVol, rPower)."
34  "Used to obtain radius of each endo voxel from matching "
35  "surround voxel. Defaults to 1/3",
38  );
40  "rScale",
41  "Used in rEndo = rScale * pow(surroundVol, rPower)."
42  "Used to obtain radius of each endo voxel from matching "
43  "surround voxel. Defaults to 0.5",
46  );
48  "aPower",
49  "Used in rEndo = aScale * pow(surroundVol, aPower)."
50  "Used to obtain area of each endo voxel from matching "
51  "surround voxel. Defaults to 1/2",
54  );
56  "aScale",
57  "Used in rEndo = aScale * pow(surroundVol, aPower)."
58  "Used to obtain area of each endo voxel from matching "
59  "surround voxel. Defaults to 0.25",
62  );
64  "vPower",
65  "Used in rEndo = vScale * pow(surroundVol, vPower)."
66  "Used to obtain volume of each endo voxel from matching "
67  "surround voxel. Defaults to 1.",
70  );
72  "vScale",
73  "Used in rEndo = vScale * pow(surroundVol, vPower)."
74  "Used to obtain volume of each endo voxel from matching "
75  "surround voxel. Defaults to 0.125",
78  );
79 
81  "surround",
82  "ObjId of compartment surrounding current EndoMesh",
85  );
86 
87  static ElementValueFinfo< EndoMesh, bool > doAxialDiffusion(
88  "doAxialDiffusion",
89  "Flag to determine if endoMesh should undertake axial "
90  "diffusion. Defaults to 'false'. "
91  "Should only be used within NeuroMesh and CylMesh. "
92  "Must be assigned before Dsolver is built.",
95  );
96 
97 
99  // MsgDest Definitions
101 
103  // Field Elements
105 
106  static Finfo* endoMeshFinfos[] = {
107  &rPower, // Value
108  &rScale, // Value
109  &aPower, // Value
110  &aScale, // Value
111  &vPower, // Value
112  &vScale, // Value
113  &surround, // Value
114  &doAxialDiffusion, // Value
115  };
116 
117  static Dinfo< EndoMesh > dinfo;
118  static Cinfo endoMeshCinfo (
119  "EndoMesh",
121  endoMeshFinfos,
122  sizeof( endoMeshFinfos ) / sizeof ( Finfo* ),
123  &dinfo
124  );
125 
126  return &endoMeshCinfo;
127 }
static const Cinfo * initCinfo()
Definition: ChemCompt.cpp:25
void setRpower(const Eref &e, double v)
Definition: EndoMesh.cpp:161
double getRpower(const Eref &e) const
Definition: EndoMesh.cpp:166
Definition: Dinfo.h:60
void setApower(const Eref &e, double v)
Definition: EndoMesh.cpp:181
double getAscale(const Eref &e) const
Definition: EndoMesh.cpp:196
double getVscale(const Eref &e) const
Definition: EndoMesh.cpp:216
double getVpower(const Eref &e) const
Definition: EndoMesh.cpp:206
double getRscale(const Eref &e) const
Definition: EndoMesh.cpp:176
void setVpower(const Eref &e, double v)
Definition: EndoMesh.cpp:201
double getApower(const Eref &e) const
Definition: EndoMesh.cpp:186
ObjId getSurround(const Eref &e) const
Definition: EndoMesh.cpp:232
void setDoAxialDiffusion(const Eref &e, bool v)
Definition: EndoMesh.cpp:237
void setAscale(const Eref &e, double v)
Definition: EndoMesh.cpp:191
void setRscale(const Eref &e, double v)
Definition: EndoMesh.cpp:171
bool getDoAxialDiffusion(const Eref &e) const
Definition: EndoMesh.cpp:242
static const Cinfo * endoMeshCinfo
Definition: EndoMesh.cpp:133
void setSurround(const Eref &e, ObjId v)
Definition: EndoMesh.cpp:221
Definition: Cinfo.h:18
void setVscale(const Eref &e, double v)
Definition: EndoMesh.cpp:211
Definition: Finfo.h:12

+ Here is the call graph for this function:

void EndoMesh::innerBuildDefaultMesh ( const Eref e,
double  volume,
unsigned int  numEntries 
)
virtual

Virtual func to make a mesh with specified Volume and numEntries.

Implements ChemCompt.

Definition at line 350 of file EndoMesh.cpp.

352 {
353 }
unsigned int EndoMesh::innerGetDimensions ( ) const
virtual

Virtual function to return # of spatial dimensions of mesh.

Implements ChemCompt.

Definition at line 264 of file EndoMesh.cpp.

265 {
266  return 1;
267 }
unsigned int EndoMesh::innerGetNumEntries ( ) const
virtual

Inherited virtual func. Returns number of MeshEntry in array

Implements ChemCompt.

Definition at line 336 of file EndoMesh.cpp.

References ChemCompt::innerGetNumEntries(), and parent_.

337 {
338  return parent_->innerGetNumEntries();
339 }
const MeshCompt * parent_
Definition: EndoMesh.h:131
virtual unsigned int innerGetNumEntries() const =0

+ Here is the call graph for this function:

void EndoMesh::innerHandleNodeInfo ( const Eref e,
unsigned int  numNodes,
unsigned int  numThreads 
)
virtual

Implements ChemCompt.

Definition at line 326 of file EndoMesh.cpp.

329 {
330 }
void EndoMesh::innerHandleRequestMeshStats ( const Eref e,
const SrcFinfo2< unsigned int, vector< double > > *  meshStatsFinfo 
)

More inherited virtual funcs: request comes in for mesh stats.

Definition at line 318 of file EndoMesh.cpp.

References ChemCompt::getNumEntries(), parent_, and vGetEntireVolume().

321 {
322  vector< double > ret( vGetEntireVolume() / parent_->getNumEntries(), 1);
323  meshStatsFinfo->send( e, 1, ret );
324 }
const MeshCompt * parent_
Definition: EndoMesh.h:131
unsigned int getNumEntries() const
Definition: ChemCompt.cpp:390
void send(const Eref &e, const T1 &arg1, const T2 &arg2) const
Definition: SrcFinfo.h:228
double vGetEntireVolume() const
Inherited virtual. Returns entire volume of compartment.
Definition: EndoMesh.cpp:402

+ Here is the call graph for this function:

void EndoMesh::innerSetNumEntries ( unsigned int  n)
virtual

Inherited virtual func.

Inherited virtual func. Dummy, because the EndoMesh just does what its parent does.

Implements ChemCompt.

Definition at line 345 of file EndoMesh.cpp.

346 {
347 }
void EndoMesh::matchMeshEntries ( const ChemCompt other,
vector< VoxelJunction > &  ret 
) const
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.

Consider concentric EndoMeshes in an outer cyl/sphere of radius r_0. Radii, from out to in, are r_0, r_1, r_2.... r_innermost. Consider that we are on EndoMesh n. The diffusion length in each case is 1/2(r_n-1 - r_n+1). For the innermost we use r_n+1 = 0 The diffusion XA is the area of the EndoMesh.

Implements ChemCompt.

Definition at line 420 of file EndoMesh.cpp.

References getVoxelArea(), MeshCompt::getVoxelLength(), PI, vGetVoxelVolume(), and ChemCompt::vGetVoxelVolume().

Referenced by CylMesh::matchMeshEntries(), CubeMesh::matchMeshEntries(), and NeuroMesh::matchMeshEntries().

422 {
431  vector< double > vol = other->vGetVoxelVolume();
432  const MeshCompt* mc = static_cast< const MeshCompt* >( other );
433  vector< double > len = mc->getVoxelLength();
434  assert( vol.size() == len.size() );
435  ret.resize( vol.size() );
436  vector< double > myVol = vGetVoxelVolume();
437  assert( myVol.size() == vol.size() );
438  vector< double > myArea = getVoxelArea();
439  assert( myArea.size() == vol.size() );
440 
441  for ( unsigned int i = 0; i < vol.size(); ++i ) {
442  double rSurround = sqrt( vol[i] / (len[i] * PI ) );
443  ret[i].first = ret[i].second = i;
444  ret[i].firstVol = myVol[i];
445  ret[i].secondVol = vol[i];
446 
447  // For now we don't consider internal EndoMeshes.
448  ret[i].diffScale = 2.0 * myArea[i] / rSurround;
449  }
450 }
const vector< double > & getVoxelArea() const
Definition: EndoMesh.cpp:384
virtual const vector< double > & vGetVoxelVolume() const =0
Virtual func so that derived classes can pass voxel volume back.
const vector< double > & vGetVoxelVolume() const
Virtual func so that derived classes can pass voxel volume back.
Definition: EndoMesh.cpp:370
virtual const vector< double > & getVoxelLength() const =0
const double PI
Definition: consts.cpp:12

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double EndoMesh::nearest ( double  x,
double  y,
double  z,
unsigned int &  index 
) const
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.

Implements ChemCompt.

Definition at line 453 of file EndoMesh.cpp.

References ChemCompt::nearest(), and parent_.

455 {
456  return parent_->nearest( x, y, z, index );
457 }
virtual double nearest(double x, double y, double z, unsigned int &index) const =0
const MeshCompt * parent_
Definition: EndoMesh.h:131

+ Here is the call graph for this function:

void EndoMesh::setApower ( const Eref e,
double  v 
)

Definition at line 181 of file EndoMesh.cpp.

References aPower_.

Referenced by initCinfo().

182 {
183  aPower_ = v;
184 }
double aPower_
rEndo = rScale * pow( surroundVol, rPower_)
Definition: EndoMesh.h:142

+ Here is the caller graph for this function:

void EndoMesh::setAscale ( const Eref e,
double  v 
)

Definition at line 191 of file EndoMesh.cpp.

References aScale_.

Referenced by initCinfo().

192 {
193  aScale_ = v;
194 }
double aScale_
aEndo = aScale * pow( surroundVol, aPower_)
Definition: EndoMesh.h:143

+ Here is the caller graph for this function:

void EndoMesh::setDoAxialDiffusion ( const Eref e,
bool  v 
)

Definition at line 237 of file EndoMesh.cpp.

References doAxialDiffusion_.

Referenced by initCinfo().

238 {
239  doAxialDiffusion_ = v;
240 }
bool doAxialDiffusion_
vEndo = vScale * pow( surroundVol, vPower_)
Definition: EndoMesh.h:147

+ Here is the caller graph for this function:

void EndoMesh::setRpower ( const Eref e,
double  v 
)

Definition at line 161 of file EndoMesh.cpp.

References rPower_.

Referenced by initCinfo().

162 {
163  rPower_ = v;
164 }
double rPower_
EndoMeshes inside. Used to update.
Definition: EndoMesh.h:140

+ Here is the caller graph for this function:

void EndoMesh::setRscale ( const Eref e,
double  v 
)

Definition at line 171 of file EndoMesh.cpp.

References rScale_.

Referenced by initCinfo().

172 {
173  rScale_ = v;
174 }
double rScale_
rEndo = rScale * pow( surroundVol, rPower_)
Definition: EndoMesh.h:141

+ Here is the caller graph for this function:

void EndoMesh::setSurround ( const Eref e,
ObjId  v 
)

Definition at line 221 of file EndoMesh.cpp.

References Element::cinfo(), ObjId::data(), ObjId::element(), Cinfo::isA(), Cinfo::name(), parent_, ObjId::path(), and surround_.

Referenced by initCinfo().

222 {
223  if ( !v.element()->cinfo()->isA( "ChemCompt" ) ) {
224  cout << "Warning: 'surround' may only be set to an object of class 'ChemCompt'\n";
225  cout << v.path() << " is of class " << v.element()->cinfo()->name() << endl;
226  return;
227  }
228  surround_ = v;
229  parent_ = reinterpret_cast< const MeshCompt* >( v.data() );
230 }
char * data() const
Definition: ObjId.cpp:113
const MeshCompt * parent_
Definition: EndoMesh.h:131
const std::string & name() const
Definition: Cinfo.cpp:260
string path() const
Definition: ObjId.cpp:119
bool isA(const string &ancestor) const
Definition: Cinfo.cpp:280
const Cinfo * cinfo() const
Definition: Element.cpp:66
Element * element() const
Definition: ObjId.cpp:124
ObjId surround_
Definition: EndoMesh.h:130

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void EndoMesh::setVpower ( const Eref e,
double  v 
)

Definition at line 201 of file EndoMesh.cpp.

References vPower_.

Referenced by initCinfo().

202 {
203  vPower_ = v;
204 }
double vPower_
aEndo = aScale * pow( surroundVol, aPower_)
Definition: EndoMesh.h:144

+ Here is the caller graph for this function:

void EndoMesh::setVscale ( const Eref e,
double  v 
)

Definition at line 211 of file EndoMesh.cpp.

References vScale_.

Referenced by initCinfo().

212 {
213  vScale_ = v;
214 }
double vScale_
vEndo = vScale * pow( surroundVol, vPower_)
Definition: EndoMesh.h:145

+ Here is the caller graph for this function:

double EndoMesh::vGetEntireVolume ( ) const
virtual

Inherited virtual. Returns entire volume of compartment.

Implements ChemCompt.

Definition at line 402 of file EndoMesh.cpp.

References vGetVoxelVolume().

Referenced by innerHandleRequestMeshStats().

403 {
404  double vol = 0.0;
405  auto vec = vGetVoxelVolume();
406  for ( auto i = vec.begin(); i != vec.end(); ++i )
407  vol += *i;
408  return vol;
409 }
const vector< double > & vGetVoxelVolume() const
Virtual func so that derived classes can pass voxel volume back.
Definition: EndoMesh.cpp:370

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const vector< double > & EndoMesh::vGetVoxelMidpoint ( ) const
virtual

Virtual func so that derived classes can return voxel midpoint.

Implements ChemCompt.

Definition at line 379 of file EndoMesh.cpp.

References parent_, and ChemCompt::vGetVoxelMidpoint().

380 {
381  return parent_->vGetVoxelMidpoint();
382 }
const MeshCompt * parent_
Definition: EndoMesh.h:131
virtual const vector< double > & vGetVoxelMidpoint() const =0
Virtual func so that derived classes can return voxel midpoint.

+ Here is the call graph for this function:

const vector< double > & EndoMesh::vGetVoxelVolume ( ) const
virtual

Virtual func so that derived classes can pass voxel volume back.

Implements ChemCompt.

Definition at line 370 of file EndoMesh.cpp.

References parent_, ChemCompt::vGetVoxelVolume(), vPower_, and vScale_.

Referenced by matchMeshEntries(), and vGetEntireVolume().

371 {
372  static vector< double > ret;
373  ret = parent_->vGetVoxelVolume();
374  for ( auto i = ret.begin(); i != ret.end(); ++i )
375  *i = vScale_ * pow( *i, vPower_ );
376  return ret;
377 }
const MeshCompt * parent_
Definition: EndoMesh.h:131
double vScale_
vEndo = vScale * pow( surroundVol, vPower_)
Definition: EndoMesh.h:145
virtual const vector< double > & vGetVoxelVolume() const =0
Virtual func so that derived classes can pass voxel volume back.
double vPower_
aEndo = aScale * pow( surroundVol, aPower_)
Definition: EndoMesh.h:144

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool EndoMesh::vSetVolumeNotRates ( double  volume)
virtual

Inherited virtual. Resizes len and dia of each voxel.

Implements ChemCompt.

Definition at line 411 of file EndoMesh.cpp.

412 {
413  return true; // maybe should be false? Unsure
414 }

Member Data Documentation

double EndoMesh::aPower_
private

rEndo = rScale * pow( surroundVol, rPower_)

Definition at line 142 of file EndoMesh.h.

Referenced by getApower(), getVoxelArea(), and setApower().

double EndoMesh::aScale_
private

aEndo = aScale * pow( surroundVol, aPower_)

Definition at line 143 of file EndoMesh.h.

Referenced by getAscale(), getVoxelArea(), and setAscale().

bool EndoMesh::doAxialDiffusion_
private

vEndo = vScale * pow( surroundVol, vPower_)

Definition at line 147 of file EndoMesh.h.

Referenced by getDoAxialDiffusion(), getParentVoxel(), and setDoAxialDiffusion().

Id EndoMesh::insideMeshes_
private

Definition at line 133 of file EndoMesh.h.

double EndoMesh::rPower_
private

EndoMeshes inside. Used to update.

The reason why the powers don't have to be 1/3, 1/2 and 1 is because some organelles are not a simple linear vol relationship with their surround. I want to keep flexibility.

Definition at line 140 of file EndoMesh.h.

Referenced by getRpower(), and setRpower().

double EndoMesh::rScale_
private

rEndo = rScale * pow( surroundVol, rPower_)

Definition at line 141 of file EndoMesh.h.

Referenced by getRscale(), and setRscale().

ObjId EndoMesh::surround_
private

Surrounding mesh. Use this for calculating all volume and diffusion terms, don't maintain any local variables.

Definition at line 130 of file EndoMesh.h.

Referenced by getSurround(), and setSurround().

double EndoMesh::vPower_
private

aEndo = aScale * pow( surroundVol, aPower_)

Definition at line 144 of file EndoMesh.h.

Referenced by extendedMeshEntryVolume(), getMeshEntryVolume(), getVoxelLength(), getVpower(), setVpower(), and vGetVoxelVolume().

double EndoMesh::vScale_
private

vEndo = vScale * pow( surroundVol, vPower_)

Definition at line 145 of file EndoMesh.h.

Referenced by extendedMeshEntryVolume(), getMeshEntryVolume(), getVoxelLength(), getVscale(), setVscale(), and vGetVoxelVolume().


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