SpECTRE
v2024.12.16
|
A FunctionOfTime that stores quaternions for the rotation map. More...
#include <QuaternionFunctionOfTime.hpp>
Public Member Functions | |
QuaternionFunctionOfTime (QuaternionFunctionOfTime &&) | |
QuaternionFunctionOfTime (const QuaternionFunctionOfTime &) | |
QuaternionFunctionOfTime & | operator= (QuaternionFunctionOfTime &&) |
QuaternionFunctionOfTime & | operator= (const QuaternionFunctionOfTime &) |
QuaternionFunctionOfTime (double t, const std::array< DataVector, 1 > &initial_quat_func, std::array< DataVector, MaxDeriv+1 > initial_angle_func, double expiration_time) | |
QuaternionFunctionOfTime (CkMigrateMessage *) | |
auto | get_clone () const -> std::unique_ptr< FunctionOfTime > override |
WRAPPED_PUPable_decl_template (QuaternionFunctionOfTime< MaxDeriv >) | |
std::array< double, 2 > | time_bounds () const override |
Returns domain of validity for the function of time. More... | |
double | expiration_after (double time) const override |
The first expiration time after time . More... | |
void | update (double time_of_update, DataVector updated_max_deriv, double next_expiration_time) override |
Updates the MaxDeriv th derivative of the angle piecewisepolynomial at the given time, then updates the stored quaternions. More... | |
void | pup (PUP::er &p) override |
std::array< DataVector, 1 > | func (const double t) const override |
Returns the quaternion at an arbitrary time t . More... | |
std::array< DataVector, 2 > | func_and_deriv (const double t) const override |
Returns the quaternion 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 quaternion and the first two derivatives at an arbitrary time t . More... | |
std::array< DataVector, 1 > | quat_func (double t) const |
Returns the quaternion at an arbitrary time t . | |
std::array< DataVector, 2 > | quat_func_and_deriv (double t) const |
Returns the quaternion and its first derivative at an arbitrary time t . | |
std::array< DataVector, 3 > | quat_func_and_2_derivs (double t) const |
Returns the quaternion and the first two derivatives at an arbitrary time t . | |
std::array< DataVector, 4 > | quat_func_and_3_derivs (double t) const |
Returns the quaternion and the first three derivatives at an arbitrary time t . | |
std::array< DataVector, 1 > | angle_func (const double t) const |
Returns stored angle at an arbitrary time t . | |
std::array< DataVector, 2 > | angle_func_and_deriv (const double t) const |
Returns stored angle and its first derivative (omega) at an arbitrary time t . | |
std::array< DataVector, 3 > | angle_func_and_2_derivs (const double t) const |
Returns stored angle and the first two derivatives at an arbitrary time t . | |
std::vector< DataVector > | angle_func_and_all_derivs (const double t) const |
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 QuaternionFunctionOfTime< LocalMaxDeriv > &lhs, const QuaternionFunctionOfTime< LocalMaxDeriv > &rhs) |
template<size_t LocalMaxDeriv> | |
std::ostream & | operator<< (std::ostream &os, const QuaternionFunctionOfTime< LocalMaxDeriv > &quaternion_f_of_t) |
A FunctionOfTime that stores quaternions for the rotation map.
This FunctionOfTime stores quaternions that will be used in the time-dependent rotation map as well as the orbital angular velocity that will be controlled by the rotation control sytem. To get the quaternion, an ODE is solved of the form PiecewisePolynomial
, and
Different from a PiecewisePolynomial
, only the quaternion itself is stored, not any of the derivatives because the derivatives must be calculated from the solved ODE at every function call. Because derivatives of the quaternion are not stored, the template parameter MaxDeriv
refers to both the max derivative of the stored angle PiecewisePolynomial and the max derivative returned by the QuaternionFunctionOfTime. The update
function is then just a wrapper around the internal PiecewisePolynomial::update
function with the addition that it then updates the stored quaternions as well.
The angle PiecewisePolynomial is accessible through the angle_func
, angle_func_and_deriv
, and angle_func_and_2_derivs
functions which correspond to the function calls of a normal PiecewisePolynomial except without the angle_
prefix.
It is encouraged to use quat_func
and angle_func
when you want the specific values of the functions to avoid ambiguity in what you are calling. However, the original three func
functions inherited from the FunctionOfTime base class are necessary because the maps use the generic func
functions, thus they return the quaternion and its derivatives (which are needed for the map). This is all to keep the symmetry of naming angle_func
and quat_func
so that function calls won't be ambiguous.
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 quaternion at an arbitrary time t
.
Implements domain::FunctionsOfTime::FunctionOfTime.
|
inlineoverridevirtual |
Returns the quaternion and the first two derivatives at an arbitrary time t
.
Implements domain::FunctionsOfTime::FunctionOfTime.
|
inlineoverridevirtual |
Returns the quaternion and its first derivative at an arbitrary time t
.
Implements domain::FunctionsOfTime::FunctionOfTime.
|
overridevirtual |
Implements domain::FunctionsOfTime::FunctionOfTime.
|
overridevirtual |
Returns domain of validity for the function of time.
Implements domain::FunctionsOfTime::FunctionOfTime.
|
overridevirtual |
Updates the MaxDeriv
th derivative of the angle piecewisepolynomial at the given time, then updates the stored quaternions.
updated_max_deriv
is a datavector of the MaxDeriv
s 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.