SpECTRE  v2022.10.04
OrientationMap< VolumeDim > Class Template Reference

A mapping of the logical coordinate axes of a host to the logical coordinate axes of a neighbor of the host. More...

#include <OrientationMap.hpp>

Public Member Functions

 OrientationMap ()
 The default orientation is the identity map on directions. The bool is_aligned_ is correspondingly set to true.
 
 OrientationMap (std::array< Direction< VolumeDim >, VolumeDim > mapped_directions)
 
 OrientationMap (const std::array< Direction< VolumeDim >, VolumeDim > &directions_in_host, const std::array< Direction< VolumeDim >, VolumeDim > &directions_in_neighbor)
 
 OrientationMap (const OrientationMap &)=default
 
OrientationMapoperator= (const OrientationMap &)=default
 
 OrientationMap (OrientationMap &&)=default
 
OrientationMapoperator= (OrientationMap &&)=default
 
bool is_aligned () const
 True when mapped(Direction) == Direction.
 
size_t operator() (const size_t dim) const
 The corresponding dimension in the neighbor.
 
Direction< VolumeDim > operator() (const Direction< VolumeDim > &direction) const
 The corresponding direction in the neighbor.
 
std::array< SegmentId, VolumeDim > operator() (const std::array< SegmentId, VolumeDim > &segmentIds) const
 The corresponding SegmentIds in the neighbor.
 
Mesh< VolumeDim > operator() (const Mesh< VolumeDim > &mesh) const
 The corresponding Mesh in the neighbor.
 
template<typename T >
std::array< T, VolumeDim > permute_to_neighbor (const std::array< T, VolumeDim > &array_to_permute) const
 An array whose elements are permuted such that result[this->operator()(d)] = array_to_permute[d]. More...
 
template<typename T >
std::array< T, VolumeDim > permute_from_neighbor (const std::array< T, VolumeDim > &array_in_neighbor) const
 An array whose elements are permuted such that result[d] = array_in_neighbor[this->operator()(d)] More...
 
OrientationMap< VolumeDim > inverse_map () const
 The corresponding Orientation of the host in the frame of the neighbor.
 
void pup (PUP::er &p)
 Serialization for Charm++.
 

Friends

bool operator== (const OrientationMap &lhs, const OrientationMap &rhs)
 

Detailed Description

template<size_t VolumeDim>
class OrientationMap< VolumeDim >

A mapping of the logical coordinate axes of a host to the logical coordinate axes of a neighbor of the host.

Given a size_t dimension, a Direction, a SegmentId, or a Mesh of the host, an OrientationMap will give the corresponding value in the neighbor.

Template Parameters
VolumeDimthe dimension of the blocks.

See the tutorial for information on how OrientationMaps are used and constructed.

Member Function Documentation

◆ permute_from_neighbor()

template<size_t VolumeDim>
template<typename T >
std::array< T, VolumeDim > OrientationMap< VolumeDim >::permute_from_neighbor ( const std::array< T, VolumeDim > &  array_in_neighbor) const

An array whose elements are permuted such that result[d] = array_in_neighbor[this->operator()(d)]

Note
the permutation depends only on how the dimension is mapped and ignores the side of the mapped direction.

◆ permute_to_neighbor()

template<size_t VolumeDim>
template<typename T >
std::array< T, VolumeDim > OrientationMap< VolumeDim >::permute_to_neighbor ( const std::array< T, VolumeDim > &  array_to_permute) const

An array whose elements are permuted such that result[this->operator()(d)] = array_to_permute[d].

Note
the permutation depends only on how the dimension is mapped and ignores the side of the mapped direction.

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