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

implicit BDF CVode solver with a Krylov preconditioner More...

+ Inheritance diagram for CVodeKrylov:
+ Collaboration diagram for CVodeKrylov:

Detailed Description

implicit BDF CVode solver with a Krylov preconditioner

Public Member Functions

virtual cmf::math::num_array _get_jacobian () const
 Returns a continuous 1D array representing the Jacobian columns concatenated.
 
cmf::math::CVodeKrylovcopy () const
 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
 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

int bandwidth
 Band width of the preconditioner (both sides of the diagonal)
 
CVodeOptions options
 the limits for the CVode solver, see CVodeOptions
 
char preconditioner
 Type of the preconditioner 'L'->left, 'R'->right, 'B'->both, 'N'->None, default 'L'.
 

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()

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

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 ( )
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