SpECTRE  v2024.04.12
TimeSteppers::AdamsMoultonPc< Monotonic > Class Template Reference

#include <AdamsMoultonPc.hpp>

Classes

struct  Order
 

Public Types

using options = tmpl::list< Order >
 
- Public Types inherited from TimeStepper
using provided_time_stepper_interfaces = tmpl::list< TimeStepper >
 

Public Member Functions

 AdamsMoultonPc (size_t order)
 
 AdamsMoultonPc (const AdamsMoultonPc &)=default
 
AdamsMoultonPcoperator= (const AdamsMoultonPc &)=default
 
 AdamsMoultonPc (AdamsMoultonPc &&)=default
 
AdamsMoultonPcoperator= (AdamsMoultonPc &&)=default
 
size_t order () const override
 The convergence order of the stepper. More...
 
size_t error_estimate_order () const override
 The convergence order of the stepper error measure. More...
 
uint64_t number_of_substeps () const override
 Number of substeps in this TimeStepper. More...
 
uint64_t number_of_substeps_for_error () const override
 Number of substeps in this TimeStepper when providing an error measure for adaptive time-stepping. More...
 
size_t number_of_past_steps () const override
 Number of past time steps needed for multi-step method. More...
 
double stable_step () const override
 Rough estimate of the maximum step size this method can take stably as a multiple of the step for Euler's method. More...
 
bool monotonic () const override
 Whether computational and temporal orderings of operations match. More...
 
TimeStepId next_time_id (const TimeStepId &current_id, const TimeDelta &time_step) const override
 The TimeStepId after the current substep. More...
 
TimeStepId next_time_id_for_error (const TimeStepId &current_id, const TimeDelta &time_step) const override
 The TimeStepId after the current substep when providing an error measure for adaptive time-stepping. More...
 
 WRAPPED_PUPable_decl_template (AdamsMoultonPc)
 
 AdamsMoultonPc (CkMigrateMessage *)
 
void pup (PUP::er &p) override
 
- Public Member Functions inherited from TimeStepper
 WRAPPED_PUPable_abstract (TimeStepper)
 
template<typename Vars >
void update_u (const gsl::not_null< Vars * > u, const gsl::not_null< TimeSteppers::History< Vars > * > history, const TimeDelta &time_step) const
 Set u to the value at the end of the current substep. More...
 
template<typename Vars , typename ErrVars >
bool update_u (const gsl::not_null< Vars * > u, const gsl::not_null< ErrVars * > u_error, const gsl::not_null< TimeSteppers::History< Vars > * > history, const TimeDelta &time_step) const
 Set u to the value at the end of the current substep; report the error measure when available. More...
 
template<typename Vars >
bool dense_update_u (const gsl::not_null< Vars * > u, const TimeSteppers::History< Vars > &history, const double time) const
 Compute the solution value at a time between steps. To evaluate at a time within a given step, call this method at the start of the step containing the time. The function returns true on success, otherwise the call should be retried after the next substep. More...
 
virtual size_t order () const =0
 The convergence order of the stepper. More...
 
virtual size_t error_estimate_order () const =0
 The convergence order of the stepper error measure. More...
 
virtual uint64_t number_of_substeps () const =0
 Number of substeps in this TimeStepper. More...
 
virtual uint64_t number_of_substeps_for_error () const =0
 Number of substeps in this TimeStepper when providing an error measure for adaptive time-stepping. More...
 
virtual size_t number_of_past_steps () const =0
 Number of past time steps needed for multi-step method. More...
 
virtual double stable_step () const =0
 Rough estimate of the maximum step size this method can take stably as a multiple of the step for Euler's method. More...
 
virtual bool monotonic () const =0
 Whether computational and temporal orderings of operations match. More...
 
virtual TimeStepId next_time_id (const TimeStepId &current_id, const TimeDelta &time_step) const =0
 The TimeStepId after the current substep. More...
 
virtual TimeStepId next_time_id_for_error (const TimeStepId &current_id, const TimeDelta &time_step) const =0
 The TimeStepId after the current substep when providing an error measure for adaptive time-stepping. More...
 
template<typename Vars >
bool can_change_step_size (const TimeStepId &time_id, const TimeSteppers::History< Vars > &history) const
 Whether a change in the step size is allowed before taking a step. More...
 

Static Public Member Functions

static std::string name ()
 

Static Public Attributes

