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

A simple PI controller which adjusts time steps in a smooth fashion depending on how well the solver performs, taking into account the most recent time step, too. More...

#include <PI.hh>

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

Public Types

using Base = TC_Default<NEWT>
 

Public Member Functions

 TC_PI (NEWT &newton_, unsigned int alg_order_, double t_, double max_t_, double dt_, double min_dt_, double max_dt_, double output_dt_)
 
- Public Member Functions inherited from 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_)
 
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

void get_q ()
 This method just updates q for the calculation of the next sug_dt.
 
virtual void step_success () override
 Increment t and suggest a dt based on current error and previous error.
 
virtual void step_fail (const std::exception &) override
 On a fail, decrease the timestep.
 
- Protected Member Functions inherited from DiFfRG::TC_Default< NEWT >

Protected Attributes

double beta1
 
double beta2
 
double qsteady_min
 
double qsteady_max
 
double qmin
 
double qmax
 
double qoldinit
 
double qold
 
double q11
 
double q
 
double gamma
 
double t
 
NEWT & newton
 
double cur_dt
 
double sug_dt
 
unsigned int alg_order
 
- Protected Attributes inherited from DiFfRG::TC_Default< NEWT >
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_PI< NEWT >

A simple PI controller which adjusts time steps in a smooth fashion depending on how well the solver performs, taking into account the most recent time step, too.

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

Member Typedef Documentation

◆ Base

template<typename NEWT >
using DiFfRG::TC_PI< NEWT >::Base = TC_Default<NEWT>

Constructor & Destructor Documentation

◆ TC_PI()

template<typename NEWT >
DiFfRG::TC_PI< NEWT >::TC_PI ( 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

◆ get_q()

template<typename NEWT >
void DiFfRG::TC_PI< NEWT >::get_q ( )
inlineprotected

This method just updates q for the calculation of the next sug_dt.

◆ step_fail()

template<typename NEWT >
virtual void DiFfRG::TC_PI< NEWT >::step_fail ( const std::exception & )
inlineoverrideprotectedvirtual

On a fail, decrease the timestep.

Reimplemented from DiFfRG::TC_Default< NEWT >.

◆ step_success()

template<typename NEWT >
virtual void DiFfRG::TC_PI< NEWT >::step_success ( )
inlineoverrideprotectedvirtual

Increment t and suggest a dt based on current error and previous error.

Reimplemented from DiFfRG::TC_Default< NEWT >.

Member Data Documentation

◆ alg_order

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

◆ beta1

template<typename NEWT >
double DiFfRG::TC_PI< NEWT >::beta1
protected

◆ beta2

template<typename NEWT >
double DiFfRG::TC_PI< NEWT >::beta2
protected

◆ cur_dt

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

◆ gamma

template<typename NEWT >
double DiFfRG::TC_PI< NEWT >::gamma
protected

◆ newton

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

◆ q

template<typename NEWT >
double DiFfRG::TC_PI< NEWT >::q
protected

◆ q11

template<typename NEWT >
double DiFfRG::TC_PI< NEWT >::q11
protected

◆ qmax

template<typename NEWT >
double DiFfRG::TC_PI< NEWT >::qmax
protected

◆ qmin

template<typename NEWT >
double DiFfRG::TC_PI< NEWT >::qmin
protected

◆ qold

template<typename NEWT >
double DiFfRG::TC_PI< NEWT >::qold
protected

◆ qoldinit

template<typename NEWT >
double DiFfRG::TC_PI< NEWT >::qoldinit
protected

◆ qsteady_max

template<typename NEWT >
double DiFfRG::TC_PI< NEWT >::qsteady_max
protected

◆ qsteady_min

template<typename NEWT >
double DiFfRG::TC_PI< NEWT >::qsteady_min
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: