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

#include <ReacBase.h>

+ Inheritance diagram for ReacBase:
+ Collaboration diagram for ReacBase:

Public Member Functions

double getConcKb (const Eref &e) const
 get Kb in concentration units More...
 
double getConcKf (const Eref &e) const
 get Kf in concentration units More...
 
double getNumKb (const Eref &e) const
 
double getNumKf (const Eref &e) const
 
unsigned int getNumPrd (const Eref &e) const
 Get number of products. More...
 
unsigned int getNumSub (const Eref &e) const
 Get number of substrates. More...
 
void prd (double v)
 
void process (const Eref &e, ProcPtr p)
 
 ReacBase ()
 
void reinit (const Eref &e, ProcPtr p)
 
void remesh (const Eref &e)
 
void setConcKb (const Eref &e, double v)
 set Kb in concentration units More...
 
void setConcKf (const Eref &e, double v)
 set Kf in concentration units More...
 
void setNumKb (const Eref &e, double v)
 
void setNumKf (const Eref &e, double v)
 
virtual void setSolver (Id solver, Id orig)
 Assign solver info. More...
 
void sub (double v)
 
virtual double vGetConcKb (const Eref &e) const =0
 
virtual double vGetConcKf (const Eref &e) const =0
 
virtual double vGetNumKb (const Eref &e) const =0
 
virtual double vGetNumKf (const Eref &e) const =0
 
virtual void vPrd (double v)
 
virtual void vProcess (const Eref &e, ProcPtr p)
 
virtual void vReinit (const Eref &e, ProcPtr p)
 
virtual void vRemesh (const Eref &e)
 
virtual void vSetConcKb (const Eref &e, double v)=0
 
virtual void vSetConcKf (const Eref &e, double v)=0
 
virtual void vSetNumKb (const Eref &e, double v)=0
 
virtual void vSetNumKf (const Eref &e, double v)=0
 
virtual void vSub (double v)
 
virtual ~ReacBase ()
 

Static Public Member Functions

static const CinfoinitCinfo ()
 
static void zombify (Element *original, const Cinfo *zClass, Id solver)
 

Protected Attributes

double concKb_
 
double concKf_
 

Detailed Description

Definition at line 13 of file ReacBase.h.

Constructor & Destructor Documentation

ReacBase::ReacBase ( )

Definition at line 164 of file ReacBase.cpp.

165  : concKf_( 0.1 ), concKb_( 0.2 )
166 {
167  ;
168 }
double concKf_
Definition: ReacBase.h:86
double concKb_
Definition: ReacBase.h:87
ReacBase::~ReacBase ( )
virtual

Definition at line 170 of file ReacBase.cpp.

171 {;}

Member Function Documentation

double ReacBase::getConcKb ( const Eref e) const

get Kb in concentration units

Definition at line 273 of file ReacBase.cpp.

References vGetConcKb().

Referenced by initCinfo(), and zombify().

274 {
275  return vGetConcKb( e );
276 }
virtual double vGetConcKb(const Eref &e) const =0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double ReacBase::getConcKf ( const Eref e) const

get Kf in concentration units

Definition at line 263 of file ReacBase.cpp.

References vGetConcKf().

Referenced by initCinfo(), and zombify().

264 {
265  return vGetConcKf( e );
266 }
virtual double vGetConcKf(const Eref &e) const =0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double ReacBase::getNumKb ( const Eref e) const

Definition at line 251 of file ReacBase.cpp.

References vGetNumKb().

Referenced by initCinfo().

252 {
253  return vGetNumKb( e );
254 }
virtual double vGetNumKb(const Eref &e) const =0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double ReacBase::getNumKf ( const Eref e) const

Definition at line 241 of file ReacBase.cpp.

References vGetNumKf().

Referenced by initCinfo().

242 {
243  return vGetNumKf( e );
244 }
virtual double vGetNumKf(const Eref &e) const =0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned int ReacBase::getNumPrd ( const Eref e) const

Get number of products.

Definition at line 286 of file ReacBase.cpp.

References Eref::element(), Element::getMsgAndFunc(), and prdOut().

Referenced by initCinfo().

287 {
288  const vector< MsgFuncBinding >* mfb =
289  e.element()->getMsgAndFunc( prdOut()->getBindIndex() );
290  assert( mfb );
291  return ( mfb->size() );
292 }
Element * element() const
Definition: Eref.h:42
const vector< MsgFuncBinding > * getMsgAndFunc(BindIndex b) const
Definition: Element.cpp:300
static SrcFinfo2< double, double > * prdOut()
Definition: ReacBase.cpp:25

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned int ReacBase::getNumSub ( const Eref e) const

