SpECTRE  v2021.12.06
domain::FunctionsOfTime::FixedSpeedCubic Class Reference

Sets \(f(t)\) and derivatives using cubic rational functions, such that the first derivative approaches a constant and the second derivative approaches zero. More...

#include <FixedSpeedCubic.hpp>

Public Member Functions

 FixedSpeedCubic (double initial_function_value, double initial_time, double velocity, double decay_timescale)
 
 FixedSpeedCubic (FixedSpeedCubic &&)=default
 
FixedSpeedCubicoperator= (FixedSpeedCubic &&)=default
 
 FixedSpeedCubic (const FixedSpeedCubic &)=default
 
FixedSpeedCubicoperator= (const FixedSpeedCubic &)=default
 
 WRAPPED_PUPable_decl_template (FixedSpeedCubic)
 
 FixedSpeedCubic (CkMigrateMessage *)
 
auto get_clone () const -> std::unique_ptr< FunctionOfTime > override
 
std::array< DataVector, 1 > func (const double t) const override
 Returns the function at an arbitrary time t. More...
 
std::array< DataVector, 2 > func_and_deriv (const 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 (const 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...
 
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::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 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 reset_expiration_time (double)
 Resets the expiration time to a new value. By default, the expiration time of a FunctionOfTime cannot be reset. 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...
 
 WRAPPED_PUPable_abstract (FunctionOfTime)
 

Friends

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

Detailed Description

Sets \(f(t)\) and derivatives using cubic rational functions, such that the first derivative approaches a constant and the second derivative approaches zero.

The resultant function of time is

\begin{align*} f(t) &= f_0 + \frac{v(t-t_0)^3}{\tau^2+(t-t_0)^2}, \end{align*}

where \(f_0\) is the value of the function \(f\) at the initial time \(t_0\), and \(v\) is the velocity that \(f^\prime(t)\) approaches on a timescale of \(\tau\).

Member Function Documentation

◆ func()

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

Returns the function at an arbitrary time t.

Implements domain::FunctionsOfTime::FunctionOfTime.

◆ func_and_2_derivs()

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

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::FixedSpeedCubic::func_and_deriv ( const double  t) const
inlineoverridevirtual

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

Implements domain::FunctionsOfTime::FunctionOfTime.

◆ get_clone()

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

◆ time_bounds()

std::array< double, 2 > domain::FunctionsOfTime::FixedSpeedCubic::time_bounds ( ) const
inlineoverridevirtual

Returns the domain of validity of the function.

Implements domain::FunctionsOfTime::FunctionOfTime.


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