MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
CylBase.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) 2012 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 _CYL_BASE_H
11 #define _CYL_BASE_H
12 
17 class CylBase
18 {
19  public:
20  CylBase( double x, double y, double z,
21  double dia, double length, unsigned int numDivs );
22  CylBase();
23 
24  void setX( double v );
25  double getX() const;
26  void setY( double v );
27  double getY() const;
28  void setZ( double v );
29  double getZ() const;
30  void setDia( double v );
31  double getDia() const;
32  void setLength( double v );
33  double getLength() const;
34  void setNumDivs( unsigned int v );
35  unsigned int getNumDivs() const;
36  void setIsCylinder( bool v );
37  bool getIsCylinder() const;
38 
40  double volume( const CylBase& parent ) const;
41 
45  double voxelVolume( const CylBase& parent, unsigned int fid ) const;
46 
57  vector< double > getCoordinates( const CylBase& parent,
58  unsigned int entry ) const;
59 
69  double getDiffusionArea(
70  const CylBase& parent, unsigned int index ) const;
71 
73  double getMiddleArea(
74  const CylBase& parent, unsigned int index ) const;
75 
77  double getVoxelLength() const;
78 
82  // Selects a grid size for generating intersection with CubeMesh.
83  double selectGridSize( double h, double dia1, double granularity )
84  const;
85 
86  void matchCubeMeshEntries( const ChemCompt* other,
87  const CylBase& parent,
88  unsigned int startIndex,
89  double granularity,
90  vector< VoxelJunction >& ret,
91  bool useCylinderCurve, bool useCylinderCap ) const;
92 
93  double nearest( double x, double y, double z,
94  const CylBase& parent,
95  double& linePos, double& r ) const;
96 
97  double nearest( double x, double y, double z,
98  const CylBase& parent,
99  unsigned int& index ) const;
100 
101  private:
103  double x_;
104  double y_;
105  double z_;
106 
107  double dia_;
108  double length_;
109  unsigned int numDivs_;
110  bool isCylinder_;
111 };
112 
113 #endif // _CYL_BASE_H
double x_
end of the node. The start is given by parent coords.
Definition: CylBase.h:103
double getLength() const
Definition: CylBase.cpp:98
void setNumDivs(unsigned int v)
Definition: CylBase.cpp:103
double length_
Diameter of node end.
Definition: CylBase.h:108
void setX(double v)
Definition: CylBase.cpp:53
double getX() const
Definition: CylBase.cpp:58
double dia_
Definition: CylBase.h:107
double voxelVolume(const CylBase &parent, unsigned int fid) const
Definition: CylBase.cpp:152
bool isCylinder_
Number of subdivisions of cylinder.
Definition: CylBase.h:110
CylBase()
Definition: CylBase.cpp:40
double getDiffusionArea(const CylBase &parent, unsigned int index) const
Definition: CylBase.cpp:210
double volume(const CylBase &parent) const
Returns vol of current node. Usually needs to refer to parent.
Definition: CylBase.cpp:135
void setLength(double v)
Definition: CylBase.cpp:93
double getY() const
Definition: CylBase.cpp:68
vector< double > getCoordinates(const CylBase &parent, unsigned int entry) const
Definition: CylBase.cpp:172
double nearest(double x, double y, double z, const CylBase &parent, double &linePos, double &r) const
Definition: CylBase.cpp:378
unsigned int numDivs_
Length of compartment.
Definition: CylBase.h:109
void matchCubeMeshEntries(const ChemCompt *other, const CylBase &parent, unsigned int startIndex, double granularity, vector< VoxelJunction > &ret, bool useCylinderCurve, bool useCylinderCap) const
Definition: CylBase.cpp:320
void setZ(double v)
Definition: CylBase.cpp:73
double getMiddleArea(const CylBase &parent, unsigned int index) const
Return cross-section area of middle of specified voxel.
Definition: CylBase.cpp:223
bool getIsCylinder() const
Definition: CylBase.cpp:118
double z_
Definition: CylBase.h:105
void setIsCylinder(bool v)
Definition: CylBase.cpp:113
void setY(double v)
Definition: CylBase.cpp:63
double getDia() const
Definition: CylBase.cpp:88
double getZ() const
Definition: CylBase.cpp:78
void setDia(double v)
Definition: CylBase.cpp:83
double y_
Definition: CylBase.h:104
unsigned int getNumDivs() const
Definition: CylBase.cpp:108
double selectGridSize(double h, double dia1, double granularity) const
Definition: CylBase.cpp:242
double getVoxelLength() const
Return length of voxel. All are equal.
Definition: CylBase.cpp:235