SpECTRE  v2024.04.12
LtsTimeStepper Class Referenceabstract

Base class for TimeSteppers with local time-stepping support, derived from TimeStepper. More...

#include <LtsTimeStepper.hpp>

Public Types

using provided_time_stepper_interfaces = tmpl::list< LtsTimeStepper, TimeStepper >
 
template<typename LocalVars , typename RemoteVars , typename Coupling >
using BoundaryHistoryType = TimeSteppers::BoundaryHistory< LocalVars, RemoteVars, std::invoke_result_t< const Coupling &, LocalVars, RemoteVars > >
 
template<typename LocalVars , typename RemoteVars , typename Coupling >
using BoundaryReturn = db::unprefix_variables< std::invoke_result_t< const Coupling &, LocalVars, RemoteVars > >
 Return type of boundary-related functions. The coupling returns the derivative of the variables, but this is multiplied by the time step so the return type should not have dt prefixes.
 
- Public Types inherited from TimeStepper
using provided_time_stepper_interfaces = tmpl::list< TimeStepper >
 

Public Member Functions

 WRAPPED_PUPable_abstract (LtsTimeStepper)
 
template<typename LocalVars , typename RemoteVars , typename Coupling >
void add_boundary_delta (const gsl::not_null< BoundaryReturn< LocalVars, RemoteVars, Coupling > * > result, const gsl::not_null< BoundaryHistoryType< LocalVars, RemoteVars, Coupling > * > history, const TimeDelta &time_step, const Coupling &coupling) const
 Compute the change in a boundary quantity due to the coupling on the interface. More...
 
template<typename LocalVars , typename RemoteVars , typename Coupling >
void boundary_dense_output (const gsl::not_null< BoundaryReturn< LocalVars, RemoteVars, Coupling > * > result, const BoundaryHistoryType< LocalVars, RemoteVars, Coupling > &history, const double time, const Coupling &coupling) const
 Derived classes must implement this as a function with signature. More...
 
virtual bool neighbor_data_required (const TimeStepId &next_substep_id, const TimeStepId &neighbor_data_id) const =0
 Check whether a neighbor record is needed for boundary output. More...
 
virtual bool neighbor_data_required (double dense_output_time, const TimeStepId &neighbor_data_id) const =0
 Check whether a neighbor record is needed for boundary output. More...
 
- 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 Attributes

static constexpr bool local_time_stepping = true
 
- Static Public Attributes inherited from TimeStepper
static constexpr bool local_time_stepping = false
 
static constexpr bool imex = false
 

Detailed Description

Base class for TimeSteppers with local time-stepping support, derived from TimeStepper.

Several of the member functions of this class are templated and perform type erasure before forwarding their arguments to the derived classes. This is implemented using the macros LTS_TIME_STEPPER_DECLARE_OVERLOADS, which must be placed in a private section of the class body, and LTS_TIME_STEPPER_DEFINE_OVERLOADS(derived_class), which must be placed in the cpp file.

Member Function Documentation

◆ add_boundary_delta()

template<typename LocalVars , typename RemoteVars , typename Coupling >
void LtsTimeStepper::add_boundary_delta ( const gsl::not_null< BoundaryReturn< LocalVars, RemoteVars, Coupling > * >  result,
const gsl::not_null< BoundaryHistoryType< LocalVars, RemoteVars, Coupling > * >  history,
const TimeDelta time_step,
const Coupling &  coupling 
) const
inline

Compute the change in a boundary quantity due to the coupling on the interface.

The coupling function coupling should take the local and remote flux data and compute the derivative of the boundary quantity. These values may be used to form a linear combination internally, so the result should have appropriate mathematical operators defined to allow that.

Derived classes must implement this as a function with signature

template <typename T>
void add_boundary_delta_impl(
const TimeDelta& time_step) const;
Represents an interval of time within a single slab.
Definition: Time.hpp:88
Type erased base class for evaluating BoundaryHistory couplings.
Definition: BoundaryHistory.hpp:75
Definition: BoundaryHistory.hpp:57
Require a pointer to not be a nullptr
Definition: Gsl.hpp:183
Note
Unlike the update_u methods, which overwrite the result argument, this function adds the result to the existing value.

◆ boundary_dense_output()

template<typename LocalVars , typename RemoteVars , typename Coupling >
void LtsTimeStepper::boundary_dense_output ( const gsl::not_null< BoundaryReturn< LocalVars, RemoteVars, Coupling > * >  result,
const BoundaryHistoryType< LocalVars, RemoteVars, Coupling > &  history,
const double  time,
const Coupling &  coupling 
) const
inline

Derived classes must implement this as a function with signature.

template <typename T>
void boundary_dense_output_impl(
const double time) const;
Access to the list of TimeStepIds in a BoundaryHistory.
Definition: BoundaryHistory.hpp:41

◆ neighbor_data_required() [1/2]

virtual bool LtsTimeStepper::neighbor_data_required ( const TimeStepId next_substep_id,
const TimeStepId neighbor_data_id 
) const
pure virtual

Check whether a neighbor record is needed for boundary output.

In order to perform boundary output, all records from the neighbor with TimeStepIds for which this method returns true should have been added to the history. Versions are provided for a substep and for dense output.

Implemented in TimeSteppers::AdamsBashforth.

◆ neighbor_data_required() [2/2]

virtual bool LtsTimeStepper::neighbor_data_required ( double  dense_output_time,
const TimeStepId neighbor_data_id 
) const
pure virtual

Check whether a neighbor record is needed for boundary output.

In order to perform boundary output, all records from the neighbor with TimeStepIds for which this method returns true should have been added to the history. Versions are provided for a substep and for dense output.

Implemented in TimeSteppers::AdamsBashforth.


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