Bookkeeps the timestep-data of Evolved. More...
#include <Evolved.h>
Public Member Functions | |
double | getDtDid () const |
returns the last performed timestep | |
double | getDtTry () const |
returns the timestep to try in the next step | |
void | setDtTry (double dtTry) |
Sets the timestep to try in the next step. More... | |
void | update (double t, double dtTry) |
TimeStepBookkeeper & | operator= (const TimeStepBookkeeper &) |
straightforward assignment operator that avoids self-assignment | |
Actual time getter/setter | |
double | getTime () const |
void | setTime (double t) |
Getters of precision parameters | |
double | getEpsRel () const |
relative precision | |
double | getEpsAbs () const |
absolute precision | |
Protected Member Functions | |
TimeStepBookkeeper (double dtInit, double epsRel, double epsAbs) | |
straightforward constructor More... | |
Friends | |
class | boost::serialization::access |
Bookkeeps the timestep-data of Evolved.
Very rarely used in itself, for the most part it can be considered as a template-parameter independent base of Evolved.
The timestep-regulation policy of adaptive-stepsize drivers is that for the step in hand they perform a timestep of at most dtTry
. Thereupon, they report the performed timestep (this is dtDid
), and suggest a stepsize for the next step to try, which can be larger than dtDid (this will be the new value of dtTry
after the step). Hence, the step can diminish in the actual step, but can grow only in the next step.
Timestep is regulated by two parameters, epsRel
limiting the (element-wise) relative precision, and epsAbs
the absolute precision. In general, it can be said that anything below epsAbs
in absolute value should be considered numerical trash.
ODE steppers must be supplied with a sensible value for the initial timestep to try in the first step.
|
protected |
straightforward constructor
dtInit | the initial timestep to try in the first step |
epsRel | relative precision |
epsAbs | absolute precision |
|
inline |
Sets the timestep to try in the next step.
This should be used if there is some factor besides the normal ODE evolution that may modify the timestep (e.g. a quantum jump in a Monte Carlo wave-function evolution). For the most part, this will be a timestep decrease.