SpECTRE  v2025.03.17
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
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 α is about z axis. Second rotation β is about rotated y axis. Third rotation γ is about rotated z axis. These rotations are of the (ξ,η,ζ) coordinate system with respect to the grid coordinates (x,y,z).

The formula for the mapping is:

x=ξ(cosγcosβcosαsinγsinα)+η(sinγcosβcosαcosγsinα)+ζsinβcosαy=ξ(cosγcosβsinα+sinγcosα)+η(sinγcosβsinα+cosγcosα)+ζsinβsinαz=ξcosγsinβ+ηsinγsinβ+ζcosβ

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 α (in radians).
rotation_about_rotated_ythe angle β (in radians).
rotation_about_rotated_zthe angle γ (in radians).

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