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

A FunctionOfTime that stores quaternions for the rotation map. More...

#include <QuaternionFunctionOfTime.hpp>

Public Member Functions

QuaternionFunctionOfTime (double t, std::array< DataVector, 1 > initial_quat_func, std::array< DataVector, MaxDeriv+1 > initial_omega_func, double expiration_time)

QuaternionFunctionOfTime (QuaternionFunctionOfTime &&)=default

QuaternionFunctionOfTimeoperator= (QuaternionFunctionOfTime &&)=default

QuaternionFunctionOfTime (const QuaternionFunctionOfTime &)=default

QuaternionFunctionOfTimeoperator= (const QuaternionFunctionOfTime &)=default

QuaternionFunctionOfTime (CkMigrateMessage *)

auto get_clone () const -> std::unique_ptr< FunctionOfTime > override

WRAPPED_PUPable_decl_template (QuaternionFunctionOfTime< MaxDeriv >)

void reset_expiration_time (const double next_expiration_time) override
Resets the expiration time to a new value. By default, the expiration time of a FunctionOfTime cannot be reset. More...

std::array< double, 2 > time_bounds () const override
Returns domain of validity for the function of time. More...

void update (double time_of_update, DataVector updated_max_deriv, double next_expiration_time) override
Updates the MaxDerivth derivative of the omega 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, 1 > omega_func (const double t) const
Returns stored omega at an arbitrary time t.

std::array< DataVector, 2 > omega_func_and_deriv (const double t) const
Returns stored omega and its first derivative at an arbitrary time t.

std::array< DataVector, 3 > omega_func_and_2_derivs (const double t) const
Returns stored omega and the first two derivatives at an arbitrary time t.

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 QuaternionFunctionOfTime< LocalMaxDeriv > &lhs, const QuaternionFunctionOfTime< LocalMaxDeriv > &rhs)

Detailed Description

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

A FunctionOfTime that stores quaternions for the rotation map.

Details

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 $$\dot{q} = \frac{1}{2} q \times \omega$$ where $$\omega$$ is the orbital angular velocity which is stored internally in a PiecewisePolynomial, and $$\times$$ here is quaternion multiplication.

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 omega 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 omega PiecewisePolynomial is accessible through the omega_func, omega_func_and_deriv, and omega_func_and_2_derivs functions which correspond to the function calls of a normal PiecewisePolynomial except without the omega_ prefix.

It is encouraged to use quat_func and omega_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 omega_func and quat_func so that function calls won't be ambiguous.

◆ func()

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

Returns the quaternion at an arbitrary time t.

Implements domain::FunctionsOfTime::FunctionOfTime.

◆ func_and_2_derivs()

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

Returns the quaternion and the first two derivatives at an arbitrary time t.

Implements domain::FunctionsOfTime::FunctionOfTime.

◆ func_and_deriv()

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

Returns the quaternion and its first derivative at an arbitrary time t.

Implements domain::FunctionsOfTime::FunctionOfTime.

◆ get_clone()

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

◆ reset_expiration_time()

template<size_t MaxDeriv>
 void domain::FunctionsOfTime::QuaternionFunctionOfTime< MaxDeriv >::reset_expiration_time ( const double )
inlineoverridevirtual

Resets the expiration time to a new value. By default, the expiration time of a FunctionOfTime cannot be reset.

Reimplemented from domain::FunctionsOfTime::FunctionOfTime.

◆ time_bounds()

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

Returns domain of validity for the function of time.

Implements domain::FunctionsOfTime::FunctionOfTime.

◆ update()

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

Updates the MaxDerivth derivative of the omega piecewisepolynomial at the given time, then updates the stored quaternions.

updated_max_deriv is a datavector of the MaxDerivs 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:
• src/Domain/FunctionsOfTime/QuaternionFunctionOfTime.hpp