|
C API Documentation
|
A RoadRunner integrator based on CVODE; serves as RoadRunner's main integrator for ODEs. More...
#include <CVODEIntegrator.h>
Public Member Functions | |
| CVODEIntegrator (ExecutableModel *oModel) | |
| Constructor: takes an executable model, does not own the pointer. More... | |
| ~CVODEIntegrator () override | |
| Destructor. More... | |
| void | syncWithModel (ExecutableModel *m) override |
| Called whenever a new model is loaded to allow integrator to reset internal state. More... | |
| void | loadConfigSettings () override |
| void | loadSBMLSettings (const std::string &filename) override |
| Load an SBML settings file and apply the configuration options. More... | |
| std::string | getName () const override |
| Get the name for this integrator. More... | |
| std::string | getDescription () const override |
| Get the description for this integrator. More... | |
| std::string | getHint () const override |
| Get the hint for this integrator. More... | |
| IntegrationMethod | getIntegrationMethod () const override |
| Always deterministic for CVODE. More... | |
| void | setValue (std::string setting, const Variant &value) override |
| Sets the value of an integrator setting (e.g. absolute_tolerance) More... | |
| void | setIndividualTolerance (string sid, double value) override |
| Sets tolerance for individual species. More... | |
| void | setConcentrationTolerance (const Variant &value) override |
| Sets tolerance based on concentration of species. More... | |
| std::vector< double > | getConcentrationTolerance () override |
| Gets tolerance based on concentration of species. More... | |
| void | resetSettings () override |
| Reset all integrator settings to their respective default values. More... | |
| void | tweakTolerances () override |
| Fix tolerances for SBML tests. More... | |
| double | integrate (double t0, double tf) override |
| Main integration routine. More... | |
| void | restart (double timeStart) override |
| Reset time to zero and reinitialize model. More... | |
| IntegratorListenerPtr | getListener () override |
| Gets the integrator listener. More... | |
| void | setListener (IntegratorListenerPtr) override |
| Sets the integrator listener. More... | |
| void | checkType () const |
| Does a RT type check which throws if it fails, EVEN IF RTTI IS DISABLED. More... | |
| void | checkVectorSize (int expected, size_t real) const |
| Does a size check which throws if it fails. More... | |
| void | checkIndex (int index, int size) const |
| Does a index check which throws if it is out of bound. More... | |
| std::string | ToString (int val) const |
| Converts integer to string for error print. More... | |
| std::string | ToString (size_t val) const |
| Converts size_t to string for error print. More... | |
| std::string | cvodeDecodeError (int cvodeError, bool exInfo=true) |
| decode the cvode error code to a string | |
| N_Vector | getStateVector () const |
| getter for the internal state vector More... | |
| SUNNonlinearSolver | getSolver () const |
| getter for the internal Sundials linear solver object More... | |
| void * | getCvodeMemory () const |
| getter for the internal CVode memory buffer More... | |
Public Member Functions inherited from rr::Integrator | |
| std::string | toString () const |
| Return a string representation of the solver. More... | |
| virtual std::string | toRepr () const |
| Return string representation a la Python repr method. More... | |
| virtual void | setValue (std::string key, const Variant &value) |
Public Member Functions inherited from rr::Solver | |
| std::vector< std::string > | getSettings () const |
| Get a list of all settings for this solver. More... | |
| virtual Variant | getValue (std::string key) const |
| Get the value of an integrator setting. More... | |
| virtual Variant | hasValue (std::string key) const |
| Return true if this setting is supported by the integrator. More... | |
| virtual size_t | getNumParams () const |
| Get the number of parameters. More... | |
| virtual std::string | getParamName (size_t n) const |
| Get the name of the parameter at index n. More... | |
| virtual std::string | getParamDisplayName (int n) const |
| Get the display name of the parameter at index n. More... | |
| virtual std::string | getParamHint (int n) const |
| Get the hint of the parameter at index n. More... | |
| virtual std::string | getParamDesc (int n) const |
| Get the description of the parameter at index n. More... | |
| virtual int | getValueAsInt (std::string key) |
| Wrapper for getValue which converts output to a specific type. More... | |
| virtual unsigned int | getValueAsUInt (std::string key) |
| Wrapper for getValue which converts output to a specific type. More... | |
| virtual long | getValueAsLong (std::string key) |
| Wrapper for getValue which converts output to a specific type. More... | |
| virtual unsigned long | getValueAsULong (std::string key) |
| Wrapper for getValue which converts output to a specific type. More... | |
| virtual float | getValueAsFloat (std::string key) |
| Wrapper for getValue which converts output to a specific type. More... | |
| virtual double | getValueAsDouble (std::string key) |
| Wrapper for getValue which converts output to a specific type. More... | |
| virtual std::vector< double > | getValueAsDoubleVector (std::string key) |
| Wrapper for getValue which converts output to a specific type. | |
| virtual char | getValueAsChar (std::string key) |
| Wrapper for getValue which converts output to a specific type. More... | |
| virtual unsigned char | getValueAsUChar (std::string key) |
| Wrapper for getValue which converts output to a specific type. More... | |
| virtual std::string | getValueAsString (std::string key) |
| Wrapper for getValue which converts output to a specific type. More... | |
| virtual bool | getValueAsBool (std::string key) |
| Wrapper for getValue which converts output to a specific type. More... | |
| const std::string & | getDisplayName (std::string key) const |
| Gets the hint associated with a given key. More... | |
| const std::string & | getHint (std::string key) const |
| Gets the hint associated with a given key. More... | |
| const std::string & | getDescription (std::string key) const |
| Gets the description associated with a given key. More... | |
| const Variant::TypeId | getType (std::string key) |
| Gets the type associated with a given key. More... | |
| std::string | getSettingsRepr () const |
| Get the solver settings as a string. More... | |
| std::string | settingsPyDictRepr () const |
| Python dictionary-style string representation of settings. More... | |
Static Public Member Functions | |
| static std::string | getCVODEIntegratorName () |
| Get the name for this integrator. More... | |
| static std::string | getCVODEIntegratorDescription () |
| Get the description for this integrator. More... | |
| static std::string | getCVODEIntegratorHint () |
| Get the hint for this integrator. More... | |
Friends | |
| int | cvodeDyDtFcn (double t, N_Vector cv_y, N_Vector cv_ydot, void *f_data) |
| int | cvodeRootFcn (double t, N_Vector y, double *gout, void *g_data) |
Additional Inherited Members | |
Public Types inherited from rr::Integrator | |
| enum | IntegrationMethod { Deterministic , Stochastic , Hybrid , Other } |
Protected Types inherited from rr::Solver | |
| typedef std::vector< std::string > | SettingsList |
| typedef RR_UNORDERED_MAP< std::string, Variant > | SettingsMap |
| typedef RR_UNORDERED_MAP< std::string, std::string > | DisplayNameMap |
| typedef RR_UNORDERED_MAP< std::string, std::string > | HintMap |
| typedef RR_UNORDERED_MAP< std::string, std::string > | DescriptionMap |
Protected Member Functions inherited from rr::Solver | |
| void | addSetting (std::string name, Variant val, string display_name, std::string hint, std::string description) |
Protected Attributes inherited from rr::Solver | |
| SettingsList | sorted_settings |
| SettingsMap | settings |
| DisplayNameMap | display_names_ |
| HintMap | hints |
| DescriptionMap | descriptions |
A RoadRunner integrator based on CVODE; serves as RoadRunner's main integrator for ODEs.
Provides a wrapper around CVODE from the SUNDIALS suite. CVODE has two main solvers: an Adams-Moulton solver for non-stiff problems, and a backward differentiation formula (BDF) solver for stiff problems. See: https://computation.llnl.gov/casc/sundials/documentation/toms_sundials.pdf
|
explicit |
Constructor: takes an executable model, does not own the pointer.
|
override |
Destructor.
| void rr::CVODEIntegrator::checkIndex | ( | int | index, |
| int | size | ||
| ) | const |
Does a index check which throws if it is out of bound.
| void rr::CVODEIntegrator::checkType | ( | ) | const |
Does a RT type check which throws if it fails, EVEN IF RTTI IS DISABLED.
| void rr::CVODEIntegrator::checkVectorSize | ( | int | expected, |
| size_t | real | ||
| ) | const |
Does a size check which throws if it fails.
|
overridevirtual |
Gets tolerance based on concentration of species.
Reimplemented from rr::Integrator.
|
static |
Get the description for this integrator.
|
static |
Get the hint for this integrator.
|
static |
Get the name for this integrator.
| void* rr::CVODEIntegrator::getCvodeMemory | ( | ) | const |
getter for the internal CVode memory buffer
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
Always deterministic for CVODE.
Implements rr::Integrator.
|
overridevirtual |
Gets the integrator listener.
Implements rr::Integrator.
|
overridevirtual |
| SUNNonlinearSolver rr::CVODEIntegrator::getSolver | ( | ) | const |
getter for the internal Sundials linear solver object
| N_Vector rr::CVODEIntegrator::getStateVector | ( | ) | const |
getter for the internal state vector
|
overridevirtual |
Main integration routine.
Implements rr::Integrator.
|
overridevirtual |
Load an SBML settings file and apply the configuration options.
Reimplemented from rr::Integrator.
|
overridevirtual |
Reset all integrator settings to their respective default values.
Reimplemented from rr::Solver.
|
overridevirtual |
Reset time to zero and reinitialize model.
Applies events which occur before time zero. Reinitializes CVODE and the executable model.
Implements rr::Integrator.
|
overridevirtual |
Sets tolerance based on concentration of species.
First converts the concentration tolerances to amount tolerances by multiplying the compartment volume of species. Whichever is smaller will be stored as absolute_tolerance and used in the integration process.
Reimplemented from rr::Integrator.
|
overridevirtual |
Sets tolerance for individual species.
Reimplemented from rr::Integrator.
|
overridevirtual |
Sets the integrator listener.
Implements rr::Integrator.
|
overridevirtual |
Sets the value of an integrator setting (e.g. absolute_tolerance)
Reimplemented from rr::Solver.
|
overridevirtual |
Called whenever a new model is loaded to allow integrator to reset internal state.
Reimplemented from rr::Integrator.
| std::string rr::CVODEIntegrator::ToString | ( | int | val | ) | const |
Converts integer to string for error print.
| std::string rr::CVODEIntegrator::ToString | ( | size_t | val | ) | const |
Converts size_t to string for error print.
|
overridevirtual |
Fix tolerances for SBML tests.
In order to ensure that the results of the SBML test suite remain valid, this method enforces a lower bound on tolerance values. Sets minimum absolute and relative tolerances to Config::CVODE_MIN_ABSOLUTE and Config::CVODE_MIN_RELATIVE resp.
Reimplemented from rr::Integrator.