2.0.0b10
catchment modelling framework
Loading...
Searching...
No Matches
CVodeBase Class Referenceabstract

Abstract base class for different modes of the CVode solver. More...

+ Inheritance diagram for CVodeBase:
+ Collaboration diagram for CVodeBase:

Detailed Description

Abstract base class for different modes of the CVode solver.

Initantiate one of the child classes to gain different modes of the CVode solver

Public Member Functions

virtual cmf::math::num_array _get_jacobian () const
 Returns a continuous 1D array representing the Jacobian columns concatenated.
 
CVodeBasecopy () const override=0
 Returns a copy of the solver.
 
cmf::math::num_array get_error () const
 Error vector of the integrator.
 
CVodeInfo get_info () const
 Returns the current solver statistics.
 
int initialize ()
 Initialize the internal memory.
 
virtual int integrate (cmf::math::Time t_max, cmf::math::Time dt)
 Integrates the vector of state variables.
 
virtual void reset ()
 Resets the history of the multispte solver and overwrites the internal state cache.
 
void set_error_msg (std::string error)
 Sets an error message.
 
std::string to_string () const override=0
 Returns a string representation of the solver.
 
Integrate
void integrate_until (cmf::math::Time t_max, cmf::math::Time dt=Time(), bool reset=false)
 Integrates the vector of state variables until t_max.
 

Public Attributes

CVodeOptions options
 the limits for the CVode solver, see CVodeOptions
 

Protected Attributes

Accuracy parameters
const real Epsilon =1e-9
 Tolerable error.
 

model time

cmf::math::Time m_t
 Actual time of the solver.
 
cmf::math::Time m_dt
 last time step of the solver
 
cmf::math::Time get_t () const
 Returns the current model time.
 
void set_t (cmf::math::Time val)
 Sets the current model time.
 
cmf::math::Time get_dt () const
 Returns the last time step.
 

Member Function Documentation

◆ _get_jacobian()

virtual cmf::math::num_array _get_jacobian ( ) const
virtual

Returns a continuous 1D array representing the Jacobian columns concatenated.

In Python, get_jacobian returns the Jacobian as a 2D array

Reimplemented in CVodeDense.

◆ initialize()

int initialize ( )

Initialize the internal memory.

Automatically called, when one starts to integrate

◆ integrate()

virtual int integrate ( cmf::math::Time t_max,
cmf::math::Time dt )
virtual

Integrates the vector of state variables.

Parameters
t_maxTo stop the model (if running in a model framework) at time steps of value exchange e.g. full hours, the next value exchange time can be given
dtTakes the proposed time step, and changes it into the effectively used time step according to the local stiffness of the problem and MaxTime

Implements Integrator.

◆ integrate_until()

void integrate_until ( cmf::math::Time t_max,
cmf::math::Time dt = Time(),
bool reset = false )
inherited

Integrates the vector of state variables until t_max.

Parameters
t_maxTime, the solver should run to
dtTime step (may be omitted)
resetIf true, solver is reseted before integration starts