MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Pool Class Reference

#include <Pool.h>

+ Inheritance diagram for Pool:
+ Collaboration diagram for Pool:

Public Member Functions

 Pool ()
 
void vDecrement (double val)
 
double vGetConc (const Eref &e) const
 
double vGetDiffConst (const Eref &e) const
 
bool vGetIsBuffered (const Eref &e) const
 
double vGetMotorConst (const Eref &e) const
 
double vGetN (const Eref &e) const
 
double vGetNinit (const Eref &e) const
 
SpeciesId vGetSpecies (const Eref &e) const
 
double vGetVolume (const Eref &e) const
 
void vHandleMolWt (const Eref &e, double v)
 
void vIncrement (double val)
 
void vnIn (double val)
 
void vProcess (const Eref &e, ProcPtr p)
 
void vReac (double A, double B)
 
void vReinit (const Eref &e, ProcPtr p)
 
void vSetConc (const Eref &e, double v)
 
void vSetConcInit (const Eref &e, double v)
 
void vSetDiffConst (const Eref &e, double v)
 
void vSetIsBuffered (const Eref &e, bool v)
 
void vSetMotorConst (const Eref &e, double v)
 Dummy MotorConst field for most Pool subclasses. More...
 
void vSetN (const Eref &e, double v)
 
void vSetNinit (const Eref &e, double v)
 
void vSetSpecies (const Eref &e, SpeciesId v)
 
void vSetVolume (const Eref &e, double v)
 
 ~Pool ()
 
- Public Member Functions inherited from PoolBase
void decrement (double val)
 
double getConc (const Eref &e) const
 
double getConcInit (const Eref &e) const
 
double getDiffConst (const Eref &e) const
 
bool getIsBuffered (const Eref &e) const
 
double getMotorConst (const Eref &e) const
 
double getN (const Eref &e) const
 
double getNinit (const Eref &e) const
 
SpeciesId getSpecies (const Eref &e) const
 
double getVolume (const Eref &e) const
 
void handleMolWt (const Eref &e, double v)
 
void increment (double val)
 
void nIn (double val)
 
 PoolBase ()
 
void process (const Eref &e, ProcPtr p)
 
void reac (double A, double B)
 
void reinit (const Eref &e, ProcPtr p)
 
void setConc (const Eref &e, double v)
 
void setConcInit (const Eref &e, double v)
 
void setDiffConst (const Eref &e, double v)
 
void setIsBuffered (const Eref &e, bool v)
 
void setMotorConst (const Eref &e, double v)
 
void setN (const Eref &e, double v)
 
void setNinit (const Eref &e, double v)
 
void setSpecies (const Eref &e, SpeciesId v)
 
void setVolume (const Eref &e, double v)
 
virtual double vGetConcInit (const Eref &e) const
 
virtual void vSetSolver (Id ksolve, Id dsolve)
 
virtual ~PoolBase ()
 

Static Public Member Functions

static const CinfoinitCinfo ()
 
- Static Public Member Functions inherited from PoolBase
static const CinfoinitCinfo ()
 
static void zombify (Element *original, const Cinfo *zClass, Id ksolve, Id dsolve)
 

Private Attributes

double A_
 Motor transport constant. More...
 
double B_
 Internal state variables, used only in explict mode. More...
 
double diffConst_
 initial number of molecules. More...
 
double motorConst_
 Diffusion constant. More...
 
double n_
 
double nInit_
 Number of molecules in pool. More...
 
unsigned int species_
 

Detailed Description

The Pool class is a molecular pool. This is a set of molecules of a given species, in a uniform chemical context. Note that the same species might be present in other compartments, or be handled by other solvers.

Definition at line 19 of file Pool.h.

Constructor & Destructor Documentation

Pool::Pool ( )

Definition at line 52 of file Pool.cpp.

53  : n_( 0.0 ), nInit_( 0.0 ), diffConst_( 0.0 ), motorConst_( 0.0 ),
54  A_( 0.0 ), B_( 0.0 ), species_( 0 )
55 {;}
double B_
Internal state variables, used only in explict mode.
Definition: Pool.h:88
double nInit_
Number of molecules in pool.
Definition: Pool.h:84
double n_
Definition: Pool.h:83
double diffConst_
initial number of molecules.
Definition: Pool.h:85
double motorConst_
Diffusion constant.
Definition: Pool.h:86
double A_
Motor transport constant.
Definition: Pool.h:87
unsigned int species_
Definition: Pool.h:94
Pool::~Pool ( )

