SpECTRE  v2024.12.16
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Direction< VolumeDim > Class Template Reference

A particular Side along a particular coordinate Axis. More...

#include <Direction.hpp>

Public Member Functions

 Direction (Axis axis, Side side)
 Construct by specifying an Axis and a Side.
 
 Direction (size_t dimension, Side side)
 Construct by specifying a dimension and a Side.
 
 Direction ()
 Default constructor for Charm++ serialization.
 
size_t dimension () const
 The dimension of the Direction.
 
Axis axis () const
 The Axis of the Direction.
 
Side side () const
 The side of the Direction.
 
double sign () const
 The sign for the normal to the Side. More...
 
Direction< VolumeDim > opposite () const
 The opposite Direction.
 
uint8_t bits () const
 
void pup (PUP::er &p)
 Serialization for Charm++.
 

Static Public Member Functions

static Direction< VolumeDim > self ()
 Get a Direction representing "self" or "no direction".
 
static const std::array< Direction< VolumeDim >, 2 *VolumeDim > & all_directions ()
 
static Direction< VolumeDim > lower_xi ()
 Helper functions for creating specific Directions. These are labeled by the logical-coordinate names (Xi,Eta,Zeta).
 
static Direction< VolumeDim > upper_xi ()
 Helper functions for creating specific Directions. These are labeled by the logical-coordinate names (Xi,Eta,Zeta).
 
static Direction< VolumeDim > lower_eta ()
 Helper functions for creating specific Directions. These are labeled by the logical-coordinate names (Xi,Eta,Zeta).
 
static Direction< VolumeDim > upper_eta ()
 Helper functions for creating specific Directions. These are labeled by the logical-coordinate names (Xi,Eta,Zeta).
 
static Direction< VolumeDim > lower_zeta ()
 Helper functions for creating specific Directions. These are labeled by the logical-coordinate names (Xi,Eta,Zeta).
 
static Direction< VolumeDim > upper_zeta ()
 Helper functions for creating specific Directions. These are labeled by the logical-coordinate names (Xi,Eta,Zeta).
 

Static Public Attributes

static constexpr const size_t volume_dim = VolumeDim
 
static constexpr uint8_t axis_mask = 0b0011
 
static constexpr uint8_t side_mask = 0b1100
 
static constexpr uint8_t all_mask = 0b1111
 
static constexpr uint8_t number_of_bits = 4
 

Friends

template<size_t LocalVolumeDim>
bool operator== (const Direction< LocalVolumeDim > &lhs, const Direction< LocalVolumeDim > &rhs)
 
template<size_t LocalVolumeDim>
size_t hash_value (const Direction< LocalVolumeDim > &d)
 

Detailed Description

template<size_t VolumeDim>
class Direction< VolumeDim >

A particular Side along a particular coordinate Axis.

Member Function Documentation

◆ sign()

template<size_t VolumeDim>
double Direction< VolumeDim >::sign ( ) const
inline

The sign for the normal to the Side.

This is +1.0 if side() == Side::Upper and -1.0 if side() == Side::Lower, otherwise an ASSERT is triggered.


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