SpECTRE  v2025.08.19
domain::FunctionsOfTime::SettleToConstant Class Reference

Given an initial function of time, transitions the map to a constant-in-time value. More...

#include <SettleToConstant.hpp>

Public Member Functions

 SettleToConstant (const std::array< DataVector, 3 > &initial_func_and_derivs, double match_time, double decay_time)
 
 SettleToConstant (SettleToConstant &&)=default
 
SettleToConstantoperator= (SettleToConstant &&)=default
 
 SettleToConstant (const SettleToConstant &)=default
 
SettleToConstantoperator= (const SettleToConstant &)=default
 
 WRAPPED_PUPable_decl_template (SettleToConstant)
 
 SettleToConstant (CkMigrateMessage *)
 
auto get_clone () const -> std::unique_ptr< FunctionOfTime > override
 
std::array< DataVector, 1 > func (double t) const override
 Returns the function at an arbitrary time t. More...
 
std::array< DataVector, 2 > func_and_deriv (double t) const override
 Returns the function and its first derivative at an arbitrary time t. More...
 
std::array< DataVector, 3 > func_and_2_derivs (double t) const override
 Returns the function and the first two derivatives at an arbitrary time t. More...
 
std::array< double, 2 > time_bounds () const override
 Returns the domain of validity of the function. More...
 
double expiration_after (double time) const override
 The first expiration time after time. More...
 
void truncate_at_time (double time) override
 Discards data only needed before the passed time, to reduce memory use. More...
 
void pup (PUP::er &p) override
 
- Public Member Functions inherited from domain::FunctionsOfTime::FunctionOfTime
 FunctionOfTime (FunctionOfTime &&)=default
 
FunctionOfTimeoperator= (FunctionOfTime &&)=default
 
 FunctionOfTime (const FunctionOfTime &)=default
 
FunctionOfTimeoperator= (const FunctionOfTime &)=default
 
virtual auto get_clone () const -> std::unique_ptr< FunctionOfTime >=0
 
virtual std::unique_ptr< FunctionOfTimecreate_at_time (const double, const double) const
 Create a FunctionOfTime at time t as if one had created a new FunctionOfTime with t as its initial time, except the initial values of new FunctionOfTime are the exact values of the old FunctionOfTime at time t, and the new expriation is expiration_time. More...
 
virtual std::array< double, 2 > time_bounds () const =0
 Returns the domain of validity of the function. For FunctionsOfTime that allow a small amount of time extrapolation, time_bounds tells you the bounds including the allowed extrapolation interval. More...
 
virtual double expiration_after (double time) const =0
 The first expiration time after time. More...
 
virtual void update (double, DataVector, double)
 Updates the maximum derivative of the FunctionOfTime at a given time while also resetting the expiration. By default, a FunctionOfTime cannot be updated. More...
 
virtual void truncate_at_time (double time)=0
 Discards data only needed before the passed time, to reduce memory use. More...
 
virtual std::array< DataVector, 1 > func (double t) const =0
 The DataVector can be of any size. More...
 
virtual std::array< DataVector, 2 > func_and_deriv (double t) const =0
 The DataVector can be of any size. More...
 
virtual std::array< DataVector, 3 > func_and_2_derivs (double t) const =0
 The DataVector can be of any size. More...
 
virtual std::vector< DataVectorfunc_and_all_derivs (double t) const
 All derivatives a function of time has to offer (because it can be more than 2) More...
 
 WRAPPED_PUPable_abstract (FunctionOfTime)
 

Friends

bool operator== (const SettleToConstant &lhs, const SettleToConstant &rhs)
 

Detailed Description

Given an initial function of time, transitions the map to a constant-in-time value.

Given an initial function \(f(t)\) and its first two derivatives at the matching time \(t_0\), the constant coefficients \(A,B,C\) are computed such that the resulting function of time \(g(t)\) satisfies \(g(t=t_0)=f(t=t_0)\) and approaches a constant value for \(t > t_0\) on a timescale of \(\tau\). The resultant function is

\[ g(t) = A + (B+C(t-t_0)) e^{-(t-t_0)/\tau} \]

where \(\tau\)=decay_time and \(t_0\)=match_time.

Member Function Documentation

◆ expiration_after()

double domain::FunctionsOfTime::SettleToConstant::expiration_after ( double  time) const
overridevirtual

The first expiration time after time.

Details

For non-updatable functions, this returns infinity. For updatable functions, the first expiration time after time is found by determining the update immediately before time. The expiration time of this update is what is returned. If time happens to be an update itself, then the expiration of that update is returned.

Implements domain::FunctionsOfTime::FunctionOfTime.

◆ func()

std::array< DataVector, 1 > domain::FunctionsOfTime::SettleToConstant::func ( double  t) const
overridevirtual

Returns the function at an arbitrary time t.

Implements domain::FunctionsOfTime::FunctionOfTime.

◆ func_and_2_derivs()

std::array< DataVector, 3 > domain::FunctionsOfTime::SettleToConstant::func_and_2_derivs ( double  t) const
overridevirtual

Returns the function and the first two derivatives at an arbitrary time t.

Implements domain::FunctionsOfTime::FunctionOfTime.

◆ func_and_deriv()

std::array< DataVector, 2 > domain::FunctionsOfTime::SettleToConstant::func_and_deriv ( double  t) const
overridevirtual

Returns the function and its first derivative at an arbitrary time t.

Implements domain::FunctionsOfTime::FunctionOfTime.

◆ get_clone()

auto domain::FunctionsOfTime::SettleToConstant::get_clone ( ) const -> std::unique_ptr< FunctionOfTime >
overridevirtual

◆ time_bounds()

std::array< double, 2 > domain::FunctionsOfTime::SettleToConstant::time_bounds ( ) const
overridevirtual

Returns the domain of validity of the function.

Implements domain::FunctionsOfTime::FunctionOfTime.

◆ truncate_at_time()

void domain::FunctionsOfTime::SettleToConstant::truncate_at_time ( double  time)
overridevirtual

Discards data only needed before the passed time, to reduce memory use.

It should be safe to call this method concurrently with update and access of any data not before time.

Implements domain::FunctionsOfTime::FunctionOfTime.


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