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

Base class for any kind of integrator. More...

+ Inheritance diagram for Integrator:
+ Collaboration diagram for Integrator:

Detailed Description

Base class for any kind of integrator.

Pure virtual functions:

  • Integrate
  • copy Please provide a custom copy constructor

Public Member Functions

virtual std::string to_string () const =0
 Desrcibes the iterator.
 
Constructors and Destructors
 Integrator (real epsilon=1e-9)
 Constructs a new Integrator with a new own state vector.
 
virtual Integratorcopy () const =0
 Polymorphic copy constructor.
 
Integrate
virtual int integrate (cmf::math::Time t_max, cmf::math::Time dt)=0
 Integrates the vector of state variables.
 
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.
 

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.
 
virtual void reset ()
 Resets any saved history (for multistep methods)
 

Constructor & Destructor Documentation

◆ Integrator()

Integrator ( real epsilon = 1e-9)
explicit

Constructs a new Integrator with a new own state vector.

Parameters
epsilonrelative error tolerance per time step (default=1e-9)

Member Function Documentation

◆ integrate()

virtual int integrate ( cmf::math::Time t_max,
cmf::math::Time dt )
pure 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

Implemented in ExplicitEuler_fixed, HeunIntegrator, ImplicitEuler, RKFIntegrator, BDF2, CVodeBase, MultiIntegrator, and SoluteWaterIntegrator.

◆ integrate_until()

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.

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