SpECTRE  2021.08.02
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) noexcept
 
 FixedSpeedCubic (FixedSpeedCubic &&) noexcept=default
 
FixedSpeedCubicoperator= (FixedSpeedCubic &&) noexcept=default
 
 FixedSpeedCubic (const FixedSpeedCubic &)=default
 
FixedSpeedCubicoperator= (const FixedSpeedCubic &)=default
 
 WRAPPED_PUPable_decl_template (FixedSpeedCubic)
 
 FixedSpeedCubic (CkMigrateMessage *)
 
auto get_clone () const noexcept -> std::unique_ptr< FunctionOfTime > override
 
std::array< DataVector, 1 > func (const double t) const noexcept override
 Returns the function at an arbitrary time t. More...
 
std::array< DataVector, 2 > func_and_deriv (const double t) const noexcept 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 noexcept override
 Returns the function and the first two derivatives at an arbitrary time t. More...
 
std::array< double, 2 > time_bounds () const noexcept 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 &&) noexcept=default
 
FunctionOfTimeoperator= (FunctionOfTime &&) noexcept=default
 
 FunctionOfTime (const FunctionOfTime &)=default
 
FunctionOfTimeoperator= (const FunctionOfTime &)=default
 
 WRAPPED_PUPable_abstract (FunctionOfTime)
 

Friends

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

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
inlineoverridevirtualnoexcept

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
inlineoverridevirtualnoexcept

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
inlineoverridevirtualnoexcept

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 >
overridevirtualnoexcept

◆ time_bounds()

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

Returns the domain of validity of the function.

Implements domain::FunctionsOfTime::FunctionOfTime.