SpECTRE  v2025.08.19
TimeSteppers::adams_lts Namespace Reference

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

Classes

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 Adams scheme.
 

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.
 
template<typename TimeType >
LtsCoefficients lts_coefficients (const ConstBoundaryHistoryTimes &local_times, const ConstBoundaryHistoryTimes &remote_times, const Time &start_time, const TimeType &end_time, SchemeType local_scheme, SchemeType remote_scheme, int local_order_offset, int remote_order_offset)
 

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,
SchemeType  local_scheme,
SchemeType  remote_scheme,
int  local_order_offset,
int  remote_order_offset 
)

Calculate the nonzero terms in an Adams LTS boundary contribution.

The coefficients are generated for a step from start_time to end_time. Interpolation from the elements is performed using polynomials appropriate for the given local_scheme and remote_scheme. The orders for the interpolations are taken from the local_times and remote_times, adjusted by local_order_offset and remote_order_offset, which can be either 0 or -1. The small-step integration is performed with an implicit method if either local_scheme or remote_scheme is implicit, and the order is the larger of the integration orders on the two sides, reduced by one if both sides have offset -1.

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 and the local order, \(j\) and \(t^R_\cdots\) are determined by remote_scheme and the remote order, and the Adams coefficients \(\tilde{\alpha}_{nq}\) correspond to the larger of the two orders, and are implicit if either set of interpolation coefficients is.

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)