IntegratorCore< FP, Integrands > Class Template Reference
|
CPP API
|
Interface class defining the integration step used in a SystemIntegrator. More...
#include <integrator.h>
Public Member Functions | |
| virtual std::unique_ptr< IntegratorCore< FP, Integrands... > > | clone () const =0 |
| IntegratorCore (const FP &dt_min, const FP &dt_max) | |
| Initialize an IntegratorCore. More... | |
| virtual bool | step (const Integrands &... fs, Eigen::Ref< const Eigen::VectorX< FP >> yt, FP &t, FP &dt, Eigen::Ref< Eigen::VectorX< FP >> ytp1) const =0 |
| Make a single integration step. More... | |
| virtual | ~IntegratorCore () |
| FP & | get_dt_min () |
| Access lower bound to the step size dt. More... | |
| const FP & | get_dt_min () const |
| Access lower bound to the step size dt. More... | |
| FP & | get_dt_max () |
| Access upper bound to the step size dt. More... | |
| const FP & | get_dt_max () const |
| Access upper bound to the step size dt. More... | |
Private Attributes | |
| FP | m_dt_max |
| FP | m_dt_min |
Detailed Description
template<typename FP, class... Integrands>
class mio::IntegratorCore< FP, Integrands >
Interface class defining the integration step used in a SystemIntegrator.
- Template Parameters
-
FP A floating point type, e.g. double. Integrands One or more function types used for defining the right hand side of a system of equations.
Constructor & Destructor Documentation
◆ IntegratorCore()
|
inline |
Initialize an IntegratorCore.
Step size bounds are needed for adaptive integrators, see the step method for more detail. Fixed size steppers ignore those bounds and may use the default constructor for FP.
- Parameters
-
dt_min Lower bound to the step size dt, as used in the step method. dt_max Upper bound to the step size dt, as used in the step method.
◆ ~IntegratorCore()
|
inlinevirtual |
Member Function Documentation
◆ clone()
|
pure virtual |
◆ get_dt_max() [1/2]
|
inline |
Access upper bound to the step size dt.
These values will only be used by adaptive steppers. Fixed size steppers ignore them.
- Returns
- A reference to the maximum possible value of dt.
◆ get_dt_max() [2/2]
|
inline |
Access upper bound to the step size dt.
These values will only be used by adaptive steppers. Fixed size steppers ignore them.
- Returns
- A reference to the maximum possible value of dt.
◆ get_dt_min() [1/2]
|
inline |
Access lower bound to the step size dt.
These values will only be used by adaptive steppers. Fixed size steppers ignore them.
- Returns
- A reference to the minimum possible value of dt.
◆ get_dt_min() [2/2]
|
inline |
Access lower bound to the step size dt.
These values will only be used by adaptive steppers. Fixed size steppers ignore them.
- Returns
- A reference to the minimum possible value of dt.
◆ step()
|
pure virtual |
Make a single integration step.
The behaviour of this method changes when the integration scheme has adaptive step sizing. These changes are noted in the parentheses (...) below. Adaptive integrators use the bounds dt_min and dt_max for dt, accessible through the IntegratorCore member functions get_dt_min() and get_dt_max(), respectively. Fixed step integrators ignore these values. The adaptive step sizing is considered to be successful, if a step of at least size dt_min sufficed tolerances. Tolerances are defined in each implementation, usually using a criterion with absolute and relative tolerances. Even if the step sizing failed, the integrator will make a step of at least size dt_min.
- Parameters
-
[in] fs One or more function(s) defining the right hand side of the IVP. May be called multiple times with different arguments. [in] yt The known value of y at time t. [in,out] t The current time. It will be increased by dt. (If adaptive, the increment is instead within [dt_min, dt].) [in,out] dt The current step size h=dt. Will not be changed. (If adaptive, the given dt is used as the maximum step size, and must be within [dt_min, dt_max]. During integration, dt is adjusted in [dt_min, dt_max] to have an optimal size for the next step.) [out] ytp1 Set to the approximated value of y at time t + dt. (If adaptive, this time may be smaller, but it is at least t + dt_min, at most t + dt_max. Note that the increment on t may be different from the returned value of dt.)
- Returns
- Always true for nonadaptive methods. (If adaptive, returns whether the adaptive step sizing was successful.)
Member Data Documentation
◆ m_dt_max
|
private |
◆ m_dt_min
|
private |
Generated by