SpECTRE  v2026.04.01
Loading...
Searching...
No Matches
domain::FunctionsOfTime::IntegratedFunctionOfTime Class Reference

A function that is integrated manually. More...

#include <IntegratedFunctionOfTime.hpp>

Public Member Functions

 IntegratedFunctionOfTime (IntegratedFunctionOfTime &&)
 IntegratedFunctionOfTime (const IntegratedFunctionOfTime &)
IntegratedFunctionOfTimeoperator= (IntegratedFunctionOfTime &&)
IntegratedFunctionOfTimeoperator= (const IntegratedFunctionOfTime &)
 IntegratedFunctionOfTime (double t, std::array< double, 2 > initial_func_and_derivs, double expiration_time, bool rotation)
 Constructs the function using the initial time, initial values, derivative and expiration time. If rotation is true, the function will be converted to a quaternion before it is output as used by the Rotation map.
 WRAPPED_PUPable_decl_template (IntegratedFunctionOfTime)
 IntegratedFunctionOfTime (CkMigrateMessage *)
auto get_clone () const -> std::unique_ptr< FunctionOfTime > override
std::unique_ptr< FunctionOfTimecreate_at_time (double t, double expiration_time) const override
 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.
std::array< DataVector, 1 > func (double t) const override
 The DataVector can be of any size.
std::array< DataVector, 2 > func_and_deriv (double t) const override
 The DataVector can be of any size.
std::array< DataVector, 3 > func_and_2_derivs (double) const override
 The DataVector can be of any size.
void update (double time_of_update, DataVector updated_value_and_derivative, double next_expiration_time) override
 Updates the function to the next global time step. The updated_value_and_derivative argument needs to be a DataVector of size 2, with the zeroth element holding the function's value and the first element holding its derivative. If rotation_ is set to true, this corresponds to the angle and the angular velocity for a rotation about the z-axis.
double expiration_after (double time) const override
 The first expiration time after time.
std::array< double, 2 > time_bounds () const override
 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.
void truncate_at_time (double time) override
 Discards data only needed before the passed time, to reduce memory use.
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 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)
 WRAPPED_PUPable_abstract (FunctionOfTime)

Friends

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

Detailed Description

A function that is integrated manually.

Details

This function only works with global time steppers that have strictly positively increasing substeps. When evaluated at this global time step, it returns the function and first derivative at that time step. It therefore needs to be updated every time step with its current values.

Member Function Documentation

◆ create_at_time()

std::unique_ptr< FunctionOfTime > domain::FunctionsOfTime::IntegratedFunctionOfTime::create_at_time ( double ,
double  ) const
overridevirtual

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.

Details

This defaults to just get_clone() since some functions can't be updated/don't expire.

Reimplemented from domain::FunctionsOfTime::FunctionOfTime.

◆ expiration_after()

double domain::FunctionsOfTime::IntegratedFunctionOfTime::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::IntegratedFunctionOfTime::func ( double t) const
overridevirtual

The DataVector can be of any size.

Implements domain::FunctionsOfTime::FunctionOfTime.

◆ func_and_2_derivs()

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

The DataVector can be of any size.

Implements domain::FunctionsOfTime::FunctionOfTime.

◆ func_and_deriv()

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

The DataVector can be of any size.

Implements domain::FunctionsOfTime::FunctionOfTime.

◆ get_clone()

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

◆ time_bounds()

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

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.

Implements domain::FunctionsOfTime::FunctionOfTime.

◆ truncate_at_time()

void domain::FunctionsOfTime::IntegratedFunctionOfTime::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.

◆ update()

void domain::FunctionsOfTime::IntegratedFunctionOfTime::update ( double time_of_update,
DataVector updated_value_and_derivative,
double next_expiration_time )
overridevirtual

Updates the function to the next global time step. The updated_value_and_derivative argument needs to be a DataVector of size 2, with the zeroth element holding the function's value and the first element holding its derivative. If rotation_ is set to true, this corresponds to the angle and the angular velocity for a rotation about the z-axis.

Reimplemented from domain::FunctionsOfTime::FunctionOfTime.


The documentation for this class was generated from the following file:
  • src/Domain/FunctionsOfTime/IntegratedFunctionOfTime.hpp