Definition at line 57 of file Pool.cpp.

58 {;}

Member Function Documentation

const Cinfo * Pool::initCinfo ( )
static

Definition at line 18 of file Pool.cpp.

References PoolBase::initCinfo(), and poolCinfo.

Referenced by BufPool::initCinfo(), and Dsolve::setPath().

19 {
21  // Field Definitions: All inherited from PoolBase.
24  // MsgDest Definitions: All inherited
27  // SrcFinfo Definitions: All inherited.
30  // SharedMsg Definitions: All inherited.
32  static Dinfo< Pool > dinfo;
33  static Cinfo poolCinfo (
34  "Pool",
36  0,
37  0,
38  &dinfo
39  );
40 
41  return &poolCinfo;
42 }
Definition: Dinfo.h:60
static const Cinfo * initCinfo()
Definition: PoolBase.cpp:19
static const Cinfo * poolCinfo
Definition: Pool.cpp:47
Definition: Cinfo.h:18

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Pool::vDecrement ( double  val)
virtual

Reimplemented from PoolBase.

Definition at line 141 of file Pool.cpp.

References A_, and B_.

142 {
143  if ( val < 0 )
144  A_ -= val;
145  else
146  B_ += val;
147 }
double B_
Internal state variables, used only in explict mode.
Definition: Pool.h:88
double A_
Motor transport constant.
Definition: Pool.h:87
double Pool::vGetConc ( const Eref e) const
virtual

Implements PoolBase.

Definition at line 192 of file Pool.cpp.

References lookupVolumeFromMesh(), n_, and NA.

193 {
194  return (n_ / NA) / lookupVolumeFromMesh( e );
195 }
const double NA
Definition: consts.cpp:15
double n_
Definition: Pool.h:83
double lookupVolumeFromMesh(const Eref &e)

+ Here is the call graph for this function:

double Pool::vGetDiffConst ( const Eref e) const
virtual

Implements PoolBase.

Definition at line 207 of file Pool.cpp.

References diffConst_.

208 {
209  return diffConst_;
210 }
double diffConst_
initial number of molecules.
Definition: Pool.h:85
bool Pool::vGetIsBuffered ( const Eref e) const
virtual

We need this explicit check because when the moose class is flipped, the internal C++ class isn't. Inherited by BufPool.

Implements PoolBase.

Definition at line 83 of file Pool.cpp.

References Element::cinfo(), Eref::element(), and Cinfo::name().

Referenced by vSetIsBuffered().

84 {
88  return e.element()->cinfo()->name() == "BufPool";
89 }
Element * element() const
Definition: Eref.h:42
const std::string & name() const
Definition: Cinfo.cpp:260
const Cinfo * cinfo() const
Definition: Element.cpp:66

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double Pool::vGetMotorConst ( const Eref e) const
virtual

Reimplemented from PoolBase.

Definition at line 217 of file Pool.cpp.

References motorConst_.

218 {
219  return motorConst_;
220 }
double motorConst_
Diffusion constant.
Definition: Pool.h:86
double Pool::vGetN ( const Eref e) const
virtual

Implements PoolBase.

Definition at line 170 of file Pool.cpp.

References n_.

171 {
172  return n_;
173 }
double n_
Definition: Pool.h:83
double Pool::vGetNinit ( const Eref e) const
virtual

Implements PoolBase.

Definition at line 180 of file Pool.cpp.

References nInit_.

181 {
182  return nInit_;
183 }
double nInit_
Number of molecules in pool.
Definition: Pool.h:84
SpeciesId Pool::vGetSpecies ( const Eref e) const
virtual

Implements PoolBase.

Definition at line 237 of file Pool.cpp.

References species_.

238 {
239  return species_;
240 }
unsigned int species_
Definition: Pool.h:94
double Pool::vGetVolume ( const Eref e) const
virtual

Implements PoolBase.

Definition at line 227 of file Pool.cpp.

References lookupVolumeFromMesh().

228 {
229  return lookupVolumeFromMesh( e );
230 }
double lookupVolumeFromMesh(const Eref &e)

+ Here is the call graph for this function:

void Pool::vHandleMolWt ( const Eref e,
double  v 
)
virtual

Reimplemented from PoolBase.

Definition at line 156 of file Pool.cpp.

157 {
158  ; // Here I should update DiffConst too.
159 }
void Pool::vIncrement ( double  val)
virtual

Reimplemented from PoolBase.

Definition at line 133 of file Pool.cpp.

References A_, and B_.

