SpECTRE  v2024.05.11
TimeSteppers::adams_coefficients Namespace Reference

Helpers for calculating Adams coefficients. More...

Typedefs

template<typename T >
using OrderVector = boost::container::static_vector< T, maximum_order >
 A vector holding one entry per order of integration.
 

Functions

OrderVector< double > constant_adams_bashforth_coefficients (size_t order)
 The standard Adams-Bashforth coefficients for constant step size, ordered from oldest to newest time, as one would find in a reference table (except likely in the opposite order).
 
OrderVector< double > constant_adams_moulton_coefficients (size_t order)
 The standard Adams-Moulton coefficients for constant step size, ordered from oldest to newest time, as one would find in a reference table (except likely in the opposite order).
 
template<typename T >
OrderVector< T > variable_coefficients (OrderVector< T > control_times, const T &step_start, const T &step_end)
 Generate coefficients for an Adams step. More...
 
template<typename Iterator , typename TimeType >
OrderVector< double > coefficients (const Iterator &times_begin, const Iterator &times_end, const Time &step_start, const TimeType &step_end)
 Get coefficients for a time step. More...
 

Variables

constexpr size_t maximum_order = 8
 

Detailed Description

Helpers for calculating Adams coefficients.

Function Documentation

◆ coefficients()

template<typename Iterator , typename TimeType >
OrderVector< double > TimeSteppers::adams_coefficients::coefficients ( const Iterator &  times_begin,
const Iterator &  times_end,
const Time step_start,
const TimeType &  step_end 
)

Get coefficients for a time step.

Arguments are an iterator pair to past times (of type Time), with the most recent last, and the start and end of the time step to take, with the end a Time or ApproximateTime. This performs the same calculation as variable_coefficients, except that it works with Times and will detect and optimize the constant-step-size case.

◆ variable_coefficients()

template<typename T >
OrderVector< T > TimeSteppers::adams_coefficients::variable_coefficients ( OrderVector< T >  control_times,
const T &  step_start,
const T &  step_end 
)

Generate coefficients for an Adams step.

The coefficients are for a step using derivatives at control_times, with the entries in the result vector corresponding to the passed times in order. The result includes the overall factor of step size, so, for example, the coefficients for Euler's method (control_times = {0}, step_start=0, step_end=dt) would be {dt}, not {1}.

No requirements are imposed on control_times, except that the entries are all distinct.

Only T = double is used by the time steppers, but T = Rational can be used to generate coefficient tables.