DiFfRG
|
This is a default time controller implementation which should be used as a base class for any other time controller. It only implements the basic tasks that should be done when advancing time, i.e. saving, logging if the stepper got stuck, checking if the simulation is finished and restricting the minimal timestep. More...
#include <default.hh>
Public Member Functions | |
TC_Default (NEWT &newton_, unsigned int alg_order_, double t_, double max_t_, double dt_, double min_dt_, double max_dt_, double output_dt_) | |
double | get_dt () const |
double | get_t () const |
unsigned int | get_stuck () const |
Get how many times in succession the timestepper was at the same time step. | |
bool | finished () const |
template<typename F , typename OF > | |
void | advance (F &f, OF &of) |
Method to perform a single time step. | |
void | print_step_info () |
Protected Member Functions | |
virtual void | step_success () |
The default implementation of step_success does nothing except incrementing time and trying to plan the next step to hit a save point. | |
virtual void | step_fail (const std::exception &e) |
The default implementation of step_fail immediately aborts the program. | |
Protected Attributes | |
NEWT & | newton |
unsigned int | alg_order |
double | t |
double | max_t |
double | sug_dt |
double | min_dt |
double | max_dt |
double | output_dt |
double | cur_dt |
double | last_save |
double | last_t |
unsigned int | stuck |
bool | fin |
This is a default time controller implementation which should be used as a base class for any other time controller. It only implements the basic tasks that should be done when advancing time, i.e. saving, logging if the stepper got stuck, checking if the simulation is finished and restricting the minimal timestep.
NEWT | the used solver type which should at least explose the methods set_ignore_nonconv(bool)->void and get_error()->double. |
|
inline |
|
inline |
Method to perform a single time step.
f | a function which performs a time step, of the signature void(double t, double dt) |
of | a function which saves the current step to disk, of signature void(double t) |
|
inline |
|
inline |
|
inline |
Get how many times in succession the timestepper was at the same time step.
|
inline |
|
inline |
|
inlineprotectedvirtual |
The default implementation of step_fail immediately aborts the program.
Reimplemented in DiFfRG::TC_PI< NEWT >.
|
inlineprotectedvirtual |
The default implementation of step_success does nothing except incrementing time and trying to plan the next step to hit a save point.
Reimplemented in DiFfRG::TC_PI< NEWT >.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |