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

#include <RateTerm.h>

+ Inheritance diagram for BidirectionalReaction:
+ Collaboration diagram for BidirectionalReaction:

Public Member Functions

 BidirectionalReaction (ZeroOrder *forward, ZeroOrder *backward)
 
RateTermcopyWithVolScaling (double vol, double sub, double prd) const
 
double getR1 () const
 Used by Zombie to return rate terms. More...
 
double getR2 () const
 Used by Zombie to return rate terms. More...
 
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)
 
void setR1 (double kf)
 Used by Zombie to assign rate terms. More...
 
void setR2 (double kb)
 Used by Zombie to assign rate terms. More...
 
void setRates (double kf, double kb)
 
 ~BidirectionalReaction ()
 
- Public Member Functions inherited from RateTerm
 RateTerm ()
 
virtual ~RateTerm ()
 

Private Attributes

ZeroOrderbackward_
 
ZeroOrderforward_
 

Additional Inherited Members

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

Detailed Description

Definition at line 541 of file RateTerm.h.

Constructor & Destructor Documentation

BidirectionalReaction::BidirectionalReaction ( ZeroOrder forward,
ZeroOrder backward 
)
inline

Definition at line 544 of file RateTerm.h.

Referenced by copyWithVolScaling().

546  : forward_( forward ), backward_( backward )
547  { // Here we allocate internal forward and backward terms
548  // with the correct number of args.
549  ;
550  }
ZeroOrder * forward_
Definition: RateTerm.h:608
ZeroOrder * backward_
Definition: RateTerm.h:609

+ Here is the caller graph for this function:

BidirectionalReaction::~BidirectionalReaction ( )
inline

Definition at line 551 of file RateTerm.h.

References backward_, and forward_.

552  {
553  delete forward_;
554  delete backward_;
555  }
ZeroOrder * forward_
Definition: RateTerm.h:608
ZeroOrder * backward_
Definition: RateTerm.h:609

Member Function Documentation

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

Implements RateTerm.

Definition at line 597 of file RateTerm.h.

References backward_, BidirectionalReaction(), ZeroOrder::copyWithVolScaling(), and forward_.

599  {
600  ZeroOrder* f = static_cast< ZeroOrder* >(
601  forward_->copyWithVolScaling( vol, sub, 1 ) );
602  ZeroOrder* b = static_cast< ZeroOrder* >(
603  backward_->copyWithVolScaling( vol, prd, 1 ) );
604  return new BidirectionalReaction( f, b );
605  }
ZeroOrder * forward_
Definition: RateTerm.h:608
BidirectionalReaction(ZeroOrder *forward, ZeroOrder *backward)
Definition: RateTerm.h:544
ZeroOrder * backward_
Definition: RateTerm.h:609
RateTerm * copyWithVolScaling(double vol, double sub, double prd) const
Definition: RateTerm.h:305

+ Here is the call graph for this function:

double BidirectionalReaction::getR1 ( ) const
inlinevirtual

Used by Zombie to return rate terms.

Implements RateTerm.

Definition at line 574 of file RateTerm.h.

References forward_, and ZeroOrder::getR1().

574  {
575  return forward_->getR1();
576  }
ZeroOrder * forward_
Definition: RateTerm.h:608
double getR1() const
Used by Zombie to return rate terms.
Definition: RateTerm.h:286

+ Here is the call graph for this function:

double BidirectionalReaction::getR2 ( ) const
inlinevirtual

Used by Zombie to return rate terms.

Implements RateTerm.

Definition at line 578 of file RateTerm.h.

References backward_, and ZeroOrder::getR1().

578  {
579  return backward_->getR1();
580  }
double getR1() const
Used by Zombie to return rate terms.
Definition: RateTerm.h:286
ZeroOrder * backward_
Definition: RateTerm.h:609

+ Here is the call graph for this function:

unsigned int BidirectionalReaction::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.

Implements RateTerm.

Definition at line 582 of file RateTerm.h.

References backward_, forward_, and ZeroOrder::getReactants().

582  {
583  forward_->getReactants( molIndex );
584  unsigned int ret = molIndex.size();
585  vector< unsigned int > temp;
586  backward_->getReactants( temp );
587  molIndex.insert( molIndex.end(), temp.begin(), temp.end() );
588  return ret;
589  }
ZeroOrder * forward_
Definition: RateTerm.h:608
unsigned int getReactants(vector< unsigned int > &molIndex) const
Definition: RateTerm.h:294
ZeroOrder * backward_
Definition: RateTerm.h:609

+ Here is the call graph for this function:

double BidirectionalReaction::operator() ( const double *  S) const
inlinevirtual

Computes the rate. The argument is the molecule array.

Implements RateTerm.

Definition at line 557 of file RateTerm.h.

References backward_, and forward_.

557  {
558  return (*forward_)( S ) - (*backward_)( S );
559  }
ZeroOrder * forward_
Definition: RateTerm.h:608
ZeroOrder * backward_
Definition: RateTerm.h:609
void BidirectionalReaction::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

Implements RateTerm.

Definition at line 591 of file RateTerm.h.

References backward_, forward_, and ZeroOrder::rescaleVolume().

593  {
594  forward_->rescaleVolume( comptIndex, compartmentLookup, ratio );
595  backward_->rescaleVolume( comptIndex, compartmentLookup, ratio);
596  }
ZeroOrder * forward_
Definition: RateTerm.h:608
void rescaleVolume(short comptIndex, const vector< short > &compartmentLookup, double ratio)
Definition: RateTerm.h:299
ZeroOrder * backward_
Definition: RateTerm.h:609

+ Here is the call graph for this function:

void BidirectionalReaction::setR1 ( double  k1)
inlinevirtual

Used by Zombie to assign rate terms.

Implements RateTerm.

Definition at line 566 of file RateTerm.h.

References forward_, and ZeroOrder::setK().

566  {
567  forward_->setK( kf );
568  }
ZeroOrder * forward_
Definition: RateTerm.h:608
void setK(double k)
Definition: RateTerm.h:268

+ Here is the call graph for this function:

void BidirectionalReaction::setR2 ( double  k2)
inlinevirtual

Used by Zombie to assign rate terms.

Implements RateTerm.

Definition at line 570 of file RateTerm.h.

References backward_, and ZeroOrder::setK().

570  {
571  backward_->setK( kb );
572  }
void setK(double k)
Definition: RateTerm.h:268
ZeroOrder * backward_
Definition: RateTerm.h:609

+ Here is the call graph for this function:

void BidirectionalReaction::setRates ( double  k1,
double  k2 
)
inlinevirtual

Assign the rates.

Implements RateTerm.

Definition at line 561 of file RateTerm.h.

References backward_, forward_, and ZeroOrder::setK().

561  {
562  forward_->setK( kf );
563  backward_->setK( kb );
564  }
ZeroOrder * forward_
Definition: RateTerm.h:608
void setK(double k)
Definition: RateTerm.h:268
ZeroOrder * backward_
Definition: RateTerm.h:609

+ Here is the call graph for this function:

Member Data Documentation

ZeroOrder* BidirectionalReaction::backward_
private
ZeroOrder* BidirectionalReaction::forward_
private

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