MOOSE - Multiscale Object Oriented Simulation Environment
|
#include <PsdMesh.h>
Public Member Functions | |
void | buildStencil () |
double | extendedMeshEntryVolume (unsigned int fid) const |
Vol of all mesh Entries including abutting diff-coupled voxels. More... | |
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... | |
vector< Id > | getElecComptMap () const |
vector< unsigned int > | getEndVoxelInCompt () const |
Returns index of end voxel mapping to elec compt, just first+1. More... | |
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 > | getNeuronVoxel () const |
vector< unsigned int > | getParentVoxel () const |
vector< unsigned int > | getStartVoxelInCompt () const |
Returns index of first voxel mapping to elec compt. More... | |
double | getThickness () const |
const vector< double > & | getVoxelArea () const |
const vector< double > & | getVoxelLength () const |
void | handlePsdList (const Eref &e, vector< double > params, vector< Id > elecCompts, vector< unsigned int > parentVoxel) |
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 |
Returns # of dimensions, always 3 here. Inherited pure virt func. 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) |
void | innerSetNumEntries (unsigned int n) |
Inherited virtual func. More... | |
void | matchCubeMeshEntries (const ChemCompt *other, vector< VoxelJunction > &ret) const |
void | matchMeshEntries (const ChemCompt *other, vector< VoxelJunction > &ret) const |
void | matchNeuroMeshEntries (const ChemCompt *other, vector< VoxelJunction > &ret) const |
void | matchSpineMeshEntries (const ChemCompt *other, vector< VoxelJunction > &ret) const |
double | nearest (double x, double y, double z, unsigned int &index) const |
unsigned int | parent (unsigned int index) const |
PsdMesh () | |
PsdMesh (const PsdMesh &other) | |
void | setMeshEntryVolume (unsigned int fid, double volume) |
Virtual function to set volume of mesh Entry. More... | |
void | setThickness (double v) |
void | transmitChange (const Eref &e) |
void | updateCoords () |
double | vGetEntireVolume () const |
Inherited virtual func. 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 func. More... | |
~PsdMesh () | |
![]() | |
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... | |
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 () | |
![]() | |
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) |
MeshEntry * | lookupEntry (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) |
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 Cinfo * | initCinfo () |
![]() | |
static double | distance (double x, double y, double z) |
static const Cinfo * | initCinfo () |
static SrcFinfo1< vector < double > > * | voxelVolOut () |
Private Attributes | |
vector< double > | area_ |
Vol. More... | |
vector< Id > | elecCompt_ |
Parent voxel index. More... | |
vector< double > | length_ |
area More... | |
vector< CylBase > | pa_ |
Specified disk of psd. More... | |
vector< unsigned int > | parent_ |
Specifies diff distance to PSD. More... | |
vector< double > | parentDist_ |
Specifies direction of psd. Length ignored. More... | |
vector< CylBase > | psd_ |
double | surfaceGranularity_ |
Ids of elec compts mapped to each voxel. More... | |
double | thickness_ |
Thickness of PSD. More... | |
vector< double > | vs_ |
The PsdMesh sets up the diffusion geometries for the PSD. It has to work in two contexts: first, as a PSD sitting on a spine head. Second, as a PSD sitting directly on the dendrite. In either case it is treated as a surface disc, not as a volume. On the dendrite this is a little strange conceptually (flat disc on round cylinder) but will do for now. Later can fine-tune the cap geometry.
In either case, the PsdMesh is filled by a message that contains information about the matching voxel index (either on spineMesh or NeuroMesh), the coordinates, the radial vector, and the diameter. The PsdMesh does not have any internal diffusion, and it expects to pass only N to the parent dendrite or spine.
PsdMesh::PsdMesh | ( | ) |
Definition at line 136 of file PsdMesh.cpp.
References psd_, and thickness_.
PsdMesh::PsdMesh | ( | const PsdMesh & | other | ) |
Definition at line 155 of file PsdMesh.cpp.
PsdMesh::~PsdMesh | ( | ) |
Definition at line 161 of file PsdMesh.cpp.
void PsdMesh::buildStencil | ( | ) |
Definition at line 433 of file PsdMesh.cpp.
References MeshCompt::innerResetStencil(), psd_, and MeshCompt::setStencilSize().
Referenced by updateCoords().
|
virtual |
Vol of all mesh Entries including abutting diff-coupled voxels.
Virtual function to return volume of mesh Entry, including for diffusively coupled voxels from other solvers.
Reimplemented from MeshCompt.
Definition at line 364 of file PsdMesh.cpp.
References MeshCompt::extendedMeshEntryVolume(), getMeshEntryVolume(), and psd_.
|
virtual |
Virtual function to return coords of mesh Entry.
Virtual function to return coords of mesh Entry. For PsdMesh, coords are x1y1z1 x2y2z2 dia
Implements ChemCompt.
Definition at line 331 of file PsdMesh.cpp.
|
virtual |
Virtual function to return diffusion X-section area.
Virtual function to return diffusion X-section area for each neighbor.
Implements ChemCompt.
Definition at line 345 of file PsdMesh.cpp.
|
virtual |
Virtual function to return scale factor for diffusion. 1 here.
Virtual function to return scale factor for diffusion. I think all dendite tips need to return just one entry of 1.
Implements ChemCompt.
Definition at line 357 of file PsdMesh.cpp.
vector< Id > PsdMesh::getElecComptMap | ( | ) | const |
Definition at line 190 of file PsdMesh.cpp.
References elecCompt_.
Referenced by initCinfo().
vector< unsigned int > PsdMesh::getEndVoxelInCompt | ( | ) | const |
Returns index of end voxel mapping to elec compt, just first+1.
Definition at line 203 of file PsdMesh.cpp.
References elecCompt_.
Referenced by initCinfo().
|
virtual |
Virtual function to return dimensions of specified entry.
Implements ChemCompt.
Definition at line 303 of file PsdMesh.cpp.
|
virtual |
Virtual function to return volume of mesh Entry.
Implements ChemCompt.
Definition at line 309 of file PsdMesh.cpp.
References pa_, psd_, and thickness_.
Referenced by extendedMeshEntryVolume(), handlePsdList(), and matchSpineMeshEntries().
|
virtual |
Virtual function to return MeshType of specified entry.
Implements ChemCompt.
Definition at line 296 of file PsdMesh.cpp.
vector< unsigned int > PsdMesh::getNeuronVoxel | ( | ) | const |
Returns index of voxel on NeuroMesh to which this spine is connected. This isn't such a great function, as it only works if the spine is sitting directly on the NeuroMesh. Otherwise it returns the vector of voxels of parent spine heads, which isn't what the name indicates.
Definition at line 184 of file PsdMesh.cpp.
References parent_.
Referenced by initCinfo().
|
virtual |
This function returns the diffusively connected parent voxel within the current (psd) mesh. Since each spine is treated as an independed voxel, there is no such voxel, so we return -1U for each psd. Note that there is a separate function that returns the parentVoxel referred to the NeuroMesh that this spine/psd sits on.
Implements MeshCompt.
Definition at line 542 of file PsdMesh.cpp.
References parent_.
vector< unsigned int > PsdMesh::getStartVoxelInCompt | ( | ) | const |
Returns index of first voxel mapping to elec compt.
Definition at line 195 of file PsdMesh.cpp.
References elecCompt_.
Referenced by initCinfo().
double PsdMesh::getThickness | ( | ) | const |
An assumed thickness for PSD. The volume is computed as the PSD area passed in to each PSD, times this value. Defaults to 50 nanometres. For reference, membranes are 5 nm.
Definition at line 169 of file PsdMesh.cpp.
References thickness_.
Referenced by initCinfo().
|
virtual |
|
virtual |
void PsdMesh::handlePsdList | ( | const Eref & | e, |
vector< double > | params, | ||
vector< Id > | elecCompts, | ||
vector< unsigned int > | parentVoxel | ||
) |
Definition at line 227 of file PsdMesh.cpp.
References area_, elecCompt_, getMeshEntryVolume(), Eref::id(), length_, ChemCompt::lookupEntry(), pa_, parent_, parentDist_, psd_, thickness_, MeshEntry::triggerRemesh(), updateCoords(), Id::value(), and vs_.
Referenced by initCinfo().
|
virtual |
Converts specified index to xyz coords of middle of voxel Values out of range return original xyz
Implements ChemCompt.
Definition at line 464 of file PsdMesh.cpp.
References innerGetNumEntries(), and psd_.
|
static |
Definition at line 28 of file PsdMesh.cpp.
References getElecComptMap(), getEndVoxelInCompt(), getNeuronVoxel(), getStartVoxelInCompt(), getThickness(), handlePsdList(), ChemCompt::initCinfo(), psdMeshCinfo, and setThickness().
|
virtual |
Virtual func to make a mesh with specified Volume and numEntries.
Not permitted
Implements ChemCompt.
Definition at line 424 of file PsdMesh.cpp.
|
virtual |
Returns # of dimensions, always 3 here. Inherited pure virt func.
Implements ChemCompt.
Definition at line 221 of file PsdMesh.cpp.
|
virtual |
Inherited virtual func. Returns number of MeshEntry in array
Implements ChemCompt.
Definition at line 407 of file PsdMesh.cpp.
References psd_.
Referenced by indexToSpace().
|
virtual |
void PsdMesh::innerHandleRequestMeshStats | ( | const Eref & | e, |
const SrcFinfo2< unsigned int, vector< double > > * | meshStatsFinfo | ||
) |
More inherited virtual funcs: request comes in for mesh stats Not clear what this does.
Definition at line 381 of file PsdMesh.cpp.
|
virtual |
Inherited virtual func.
Inherited virtual func. Assigns number of MeshEntries. Doesn't do anything, we have to set psd # from geometry.
Implements ChemCompt.
Definition at line 416 of file PsdMesh.cpp.
void PsdMesh::matchCubeMeshEntries | ( | const ChemCompt * | other, |
vector< VoxelJunction > & | ret | ||
) | const |
Definition at line 520 of file PsdMesh.cpp.
References CylBase::matchCubeMeshEntries(), pa_, psd_, and surfaceGranularity_.
Referenced by matchMeshEntries().
|
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.
Implements ChemCompt.
Definition at line 443 of file PsdMesh.cpp.
References matchCubeMeshEntries(), matchNeuroMeshEntries(), and matchSpineMeshEntries().
void PsdMesh::matchNeuroMeshEntries | ( | const ChemCompt * | other, |
vector< VoxelJunction > & | ret | ||
) | const |
Definition at line 509 of file PsdMesh.cpp.
References pa_, parent_, parentDist_, and psd_.
Referenced by matchMeshEntries().
void PsdMesh::matchSpineMeshEntries | ( | const ChemCompt * | other, |
vector< VoxelJunction > & | ret | ||
) | const |
Definition at line 493 of file PsdMesh.cpp.
References getMeshEntryVolume(), SpineMesh::getMeshEntryVolume(), pa_, parent_, parentDist_, and psd_.
Referenced by matchMeshEntries(), and SpineMesh::matchMeshEntries().
|
virtual |
This works a little different from other subclass versions of the function. It finds the index of the mesh entry whose centre is closest to the specified coords, and returns the distance to the centre. Doesn't worry about whether this distance is inside or outside cell.
Implements ChemCompt.
Definition at line 474 of file PsdMesh.cpp.
References Vec::distance(), and psd_.
unsigned int PsdMesh::parent | ( | unsigned int | index | ) | const |
Return voxel# on parent compartment on spine or dendrite. For now PSD is always on spine, so it just returns the index.
Definition at line 395 of file PsdMesh.cpp.
References parent_.
|
virtual |
Virtual function to set volume of mesh Entry.
Virtual function to assign volume of mesh Entry. Thickness not touched.
Reimplemented from ChemCompt.
Definition at line 318 of file PsdMesh.cpp.
References area_, PI, psd_, thickness_, and vs_.
void PsdMesh::setThickness | ( | double | v | ) |
Definition at line 173 of file PsdMesh.cpp.
References thickness_.
Referenced by initCinfo().
void PsdMesh::transmitChange | ( | const Eref & | e | ) |
void PsdMesh::updateCoords | ( | ) |
Recomputes all local coordinate and meshing data following a change in any of the coord parameters
This assumes that lambda is the quantity to preserve, over numEntries. So when the compartment changes volume, numEntries changes too. Assumes that the soma node is at index 0.
Definition at line 216 of file PsdMesh.cpp.
References buildStencil().
Referenced by handlePsdList().
|
virtual |
Inherited virtual func.
Implements ChemCompt.
Definition at line 588 of file PsdMesh.cpp.
References vs_.
Referenced by vSetVolumeNotRates().
|
virtual |
Virtual func so that derived classes can return voxel midpoint.
Implements ChemCompt.
Definition at line 561 of file PsdMesh.cpp.
|
virtual |
Virtual func so that derived classes can pass voxel volume back.
Implements ChemCompt.
Definition at line 549 of file PsdMesh.cpp.
References vs_.
|
virtual |
Inherited virtual func.
Implements ChemCompt.
Definition at line 597 of file PsdMesh.cpp.
References area_, length_, psd_, thickness_, vGetEntireVolume(), and vs_.
|
private |
Vol.
Definition at line 192 of file PsdMesh.h.
Referenced by getVoxelArea(), handlePsdList(), setMeshEntryVolume(), and vSetVolumeNotRates().
|
private |
Parent voxel index.
Definition at line 182 of file PsdMesh.h.
Referenced by getElecComptMap(), getEndVoxelInCompt(), getStartVoxelInCompt(), and handlePsdList().
|
private |
area
Definition at line 193 of file PsdMesh.h.
Referenced by getVoxelLength(), handlePsdList(), and vSetVolumeNotRates().
|
private |
Specified disk of psd.
Definition at line 179 of file PsdMesh.h.
Referenced by getCoordinates(), getDiffusionArea(), getMeshEntryVolume(), handlePsdList(), matchCubeMeshEntries(), matchNeuroMeshEntries(), matchSpineMeshEntries(), and vGetVoxelMidpoint().
|
private |
Specifies diff distance to PSD.
Definition at line 181 of file PsdMesh.h.
Referenced by getNeuronVoxel(), getParentVoxel(), handlePsdList(), matchNeuroMeshEntries(), matchSpineMeshEntries(), and parent().
|
private |
Specifies direction of psd. Length ignored.
Definition at line 180 of file PsdMesh.h.
Referenced by handlePsdList(), matchNeuroMeshEntries(), and matchSpineMeshEntries().
|
private |
These do the actual work.
Definition at line 178 of file PsdMesh.h.
Referenced by buildStencil(), extendedMeshEntryVolume(), getCoordinates(), getDiffusionArea(), getMeshEntryVolume(), getMeshType(), handlePsdList(), indexToSpace(), innerGetNumEntries(), matchCubeMeshEntries(), matchNeuroMeshEntries(), matchSpineMeshEntries(), nearest(), PsdMesh(), setMeshEntryVolume(), vGetVoxelMidpoint(), and vSetVolumeNotRates().
|
private |
Ids of elec compts mapped to each voxel.
Decides how finely to subdivide diffLength_ or radius or cubic mesh side when computing surfacearea of intersections with CubeMesh. Defaults to 0.1.
Definition at line 189 of file PsdMesh.h.
Referenced by matchCubeMeshEntries().
|
private |
Thickness of PSD.
Definition at line 173 of file PsdMesh.h.
Referenced by getMeshEntryVolume(), getThickness(), handlePsdList(), PsdMesh(), setMeshEntryVolume(), setThickness(), and vSetVolumeNotRates().
|
private |
Definition at line 191 of file PsdMesh.h.
Referenced by handlePsdList(), setMeshEntryVolume(), vGetEntireVolume(), vGetVoxelVolume(), and vSetVolumeNotRates().