#include <law.hpp>
Inheritance diagram for ecco::Law:
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 ReactionParameters * | parameters () 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() |
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.
|
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(). |
|
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. |
|
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. |
|
returns the index of the law within the reaction network = index of corresponding reaction |
|
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(). |
|
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. |
|
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. |
|
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. |