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

#include <ZombiePool.h>

+ Inheritance diagram for ZombiePool:
+ Collaboration diagram for ZombiePool:

Public Member Functions

double vGetConc (const Eref &e) const
 
double vGetConcInit (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
 
unsigned int vGetSpecies (const Eref &e) const
 
double vGetVolume (const Eref &e) const
 
void vSetConc (const Eref &e, double v)
 
void vSetConcInit (const Eref &e, double v)
 
void vSetDiffConst (const Eref &e, double 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 vSetSolver (Id ksolve, Id dsolve)
 
void vSetSpecies (const Eref &e, unsigned int v)
 
void vSetVolume (const Eref &e, double v)
 
 ZombiePool ()
 
 ~ZombiePool ()
 
- 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 void vDecrement (double val)
 
virtual void vHandleMolWt (const Eref &e, double v)
 
virtual void vIncrement (double val)
 
virtual void vnIn (double val)
 
virtual void vProcess (const Eref &e, ProcPtr p)
 
virtual void vReac (double A, double B)
 
virtual void vReinit (const Eref &e, ProcPtr p)
 
virtual void vSetIsBuffered (const Eref &e, bool v)
 I put in a default empty function for vSetIsBuffered. More...
 
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)
 

Protected Attributes

double diffConst_
 
ZombiePoolInterfacedsolve_
 
ZombiePoolInterfaceksolve_
 
double motorConst_
 

Detailed Description

This class is used by the Dsolve and Ksolve to take over from regular pools. Possibly other solver classes will eventually use it too.

Definition at line 17 of file ZombiePool.h.

Constructor & Destructor Documentation

ZombiePool::ZombiePool ( )

Definition at line 61 of file ZombiePool.cpp.

62  : dsolve_( 0 ), ksolve_( 0 ), diffConst_( 1e-12 ), motorConst_( 0.0 )
63 {;}
double motorConst_
Definition: ZombiePool.h:73
ZombiePoolInterface * dsolve_
Definition: ZombiePool.h:70
ZombiePoolInterface * ksolve_
Definition: ZombiePool.h:71
double diffConst_
Definition: ZombiePool.h:72
ZombiePool::~ZombiePool ( )

Definition at line 65 of file ZombiePool.cpp.

66 {;}

Member Function Documentation

const Cinfo * ZombiePool::initCinfo ( )
static

Definition at line 21 of file ZombiePool.cpp.

References PoolBase::initCinfo(), and zombiePoolCinfo.

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

22 {
24  // Field Definitions: All inherited from PoolBase
27  // MsgDest Definitions: All inherited from PoolBase
30  // SrcFinfo Definitions: All inherited from PoolBase
33  // SharedMsg Definitions: All inherited from PoolBase
35 
36  // Note that here the isOneZombie_ flag on the Dinfo constructor is
37  // true. This means that the duplicate and copy operations only make
38  // one copy, regardless of how big the array of zombie pools.
39  // The assumption is that each Id has a single pool, which can be
40  // present in many voxels.
41  static Dinfo< ZombiePool > dinfo( true );
42  static Cinfo zombiePoolCinfo (
43  "ZombiePool",
45  0,
46  0,
47  &dinfo
48  );
49 
50  return &zombiePoolCinfo;
51 }
Definition: Dinfo.h:60
static const Cinfo * initCinfo()
Definition: PoolBase.cpp:19
Definition: Cinfo.h:18
static const Cinfo * zombiePoolCinfo
Definition: ZombiePool.cpp:59

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double ZombiePool::vGetConc ( const Eref e) const
virtual

Implements PoolBase.

Definition at line 118 of file ZombiePool.cpp.

References lookupVolumeFromMesh(), NA, and vGetN().

119 {
120  return vGetN( e ) / ( NA * lookupVolumeFromMesh( e ) );
121 }
const double NA
Definition: consts.cpp:15
double vGetN(const Eref &e) const
Definition: ZombiePool.cpp:85
double lookupVolumeFromMesh(const Eref &e)

+ Here is the call graph for this function:

double ZombiePool::vGetConcInit ( const Eref e) const
virtual

Reimplemented from PoolBase.

Definition at line 133 of file ZombiePool.cpp.

References lookupVolumeFromMesh(), NA, and vGetNinit().

134 {
135  return vGetNinit( e ) / (NA * lookupVolumeFromMesh( e ) );
136 }
const double NA
Definition: consts.cpp:15
double vGetNinit(const Eref &e) const
Definition: ZombiePool.cpp:102
double lookupVolumeFromMesh(const Eref &e)

+ Here is the call graph for this function:

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

Implements PoolBase.

Definition at line 145 of file ZombiePool.cpp.

References diffConst_.

146 {
147  return diffConst_;
148 }
double diffConst_
Definition: ZombiePool.h:72
bool ZombiePool::vGetIsBuffered ( const Eref e) const
virtual

Implements PoolBase.

Definition at line 182 of file ZombiePool.cpp.

183 {
184  return false;
185 }
double ZombiePool::vGetMotorConst ( const Eref e) const
virtual

Reimplemented from PoolBase.

Definition at line 150 of file ZombiePool.cpp.

References motorConst_.

151 {
152  return motorConst_;
153 }
double motorConst_
Definition: ZombiePool.h:73
double ZombiePool::vGetN ( const Eref e) const
virtual

Implements PoolBase.

Definition at line 85 of file ZombiePool.cpp.

References dsolve_, ZombiePoolInterface::getN(), and ksolve_.

Referenced by vGetConc().

86 {
87  if ( ksolve_ != 0 )
88  return ksolve_->getN( e );
89  else if ( dsolve_ != 0 )
90  return dsolve_->getN( e );
91  return 0.0;
92 }
virtual double getN(const Eref &e) const =0
Get # of molecules in given pool and voxel. Varies with time.
ZombiePoolInterface * dsolve_
Definition: ZombiePool.h:70
ZombiePoolInterface * ksolve_
Definition: ZombiePool.h:71

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double ZombiePool::vGetNinit ( const Eref e) const
virtual

Implements PoolBase.

Definition at line 102 of file ZombiePool.cpp.

References dsolve_, ZombiePoolInterface::getNinit(), and ksolve_.

Referenced by vGetConcInit().

103 {
104  if ( ksolve_ != 0 )
105  return ksolve_->getNinit( e );
106  else if ( dsolve_ != 0 )
107  return dsolve_->getNinit( e );
108  return 0.0;
109 }
ZombiePoolInterface * dsolve_
Definition: ZombiePool.h:70
virtual double getNinit(const Eref &e) const =0
get initial # of molecules in given pool and voxel. Bdry cond.
ZombiePoolInterface * ksolve_
Definition: ZombiePool.h:71

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned int ZombiePool::vGetSpecies ( const Eref e) const
virtual

Implements PoolBase.

Definition at line 167 of file ZombiePool.cpp.

168 {
169  return 0;
170 }
double ZombiePool::vGetVolume ( const Eref e) const
virtual

Implements PoolBase.

Definition at line 177 of file ZombiePool.cpp.

References lookupVolumeFromMesh().

178 {
179  return lookupVolumeFromMesh( e );
180 }
double lookupVolumeFromMesh(const Eref &e)

+ Here is the call graph for this function:

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

Implements PoolBase.

Definition at line 111 of file ZombiePool.cpp.

References lookupVolumeFromMesh(), NA, and vSetN().

112 {
113  // unsigned int pool = convertIdToPoolIndex( e.id() );
114  double n = NA * conc * lookupVolumeFromMesh( e );
115  vSetN( e, n );
116 }
const double NA
Definition: consts.cpp:15
void vSetN(const Eref &e, double v)
Definition: ZombiePool.cpp:76
double lookupVolumeFromMesh(const Eref &e)

+ Here is the call graph for this function:

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

Implements PoolBase.

Definition at line 123 of file ZombiePool.cpp.

References lookupVolumeFromMesh(), NA, and vSetNinit().

124 {
125  double n = NA * conc * lookupVolumeFromMesh( e );
126  vSetNinit( e, n );
127 }
const double NA
Definition: consts.cpp:15
void vSetNinit(const Eref &e, double v)
Definition: ZombiePool.cpp:94
double lookupVolumeFromMesh(const Eref &e)

+ Here is the call graph for this function:

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

Implements PoolBase.

Definition at line 138 of file ZombiePool.cpp.

References diffConst_, dsolve_, and ZombiePoolInterface::setDiffConst().

139 {
140  diffConst_ = v;
141  if ( dsolve_ )
142  dsolve_->setDiffConst( e, v );
143 }
ZombiePoolInterface * dsolve_
Definition: ZombiePool.h:70
virtual void setDiffConst(const Eref &e, double val)=0
Diffusion constant: Only one per pool, voxel number is ignored.
double diffConst_
Definition: ZombiePool.h:72

+ Here is the call graph for this function:

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

Dummy MotorConst field for most Pool subclasses.

Reimplemented from PoolBase.

Definition at line 155 of file ZombiePool.cpp.

References dsolve_, motorConst_, and ZombiePoolInterface::setMotorConst().

156 {
157  motorConst_ = v;
158  if ( dsolve_ )
159  dsolve_->setMotorConst( e, v );
160 }
double motorConst_
Definition: ZombiePool.h:73
ZombiePoolInterface * dsolve_
Definition: ZombiePool.h:70
virtual void setMotorConst(const Eref &e, double val)

+ Here is the call graph for this function:

void ZombiePool::vSetN ( const Eref e,
double  v 
)
virtual

Implements PoolBase.

Definition at line 76 of file ZombiePool.cpp.

References dsolve_, ksolve_, and ZombiePoolInterface::setN().

Referenced by vSetConc(), and ZombieBufPool::vSetN().

77 {
78  if ( ksolve_ )
79  ksolve_->setN( e, v );
80  if ( dsolve_ )
81  dsolve_->setN( e, v );
82  // S_[ e.index().value() ][ convertIdToPoolIndex( e.id() ) ] = v;
83 }
virtual void setN(const Eref &e, double val)=0
Set # of molecules in given pool and voxel. Varies with time.
ZombiePoolInterface * dsolve_
Definition: ZombiePool.h:70
ZombiePoolInterface * ksolve_
Definition: ZombiePool.h:71

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Implements PoolBase.

Definition at line 94 of file ZombiePool.cpp.

References dsolve_, ksolve_, and ZombiePoolInterface::setNinit().

Referenced by vSetConcInit(), and ZombieBufPool::vSetN().

95 {
96  if ( ksolve_ )
97  ksolve_->setNinit( e, v );
98  if ( dsolve_ )
99  dsolve_->setNinit( e, v );
100 }
virtual void setNinit(const Eref &e, double val)=0
Set initial # of molecules in given pool and voxel. Bdry cond.
ZombiePoolInterface * dsolve_
Definition: ZombiePool.h:70
ZombiePoolInterface * ksolve_
Definition: ZombiePool.h:71

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ZombiePool::vSetSolver ( Id  ksolve,
Id  dsolve 
)
virtual

Assign whatever info is needed by the zombie based on the solver Element. Encapsulates some unpleasant field extraction, casting, and assignment. Default version of this function does nothing.

Reimplemented from PoolBase.

Definition at line 191 of file ZombiePool.cpp.

References Element::cinfo(), ObjId::data(), dsolve_, Id::element(), Cinfo::isA(), ksolve_, and Cinfo::name().

192 {
193  // Nasty unsafe typecast. I would have preferred to pass in a
194  // safely typed pointer but that would have exposed a low-level
195  // class for the ZombiePoolInterface.
196  if ( ksolve.element()->cinfo()->isA( "Ksolve" ) ||
197  ksolve.element()->cinfo()->isA( "Gsolve" ) ) {
198  ksolve_= reinterpret_cast< ZombiePoolInterface *>(
199  ObjId( ksolve, 0 ).data() );
200  } else if ( ksolve == Id() ) {
201  ksolve_ = 0;
202  } else {
203  cout << "Warning:ZombiePool::vSetSolver: solver class " <<
204  ksolve.element()->cinfo()->name() <<
205  " not known.\nShould be Ksolve or Gsolve\n";
206  ksolve_ = 0;
207  }
208 
209  if ( dsolve.element()->cinfo()->isA( "Dsolve" ) ) {
210  dsolve_= reinterpret_cast< ZombiePoolInterface *>(
211  ObjId( dsolve, 0 ).data() );
212  } else if ( dsolve == Id() ) {
213  dsolve_ = 0;
214  } else {
215  cout << "Warning:ZombiePool::vSetSolver: solver class " <<
216  dsolve.element()->cinfo()->name() <<
217  " not known.\nShould be Dsolve\n";
218  dsolve_ = 0;
219  }
220 }
char * data() const
Definition: ObjId.cpp:113
Element * element() const
Synonym for Id::operator()()
Definition: Id.cpp:113
Definition: ObjId.h:20
const std::string & name() const
Definition: Cinfo.cpp:260
ZombiePoolInterface * dsolve_
Definition: ZombiePool.h:70
bool isA(const string &ancestor) const
Definition: Cinfo.cpp:280
const Cinfo * cinfo() const
Definition: Element.cpp:66
ZombiePoolInterface * ksolve_
Definition: ZombiePool.h:71
Definition: Id.h:17

+ Here is the call graph for this function:

void ZombiePool::vSetSpecies ( const Eref e,
unsigned int  v 
)
virtual

Implements PoolBase.

Definition at line 162 of file ZombiePool.cpp.

163 {
164  ;
165 }
void ZombiePool::vSetVolume ( const Eref e,
double  v 
)
virtual

Implements PoolBase.

Definition at line 172 of file ZombiePool.cpp.

173 {
174  assert( 0 ); // Illegal op, but should handle more gracefully.
175 }

Member Data Documentation

double ZombiePool::diffConst_
protected

Definition at line 72 of file ZombiePool.h.

Referenced by vGetDiffConst(), and vSetDiffConst().

ZombiePoolInterface* ZombiePool::dsolve_
protected

The ZombiePoolInterface pointers hold the solvers for the ZombiePool. At least one must be assigned. Field assignments propagate from the pool to whichever is assigned. Field lookups first check the dsolve, then the ksolve. The ZombiePool may be managed by the diffusion solver without the involvement of the Stoich class at all. So instead of routing the zombie operations through the Stoich, we have pointers directly into the Dsolve and Ksolve.

Definition at line 70 of file ZombiePool.h.

Referenced by vGetN(), vGetNinit(), vSetDiffConst(), vSetMotorConst(), vSetN(), vSetNinit(), and vSetSolver().

ZombiePoolInterface* ZombiePool::ksolve_
protected

Definition at line 71 of file ZombiePool.h.

Referenced by vGetN(), vGetNinit(), vSetN(), vSetNinit(), and vSetSolver().

double ZombiePool::motorConst_
protected

Definition at line 73 of file ZombiePool.h.

Referenced by vGetMotorConst(), and vSetMotorConst().


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