static constexpr size_t minimum_order = 2
 
static constexpr size_t maximum_order = 8
 
static constexpr Options::String help
 
- Static Public Attributes inherited from TimeStepper
static constexpr bool local_time_stepping = false
 
static constexpr bool imex = false
 

Detailed Description

template<bool Monotonic>
class TimeSteppers::AdamsMoultonPc< Monotonic >

An \(N\\)th order Adams-Moulton predictor-corrector method using an \f$(N - 1)$th order Adams-Bashforth predictor.

If Monotonic is true, dense output is performed using the predictor stage, otherwise the corrector is used. The corrector results are more accurate (but still formally the same order), but require a RHS evaluation at the end of the step before dense output can be performed.

The stable step size factors for different orders are (to approximately 4-5 digits):

Order CFL Factor
2 1
3 0.981297
4 0.794227
5 0.612340
6 0.464542
7 0.350596
8 0.264373

Member Function Documentation

◆ error_estimate_order()

template<bool Monotonic>
size_t TimeSteppers::AdamsMoultonPc< Monotonic >::error_estimate_order ( ) const
overridevirtual

The convergence order of the stepper error measure.

Implements TimeStepper.

◆ monotonic()

template<bool Monotonic>
bool TimeSteppers::AdamsMoultonPc< Monotonic >::monotonic ( ) const
overridevirtual

Whether computational and temporal orderings of operations match.

If this method returns true, then, for two time-stepper operations occurring at different simulation times, the temporally earlier operation will be performed first. These operations include RHS evaluation, dense output, and neighbor communication. In particular, dense output never requires performing a RHS evaluation later than the output time, so control systems measurements cannot cause deadlocks.

Warning
This guarantee only holds if the time steps themselves are monotonic, which can be violated during initialization.

Implements TimeStepper.

◆ next_time_id()

template<bool Monotonic>
TimeStepId TimeSteppers::AdamsMoultonPc< Monotonic >::next_time_id ( const TimeStepId current_id,
const TimeDelta time_step 
) const
overridevirtual

The TimeStepId after the current substep.

Implements TimeStepper.

◆ next_time_id_for_error()

template<bool Monotonic>
TimeStepId TimeSteppers::AdamsMoultonPc< Monotonic >::next_time_id_for_error ( const TimeStepId current_id,
const TimeDelta time_step 
) const
overridevirtual

The TimeStepId after the current substep when providing an error measure for adaptive time-stepping.

Certain substep methods (e.g. embedded RK4(3)) require additional steps when providing an error measure of the integration.

Implements TimeStepper.

◆ number_of_past_steps()

template<bool Monotonic>
size_t TimeSteppers::AdamsMoultonPc< Monotonic >::number_of_past_steps ( ) const
overridevirtual

Number of past time steps needed for multi-step method.

Implements TimeStepper.

◆ number_of_substeps()

template<bool Monotonic>
uint64_t TimeSteppers::AdamsMoultonPc< Monotonic >::number_of_substeps ( ) const
overridevirtual

Number of substeps in this TimeStepper.

Implements TimeStepper.

◆ number_of_substeps_for_error()

template<bool Monotonic>
uint64_t TimeSteppers::AdamsMoultonPc< Monotonic >::number_of_substeps_for_error ( ) const
overridevirtual

Number of substeps in this TimeStepper when providing an error measure for adaptive time-stepping.

Details

Certain substep methods (e.g. embedded RK4(3)) require additional steps when providing an error measure of the integration.

Implements TimeStepper.

◆ order()

template<bool Monotonic>
size_t TimeSteppers::AdamsMoultonPc< Monotonic >::order ( ) const
overridevirtual

The convergence order of the stepper.

Implements TimeStepper.

◆ stable_step()

template<bool Monotonic>
double TimeSteppers::AdamsMoultonPc< Monotonic >::stable_step ( ) const
overridevirtual

Rough estimate of the maximum step size this method can take stably as a multiple of the step for Euler's method.

Implements TimeStepper.

Member Data Documentation

◆ help

template<bool Monotonic>
constexpr Options::String TimeSteppers::AdamsMoultonPc< Monotonic >::help
staticconstexpr
Initial value:
=
Monotonic
? "An Adams-Moulton predictor-corrector time-stepper with monotonic "
"dense output."
: "An Adams-Moulton predictor-corrector time-stepper."

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