SpECTRE  v2025.08.19
VariableOrderAlgorithm Class Reference

Class encapsulating the time-stepper order changing algorithms. More...

#include <VariableOrderAlgorithm.hpp>

Classes

struct  GoalOrder
 
struct  OrderFalloff
 

Public Types

using options = tmpl::list< Options::Alternatives< tmpl::list< GoalOrder >, tmpl::list< OrderFalloff > > >
 

Public Member Functions

 VariableOrderAlgorithm (size_t goal_order)
 
 VariableOrderAlgorithm (double order_falloff)
 
StepperErrorTolerances::Estimates required_estimates () const
 
template<typename... VariablesTags>
size_t choose_order (const TimeSteppers::History< typename VariablesTags::type > &... histories, const typename tmpl::has_type< VariablesTags, std::array< std::optional< StepperErrorEstimate >, 2 > >::type &... errors) const
 
void pup (PUP::er &p)
 

Static Public Attributes

static constexpr Options::String help
 

Friends

bool operator== (const VariableOrderAlgorithm &a, const VariableOrderAlgorithm &b)
 

Detailed Description

Class encapsulating the time-stepper order changing algorithms.

Details

Supports two modes: driving the order to a specified constant, and measuring the convergence of the error estimates.

When driving to a constant, the order is changed by one towards the goal if it is not at the goal.

When measuring convergence, let the relative error estimate from the time stepper for order- \(k\) integration be \(e_k\), and \(\lambda \le 1\) be the falloff this class was constructed with. Then, we decrease the order by one if, for any \(k \ge 2\) and less than the current integration order,

\begin{equation} \frac{e_k}{e_{k-1}} > \left(\min_{2 \le j < k} \frac{e_j}{e_{j-1}}\right)^\lambda, \end{equation}

with the right-hand side taken to be \(1\) for \(k = 2\). If the order is not decreased, it is kept the same if the above condition holds for \(k\) equal to the current integration order, and is increased by one otherwise. If the current integration order is \(1\) (not possible for predictor-corrector methods), it is always increased. This algorithm will almost never prefer an integration order less than three.

Note
This is currently all implemented in one class for simplicity with dealing with templates. If we add more algorithms splitting into a base class with implementations would be appropriate.

Member Data Documentation

◆ help

constexpr Options::String VariableOrderAlgorithm::help
staticconstexpr
Initial value:
=
"Algorithm for choosing the time-stepper order in a variable-order "
"evolution."

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