SpECTRE  2021.08.02
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 () noexcept
 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) noexcept
 
 OrientationMap (const std::array< Direction< VolumeDim >, VolumeDim > &directions_in_host, const std::array< Direction< VolumeDim >, VolumeDim > &directions_in_neighbor) noexcept
 
 OrientationMap (const OrientationMap &)=default
 
OrientationMapoperator= (const OrientationMap &)=default
 
 OrientationMap (OrientationMap &&) noexcept=default
 
OrientationMapoperator= (OrientationMap &&) noexcept=default
 
bool is_aligned () const noexcept
 True when mapped(Direction) == Direction.
 
size_t operator() (const size_t dim) const noexcept
 The corresponding dimension in the neighbor.
 
Direction< VolumeDim > operator() (const Direction< VolumeDim > &direction) const noexcept
 The corresponding direction in the neighbor.
 
std::array< SegmentId, VolumeDim > operator() (const std::array< SegmentId, VolumeDim > &segmentIds) const noexcept
 The corresponding SegmentIds in the neighbor.
 
Mesh< VolumeDim > operator() (const Mesh< VolumeDim > &mesh) const noexcept
 The corresponding Mesh in the neighbor.
 
template<typename T >
std::array< T, VolumeDim > permute_from_neighbor (const std::array< T, VolumeDim > &array_in_neighbor) const noexcept
 An array whose elements are permuted such that result[d] = array_in_neighbor[this->operator()(d)] More...
 
OrientationMap< VolumeDim > inverse_map () const noexcept
 The corresponding Orientation of the host in the frame of the neighbor.
 
void pup (PUP::er &p) noexcept
 Serialization for Charm++.
 

Friends

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

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.

Usage

Given a size_t dimension, a Direction, or a SegmentId 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
noexcept

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.