134 {
135  if ( val > 0 )
136  A_ += val;
137  else
138  B_ -= val;
139 }
double B_
Internal state variables, used only in explict mode.
Definition: Pool.h:88
double A_
Motor transport constant.
Definition: Pool.h:87
void Pool::vnIn ( double  val)
virtual

Reimplemented from PoolBase.

Definition at line 149 of file Pool.cpp.

References A_, B_, and n_.

150 {
151  n_ = val;
152  B_ = 0;
153  A_ = 0;
154 }
double B_
Internal state variables, used only in explict mode.
Definition: Pool.h:88
double n_
Definition: Pool.h:83
double A_
Motor transport constant.
Definition: Pool.h:87
void Pool::vProcess ( const Eref e,
ProcPtr  p 
)
virtual

Reimplemented from PoolBase.

Definition at line 97 of file Pool.cpp.

References A_, B_, ProcInfo::dt, EPSILON, n_, and SrcFinfo1< T >::send().

98 {
99  // double A = e.sumBuf( aSlot );
100  // double B = e.sumBuf( bSlot );
101 
102  if ( n_ > EPSILON && B_ > EPSILON )
103  {
104  double C = exp( -B_ * p->dt / n_ );
105  n_ *= C + (A_ / B_ ) * ( 1.0 - C );
106  }
107  else
108  {
109  n_ += ( A_ - B_ ) * p->dt;
110  if ( n_ < 0.0 )
111  n_ = 0.0;
112  }
113 
114  A_ = B_ = 0.0;
115 
116  nOut.send( e, n_ );
117 }
double B_
Internal state variables, used only in explict mode.
Definition: Pool.h:88
double dt
Definition: ProcInfo.h:18
const SrcFinfo1< double > & nOut
Definition: Pool.cpp:49
double n_
Definition: Pool.h:83
#define EPSILON
Definition: Pool.cpp:16
double A_
Motor transport constant.
Definition: Pool.h:87

+ Here is the call graph for this function:

void Pool::vReac ( double  A,
double  B 
)
virtual

Reimplemented from PoolBase.

Definition at line 127 of file Pool.cpp.

References A_, and B_.

128 {
129  A_ += A;
130  B_ += B;
131 }
double B_
Internal state variables, used only in explict mode.
Definition: Pool.h:88
double A_
Motor transport constant.
Definition: Pool.h:87
void Pool::vReinit ( const Eref e,
ProcPtr  p 
)
virtual

Reimplemented from PoolBase.

Definition at line 119 of file Pool.cpp.

References A_, B_, PoolBase::getNinit(), n_, and SrcFinfo1< T >::send().

Referenced by BufPool::vProcess(), and BufPool::vReinit().

120 {
121  A_ = B_ = 0.0;
122  n_ = getNinit( e );
123 
124  nOut.send( e, n_ );
125 }
double B_
Internal state variables, used only in explict mode.
Definition: Pool.h:88
const SrcFinfo1< double > & nOut
Definition: Pool.cpp:49
double n_
Definition: Pool.h:83
double A_
Motor transport constant.
Definition: Pool.h:87
double getNinit(const Eref &e) const
Definition: PoolBase.cpp:319

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Pool::vSetConc ( const Eref e,
double  v 
)
virtual

Implements PoolBase.

Definition at line 186 of file Pool.cpp.

References lookupVolumeFromMesh(), n_, and NA.

187 {
188  n_ = NA * c * lookupVolumeFromMesh( e );
189 }
const double NA
Definition: consts.cpp:15
double n_
Definition: Pool.h:83
double lookupVolumeFromMesh(const Eref &e)

+ Here is the call graph for this function:

void Pool::vSetConcInit ( const Eref e,
double  v 
)
virtual

Implements PoolBase.

Definition at line 197 of file Pool.cpp.

References lookupVolumeFromMesh(), NA, and nInit_.

198 {
199  nInit_ = NA * c * lookupVolumeFromMesh( e );
200 }
const double NA
Definition: consts.cpp:15
double nInit_
Number of molecules in pool.
Definition: Pool.h:84
double lookupVolumeFromMesh(const Eref &e)

+ Here is the call graph for this function:

void Pool::vSetDiffConst ( const Eref e,
double  v 
)
virtual

Implements PoolBase.

Definition at line 202 of file Pool.cpp.

References diffConst_.

203 {
204  diffConst_ = v;
205 }
double diffConst_
initial number of molecules.
Definition: Pool.h:85
void Pool::vSetIsBuffered ( const Eref e,
bool  v 
)
virtual

