SpECTRE  v2024.02.05
TimeSequences::EvenlySpaced< T > Class Template Reference

A sequence of evenly spaced times. More...

#include <TimeSequence.hpp>

Classes

struct  Interval
 
struct  Offset
 

Public Types

using options = tmpl::list< Interval, Offset >
 

Public Member Functions

 EvenlySpaced (T interval, T offset=0, const Options::Context &context={})
 
std::array< std::optional< T >, 3 > times_near (T time) const override
 Returns the time in the sequence nearest to time, the time before that, and the time after, in numerical order. These values allow a consumer to find the times in the sequence bracketing the given time and give enough additional information so that exact or roundoff matches can be handled however the consumer wishes. Any time that does not exist (because the sequence terminates) is returned as an empty std::optional. The central std::optional will be populated unless the sequence is empty. More...
 
void pup (PUP::er &p) override
 
- Public Member Functions inherited from TimeSequence< T >
 WRAPPED_PUPable_abstract (TimeSequence)
 
virtual std::array< std::optional< T >, 3 > times_near (T time) const =0
 Returns the time in the sequence nearest to time, the time before that, and the time after, in numerical order. These values allow a consumer to find the times in the sequence bracketing the given time and give enough additional information so that exact or roundoff matches can be handled however the consumer wishes. Any time that does not exist (because the sequence terminates) is returned as an empty std::optional. The central std::optional will be populated unless the sequence is empty. More...
 

Static Public Attributes

static constexpr Options::String help
 

Detailed Description

template<typename T>
class TimeSequences::EvenlySpaced< T >

A sequence of evenly spaced times.

The sequence of times

\begin{equation} n \times \mathrm{Interval} + \mathrm{Offset} \end{equation}

for all integers \(n\).

Member Function Documentation

◆ times_near()

template<typename T >
std::array< std::optional< T >, 3 > TimeSequences::EvenlySpaced< T >::times_near ( time) const
overridevirtual

Returns the time in the sequence nearest to time, the time before that, and the time after, in numerical order. These values allow a consumer to find the times in the sequence bracketing the given time and give enough additional information so that exact or roundoff matches can be handled however the consumer wishes. Any time that does not exist (because the sequence terminates) is returned as an empty std::optional. The central std::optional will be populated unless the sequence is empty.

Implements TimeSequence< T >.

Member Data Documentation

◆ help

template<typename T >
constexpr Options::String TimeSequences::EvenlySpaced< T >::help
staticconstexpr
Initial value:
=
"The sequence of times n * Interval + Offset for all integers n."

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