SpECTRE  v2021.12.06
domain::FunctionsOfTime::PiecewisePolynomial< MaxDeriv > Class Template Reference

A function that has a piecewise-constant MaxDerivth derivative. More...

#include <PiecewisePolynomial.hpp>

Public Member Functions

 PiecewisePolynomial (double t, std::array< DataVector, MaxDeriv+1 > initial_func_and_derivs, double expiration_time)
 
 PiecewisePolynomial (PiecewisePolynomial &&)=default
 
PiecewisePolynomialoperator= (PiecewisePolynomial &&)=default
 
 PiecewisePolynomial (const PiecewisePolynomial &)=default
 
PiecewisePolynomialoperator= (const PiecewisePolynomial &)=default
 
 PiecewisePolynomial (CkMigrateMessage *)
 
auto get_clone () const -> std::unique_ptr< FunctionOfTime > override
 
 WRAPPED_PUPable_decl_template (PiecewisePolynomial< MaxDeriv >)
 
std::array< DataVector, 1 > func (double t) const override
 Returns the function at an arbitrary time t. If MaxDeriv is 0 and update has been called for time t, the updated value is ignored. More...
 
std::array< DataVector, 2 > func_and_deriv (double t) const override
 Returns the function and its first derivative at an arbitrary time t. If MaxDeriv is 1 and update has been called for time t, the updated value is ignored. 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. If MaxDeriv is 2 and update has been called for time t, the updated value is ignored. More...
 
void update (double time_of_update, DataVector updated_max_deriv, double next_expiration_time) override
 Updates the MaxDerivth derivative of the function at the given time. updated_max_deriv is a vector of the MaxDerivths for each component. next_expiration_time is the next expiration time. More...
 
void reset_expiration_time (double next_expiration_time) override
 Resets the expiration time to a later time. More...
 
std::array< double, 2 > time_bounds () const override
 Returns the domain of validity of the function, including the extrapolation region. More...
 
const std::vector< FunctionOfTimeHelpers::StoredInfo< MaxDeriv+1 > > & get_deriv_info () const
 Return a const reference to the stored deriv info so external classes can read the stored times and derivatives (mostly for QuaternionFunctionOfTime).
 
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

template<size_t LocalMaxDeriv>
bool operator== (const PiecewisePolynomial< LocalMaxDeriv > &lhs, const PiecewisePolynomial< LocalMaxDeriv > &rhs)
 
template<size_t LocalMaxDeriv>
std::ostreamoperator<< (std::ostream &os, const PiecewisePolynomial< LocalMaxDeriv > &piecewise_polynomial)
 

Detailed Description

template<size_t MaxDeriv>
class domain::FunctionsOfTime::PiecewisePolynomial< MaxDeriv >

A function that has a piecewise-constant MaxDerivth derivative.

Member Function Documentation

◆ func()

template<size_t MaxDeriv>
std::array< DataVector, 1 > domain::FunctionsOfTime::PiecewisePolynomial< MaxDeriv >::func ( double  t) const
inlineoverridevirtual

Returns the function at an arbitrary time t. If MaxDeriv is 0 and update has been called for time t, the updated value is ignored.

Implements domain::FunctionsOfTime::FunctionOfTime.

◆ func_and_2_derivs()

template<size_t MaxDeriv>
std::array< DataVector, 3 > domain::FunctionsOfTime::PiecewisePolynomial< MaxDeriv >::func_and_2_derivs ( double  t) const
inlineoverridevirtual

Returns the function and the first two derivatives at an arbitrary time t. If MaxDeriv is 2 and update has been called for time t, the updated value is ignored.

Implements domain::FunctionsOfTime::FunctionOfTime.

◆ func_and_deriv()

template<size_t MaxDeriv>
std::array< DataVector, 2 > domain::FunctionsOfTime::PiecewisePolynomial< MaxDeriv >::func_and_deriv ( double  t) const
inlineoverridevirtual

Returns the function and its first derivative at an arbitrary time t. If MaxDeriv is 1 and update has been called for time t, the updated value is ignored.

Implements domain::FunctionsOfTime::FunctionOfTime.

◆ get_clone()

template<size_t MaxDeriv>
auto domain::FunctionsOfTime::PiecewisePolynomial< MaxDeriv >::get_clone ( ) const -> std::unique_ptr< FunctionOfTime >
overridevirtual

◆ reset_expiration_time()

template<size_t MaxDeriv>
void domain::FunctionsOfTime::PiecewisePolynomial< MaxDeriv >::reset_expiration_time ( double  next_expiration_time)
overridevirtual

Resets the expiration time to a later time.

Reimplemented from domain::FunctionsOfTime::FunctionOfTime.

◆ time_bounds()

template<size_t MaxDeriv>
std::array< double, 2 > domain::FunctionsOfTime::PiecewisePolynomial< MaxDeriv >::time_bounds ( ) const
inlineoverridevirtual

Returns the domain of validity of the function, including the extrapolation region.

Implements domain::FunctionsOfTime::FunctionOfTime.

◆ update()

template<size_t MaxDeriv>
void domain::FunctionsOfTime::PiecewisePolynomial< MaxDeriv >::update ( double  time_of_update,
DataVector  updated_max_deriv,
double  next_expiration_time 
)
overridevirtual

Updates the MaxDerivth derivative of the function at the given time. updated_max_deriv is a vector of the MaxDerivths for each component. next_expiration_time is the next expiration time.

Reimplemented from domain::FunctionsOfTime::FunctionOfTime.


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