2.0.0b10
catchment modelling framework
Loading...
Searching...
No Matches
CVodeDense Class Reference

implicit BDF CVode solver with full Jacobian approximation More...

+ Inheritance diagram for CVodeDense:
+ Collaboration diagram for CVodeDense:

Detailed Description

implicit BDF CVode solver with full Jacobian approximation

Use this solver for small but stiff systems (<20 state variables)

The solver calculates for each step the full Jacobian matrix of the system using a difference quotient approximation of the real Jacobian

Public Member Functions

 CVodeDense (const cmf::math::state_list &states, real epsilon=1e-9)
 Creates a new implicit dense CVode solver.
 
cmf::math::num_array _get_jacobian () const override
 Returns a continuous 1D array representing the Jacobian columns concatenated.
 
cmf::math::CVodeDensecopy () const override
 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
 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 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.
 
cmf::math::Time m_t
 Actual time of the solver.
 
cmf::math::Time m_dt
 last time step of the solver
 

Member Function Documentation

◆ _get_jacobian()

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

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

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

Reimplemented from CVodeBase.

◆ initialize()

int initialize ( )
inherited

Initialize the internal memory.

Automatically called, when one starts to integrate

◆ integrate()

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

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