MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SpineMesh.h
Go to the documentation of this file.
1 /**********************************************************************
2 ** This program is part of 'MOOSE', the
3 ** Messaging Object Oriented Simulation Environment.
4 ** Copyright (C) 2013 Upinder S. Bhalla. and NCBS
5 ** It is made available under the terms of the
6 ** GNU Lesser General Public License version 2.1
7 ** See the file COPYING.LIB for the full notice.
8 **********************************************************************/
9 
10 #ifndef _SPINE_MESH_H
11 #define _SPINE_MESH_H
12 
26 class SpineMesh: public MeshCompt
27 {
28  public:
29  SpineMesh();
30  SpineMesh( const SpineMesh& other );
31  ~SpineMesh();
32 // SpineMesh& operator=( const SpineMesh& other );
34  // Utility func
36 
41  void updateCoords();
42 
44  // Field assignment stuff
46 
54  vector< unsigned int > getParentVoxel() const;
59  vector< unsigned int > getNeuronVoxel() const;
60 
65  vector< Id > getElecComptMap() const;
66 
68  vector< unsigned int > getStartVoxelInCompt() const;
70  vector< unsigned int > getEndVoxelInCompt() const;
71 
73  // FieldElement assignment stuff for MeshEntries
75 
77  unsigned int getMeshType( unsigned int fid ) const;
79  unsigned int getMeshDimensions( unsigned int fid ) const;
81  double getMeshEntryVolume( unsigned int fid ) const;
83  void setMeshEntryVolume( unsigned int fid, double volume );
85  vector< double > getCoordinates( unsigned int fid ) const;
87  vector< double > getDiffusionArea( unsigned int fid ) const;
89  vector< double > getDiffusionScaling( unsigned int fid ) const;
91  double extendedMeshEntryVolume( unsigned int fid ) const;
92 
94 
97  unsigned int innerGetNumEntries() const;
99  void innerSetNumEntries( unsigned int n );
100 
102  unsigned int innerGetDimensions() const;
103 
105  double vGetEntireVolume() const;
106 
108  bool vSetVolumeNotRates( double volume );
109 
111  // Dest funcs
113 
115  void innerBuildDefaultMesh( const Eref& e,
116  double volume, unsigned int numEntries );
117 
118  /*
119  void innerHandleRequestMeshStats(
120  const Eref& e,
121  const SrcFinfo2< unsigned int, vector< double > >*
122  meshStatsFinfo
123  );
124  */
125 
126  void innerHandleNodeInfo(
127  const Eref& e,
128  unsigned int numNodes, unsigned int numThreads );
129 
130  void handleSpineList(
131  const Eref& e,
132  vector< Id > shaft, vector< Id > head,
133  vector< unsigned int > parentVoxel );
134 
135  void transmitChange( const Eref& e );
136 
137  void buildStencil();
138 
140  // inherited virtual funcs for Boundary
142 
143  void matchMeshEntries( const ChemCompt* other,
144  vector< VoxelJunction > & ret ) const;
145 
146  void matchNeuroMeshEntries( const ChemCompt* other,
147  vector< VoxelJunction > & ret ) const;
148 
149  void matchCubeMeshEntries( const ChemCompt* other,
150  vector< VoxelJunction > & ret ) const;
151 
152  void matchSpineMeshEntries( const ChemCompt* other,
153  vector< VoxelJunction > & ret ) const;
154 
163  double nearest( double x, double y, double z,
164  unsigned int& index ) const;
165 
166  void indexToSpace( unsigned int index,
167  double& x, double& y, double& z ) const;
168 
169  const vector< double >& vGetVoxelVolume() const;
170  const vector< double >& vGetVoxelMidpoint() const;
171  const vector< double >& getVoxelArea() const;
172  const vector< double >& getVoxelLength() const;
174  // Utility function for tests
175  const vector< SpineEntry >& spines() const;
177  static const Cinfo* initCinfo();
178 
179  private:
183  vector< SpineEntry > spines_;
184 
191 
197  vector< double > vs_;
198 
203  vector< double > area_;
204 
206  vector< double > length_;
207 };
208 
209 
210 #endif // _SPINE_MESH_H
unsigned int innerGetNumEntries() const
Definition: SpineMesh.cpp:443
void innerBuildDefaultMesh(const Eref &e, double volume, unsigned int numEntries)
Virtual func to make a mesh with specified Volume and numEntries.
Definition: SpineMesh.cpp:460
vector< double > area_
Definition: SpineMesh.h:203
double getMeshEntryVolume(unsigned int fid) const
Virtual function to return volume of mesh Entry.
Definition: SpineMesh.cpp:307
const vector< double > & vGetVoxelVolume() const
Virtual func so that derived classes can pass voxel volume back.
Definition: SpineMesh.cpp:385
bool vSetVolumeNotRates(double volume)
Inherited virtual func.
Definition: SpineMesh.cpp:422
vector< unsigned int > getStartVoxelInCompt() const
Returns index of first voxel mapping to elec compt.
Definition: SpineMesh.cpp:212
const vector< double > & vGetVoxelMidpoint() const
Virtual func so that derived classes can return voxel midpoint.
Definition: SpineMesh.cpp:390
double extendedMeshEntryVolume(unsigned int fid) const
Vol of all mesh Entries including abutting diff-coupled voxels.
Definition: SpineMesh.cpp:348
vector< double > getCoordinates(unsigned int fid) const
Virtual function to return coords of mesh Entry.
Definition: SpineMesh.cpp:325
const vector< double > & getVoxelArea() const
Definition: SpineMesh.cpp:403
void indexToSpace(unsigned int index, double &x, double &y, double &z) const
Definition: SpineMesh.cpp:508
vector< double > getDiffusionArea(unsigned int fid) const
Virtual function to return diffusion X-section area.
Definition: SpineMesh.cpp:332
void matchMeshEntries(const ChemCompt *other, vector< VoxelJunction > &ret) const
Definition: SpineMesh.cpp:486
vector< SpineEntry > spines_
Definition: SpineMesh.h:183
const int numEntries
Definition: proc.cpp:60
const vector< SpineEntry > & spines() const
Definition: SpineMesh.cpp:467
void updateCoords()
Definition: SpineMesh.cpp:235
vector< Id > getElecComptMap() const
Definition: SpineMesh.cpp:204
unsigned int getMeshType(unsigned int fid) const
Virtual function to return MeshType of specified entry.
Definition: SpineMesh.cpp:294
double vGetEntireVolume() const
Inherited virtual func.
Definition: SpineMesh.cpp:413
const vector< double > & getVoxelLength() const
Definition: SpineMesh.cpp:408
vector< double > length_
Pre-calculation of length of each MeshEntry.
Definition: SpineMesh.h:206
vector< double > vs_
Definition: SpineMesh.h:197
vector< unsigned int > getNeuronVoxel() const
Definition: SpineMesh.cpp:196
static const Cinfo * initCinfo()
Definition: SpineMesh.cpp:48
double surfaceGranularity_
Definition: SpineMesh.h:190
Definition: Eref.h:26
void transmitChange(const Eref &e)
vector< double > getDiffusionScaling(unsigned int fid) const
Virtual function to return scale factor for diffusion. 1 here.
Definition: SpineMesh.cpp:341
void matchSpineMeshEntries(const ChemCompt *other, vector< VoxelJunction > &ret) const
Definition: SpineMesh.cpp:538
void innerSetNumEntries(unsigned int n)
Inherited virtual func.
Definition: SpineMesh.cpp:452
void innerHandleNodeInfo(const Eref &e, unsigned int numNodes, unsigned int numThreads)
Definition: SpineMesh.cpp:374
double nearest(double x, double y, double z, unsigned int &index) const
Definition: SpineMesh.cpp:516
static unsigned int numNodes
void matchNeuroMeshEntries(const ChemCompt *other, vector< VoxelJunction > &ret) const
Definition: SpineMesh.cpp:543
vector< unsigned int > getEndVoxelInCompt() const
Returns index of end voxel mapping to elec compt, just first+1.
Definition: SpineMesh.cpp:220
void setMeshEntryVolume(unsigned int fid, double volume)
Virtual function to assign volume of mesh Entry.
Definition: SpineMesh.cpp:315
void buildStencil()
Definition: SpineMesh.cpp:475
void matchCubeMeshEntries(const ChemCompt *other, vector< VoxelJunction > &ret) const
Definition: SpineMesh.cpp:557
Definition: Cinfo.h:18
unsigned int getMeshDimensions(unsigned int fid) const
Virtual function to return dimensions of specified entry.
Definition: SpineMesh.cpp:301
unsigned int innerGetDimensions() const
Returns # of dimensions, always 3 here. Inherited pure virt func.
Definition: SpineMesh.cpp:240
vector< unsigned int > getParentVoxel() const
Definition: SpineMesh.cpp:185
void handleSpineList(const Eref &e, vector< Id > shaft, vector< Id > head, vector< unsigned int > parentVoxel)
Definition: SpineMesh.cpp:246