#include <CylMesh.h>
Public Member Functions | |
CylMesh () | |
~CylMesh () | |
void | updateCoords (const Eref &e, const vector< double > &childConcs) |
void | setX0 (const Eref &e, double v) |
double | getX0 (const Eref &e) const |
void | setY0 (const Eref &e, double v) |
double | getY0 (const Eref &e) const |
void | setZ0 (const Eref &e, double v) |
double | getZ0 (const Eref &e) const |
void | setR0 (const Eref &e, double v) |
double | getR0 (const Eref &e) const |
void | setX1 (const Eref &e, double v) |
double | getX1 (const Eref &e) const |
void | setY1 (const Eref &e, double v) |
double | getY1 (const Eref &e) const |
void | setZ1 (const Eref &e, double v) |
double | getZ1 (const Eref &e) const |
void | setR1 (const Eref &e, double v) |
double | getR1 (const Eref &e) const |
void | innerSetCoords (const Eref &e, const vector< double > &v) |
void | setCoords (const Eref &e, vector< double > v) |
vector< double > | getCoords (const Eref &e) const |
void | setDiffLength (const Eref &e, double v) |
double | getDiffLength (const Eref &e) const |
double | getTotLength () const |
unsigned int | innerGetDimensions () const |
unsigned int | getMeshType (unsigned int fid) const |
Virtual function to return MeshType of specified entry. | |
unsigned int | getMeshDimensions (unsigned int fid) const |
Virtual function to return dimensions of specified entry. | |
double | getMeshEntryVolume (unsigned int fid) const |
Virtual function to return volume of mesh Entry. | |
vector< double > | getCoordinates (unsigned int fid) const |
Virtual function to return coords of mesh Entry. | |
vector< double > | getDiffusionArea (unsigned int fid) const |
Virtual function to return diffusion X-section area. | |
vector< double > | getDiffusionScaling (unsigned int fid) const |
Virtual function to return scale factor for diffusion. 1 here. | |
double | extendedMeshEntryVolume (unsigned int fid) const |
Volume of mesh Entry including abutting diff-coupled voxels. | |
unsigned int | innerGetNumEntries () const |
void | innerSetNumEntries (unsigned int n) |
Inherited virtual func. | |
vector< unsigned int > | getParentVoxel () const |
Inherited virtual, do nothing for now. | |
const vector< double > & | vGetVoxelVolume () const |
Virtual func so that derived classes can pass voxel volume back. | |
const vector< double > & | vGetVoxelMidpoint () const |
Virtual func so that derived classes can return voxel midpoint. | |
const vector< double > & | getVoxelArea () const |
const vector< double > & | getVoxelLength () const |
double | vGetEntireVolume () const |
Inherited virtual. Returns entire volume of compartment. | |
bool | vSetVolumeNotRates (double volume) |
Inherited virtual. Resizes len and dia of each voxel. | |
void | innerBuildDefaultMesh (const Eref &e, double volume, unsigned int numEntries) |
Virtual func to make a mesh with specified Volume and numEntries. | |
void | innerHandleRequestMeshStats (const Eref &e, const SrcFinfo2< unsigned int, vector< double > > *meshStatsFinfo) |
void | innerHandleNodeInfo (const Eref &e, unsigned int numNodes, unsigned int numThreads) |
void | transmitChange (const Eref &e) |
void | buildStencil () |
void | matchMeshEntries (const ChemCompt *other, vector< VoxelJunction > &ret) const |
double | nearest (double x, double y, double z, unsigned int &index) const |
double | nearest (double x, double y, double z, double &linePos, double &r) const |
void | indexToSpace (unsigned int index, double &x, double &y, double &z) const |
void | matchCylMeshEntries (const CylMesh *other, vector< VoxelJunction > &ret) const |
void | matchCubeMeshEntries (const CubeMesh *other, vector< VoxelJunction > &ret) const |
void | matchNeuroMeshEntries (const NeuroMesh *other, vector< VoxelJunction > &ret) const |
double | selectGridVolume (double h) const |
Static Public Member Functions | |
static const Cinfo * | initCinfo () |
The CylMesh represents a chemically identified compartment shaped like an extended cylinder. This is psuedo-1 dimension: Only the axial dimension is considered for diffusion and subdivisions. Typically used in modelling small segments of dendrite
CylMesh::CylMesh | ( | ) |
CylMesh::~CylMesh | ( | ) |
void CylMesh::buildStencil | ( | ) |
References MeshCompt::addRow(), MeshCompt::innerResetStencil(), PI, and MeshCompt::setStencilSize().
Referenced by innerSetNumEntries().
double CylMesh::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.
Reimplemented from MeshCompt.
References getMeshEntryVolume().
vector< double > CylMesh::getCoordinates | ( | unsigned int | fid | ) | const [virtual] |
Virtual function to return coords of mesh Entry.
Virtual function to return coords of mesh Entry. For Cylindrical mesh, coords are x1y1z1 x2y2z2 r0 r1 phi0 phi1
Implements ChemCompt.
vector< double > CylMesh::getCoords | ( | const Eref & | e | ) | const |
Referenced by initCinfo().
double CylMesh::getDiffLength | ( | const Eref & | e | ) | const |
Referenced by initCinfo().
vector< double > CylMesh::getDiffusionArea | ( | unsigned int | fid | ) | const [virtual] |
vector< double > CylMesh::getDiffusionScaling | ( | unsigned int | fid | ) | const [virtual] |
Virtual function to return scale factor for diffusion. 1 here.
Implements ChemCompt.
unsigned int CylMesh::getMeshDimensions | ( | unsigned int | fid | ) | const [virtual] |
Virtual function to return dimensions of specified entry.
Implements ChemCompt.
double CylMesh::getMeshEntryVolume | ( | unsigned int | fid | ) | const [virtual] |
Virtual function to return volume of mesh Entry.
diffLength = length constant for diffusive spread len = length of each mesh entry totLen = total length of cylinder diffLength = k * r^2 Each entry has the same number of diffLengths, L = len/diffLength. Thinner entries have shorter diffLength. This gives a moderately nasty quadratic. However, as len(i) is prop to diffLength(i), and diffLength(i) is prop to r(i)^2 and the cyl-mesh is assumed a gently sloping cone we get len(i) is prop to (r0 + slope.x)^2 and ignoring the 2nd-order term we have len(i) is approx proportional to x position.
dr/dx = (r1-r0)/len ri = r0 + i * dr/dx r(i+1)-ri = (r1-r0)/numEntries len = k * r^2 we get k from integ_r0,r1( len.dr ) = totLen So k.r^3/3 | r0, r1 = totLen => k/3 * ( r1^3 - r0^3) = totLen => k = 3 * totLen / (r1^3 - r0^3); This is bad if r1 == r0, and is generally unpleasant.
Simple definition of rSlope: rSlope is measured per meshEntry, not per length: rSlope = ( r1 - r0 ) / numEntries; Let's just compute len0 from r0 and diffLength. len0/diffLength = 2 * r0 / (r0 + r1) so len0 = diffLength * 2 * r0 / (r0 + r1) and dlen/dx = lenSlope = diffLength * rSlope * 2/(r0 + r1)
Drop the following calculations: // dlen/dx = dr/dx * dlen/dr = ( (r1-r0)/len ) * 2k.r // To linearize, let 2r = r0 + r1. // so dlen/dx = ( (r1-r0)/len ) * k * ( r0 + r1 ) // len(i) = len0 + i * dlen/dx // len0 = totLen/numEntries - ( numEntries/2 ) * dlen/dx
Implements ChemCompt.
References PI.
Referenced by extendedMeshEntryVolume(), vGetEntireVolume(), and vGetVoxelVolume().
unsigned int CylMesh::getMeshType | ( | unsigned int | fid | ) | const [virtual] |
Virtual function to return MeshType of specified entry.
Implements ChemCompt.
References CYL, and SPHERE_SHELL_SEG.
vector< unsigned int > CylMesh::getParentVoxel | ( | ) | const [virtual] |
Inherited virtual, do nothing for now.
Implements MeshCompt.
double CylMesh::getR0 | ( | const Eref & | e | ) | const |
Referenced by initCinfo().
double CylMesh::getR1 | ( | const Eref & | e | ) | const |
Referenced by initCinfo().
double CylMesh::getTotLength | ( | ) | const |
Referenced by initCinfo().
const vector< double > & CylMesh::getVoxelArea | ( | ) | const [virtual] |
const vector< double > & CylMesh::getVoxelLength | ( | ) | const [virtual] |
Implements MeshCompt.
double CylMesh::getX0 | ( | const Eref & | e | ) | const |
Referenced by initCinfo().
double CylMesh::getX1 | ( | const Eref & | e | ) | const |
Referenced by initCinfo().
double CylMesh::getY0 | ( | const Eref & | e | ) | const |
Referenced by initCinfo().
double CylMesh::getY1 | ( | const Eref & | e | ) | const |
Referenced by initCinfo().
double CylMesh::getZ0 | ( | const Eref & | e | ) | const |
Referenced by initCinfo().
double CylMesh::getZ1 | ( | const Eref & | e | ) | const |
Referenced by initCinfo().
void CylMesh::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.
const Cinfo * CylMesh::initCinfo | ( | ) | [static] |
Reimplemented from ChemCompt.
References getCoords(), getDiffLength(), getR0(), getR1(), getTotLength(), getX0(), getX1(), getY0(), getY1(), getZ0(), getZ1(), ChemCompt::initCinfo(), innerGetNumEntries(), setCoords(), setDiffLength(), setR0(), setR1(), setX0(), setX1(), setY0(), setY1(), setZ0(), and setZ1().
void CylMesh::innerBuildDefaultMesh | ( | const Eref & | e, | |
double | volume, | |||
unsigned int | numEntries | |||
) | [virtual] |
Virtual func to make a mesh with specified Volume and numEntries.
Single voxel cylinder with diameter = length. vol = volume = pi.r^2.len. So len = 2r, volume = pi*r^2*2r = 2pi*r^3 so r = (volume/2pi)^(1/3)
Implements ChemCompt.
References PI, and setCoords().
unsigned int CylMesh::innerGetDimensions | ( | ) | const [virtual] |
Implements ChemCompt.
unsigned int CylMesh::innerGetNumEntries | ( | ) | const [virtual] |
Inherited virtual func. Returns number of MeshEntry in array
Implements ChemCompt.
Referenced by initCinfo().
void CylMesh::innerHandleNodeInfo | ( | const Eref & | e, | |
unsigned int | numNodes, | |||
unsigned int | numThreads | |||
) | [virtual] |
Implements ChemCompt.
void CylMesh::innerHandleRequestMeshStats | ( | const Eref & | e, | |
const SrcFinfo2< unsigned int, vector< double > > * | meshStatsFinfo | |||
) |
void CylMesh::innerSetCoords | ( | const Eref & | e, | |
const vector< double > & | v | |||
) |
Referenced by testCubeMeshJunctionDiffSizeMesh(), and testCubeMeshJunctionTwoDimSurface().
void CylMesh::innerSetNumEntries | ( | unsigned int | n | ) | [virtual] |
Inherited virtual func.
Inherited virtual func. Assigns number of MeshEntries.
Implements ChemCompt.
References buildStencil().
void CylMesh::matchCubeMeshEntries | ( | const CubeMesh * | other, | |
vector< VoxelJunction > & | ret | |||
) | const |
void CylMesh::matchCylMeshEntries | ( | const CylMesh * | other, | |
vector< VoxelJunction > & | ret | |||
) | const |
void CylMesh::matchMeshEntries | ( | const ChemCompt * | other, | |
vector< VoxelJunction > & | ret | |||
) | const |
void CylMesh::matchNeuroMeshEntries | ( | const NeuroMesh * | other, | |
vector< VoxelJunction > & | ret | |||
) | const |
double CylMesh::nearest | ( | double | x, | |
double | y, | |||
double | z, | |||
double & | linePos, | |||
double & | r | |||
) | const |
double CylMesh::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.
double CylMesh::selectGridVolume | ( | double | h | ) | const |
void CylMesh::setCoords | ( | const Eref & | e, | |
vector< double > | v | |||
) |
Referenced by initCinfo(), and innerBuildDefaultMesh().
void CylMesh::setDiffLength | ( | const Eref & | e, | |
double | v | |||
) |
References ChemCompt::getChildConcs(), and updateCoords().
Referenced by initCinfo().
void CylMesh::setR0 | ( | const Eref & | e, | |
double | v | |||
) |
References ChemCompt::getChildConcs(), and updateCoords().
Referenced by initCinfo().
void CylMesh::setR1 | ( | const Eref & | e, | |
double | v | |||
) |
References ChemCompt::getChildConcs(), and updateCoords().
Referenced by initCinfo().
void CylMesh::setX0 | ( | const Eref & | e, | |
double | v | |||
) |
References ChemCompt::getChildConcs(), and updateCoords().
Referenced by initCinfo().
void CylMesh::setX1 | ( | const Eref & | e, | |
double | v | |||
) |
References ChemCompt::getChildConcs(), and updateCoords().
Referenced by initCinfo().
void CylMesh::setY0 | ( | const Eref & | e, | |
double | v | |||
) |
References ChemCompt::getChildConcs(), and updateCoords().
Referenced by initCinfo().
void CylMesh::setY1 | ( | const Eref & | e, | |
double | v | |||
) |
References ChemCompt::getChildConcs(), and updateCoords().
Referenced by initCinfo().
void CylMesh::setZ0 | ( | const Eref & | e, | |
double | v | |||
) |
References ChemCompt::getChildConcs(), and updateCoords().
Referenced by initCinfo().
void CylMesh::setZ1 | ( | const Eref & | e, | |
double | v | |||
) |
References ChemCompt::getChildConcs(), and updateCoords().
Referenced by initCinfo().
void CylMesh::transmitChange | ( | const Eref & | e | ) |
void CylMesh::updateCoords | ( | const Eref & | e, | |
const vector< double > & | childConcs | |||
) |
double CylMesh::vGetEntireVolume | ( | ) | const [virtual] |
Inherited virtual. Returns entire volume of compartment.
Implements ChemCompt.
References getMeshEntryVolume().
Referenced by vSetVolumeNotRates().
const vector< double > & CylMesh::vGetVoxelMidpoint | ( | ) | const [virtual] |
Virtual func so that derived classes can return voxel midpoint.
Implements ChemCompt.
const vector< double > & CylMesh::vGetVoxelVolume | ( | ) | const [virtual] |
Virtual func so that derived classes can pass voxel volume back.
Implements ChemCompt.
References getMeshEntryVolume().
bool CylMesh::vSetVolumeNotRates | ( | double | volume | ) | [virtual] |
Inherited virtual. Resizes len and dia of each voxel.
Implements ChemCompt.
References vGetEntireVolume().