13 #include "../utility/Vec.h"
25 #include "../utility/numutil.h"
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",
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",
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",
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",
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.",
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",
82 "ObjId of compartment surrounding current EndoMesh",
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.",
106 static Finfo* endoMeshFinfos[] = {
122 sizeof( endoMeshFinfos ) /
sizeof (
Finfo* ),
141 rPower_( 1.0 / 3.0 ),
147 doAxialDiffusion_( false )
224 cout <<
"Warning: 'surround' may only be set to an object of class 'ChemCompt'\n";
280 vector< double > ret;
281 if ( temp.size() > 6 ) {
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] );
319 const SrcFinfo2<
unsigned int, vector< double > >* meshStatsFinfo
323 meshStatsFinfo->send( e, 1, ret );
328 unsigned int numNodes,
unsigned int numThreads )
372 static vector< double > ret;
374 for (
auto i = ret.begin(); i != ret.end(); ++i )
386 static vector< double > ret;
388 for (
auto i = ret.begin(); i != ret.end(); ++i )
395 static vector< double > ret;
397 for (
auto i = ret.begin(); i != ret.end(); ++i )
406 for (
auto i = vec.begin(); i != vec.end(); ++i )
421 vector< VoxelJunction >& ret )
const
434 assert( vol.size() == len.size() );
435 ret.resize( vol.size() );
437 assert( myVol.size() == vol.size() );
439 assert( myArea.size() == vol.size() );
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];
448 ret[i].diffScale = 2.0 * myArea[i] / rSurround;
454 unsigned int& index )
const
461 double &x,
double &y,
double &z )
const
static const Cinfo * initCinfo()
virtual double nearest(double x, double y, double z, unsigned int &index) const =0
unsigned int getMeshDimensions(unsigned int fid) const
Virtual function to return dimensions of specified entry.
const MeshCompt * parent_
const vector< double > & getVoxelArea() const
void setRpower(const Eref &e, double v)
double getRpower(const Eref &e) const
vector< double > getDiffusionArea(unsigned int fid) const
Virtual function to return diffusion X-section area.
unsigned int innerGetNumEntries() const
void indexToSpace(unsigned int index, double &x, double &y, double &z) const
double extendedMeshEntryVolume(unsigned int fid) const
Virtual function to return volume of mesh Entry, including.
bool vSetVolumeNotRates(double volume)
Inherited virtual. Resizes len and dia of each voxel.
bool doAxialDiffusion_
vEndo = vScale * pow( surroundVol, vPower_)
void innerHandleRequestMeshStats(const Eref &e, const SrcFinfo2< unsigned int, vector< double > > *meshStatsFinfo)
More inherited virtual funcs: request comes in for mesh stats.
double getMeshEntryVolume(unsigned int fid) const
Virtual function to return volume of mesh Entry.
double aPower_
rEndo = rScale * pow( surroundVol, rPower_)
virtual vector< double > getCoordinates(unsigned int fid) const =0
Virtual function to return coords of mesh Entry.
void innerSetNumEntries(unsigned int n)
Inherited virtual func.
virtual vector< unsigned int > getParentVoxel() const =0
void setApower(const Eref &e, double v)
double vScale_
vEndo = vScale * pow( surroundVol, vPower_)
double getAscale(const Eref &e) const
double getVscale(const Eref &e) const
unsigned int getNumEntries() const
void innerHandleNodeInfo(const Eref &e, unsigned int numNodes, unsigned int numThreads)
const std::string & name() const
static const Cinfo * initCinfo()
double getVpower(const Eref &e) const
double rPower_
EndoMeshes inside. Used to update.
double getRscale(const Eref &e) const
void setVpower(const Eref &e, double v)
virtual const vector< double > & vGetVoxelVolume() const =0
Virtual func so that derived classes can pass voxel volume back.
void innerBuildDefaultMesh(const Eref &e, double volume, unsigned int numEntries)
Virtual func to make a mesh with specified Volume and numEntries.
virtual unsigned int innerGetNumEntries() const =0
const vector< double > & vGetVoxelMidpoint() const
Virtual func so that derived classes can return voxel midpoint.
double getApower(const Eref &e) const
vector< unsigned int > getParentVoxel() const
Inherited virtual, do nothing for now.
virtual void indexToSpace(unsigned int index, double &x, double &y, double &z) const =0
const vector< double > & vGetVoxelVolume() const
Virtual func so that derived classes can pass voxel volume back.
double vPower_
aEndo = aScale * pow( surroundVol, aPower_)
bool isA(const string &ancestor) const
const Cinfo * cinfo() const
ObjId getSurround(const Eref &e) const
void setDoAxialDiffusion(const Eref &e, bool v)
unsigned int getMeshType(unsigned int fid) const
Virtual function to return MeshType of specified entry.
void setAscale(const Eref &e, double v)
void setRscale(const Eref &e, double v)
double nearest(double x, double y, double z, unsigned int &index) const
Element * element() const
static unsigned int numNodes
virtual const vector< double > & getVoxelLength() const =0
vector< double > getCoordinates(unsigned int fid) const
Virtual function to return coords of mesh Entry.
double aScale_
aEndo = aScale * pow( surroundVol, aPower_)
double extendedMeshEntryVolume(unsigned int fid) const
Volume of mesh Entry including abutting diff-coupled voxels.
virtual const vector< double > & vGetVoxelMidpoint() const =0
Virtual func so that derived classes can return voxel midpoint.
unsigned int innerGetDimensions() const
Virtual function to return # of spatial dimensions of mesh.
bool getDoAxialDiffusion(const Eref &e) const
double vGetEntireVolume() const
Inherited virtual. Returns entire volume of compartment.
virtual double getMeshEntryVolume(unsigned int fid) const =0
Virtual function to return volume of mesh Entry.
static const Cinfo * endoMeshCinfo
void setSurround(const Eref &e, ObjId v)
void matchMeshEntries(const ChemCompt *other, vector< VoxelJunction > &ret) const
const vector< double > & getVoxelLength() const
vector< double > getDiffusionScaling(unsigned int fid) const
Virtual function to return scale factor for diffusion. 1 here.
double rScale_
rEndo = rScale * pow( surroundVol, rPower_)
void setVscale(const Eref &e, double v)