SpECTRE
v2024.09.29
|
A function that has a piecewise-constant MaxDeriv
th derivative.
More...
#include <PiecewisePolynomial.hpp>
Public Member Functions | |
PiecewisePolynomial (PiecewisePolynomial &&) | |
PiecewisePolynomial (const PiecewisePolynomial &) | |
PiecewisePolynomial & | operator= (PiecewisePolynomial &&) |
PiecewisePolynomial & | operator= (const PiecewisePolynomial &) |
PiecewisePolynomial (double t, std::array< DataVector, MaxDeriv+1 > initial_func_and_derivs, double expiration_time) | |
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... | |
std::vector< DataVector > | func_and_all_derivs (double t) const override |
Return the function and all derivs up to and including the MaxDeriv at an arbitrary time t . More... | |
void | update (double time_of_update, DataVector updated_max_deriv, double next_expiration_time) override |
Updates the MaxDeriv th derivative of the function at the given time. updated_max_deriv is a vector of the MaxDeriv ths for each component. next_expiration_time is the next expiration time. More... | |
std::array< double, 2 > | time_bounds () const override |
Returns the domain of validity of the function, including the extrapolation region. More... | |
double | expiration_after (double time) const override |
The first expiration time after time . More... | |
void | pup (PUP::er &p) override |
Public Member Functions inherited from domain::FunctionsOfTime::FunctionOfTime | |
FunctionOfTime (FunctionOfTime &&)=default | |
FunctionOfTime & | operator= (FunctionOfTime &&)=default |
FunctionOfTime (const FunctionOfTime &)=default | |
FunctionOfTime & | operator= (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 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 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< DataVector > | func_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 | |
template<size_t LocalMaxDeriv> | |
bool | operator== (const PiecewisePolynomial< LocalMaxDeriv > &lhs, const PiecewisePolynomial< LocalMaxDeriv > &rhs) |
template<size_t LocalMaxDeriv> | |
std::ostream & | operator<< (std::ostream &os, const PiecewisePolynomial< LocalMaxDeriv > &piecewise_polynomial) |
A function that has a piecewise-constant MaxDeriv
th derivative.
Parallel::GlobalCache
for objects held by mutable global cache tags.
|
overridevirtual |
The first expiration time after time
.
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.
|
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.
|
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.
|
overridevirtual |
Return the function and all derivs up to and including the MaxDeriv
at an arbitrary time t
.
Reimplemented from domain::FunctionsOfTime::FunctionOfTime.
|
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.
|
overridevirtual |
Implements domain::FunctionsOfTime::FunctionOfTime.
|
overridevirtual |
Returns the domain of validity of the function, including the extrapolation region.
Implements domain::FunctionsOfTime::FunctionOfTime.
|
overridevirtual |
Updates the MaxDeriv
th derivative of the function at the given time. updated_max_deriv
is a vector of the MaxDeriv
ths for each component. next_expiration_time
is the next expiration time.
The time_of_update
must be the same as the old expiration time. It is passed as a check that the calling code is computing the other arguments with the correct value.
Reimplemented from domain::FunctionsOfTime::FunctionOfTime.