TC_PI< NEWT > Class Template Reference#
|
DiFfRG
Discretization Framework for functional Renormalization Group flows
|
Proportional-integral step-size control from the solver's error measure. More...
#include <pi.hh>
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_) | |
Public Member Functions inherited from 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 | get_dt () const |
| The step to take next. | |
| double | get_t () const |
| The current time. | |
| unsigned int | get_stuck () const |
| How many steps in a row did not advance the time. | |
| bool | finished () const |
| Whether max_t has been reached. | |
| template<typename F > | |
| void | advance (F &f) |
| Attempt one step and plan the next. | |
Protected Member Functions | |
| void | get_q () |
| Update q from the current error. | |
| virtual void | step_success () override |
| Advance the time and suggest the next step from the current and previous error. | |
| virtual void | step_fail (const std::exception &) override |
| On a fail, decrease the timestep by at least a factor of 2 relative to the failed step. | |
Protected Member Functions inherited from 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 TC_Default< NEWT > | |
| NEWT & | newton |
| unsigned int | alg_order |
| double | t |
| double | max_t |
| double | sug_dt |
| double | min_dt |
| double | max_dt |
| double | cur_dt |
| double | last_t |
| unsigned int | stuck |
| bool | fin |
Detailed Description
class DiFfRG::TC_PI< NEWT >
Proportional-integral step-size control from the solver's error measure.
With the error \(E_n\) = newton.get_error() of the accepted step and the one before, \(E_{n-1}\), the next step is \(\Delta t_{n+1} = \Delta t_n / q\) with
\[ q = \frac{1}{0.9}\, \frac{E_n^{\beta_1}}{E_{n-1}^{\beta_2}}\,, \qquad \beta_1 = \frac{0.7}{p}\,, \quad \beta_2 = \frac{0.4}{p}\,, \]
where \(p\) is the order of the method, \(q\) is clipped to [0.1, 5] and set to 1 within [0.99, 1.2]. \(E_{n-1}\) is floored at \(10^{-4}\). A failed step is retried with at most half the step size. The coefficients are close to the PI defaults of OrdinaryDiffEq.jl. For ImplicitEuler and TRBDF2 \(E\) is the weighted norm of their local error estimate; a step that throws (e.g. rejected with \(E > 1\)) is retried with a smaller step.
- Template Parameters
-
NEWT the solver; must provide set_ignore_nonconv(bool) and get_error().
Member Typedef Documentation
◆ Base
| using Base = TC_Default<NEWT> |
Constructor & Destructor Documentation
◆ TC_PI()
|
inline |
Member Function Documentation
◆ get_q()
|
inlineprotected |
Update q from the current error.
◆ step_fail()
|
inlineoverrideprotectedvirtual |
On a fail, decrease the timestep by at least a factor of 2 relative to the failed step.
The error estimate alone cannot guarantee that: a failure need not come with EEst > 1, and the failed step may have been clipped below sug_dt (to hit max_t), so scaling sug_dt could retry the same step.
Reimplemented from TC_Default< NEWT >.
◆ step_success()
|
inlineoverrideprotectedvirtual |
Advance the time and suggest the next step from the current and previous error.
Reimplemented from TC_Default< NEWT >.
Member Data Documentation
◆ alg_order
|
protected |
◆ beta1
|
protected |
◆ beta2
|
protected |
◆ cur_dt
|
protected |
◆ gamma
|
protected |
◆ newton
|
protected |
◆ q
|
protected |
◆ q11
|
protected |
◆ qmax
|
protected |
◆ qmin
|
protected |
◆ qold
|
protected |
◆ qoldinit
|
protected |
◆ qsteady_max
|
protected |
◆ qsteady_min
|
protected |
◆ sug_dt
|
protected |
◆ t
|
protected |
The documentation for this class was generated from the following file:
- /home/runner/work/DiFfRG/DiFfRG/DiFfRG/include/DiFfRG/timestepping/timestep_control/pi.hh
Generated by
Public Member Functions inherited from