Get number of substrates.

Definition at line 278 of file ReacBase.cpp.

References Eref::element(), Element::getMsgAndFunc(), and subOut().

Referenced by initCinfo().

279 {
280  const vector< MsgFuncBinding >* mfb =
281  e.element()->getMsgAndFunc( subOut()->getBindIndex() );
282  assert( mfb );
283  return ( mfb->size() );
284 }
Element * element() const
Definition: Eref.h:42
static SrcFinfo2< double, double > * subOut()
Definition: ReacBase.cpp:17
const vector< MsgFuncBinding > * getMsgAndFunc(BindIndex b) const
Definition: Element.cpp:300

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const Cinfo * ReacBase::initCinfo ( )
static

Definition at line 33 of file ReacBase.cpp.

References getConcKb(), getConcKf(), getNumKb(), getNumKf(), getNumPrd(), getNumSub(), Neutral::initCinfo(), prd(), prdOut(), process(), reacBaseCinfo, reinit(), setConcKb(), setConcKf(), setNumKb(), setNumKf(), sub(), and subOut().

Referenced by findParentComptOfReac(), ZombieReac::initCinfo(), and Reac::initCinfo().

34 {
36  // Field Definitions
39  "numKf",
40  "Forward rate constant, in # units",
43  );
44 
46  "numKb",
47  "Reverse rate constant, in # units",
50  );
51 
53  "Kf",
54  "Forward rate constant, in concentration units",
57  );
58 
60  "Kb",
61  "Reverse rate constant, in concentration units",
64  );
65 
67  "numSubstrates",
68  "Number of substrates of reaction",
70  );
71 
73  "numProducts",
74  "Number of products of reaction",
76  );
77 
79  // MsgDest Definitions
81  static DestFinfo process( "process",
82  "Handles process call",
84  static DestFinfo reinit( "reinit",
85  "Handles reinit call",
87 
89  // Shared Msg Definitions
91 
92  static DestFinfo subDest( "subDest",
93  "Handles # of molecules of substrate",
95  static DestFinfo prdDest( "prdDest",
96  "Handles # of molecules of product",
98  static Finfo* subShared[] = {
99  subOut(), &subDest
100  };
101  static Finfo* prdShared[] = {
102  prdOut(), &prdDest
103  };
104  static SharedFinfo sub( "sub",
105  "Connects to substrate pool",
106  subShared, sizeof( subShared ) / sizeof( const Finfo* )
107  );
108  static SharedFinfo prd( "prd",
109  "Connects to substrate pool",
110  prdShared, sizeof( prdShared ) / sizeof( const Finfo* )
111  );
112  static Finfo* procShared[] = {
113  &process, &reinit
114  };
115  static SharedFinfo proc( "proc",
116  "Shared message for process and reinit",
117  procShared, sizeof( procShared ) / sizeof( const Finfo* )
118  );
119 
120 
121  static Finfo* reacFinfos[] = {
122  &kf, // Value
123  &kb, // Value
124  &Kf, // Value
125  &Kb, // Value
126  &numSub, // ReadOnlyValue
127  &numPrd, // ReadOnlyValue
128  &sub, // SharedFinfo
129  &prd, // SharedFinfo
130  &proc, // SharedFinfo
131  };
132 
133  static string doc[] =
134  {
135  "Name", "ReacBase",
136  "Author", "Upinder S. Bhalla, 2012, NCBS",
137  "Description", "Base class for reactions. Provides the MOOSE API"
138  "functions, but ruthlessly refers almost all of them to derived"
139  "classes, which have to provide the man page output."
140  };
141 
142  static ZeroSizeDinfo< int> dinfo;
143  static Cinfo reacBaseCinfo (
144  "ReacBase",
146  reacFinfos,
147  sizeof( reacFinfos ) / sizeof ( Finfo* ),
148  &dinfo,
149  doc,
150  sizeof( doc ) / sizeof( string ),
151  true // Ban creation, this is an abstract base class.
152  );
153 
154  return &reacBaseCinfo;
155 }
unsigned int getNumSub(const Eref &e) const
Get number of substrates.
Definition: ReacBase.cpp:278
void sub(double v)
Definition: ReacBase.cpp:177
void setNumKb(const Eref &e, double v)
Definition: ReacBase.cpp:246
double getNumKb(const Eref &e) const
Definition: ReacBase.cpp:251
void prd(double v)
Definition: ReacBase.cpp:182
void reinit(const Eref &e, ProcPtr p)
Definition: ReacBase.cpp:192
static SrcFinfo2< double, double > * subOut()
Definition: ReacBase.cpp:17
void setConcKf(const Eref &e, double v)
set Kf in concentration units
Definition: ReacBase.cpp:258
double getNumKf(const Eref &e) const
Definition: ReacBase.cpp:241
void setConcKb(const Eref &e, double v)
set Kb in concentration units
Definition: ReacBase.cpp:268
unsigned int getNumPrd(const Eref &e) const
Get number of products.
Definition: ReacBase.cpp:286
Definition: OpFunc.h:27
double getConcKf(const Eref &e) const
get Kf in concentration units
Definition: ReacBase.cpp:263
double getConcKb(const Eref &e) const
get Kb in concentration units
Definition: ReacBase.cpp:273
static const Cinfo * initCinfo()
Definition: Neutral.cpp:16
static const Cinfo * reacBaseCinfo
Definition: ReacBase.cpp:157
void process(const Eref &e, ProcPtr p)
Definition: ReacBase.cpp:187
static SrcFinfo2< double, double > * prdOut()
Definition: ReacBase.cpp:25
Definition: Cinfo.h:18
void setNumKf(const Eref &e, double v)
Definition: ReacBase.cpp:236
Definition: Finfo.h:12

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ReacBase::prd ( double  v)

Definition at line 182 of file ReacBase.cpp.

References vPrd().

Referenced by initCinfo(), and ZombieReac::setSolver().

183 {
184  vPrd( v );
185 }
virtual void vPrd(double v)
Definition: ReacBase.cpp:212

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ReacBase::process ( const Eref e,
ProcPtr  p 
)

Definition at line 187 of file ReacBase.cpp.

References vProcess().

Referenced by initCinfo().

188 {
189  vProcess( e, p );
190 }
virtual void vProcess(const Eref &e, ProcPtr p)
Definition: ReacBase.cpp:217

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ReacBase::reinit ( const Eref e,
ProcPtr  p 
)

Definition at line 192 of file ReacBase.cpp.

References vReinit().

Referenced by initCinfo().

193 {
194  vReinit( e, p );
195 }
virtual void vReinit(const Eref &e, ProcPtr p)
Definition: ReacBase.cpp:222

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ReacBase::remesh ( const Eref e)

Definition at line 197 of file ReacBase.cpp.

References vRemesh().

198 {
199  vRemesh( e );
200 }
virtual void vRemesh(const Eref &e)
Definition: ReacBase.cpp:227

+ Here is the call graph for this function:

void ReacBase::setConcKb ( const Eref e,
double  v 
)

set Kb in concentration units

Definition at line 268 of file ReacBase.cpp.

References vSetConcKb().

Referenced by initCinfo(), and zombify().

269 {
270  vSetConcKb( e, v );
271 }
virtual void vSetConcKb(const Eref &e, double v)=0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ReacBase::setConcKf ( const Eref e,
double  v 
)

set Kf in concentration units

Definition at line 258 of file ReacBase.cpp.

References vSetConcKf().

Referenced by initCinfo(), and zombify().

259 {
260  vSetConcKf( e, v );
261 }
virtual void vSetConcKf(const Eref &e, double v)=0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ReacBase::setNumKb ( const Eref e,
double  v 
)

Definition at line 246 of file ReacBase.cpp.

References vSetNumKb().

Referenced by initCinfo().

247 {
248  vSetNumKb( e, v );
249 }
virtual void vSetNumKb(const Eref &e, double v)=0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ReacBase::setNumKf ( const Eref e,
double  v 
)

Definition at line 236 of file ReacBase.cpp.

References vSetNumKf().

Referenced by initCinfo().

237 {
238  vSetNumKf( e, v );
239 }
virtual void vSetNumKf(const Eref &e, double v)=0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ReacBase::setSolver ( Id  solver,
Id  orig 
)
virtual

Assign solver info.

Reimplemented in ZombieReac.

Definition at line 327 of file ReacBase.cpp.

Referenced by zombify().

328 {
329  ;
330 }

+ Here is the caller graph for this function:

void ReacBase::sub ( double  v)

Definition at line 177 of file ReacBase.cpp.

References vSub().

Referenced by initCinfo(), and ZombieReac::setSolver().

178 {
179  vSub( v );
180 }
virtual void vSub(double v)
Definition: ReacBase.cpp:207

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual double ReacBase::vGetConcKb ( const Eref e) const
pure virtual

Implemented in Reac, and ZombieReac.

Referenced by getConcKb().

+ Here is the caller graph for this function:

virtual double ReacBase::vGetConcKf ( const Eref e) const
pure virtual

Implemented in Reac, and ZombieReac.

Referenced by getConcKf().

+ Here is the caller graph for this function:

virtual double ReacBase::vGetNumKb ( const Eref e) const
pure virtual

Implemented in Reac, and ZombieReac.

Referenced by getNumKb().

+ Here is the caller graph for this function:

virtual double ReacBase::vGetNumKf ( const Eref e) const
pure virtual

Implemented in Reac, and ZombieReac.

Referenced by getNumKf().

+ Here is the caller graph for this function:

void ReacBase::vPrd ( double  v)
virtual

Reimplemented in Reac.

Definition at line 212 of file ReacBase.cpp.

Referenced by prd().

213 {
214  ;
215 }

+ Here is the caller graph for this function:

void ReacBase::vProcess ( const Eref e,
ProcPtr  p 
)
virtual

Reimplemented in Reac.

Definition at line 217 of file ReacBase.cpp.

Referenced by process().

218 {
219  ;
220 }

+ Here is the caller graph for this function:

void ReacBase::vReinit ( const Eref e,
ProcPtr  p 
)
virtual

Reimplemented in Reac.

Definition at line 222 of file ReacBase.cpp.

Referenced by reinit().

223 {
224  ;
225 }

+ Here is the caller graph for this function:

void ReacBase::vRemesh ( const Eref e)
virtual

Reimplemented in Reac.

Definition at line 227 of file ReacBase.cpp.

Referenced by remesh().

228 {
229  ;
230 }

+ Here is the caller graph for this function:

virtual void ReacBase::vSetConcKb ( const Eref e,
double  v 
)
pure virtual

Implemented in Reac, and ZombieReac.

Referenced by setConcKb().

+ Here is the caller graph for this function:

virtual void ReacBase::vSetConcKf ( const Eref e,
double  v 
)
pure virtual

Implemented in Reac, and ZombieReac.

Referenced by setConcKf().

+ Here is the caller graph for this function:

virtual void ReacBase::vSetNumKb ( const Eref e,
double  v 
)
pure virtual

Implemented in Reac, and ZombieReac.

Referenced by setNumKb().

+ Here is the caller graph for this function:

virtual void ReacBase::vSetNumKf ( const Eref e,
double  v 
)
pure virtual

Implemented in Reac, and ZombieReac.

Referenced by setNumKf().

+ Here is the caller graph for this function:

void ReacBase::vSub ( double  v)
virtual

Reimplemented in Reac.

Definition at line 207 of file ReacBase.cpp.

Referenced by sub().

208 {
209  ;
210 }

+ Here is the caller graph for this function:

void ReacBase::zombify ( Element original,
const Cinfo zClass,
Id  solver 
)
static

Zombification functions.

Definition at line 299 of file ReacBase.cpp.

References Element::cinfo(), Eref::data(), getConcKb(), getConcKf(), Element::id(), Element::localDataStart(), Element::numLocalData(), setConcKb(), setConcKf(), setSolver(), and Element::zombieSwap().

Referenced by Stoich::unZombifyModel(), and Stoich::zombifyModel().

300 {
301  if ( orig->cinfo() == zClass )
302  return;
303  unsigned int start = orig->localDataStart();
304  unsigned int num = orig->numLocalData();
305  if ( num == 0 )
306  return;
307  vector< double > concKf( num, 0.0 );
308  vector< double > concKb( num, 0.0 );
309  for ( unsigned int i = 0; i < num; ++i ) {
310  Eref er( orig, i + start );
311  const ReacBase* rb =
312  reinterpret_cast< const ReacBase* >( er.data() );
313  concKf[ i ] = rb->getConcKf( er );
314  concKb[ i ] = rb->getConcKb( er );
315  }
316  orig->zombieSwap( zClass );
317  for ( unsigned int i = 0; i < num; ++i ) {
318  Eref er( orig, i + start );
319  ReacBase* rb = reinterpret_cast< ReacBase* >( er.data() );
320  rb->setSolver( solver, orig->id() );
321  rb->setConcKf( er, concKf[i] );
322  rb->setConcKb( er, concKb[i] );
323  }
324 }
void setConcKf(const Eref &e, double v)
set Kf in concentration units
Definition: ReacBase.cpp:258
void setConcKb(const Eref &e, double v)
set Kb in concentration units
Definition: ReacBase.cpp:268
Definition: Eref.h:26
double getConcKf(const Eref &e) const
get Kf in concentration units
Definition: ReacBase.cpp:263
virtual void setSolver(Id solver, Id orig)
Assign solver info.
Definition: ReacBase.cpp:327
double getConcKb(const Eref &e) const
get Kb in concentration units
Definition: ReacBase.cpp:273

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation


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