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

#include <RateTerm.h>

+ Inheritance diagram for NOrder:
+ Collaboration diagram for NOrder:

Public Member Functions

RateTermcopyWithVolScaling (double vol, double sub, double prd) const
 
unsigned int getReactants (vector< unsigned int > &molIndex) const
 
 NOrder (double k, vector< unsigned int > v)
 
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)
 
- 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 ()
 

Protected Attributes

vector< unsigned int > v_
 
- Protected Attributes inherited from ZeroOrder
double k_
 

Additional Inherited Members

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

Detailed Description

Definition at line 472 of file RateTerm.h.

Constructor & Destructor Documentation

NOrder::NOrder ( double  k,
vector< unsigned int >  v 
)
inline

Definition at line 475 of file RateTerm.h.

Referenced by copyWithVolScaling().

476  : ZeroOrder( k ), v_( v )
477  {;}
ZeroOrder(double k)
Definition: RateTerm.h:257
vector< unsigned int > v_
Definition: RateTerm.h:512

+ Here is the caller graph for this function:

Member Function Documentation

RateTerm* NOrder::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.

Reimplemented in StochNOrder.

Definition at line 503 of file RateTerm.h.

References ZeroOrder::k_, NA, NOrder(), and v_.

505  {
506  assert( v_.size() > 0 );
507  double ratio = sub * pow( NA * vol, (int)( v_.size() ) - 1 );
508  return new NOrder( k_ / ratio, v_ );
509  }
double k_
Definition: RateTerm.h:311
const double NA
Definition: consts.cpp:15
NOrder(double k, vector< unsigned int > v)
Definition: RateTerm.h:475
vector< unsigned int > v_
Definition: RateTerm.h:512

+ Here is the call graph for this function:

unsigned int NOrder::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 489 of file RateTerm.h.

References v_.

489  {
490  molIndex = v_;
491  return v_.size();
492  }
vector< unsigned int > v_
Definition: RateTerm.h:512
double NOrder::operator() ( const double *  S) const
inlinevirtual

Computes the rate. The argument is the molecule array.

Reimplemented from ZeroOrder.

Reimplemented in StochNOrder.

Definition at line 479 of file RateTerm.h.

References ZeroOrder::k_, and v_.

479  {
480  double ret = k_;
481  vector< unsigned int >::const_iterator i;
482  for ( i = v_.begin(); i != v_.end(); i++) {
483  assert( !std::isnan( S[ *i ] ) );
484  ret *= S[ *i ];
485  }
486  return ret;
487  }
double k_
Definition: RateTerm.h:311
vector< unsigned int > v_
Definition: RateTerm.h:512
void NOrder::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 494 of file RateTerm.h.

References ZeroOrder::k_, and v_.

496  {
497  for ( unsigned int i = 1; i < v_.size(); ++i ) {
498  if ( comptIndex == compartmentLookup[ v_[i] ] )
499  k_ /= ratio;
500  }
501  }
double k_
Definition: RateTerm.h:311
vector< unsigned int > v_
Definition: RateTerm.h:512

Member Data Documentation

vector< unsigned int > NOrder::v_
protected

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