Block-Structured AMR Software Framework
amrex::Orientation Class Reference

Encapsulation of the Orientation of the Faces of a Box. More...

#include <AMReX_Orientation.H>

Public Types

enum  Side { low = 0 , high = 1 }
 In each dimension a face is either low or high. More...
 

Public Member Functions

constexpr Orientation () noexcept=default
 The default constructor. More...
 
AMREX_GPU_HOST_DEVICE Orientation (int dir, Side side) noexcept
 Set the orientation of a side. More...
 
constexpr AMREX_GPU_HOST_DEVICE Orientation (Direction dir, Side side) noexcept
 
AMREX_GPU_HOST_DEVICE bool operator== (const Orientation &o) const noexcept
 Logical equality. More...
 
AMREX_GPU_HOST_DEVICE bool operator!= (const Orientation &o) const noexcept
 Logical inequality. More...
 
AMREX_GPU_HOST_DEVICE bool operator< (const Orientation &o) const noexcept
 Less-than. More...
 
AMREX_GPU_HOST_DEVICE bool operator<= (const Orientation &o) const noexcept
 Less-than or equal. More...
 
AMREX_GPU_HOST_DEVICE bool operator> (const Orientation &o) const noexcept
 Greater-than. More...
 
AMREX_GPU_HOST_DEVICE bool operator>= (const Orientation &o) const noexcept
 Greater-than or equal. More...
 
constexpr AMREX_GPU_HOST_DEVICE operator int () const noexcept
 This conversion operator maps an orientation into a unique integer in the range [0 .. 2*AMREX_SPACEDIM-1] according to the above ordering. More...
 
AMREX_GPU_HOST_DEVICE Orientation flip () const noexcept
 Return opposite orientation. More...
 
AMREX_GPU_HOST_DEVICE int coordDir () const noexcept
 Returns the coordinate direction. More...
 
AMREX_GPU_HOST_DEVICE Side faceDir () const noexcept
 Returns the orientation of the face – low or high. More...
 
AMREX_GPU_HOST_DEVICE bool isLow () const noexcept
 Returns true if Orientation is low. More...
 
AMREX_GPU_HOST_DEVICE bool isHigh () const noexcept
 Returns true if Orientation is high. More...
 

Static Public Member Functions

AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int xlo () noexcept
 Int value of the x-lo-face. More...
 
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int xhi () noexcept
 Int value of the x-hi-face. More...
 
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int ylo () noexcept
 Int value of the y-lo-face. More...
 
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int yhi () noexcept
 Int value of the y-hi-face. More...
 
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int zlo () noexcept
 Int value of the z-lo-face. More...
 
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int zhi () noexcept
 Int value of the z-hi-face. More...
 

Private Member Functions

AMREX_GPU_HOST_DEVICE Orientation (int v) noexcept
 Used internally. More...
 

Private Attributes

int val = -1
 The data. More...
 

Friends

class OrientationIter
 
std::istream & operator>> (std::istream &is, Orientation &o)
 Read from an istream. More...
 

Detailed Description

Encapsulation of the Orientation of the Faces of a Box.

This class encapsulates the orientation of the faces of a Box by providing an ordering of each of the faces of a Box in AMREX_SPACEDIM dimensions. This allows iterating over all the faces of a Box. The ordering first traverses the AMREX_SPACEDIM low sides from direction 0 .. AMREX_SPACEDIM-1 and then the AMREX_SPACEDIM high sides from direction 0 .. AMREX_SPACEDIM-1.

Member Enumeration Documentation

◆ Side

In each dimension a face is either low or high.

Enumerator
low 
high 

Constructor & Destructor Documentation

◆ Orientation() [1/4]

constexpr amrex::Orientation::Orientation ( )
constexprdefaultnoexcept

The default constructor.

◆ Orientation() [2/4]

AMREX_GPU_HOST_DEVICE amrex::Orientation::Orientation ( int  dir,
Side  side 
)
inlinenoexcept

Set the orientation of a side.

◆ Orientation() [3/4]

constexpr AMREX_GPU_HOST_DEVICE amrex::Orientation::Orientation ( Direction  dir,
Side  side 
)
inlineconstexprnoexcept

◆ Orientation() [4/4]

AMREX_GPU_HOST_DEVICE amrex::Orientation::Orientation ( int  v)
inlineprivatenoexcept

Used internally.

Member Function Documentation

◆ coordDir()

AMREX_GPU_HOST_DEVICE int amrex::Orientation::coordDir ( ) const
inlinenoexcept

Returns the coordinate direction.

◆ faceDir()

AMREX_GPU_HOST_DEVICE Side amrex::Orientation::faceDir ( ) const
inlinenoexcept

Returns the orientation of the face – low or high.

◆ flip()

AMREX_GPU_HOST_DEVICE Orientation amrex::Orientation::flip ( ) const
inlinenoexcept

Return opposite orientation.

◆ isHigh()

AMREX_GPU_HOST_DEVICE bool amrex::Orientation::isHigh ( ) const
inlinenoexcept

Returns true if Orientation is high.

◆ isLow()

AMREX_GPU_HOST_DEVICE bool amrex::Orientation::isLow ( ) const
inlinenoexcept

Returns true if Orientation is low.

◆ operator int()

constexpr AMREX_GPU_HOST_DEVICE amrex::Orientation::operator int ( ) const
inlineconstexprnoexcept

This conversion operator maps an orientation into a unique integer in the range [0 .. 2*AMREX_SPACEDIM-1] according to the above ordering.

◆ operator!=()

AMREX_GPU_HOST_DEVICE bool amrex::Orientation::operator!= ( const Orientation o) const
inlinenoexcept

Logical inequality.

◆ operator<()

AMREX_GPU_HOST_DEVICE bool amrex::Orientation::operator< ( const Orientation o) const
inlinenoexcept

Less-than.

◆ operator<=()

AMREX_GPU_HOST_DEVICE bool amrex::Orientation::operator<= ( const Orientation o) const
inlinenoexcept

Less-than or equal.

◆ operator==()

AMREX_GPU_HOST_DEVICE bool amrex::Orientation::operator== ( const Orientation o) const
inlinenoexcept

Logical equality.

◆ operator>()

AMREX_GPU_HOST_DEVICE bool amrex::Orientation::operator> ( const Orientation o) const
inlinenoexcept

Greater-than.

◆ operator>=()

AMREX_GPU_HOST_DEVICE bool amrex::Orientation::operator>= ( const Orientation o) const
inlinenoexcept

Greater-than or equal.

◆ xhi()

AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int amrex::Orientation::xhi ( )
inlinestaticconstexprnoexcept

Int value of the x-hi-face.

◆ xlo()

AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int amrex::Orientation::xlo ( )
inlinestaticconstexprnoexcept

Int value of the x-lo-face.

◆ yhi()

AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int amrex::Orientation::yhi ( )
inlinestaticconstexprnoexcept

Int value of the y-hi-face.

◆ ylo()

AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int amrex::Orientation::ylo ( )
inlinestaticconstexprnoexcept

Int value of the y-lo-face.

◆ zhi()

AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int amrex::Orientation::zhi ( )
inlinestaticconstexprnoexcept

Int value of the z-hi-face.

◆ zlo()

AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int amrex::Orientation::zlo ( )
inlinestaticconstexprnoexcept

Int value of the z-lo-face.

Friends And Related Function Documentation

◆ operator>>

std::istream& operator>> ( std::istream &  is,
Orientation o 
)
friend

Read from an istream.

◆ OrientationIter

friend class OrientationIter
friend

Member Data Documentation

◆ val

int amrex::Orientation::val = -1
private

The data.


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