SpECTRE  v2026.09.05
Loading...
Searching...
No Matches
StepChoosers::ErrorControl< StepChooserUse, System, typename > Class Template Reference

Sets a goal based on time-stepper truncation error. More...

Detailed Description

template<typename StepChooserUse, typename System, typename = tmpl::conditional_t< tt::is_a_v<tmpl::list, typename System::variables_tag>, typename System::variables_tag, tmpl::list<typename System::variables_tag>>>
class StepChoosers::ErrorControl< StepChooserUse, System, typename >

Sets a goal based on time-stepper truncation error.

Details

The suggested step is calculated via a simple specialization of the scheme suggested in [95]. We first compute the aggregated error measure from the stepper error:

\[E = \max_i(|E_i| / sc_i), \]

where \(E_i\) is the ODE error reported for each individual grid point, reported by the time stepper, and \(sc_i\) is the step control measure determined by the tolerances:

\[sc_i = Atol_i + \max(|y_i|,|y_i + E_i|) Rtol_i, \]

and \(y_i\) is the value of the function at the previous step at grid point \(i\). (The estimate is more commonly done comparing with the current step, but using the previous step avoids a memory allocation in the TimeStepper and should not have a major effect on the result.)

When choosing a step size for LTS or when no record of previous error is available, the step has size:

\[h_{\text{new}} = h \cdot \min\left(F_{\text{max}}, \max\left(F_{\text{min}}, \frac{F_{\text{safety}}}{E^{1/(q + 1)}}\right)\right), \]

where \(h_{\text{new}}\) is the new suggested step size \(h\) is the previous step size, \(F_{\text{max}}\) is the maximum factor by which we allow the step to increase, \(F_{\text{min}}\) is the minimum factor by which we allow the step to decrease. \(F_{\text{safety}}\) is the safety factor on the computed error – this forces the step size slightly lower than we would naively compute so that the result of the step will likely be within the target error. \(q\) is the order of the stepper error calculation. Intuitively, we should change the step less drastically for a higher order stepper.

When controlling slab size, after the first error calculation, the error \(E\) is recorded in the DataBox, and subsequent error calculations use a simple PI scheme suggested in [178] section 17.2.1:

\[h_{\text{new}} = h \cdot \min\left(F_{\text{max}}, \max\left(F_{\text{min}}, F_{\text{safety}} E^{-0.7 / (q + 1)} E_{\text{prev}}^{0.4 / (q + 1)}\right)\right), \]

where \(E_{\text{prev}}\) is the error computed in the previous step. This method is never used for choosing an LTS step because the restriction of step size changes to factors of two was found to interfere with the more gradual increase chosen by the PI controller.


The documentation for this class was generated from the following file:
  • src/Time/StepChoosers/ErrorControl.hpp