00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _CYL_MESH_H
00011 #define _CYL_MESH_H
00012
00019 class CylMesh: public MeshCompt
00020 {
00021 public:
00022 CylMesh();
00023 ~CylMesh();
00025
00027
00032 void updateCoords( const Eref& e, const vector< double >& childConcs );
00033
00035
00037
00038 void setX0( const Eref& e, double v );
00039 double getX0( const Eref& e ) const;
00040 void setY0( const Eref& e, double v );
00041 double getY0( const Eref& e ) const;
00042 void setZ0( const Eref& e, double v );
00043 double getZ0( const Eref& e ) const;
00044 void setR0( const Eref& e, double v );
00045 double getR0( const Eref& e ) const;
00046
00047 void setX1( const Eref& e, double v );
00048 double getX1( const Eref& e ) const;
00049 void setY1( const Eref& e, double v );
00050 double getY1( const Eref& e ) const;
00051 void setZ1( const Eref& e, double v );
00052 double getZ1( const Eref& e ) const;
00053 void setR1( const Eref& e, double v );
00054 double getR1( const Eref& e ) const;
00055
00056 void innerSetCoords( const Eref& e, const vector< double >& v);
00057 void setCoords( const Eref& e, vector< double > v );
00058 vector< double > getCoords( const Eref& e ) const;
00059
00060 void setDiffLength( const Eref& e, double v );
00061 double getDiffLength( const Eref& e ) const;
00062
00063 double getTotLength() const;
00064
00065 unsigned int innerGetDimensions() const;
00066
00068
00070
00072 unsigned int getMeshType( unsigned int fid ) const;
00074 unsigned int getMeshDimensions( unsigned int fid ) const;
00076 double getMeshEntryVolume( unsigned int fid ) const;
00078 vector< double > getCoordinates( unsigned int fid ) const;
00080 vector< double > getDiffusionArea( unsigned int fid ) const;
00082 vector< double > getDiffusionScaling( unsigned int fid ) const;
00084 double extendedMeshEntryVolume( unsigned int fid ) const;
00085
00087
00091 unsigned int innerGetNumEntries() const;
00093 void innerSetNumEntries( unsigned int n );
00094
00096 vector< unsigned int > getParentVoxel() const;
00097 const vector< double >& vGetVoxelVolume() const;
00098 const vector< double >& vGetVoxelMidpoint() const;
00099 const vector< double >& getVoxelArea() const;
00100 const vector< double >& getVoxelLength() const;
00101
00103 double vGetEntireVolume() const;
00104
00106 bool vSetVolumeNotRates( double volume );
00108
00110
00112 void innerBuildDefaultMesh( const Eref& e,
00113 double volume, unsigned int numEntries );
00114
00115 void innerHandleRequestMeshStats(
00116 const Eref& e,
00117 const SrcFinfo2< unsigned int, vector< double > >*
00118 meshStatsFinfo
00119 );
00120
00121 void innerHandleNodeInfo(
00122 const Eref& e,
00123 unsigned int numNodes, unsigned int numThreads );
00124
00125 void transmitChange( const Eref& e );
00126
00127 void buildStencil();
00128
00130
00132
00133 void matchMeshEntries( const ChemCompt* other,
00134 vector< VoxelJunction > & ret ) const;
00135
00136 double nearest( double x, double y, double z,
00137 unsigned int& index ) const;
00138
00139 double nearest( double x, double y, double z,
00140 double& linePos, double& r ) const;
00141
00142 void indexToSpace( unsigned int index,
00143 double& x, double& y, double& z ) const;
00144
00146
00148 void matchCylMeshEntries( const CylMesh* other,
00149 vector< VoxelJunction >& ret ) const;
00150 void matchCubeMeshEntries( const CubeMesh* other,
00151 vector< VoxelJunction >& ret ) const;
00152 void matchNeuroMeshEntries( const NeuroMesh* other,
00153 vector< VoxelJunction >& ret ) const;
00154
00155
00156 double selectGridVolume( double h ) const;
00157
00159
00160 static const Cinfo* initCinfo();
00161
00162 private:
00163 unsigned int numEntries_;
00164 bool useCaps_;
00165 bool isToroid_;
00166
00167 double x0_;
00168 double y0_;
00169 double z0_;
00170
00171 double x1_;
00172 double y1_;
00173 double z1_;
00174
00175 double r0_;
00176 double r1_;
00177
00178 double diffLength_;
00179
00185 double surfaceGranularity_;
00186
00187 double totLen_;
00188 double rSlope_;
00189 double lenSlope_;
00190 };
00191
00192 #endif // _CYL_MESH_H