SpECTRE  v2021.12.06
domain::CoordinateMaps::TimeDependent::Rotation< 2 > Class Reference

Time-dependent spatial rotation in two dimensions. More...

#include <Rotation.hpp>

Public Member Functions

 Rotation (std::string function_of_time_name)
 
template<typename T >
std::array< tt::remove_cvref_wrap_t< T >, 2 > operator() (const std::array< T, 2 > &source_coords, double time, const std::unordered_map< std::string, std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > > &functions_of_time) const
 
std::optional< std::array< double, 2 > > inverse (const std::array< double, 2 > &target_coords, double time, const std::unordered_map< std::string, std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > > &functions_of_time) const
 The inverse function is only callable with doubles because the inverse might fail if called for a point out of range, and it is unclear what should happen if the inverse were to succeed for some points in a DataVector but fail for other points.
 
template<typename T >
std::array< tt::remove_cvref_wrap_t< T >, 2 > frame_velocity (const std::array< T, 2 > &source_coords, double time, const std::unordered_map< std::string, std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > > &functions_of_time) const
 
template<typename T >
tnsr::Ij< tt::remove_cvref_wrap_t< T >, 2, Frame::NoFramejacobian (const std::array< T, 2 > &source_coords, double time, const std::unordered_map< std::string, std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > > &functions_of_time) const
 
template<typename T >
tnsr::Ij< tt::remove_cvref_wrap_t< T >, 2, Frame::NoFrameinv_jacobian (const std::array< T, 2 > &source_coords, double time, const std::unordered_map< std::string, std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > > &functions_of_time) const
 
void pup (PUP::er &p)
 

Static Public Member Functions

static bool is_identity ()
 

Static Public Attributes

static constexpr size_t dim = 2
 

Friends

bool operator== (const Rotation< 2 > &lhs, const Rotation< 2 > &rhs)
 

Detailed Description

Time-dependent spatial rotation in two dimensions.

Let \((R,\Phi)\) be the polar coordinates associated with \((\xi,\eta)\), where \(\xi\) and \(\eta\) are the unmapped coordiantes. Let \((r,\phi)\) be the polar coordinates associated with \((x,y)\), where \(x\) and \(y\) are the mapped coordinates. This map applies the spatial rotation \(\phi = \Phi + \alpha(t)\).

The formula for the mapping is:

\begin{eqnarray*} x &=& \xi \cos \alpha(t) - \eta \sin \alpha(t), \\ y &=& \xi \sin \alpha(t) + \eta \cos \alpha(t). \end{eqnarray*}

Note
Currently, only a rotation in two-dimensional space is implemented here. In the future, this class should be extended to also support three-dimensional rotations using quaternions.

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