DiFfRG
Loading...
Searching...
No Matches
DiFfRG::TC_Default< NEWT > Class Template Reference

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>

Inheritance diagram for DiFfRG::TC_Default< NEWT >:
DiFfRG::TC_PI< NEWT >

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
 

Detailed Description

template<typename NEWT>
class DiFfRG::TC_Default< NEWT >

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.

Template Parameters
NEWTthe used solver type which should at least explose the methods set_ignore_nonconv(bool)->void and get_error()->double.

Constructor & Destructor Documentation

◆ TC_Default()

template<typename NEWT >
DiFfRG::TC_Default< NEWT >::TC_Default ( NEWT & newton_,
unsigned int alg_order_,
double t_,
double max_t_,
double dt_,
double min_dt_,
double max_dt_,
double output_dt_ )
inline

Member Function Documentation

◆ advance()

template<typename NEWT >
template<typename F , typename OF >
void DiFfRG::TC_Default< NEWT >::advance ( F & f,
OF & of )
inline

Method to perform a single time step.

Parameters
fa function which performs a time step, of the signature void(double t, double dt)
ofa function which saves the current step to disk, of signature void(double t)

◆ finished()

template<typename NEWT >
bool DiFfRG::TC_Default< NEWT >::finished ( ) const
inline

◆ get_dt()

template<typename NEWT >
double DiFfRG::TC_Default< NEWT >::get_dt ( ) const
inline

◆ get_stuck()

template<typename NEWT >
unsigned int DiFfRG::TC_Default< NEWT >::get_stuck ( ) const
inline

Get how many times in succession the timestepper was at the same time step.

◆ get_t()

template<typename NEWT >
double DiFfRG::TC_Default< NEWT >::get_t ( ) const
inline

◆ print_step_info()

template<typename NEWT >
void DiFfRG::TC_Default< NEWT >::print_step_info ( )
inline

◆ step_fail()

template<typename NEWT >
virtual void DiFfRG::TC_Default< NEWT >::step_fail ( const std::exception & e)
inlineprotectedvirtual

The default implementation of step_fail immediately aborts the program.

Reimplemented in DiFfRG::TC_PI< NEWT >.

◆ step_success()

template<typename NEWT >
virtual void DiFfRG::TC_Default< NEWT >::step_success ( )
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 >.

Member Data Documentation

◆ alg_order

template<typename NEWT >
unsigned int DiFfRG::TC_Default< NEWT >::alg_order
protected

◆ cur_dt

template<typename NEWT >
double DiFfRG::TC_Default< NEWT >::cur_dt
protected

◆ fin

template<typename NEWT >
bool DiFfRG::TC_Default< NEWT >::fin
protected

◆ last_save

template<typename NEWT >
double DiFfRG::TC_Default< NEWT >::last_save
protected

◆ last_t

template<typename NEWT >
double DiFfRG::TC_Default< NEWT >::last_t
protected

◆ max_dt

template<typename NEWT >
double DiFfRG::TC_Default< NEWT >::max_dt
protected

◆ max_t

template<typename NEWT >
double DiFfRG::TC_Default< NEWT >::max_t
protected

◆ min_dt

template<typename NEWT >
double DiFfRG::TC_Default< NEWT >::min_dt
protected

◆ newton

template<typename NEWT >
NEWT& DiFfRG::TC_Default< NEWT >::newton
protected

◆ output_dt

template<typename NEWT >
double DiFfRG::TC_Default< NEWT >::output_dt
protected

◆ stuck

template<typename NEWT >
unsigned int DiFfRG::TC_Default< NEWT >::stuck
protected

◆ sug_dt

template<typename NEWT >
double DiFfRG::TC_Default< NEWT >::sug_dt
protected

◆ t

template<typename NEWT >
double DiFfRG::TC_Default< NEWT >::t
protected

The documentation for this class was generated from the following file: