SpECTRE  v2024.08.03
TimeSteppers::adams_lts Namespace Reference

Shared LTS implementation for the two Adams-based methods. More...

Classes

struct  AdamsScheme
 
struct  LtsCoefficients
 Storage for LTS coefficients that should not allocate in typical cases. Each entry is a tuple of (local id, remote id, coefficient). The contents should be kept sorted, as some functions assume that. More...
 

Enumerations

enum class  SchemeType { Explicit , Implicit }
 Type of coefficients used for an AdamsScheme.
 

Functions

Time exact_substep_time (const TimeStepId &id)
 Get the time of a substep as a Time, assuming substeps are at the end of the step.
 
LtsCoefficientsoperator+= (LtsCoefficients &a, const LtsCoefficients &b)
 
LtsCoefficientsoperator-= (LtsCoefficients &a, const LtsCoefficients &b)
 
LtsCoefficients operator+ (LtsCoefficients &&a, LtsCoefficients &&b)
 
LtsCoefficients operator+ (LtsCoefficients &&a, const LtsCoefficients &b)
 
LtsCoefficients operator+ (const LtsCoefficients &a, LtsCoefficients &&b)
 
LtsCoefficients operator+ (const LtsCoefficients &a, const LtsCoefficients &b)
 
LtsCoefficients operator- (LtsCoefficients &&a, LtsCoefficients &&b)
 
LtsCoefficients operator- (LtsCoefficients &&a, const LtsCoefficients &b)
 
LtsCoefficients operator- (const LtsCoefficients &a, LtsCoefficients &&b)
 
LtsCoefficients operator- (const LtsCoefficients &a, const LtsCoefficients &b)
 
template<typename T >
void apply_coefficients (gsl::not_null< T * > result, const LtsCoefficients &coefficients, const BoundaryHistoryEvaluator< T > &coupling)
 Add the LTS boundary terms for to result for the given set of coefficients.
 
bool operator== (const AdamsScheme &a, const AdamsScheme &b)
 
bool operator!= (const AdamsScheme &a, const AdamsScheme &b)
 
template<typename TimeType >
LtsCoefficients lts_coefficients (const ConstBoundaryHistoryTimes &local_times, const ConstBoundaryHistoryTimes &remote_times, const Time &start_time, const TimeType &end_time, const AdamsScheme &local_scheme, const AdamsScheme &remote_scheme, const AdamsScheme &small_step_scheme)
 

Variables

constexpr size_t lts_coefficients_static_size
 

Detailed Description

Shared LTS implementation for the two Adams-based methods.

Function Documentation

◆ lts_coefficients()

template<typename TimeType >
LtsCoefficients TimeSteppers::adams_lts::lts_coefficients ( const ConstBoundaryHistoryTimes local_times,
const ConstBoundaryHistoryTimes remote_times,
const Time start_time,
const TimeType &  end_time,
const AdamsScheme local_scheme,
const AdamsScheme remote_scheme,
const AdamsScheme small_step_scheme 
)

Calculate the nonzero terms in an Adams LTS boundary contribution.

The coefficients are generated for a step from start_time to end_time, integrating using the small_step_scheme. Interpolation from the elements is performed using polynomials appropriate for the given local_scheme and remote_scheme.

This function returns the sum of the coefficients for the small steps, i.e., the steps between all the times either side updates between the time bounds. Each small step is calculated as

\begin{equation} \Delta \tilde{y}_n = \Delta \tilde{t}_n \sum_{ij} D(y^L_{n,-i}, y^R_{n,-j}) \sum_q \tilde{\alpha}_{nq} \ell_i(\tilde{t}_{n-q}; t^L_\cdots, \ldots) \ell_j(\tilde{t}_{n-q}; t^R_\cdots, \ldots), \end{equation}

where \(y^L_{n,0}\) and \(y^R_{n,0}\) are the values of the local and remote variables at the start of the step containing small step \(n\), \(y^L_{n,1}\) and \(y^R_{n,1}\) are the predictor values for those steps, and other index values count backwards in the history of that side. The range of \(i\) and choice of the control times \(t^L_\cdots\) are determined by local_scheme, \(j\) and \(t^R_\cdots\) are determined by remote_scheme, and the Adams coefficients \(\tilde{\alpha}_{nq}\) correspond to small_step_scheme.

When called for dense output, the arguments must represent a single small step, i.e., the step cannot cross any of the control times. Any additional terms can be generated by a second call treating the remainder of the step as non-dense.

Template Parameters
TimeTypeThe type Time for a step aligned with the control times or ApproximateTime for dense output.

Variable Documentation

◆ lts_coefficients_static_size

constexpr size_t TimeSteppers::adams_lts::lts_coefficients_static_size
constexpr
Initial value:
=
adams_coefficients::maximum_order * (adams_coefficients::maximum_order + 1)