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

Spatial rotation in three dimensions using Euler angles. More...

#include <Rotation.hpp>

Public Member Functions

 Rotation (double rotation_about_z, double rotation_about_rotated_y, double rotation_about_rotated_z)
 Constructor. More...
 
 Rotation (const Rotation &)=default
 
Rotationoperator= (const Rotation &)=default
 
 Rotation (Rotation &&)=default
 
Rotationoperator= (Rotation &&)=default
 
template<typename T >
std::array< tt::remove_cvref_wrap_t< T >, 3 > operator() (const std::array< T, 3 > &source_coords) const
 
std::optional< std::array< double, 3 > > inverse (const std::array< double, 3 > &target_coords) const
 
template<typename T >
tnsr::Ij< tt::remove_cvref_wrap_t< T >, 3, Frame::NoFramejacobian (const std::array< T, 3 > &source_coords) const
 
template<typename T >
tnsr::Ij< tt::remove_cvref_wrap_t< T >, 3, Frame::NoFrameinv_jacobian (const std::array< T, 3 > &source_coords) const
 
void pup (PUP::er &p)
 
bool is_identity () const
 

Static Public Attributes

static constexpr size_t dim = 3
 

Friends

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

Detailed Description

Spatial rotation in three dimensions using Euler angles.

Rotation angles should be specified in degrees. First rotation \(\alpha\) is about z axis. Second rotation \(\beta\) is about rotated y axis. Third rotation \(\gamma\) is about rotated z axis. These rotations are of the \((\xi,\eta,\zeta)\) coordinate system with respect to the grid coordinates \((x,y,z)\).

The formula for the mapping is:

\begin{eqnarray*} x &=& \xi (\cos\gamma \cos\beta \cos\alpha - \sin\gamma \sin\alpha) + \eta (-\sin\gamma \cos\beta \cos\alpha - \cos\gamma \sin\alpha) + \zeta \sin\beta \cos\alpha \\ y &=& \xi (\cos\gamma \cos\beta \sin\alpha + \sin\gamma \cos\alpha) + \eta (-\sin\gamma \cos\beta \sin\alpha + \cos\gamma \cos\alpha) + \zeta \sin\beta \sin\alpha \\ z &=& -\xi \cos\gamma \sin\beta + \eta \sin\gamma \sin\beta + \zeta \cos\beta \end{eqnarray*}

Constructor & Destructor Documentation

◆ Rotation()

domain::CoordinateMaps::Rotation< 3 >::Rotation ( double  rotation_about_z,
double  rotation_about_rotated_y,
double  rotation_about_rotated_z 
)

Constructor.

Parameters
rotation_about_zthe angle \(\alpha\) (in radians).
rotation_about_rotated_ythe angle \(\beta\) (in radians).
rotation_about_rotated_zthe angle \(\gamma\) (in radians).

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