Functions to examine and change class between Pool and BufPool.

setIsBuffered is a really nasty operation, made possible only because BufPool is derived from Pool and has no other fields. It uses a low-level replaceCinfo call to just change the identity of the Cinfo used, leaving everything else as is.

Reimplemented from PoolBase.

Definition at line 68 of file Pool.cpp.

References bufPoolCinfo, Eref::element(), Cinfo::find(), Element::replaceCinfo(), and vGetIsBuffered().

69 {
70  static const Cinfo* bufPoolCinfo = Cinfo::find( "BufPool" );
71  if (vGetIsBuffered( e ) == v)
72  return;
73  if (v)
74  {
75  e.element()->replaceCinfo( bufPoolCinfo );
76  }
77  else
78  {
80  }
81 }
bool vGetIsBuffered(const Eref &e) const
Definition: Pool.cpp:83
static const Cinfo * find(const std::string &name)
Definition: Cinfo.cpp:200
static const Cinfo * bufPoolCinfo
Definition: BufPool.cpp:47
Element * element() const
Definition: Eref.h:42
static const Cinfo * poolCinfo
Definition: Pool.cpp:47
void replaceCinfo(const Cinfo *newCinfo)
Support function for zombieSwap, replaces Cinfo.
Definition: Element.cpp:740
Definition: Cinfo.h:18

+ Here is the call graph for this function:

void Pool::vSetMotorConst ( const Eref e,
double  v 
)
virtual

Dummy MotorConst field for most Pool subclasses.

Reimplemented from PoolBase.

Definition at line 212 of file Pool.cpp.

References motorConst_.

213 {
214  motorConst_ = v;
215 }
double motorConst_
Diffusion constant.
Definition: Pool.h:86
void Pool::vSetN ( const Eref e,
double  v 
)
virtual

Implements PoolBase.

Definition at line 165 of file Pool.cpp.

References n_.

Referenced by BufPool::vSetN().

166 {
167  n_ = v;
168 }
double n_
Definition: Pool.h:83

+ Here is the caller graph for this function:

void Pool::vSetNinit ( const Eref e,
double  v 
)
virtual

Implements PoolBase.

Definition at line 175 of file Pool.cpp.

References nInit_.

Referenced by BufPool::vSetN().

176 {
177  nInit_ = v;
178 }
double nInit_
Number of molecules in pool.
Definition: Pool.h:84

+ Here is the caller graph for this function:

void Pool::vSetSpecies ( const Eref e,
SpeciesId  v 
)
virtual

Implements PoolBase.

Definition at line 232 of file Pool.cpp.

References species_.

233 {
234  species_ = v;
235 }
unsigned int species_
Definition: Pool.h:94
void Pool::vSetVolume ( const Eref e,
double  v 
)
virtual

Volume is usually volume, but we also permit areal density This is obtained by looking up the corresponding spatial mesh entry in the parent compartment. If the message isn't set then it defaults to 1.0.

Implements PoolBase.

Definition at line 222 of file Pool.cpp.

223 {
224  cout << "Warning: Pool::vSetVolume: Operation not permitted. Ignored\n";
225 }

Member Data Documentation

double Pool::A_
private

Motor transport constant.

Definition at line 87 of file Pool.h.

Referenced by vDecrement(), vIncrement(), vnIn(), vProcess(), vReac(), and vReinit().

double Pool::B_
private

Internal state variables, used only in explict mode.

Definition at line 88 of file Pool.h.

Referenced by vDecrement(), vIncrement(), vnIn(), vProcess(), vReac(), and vReinit().

double Pool::diffConst_
private

initial number of molecules.

Definition at line 85 of file Pool.h.

Referenced by vGetDiffConst(), and vSetDiffConst().

double Pool::motorConst_
private

Diffusion constant.

Definition at line 86 of file Pool.h.

Referenced by vGetMotorConst(), and vSetMotorConst().

double Pool::n_
private

Definition at line 83 of file Pool.h.

Referenced by vGetConc(), vGetN(), vnIn(), vProcess(), vReinit(), vSetConc(), and vSetN().

double Pool::nInit_
private

Number of molecules in pool.

Definition at line 84 of file Pool.h.

Referenced by vGetNinit(), vSetConcInit(), and vSetNinit().

unsigned int Pool::species_
private

System wide identifier for all mol pools that are chemically the same species.

Definition at line 94 of file Pool.h.

Referenced by vGetSpecies(), and vSetSpecies().


The documentation for this class was generated from the following files: