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

#include <RateTerm.h>

+ Inheritance diagram for SecondOrder:
+ Collaboration diagram for SecondOrder:

Public Member Functions

RateTermcopyWithVolScaling (double vol, double sub, double prd) const
 
unsigned int getReactants (vector< unsigned int > &molIndex) const
 
double operator() (const double *S) const
 Computes the rate. The argument is the molecule array. More...
 
void rescaleVolume (short comptIndex, const vector< short > &compartmentLookup, double ratio)
 
 SecondOrder (double k, unsigned int y1, unsigned int y2)
 
- Public Member Functions inherited from ZeroOrder
double getR1 () const
 Used by Zombie to return rate terms. More...
 
double getR2 () const
 Used by Zombie to return rate terms. More...
 
void setK (double k)
 
void setR1 (double k1)
 Used by Zombie to assign rate terms. More...
 
void setR2 (double k2)
 Used by Zombie to assign rate terms. More...
 
void setRates (double k1, double k2)
 
 ZeroOrder (double k)
 
- Public Member Functions inherited from RateTerm
 RateTerm ()
 
virtual ~RateTerm ()
 

Private Attributes

unsigned int y1_
 
unsigned int y2_
 

Additional Inherited Members

- Static Public Attributes inherited from RateTerm
static const double EPSILON = 1.0e-6
 
- Protected Attributes inherited from ZeroOrder
double k_
 

Detailed Description

Definition at line 387 of file RateTerm.h.

Constructor & Destructor Documentation

SecondOrder::SecondOrder ( double  k,
unsigned int  y1,
unsigned int  y2 
)
inline

Definition at line 390 of file RateTerm.h.

Referenced by copyWithVolScaling().

391  : ZeroOrder( k ), y1_( y1 ), y2_( y2 )
392  {;}
ZeroOrder(double k)
Definition: RateTerm.h:257
unsigned int y1_
Definition: RateTerm.h:423
unsigned int y2_
Definition: RateTerm.h:424

+ Here is the caller graph for this function:

Member Function Documentation

RateTerm* SecondOrder::copyWithVolScaling ( double  vol,
double  sub,
double  prd 
) const
inlinevirtual

Duplicates rate term and then applies volume scaling. Arguments are volume of reference voxel, product of vol/refVol for all substrates: applied to R1 product of vol/refVol for all products: applied to R2

Note that unless the reaction is cross-compartment, the vol/refVol will be one.

Reimplemented from ZeroOrder.

Definition at line 415 of file RateTerm.h.

References ZeroOrder::k_, NA, SecondOrder(), y1_, and y2_.

417  {
418  double ratio = sub * vol * NA;
419  return new SecondOrder( k_ / ratio, y1_, y2_ );
420  }
double k_
Definition: RateTerm.h:311
const double NA
Definition: consts.cpp:15
unsigned int y1_
Definition: RateTerm.h:423
unsigned int y2_
Definition: RateTerm.h:424
SecondOrder(double k, unsigned int y1, unsigned int y2)
Definition: RateTerm.h:390

+ Here is the call graph for this function:

unsigned int SecondOrder::getReactants ( vector< unsigned int > &  molIndex) const
inlinevirtual

This function finds the reactant indices in the vector S. It returns the number of substrates found, which are the first entries in molIndex. The products are the remaining ones. Note that it does NOT find products for unidirectional reactions, which is a bit of a problem.

Reimplemented from ZeroOrder.

Definition at line 400 of file RateTerm.h.

References y1_, and y2_.

400  {
401  molIndex.resize( 2 );
402  molIndex[0] = y1_;
403  molIndex[1] = y2_;
404  return 2;
405  }
unsigned int y1_
Definition: RateTerm.h:423
unsigned int y2_
Definition: RateTerm.h:424
double SecondOrder::operator() ( const double *  S) const
inlinevirtual

Computes the rate. The argument is the molecule array.

Reimplemented from ZeroOrder.

Definition at line 394 of file RateTerm.h.

References ZeroOrder::k_, y1_, and y2_.

394  {
395  assert( !std::isnan( S[ y1_ ] ) );
396  assert( !std::isnan( S[ y2_ ] ) );
397  return k_ * S[ y1_ ] * S[ y2_ ];
398  }
double k_
Definition: RateTerm.h:311
unsigned int y1_
Definition: RateTerm.h:423
unsigned int y2_
Definition: RateTerm.h:424
void SecondOrder::rescaleVolume ( short  comptIndex,
const vector< short > &  compartmentLookup,
double  ratio 
)
inlinevirtual

This is used to rescale the RateTerm kinetics when the compartment volume changes. This is needed because the kinetics are in extensive units, that is, mol numbers, rather than in intensive units like concentration. So when the volume changes the rate terms change. Each Rate term checks if any of its reactant molecules are affected, and if so, rescales. Ratio is newVol / oldVol

Reimplemented from ZeroOrder.

Definition at line 407 of file RateTerm.h.

References ZeroOrder::k_, y1_, and y2_.

409  {
410  if ( comptIndex == compartmentLookup[ y1_ ] ||
411  comptIndex == compartmentLookup[ y2_ ] )
412  k_ /= ratio;
413  }
double k_
Definition: RateTerm.h:311
unsigned int y1_
Definition: RateTerm.h:423
unsigned int y2_
Definition: RateTerm.h:424

Member Data Documentation

unsigned int SecondOrder::y1_
private

Definition at line 423 of file RateTerm.h.

Referenced by copyWithVolScaling(), getReactants(), operator()(), and rescaleVolume().

unsigned int SecondOrder::y2_
private

Definition at line 424 of file RateTerm.h.

Referenced by copyWithVolScaling(), getReactants(), operator()(), and rescaleVolume().


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