Main Page | Class Hierarchy | Class List | File List | Class Members

ecco::Law Class Reference

#include <law.hpp>

Inheritance diagram for ecco::Law:

Inheritance graph
[legend]
Collaboration diagram for ecco::Law:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Law (const uint_t &dim, const uint_t &index)
 dim = total number of species, index = reaction index

uint_t dim () const
virtual uint_t index () const
virtual double value (const std::vector< double > &concs, const double &p=0)=0
virtual std::vector< double > grad (const std::vector< double > &concs, const double &p=0)=0
virtual void grad (std::vector< double > &grad, const std::vector< double > &concs, const double &p=0)=0
virtual double partial (const uint_t &s, const std::vector< double > &concs, const double &p=0)=0
virtual double value_dp (const std::vector< double > &concs, const double &p=0)
virtual std::string name () const=0
virtual ReactionParametersparameters () const
 get reaction parameters of the law

virtual void add (const int &scalar, Law *law)=0
 composite pattern: add "scalar*Law" to current law


Protected Member Functions

 Law (const uint_t &dim, const uint_t &index, ReactionParameters *params)

Protected Attributes

const uint_t _dim
 dimension of concentration space = number of species

const uint_t _index
 law index = reaction index

ReactionParameters_params
 parameters


Static Protected Attributes

const double EPSILON = std::numeric_limits<double>::epsilon()

Detailed Description

Laws represent rate laws or equilibrium laws. Mathematically, such a law can be regarded as a scalar function,

f(c0,c1,...,c_{dim-1}) : R^N x I --> R

or for potential dependent laws

f(c0,c1,...,c_{dim-1},p) : R^N x I --> R

that maps (dimensionless) concentration values from a domain D = [0,1]^N to a real number. In the context of Ecco, the (unsigned) integer 'dim' is equivalent to the total number of different species occuring in the reaction network. Depending on the actual concentration value of the species, the law provides both the value and the gradient. Note that the gradient is a 1xdim vector containing the partial concentration derivatives with respect to all species occuring in the reaction mechanism and not only to those occuring in the law (other values are zero). The indices of the partial derivatives correspond to the indices of the species. Heterogeneous rate laws can be supplied with an excitation function.

Definition at line 66 of file law.hpp.


Member Function Documentation

uint_t ecco::Law::dim  )  const [inline]
 

returns dimension of the concentration space (equals the total number of different species within the reaction mechanism)

Definition at line 132 of file law.hpp.

References _dim.

Referenced by ecco::CompositeLaw::add().

virtual void ecco::Law::grad std::vector< double > &  grad,
const std::vector< double > &  concs,
const double &  p = 0
[pure virtual]
 

evaluate gradient df/dc(c0,c1,....,p) Note that the values within 'concs' need to be ordered by the species indices 0,1,...,dim-1.

Implemented in ecco::ButlerVolmer, ecco::CompositeLaw, ecco::GenericRateLaw, ecco::IrrPowerRateLaw, ecco::Langmuir, ecco::LangmuirKinetics, ecco::LawOfMassAction, ecco::PowerRateLaw, ecco::RevPowerRateLaw, and ecco::ZeroLaw.

virtual std::vector<double> ecco::Law::grad const std::vector< double > &  concs,
const double &  p = 0
[pure virtual]
 

evaluate gradient df/dc(c0,c1,....,p). Note that the values within 'concs' need to be ordered by the species indices 0,1,...,dim-1.

Implemented in ecco::ButlerVolmer, ecco::CompositeLaw, ecco::GenericRateLaw, ecco::IrrPowerRateLaw, ecco::Langmuir, ecco::LangmuirKinetics, ecco::LawOfMassAction, ecco::PowerRateLaw, ecco::RevPowerRateLaw, and ecco::ZeroLaw.

uint_t ecco::Law::index  )  const [inline, virtual]
 

returns the index of the law within the reaction network = index of corresponding reaction

Definition at line 138 of file law.hpp.

virtual std::string ecco::Law::name  )  const [pure virtual]
 

get name of law: "ButlerVolmer", "LawOfMassAction", "RevPowerRateLaw", "IrrPowerRateLaw", "Langmuir", "LangmuirKinetics", "ZeroLaw", "GenericRateLaw: <name of generic rate>", "CompositeLaw ... <concatenated string>"

Implemented in ecco::ButlerVolmer, ecco::CompositeLaw, ecco::GenericRateLaw, ecco::IrrPowerRateLaw, ecco::Langmuir, ecco::LangmuirKinetics, ecco::LawOfMassAction, ecco::PowerRateLaw, ecco::RevPowerRateLaw, and ecco::ZeroLaw.

Referenced by ecco::CompositeLaw::add().

virtual double ecco::Law::partial const uint_t &  s,
const std::vector< double > &  concs,
const double &  p = 0
[pure virtual]
 

evaluates partial derivative with respect to species with index s, df/dc_s(c0,c1,...,p). Note that the values within 'concs' need to be ordered by the species indices 0,1,...,dim-1.

Implemented in ecco::ButlerVolmer, ecco::CompositeLaw, ecco::GenericRateLaw, ecco::IrrPowerRateLaw, ecco::Langmuir, ecco::LangmuirKinetics, ecco::LawOfMassAction, ecco::PowerRateLaw, ecco::RevPowerRateLaw, and ecco::ZeroLaw.

virtual double ecco::Law::value const std::vector< double > &  concs,
const double &  p = 0
[pure virtual]
 

evaluate function f(c0,c1,...,p) Note that the values within 'concs' need to be ordered by the species indices 0,1,...,dim-1.

Implemented in ecco::ButlerVolmer, ecco::CompositeLaw, ecco::GenericRateLaw, ecco::IrrPowerRateLaw, ecco::Langmuir, ecco::LangmuirKinetics, ecco::LawOfMassAction, ecco::PowerRateLaw, ecco::RevPowerRateLaw, and ecco::ZeroLaw.

double ecco::Law::value_dp const std::vector< double > &  concs,
const double &  p = 0
[inline, virtual]
 

evaluates potential derivative df/dp(c0,c1,...,p) Note that the values within 'concs' need to be ordered by the species indices 0,1,...,dim-1.

Reimplemented in ecco::ButlerVolmer, and ecco::CompositeLaw.

Definition at line 152 of file law.hpp.


The documentation for this class was generated from the following files:
Generated on Mon Dec 18 16:29:20 2006 for Ecco by doxygen 1.3.6