Proto  3.2
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
Proto::CoordPermutation Class Reference

Defines discrete rotations in logically rectangular coordinate systems. More...

#include <Proto_CoordPermutation.H>

Public Member Functions

 CoordPermutation ()
 Default / Identity constructor. More...
 
 CoordPermutation (std::initializer_list< Array< int, 3 >> a_args)
 Constructor. More...
 
 CoordPermutation (std::initializer_list< Array< Point, 2 >> a_args)
 
 CoordPermutation (std::vector< Array< int, 3 >> &a_args)
 
void define (std::vector< Array< int, 3 >> &a_args)
 
void defineMatrix (Array< Array< int, DIM >, DIM > a_matrix)
 
Point operator() (Point a_pt) const
 Direct Matrix Construction. More...
 
CoordPermutation inverse () const
 Compute and return the inverse Permutation. More...
 
Point rotateCell (Point a_point, const Box &a_srcBox, const Box &a_dstBox) const
 Rotate Cell. More...
 
Point rotatePoint (Point a_point, const Box &a_srcBox, const Box &a_dstBox) const
 Rotate Point. More...
 
template<typename T , unsigned int C = 1, unsigned int D = 1, unsigned int E = 1>
void rotateBuffer (T *srcData, T *dstData, const Box &srcBox, const Box &dstBox) const
 
Array< Array< int, DIM >, DIM > matrix () const
 
bool operator== (const CoordPermutation &a_rhs) const
 
bool isIdentity () const
 
void print () const
 
void printMatrix () const
 

Static Public Member Functions

static CoordPermutation identity ()
 Trivial Permutation. More...
 
static CoordPermutation cw (int a_coord=2)
 Clockwise (-90* rotation) in the XY plane. More...
 
static CoordPermutation ccw (int a_coord=2)
 Counter-Clockwise (+90* rotation) in the XY plane. More...
 
static CoordPermutation reverse ()
 Invert all coordinates. More...
 
static CoordPermutation rotatePlane (int a_c0, int a_c1)
 Rotate the plane containing two coordinates such that c0 -> c1. More...
 

Private Member Functions

bool isValid () const
 

Private Attributes

Array< Array< int, DIM >, DIM > m_matrix
 

Detailed Description

Defines discrete rotations in logically rectangular coordinate systems.

Constructor & Destructor Documentation

◆ CoordPermutation() [1/4]

Proto::CoordPermutation::CoordPermutation ( )
inline

Default / Identity constructor.

◆ CoordPermutation() [2/4]

Proto::CoordPermutation::CoordPermutation ( std::initializer_list< Array< int, 3 >>  a_args)
inline

Constructor.

Syntax: CoordPermutation p {{c0, c1, s}, {c0, c1, s}}; Which is meant to be read as "map coordinate c0 to coordinate c1 with an optional reflection s". Any coordinates omitted from the constructor are understood to be mapped through a positive identity

Example: 2D rotation in 3D: CoordPermutation rot{{0,1,1}, {1,0,-1}}; coord 0 -> +coord 1 coord 1 -> -coord 0 coord 2 -> +coord 2

◆ CoordPermutation() [3/4]

Proto::CoordPermutation::CoordPermutation ( std::initializer_list< Array< Point, 2 >>  a_args)
inline

◆ CoordPermutation() [4/4]

Proto::CoordPermutation::CoordPermutation ( std::vector< Array< int, 3 >> &  a_args)
inline

Member Function Documentation

◆ identity()

static CoordPermutation Proto::CoordPermutation::identity ( )
inlinestatic

Trivial Permutation.

◆ cw()

static CoordPermutation Proto::CoordPermutation::cw ( int  a_coord = 2)
inlinestatic

Clockwise (-90* rotation) in the XY plane.

◆ ccw()

static CoordPermutation Proto::CoordPermutation::ccw ( int  a_coord = 2)
inlinestatic

Counter-Clockwise (+90* rotation) in the XY plane.

◆ reverse()

static CoordPermutation Proto::CoordPermutation::reverse ( )
inlinestatic

Invert all coordinates.

◆ rotatePlane()

static CoordPermutation Proto::CoordPermutation::rotatePlane ( int  a_c0,
int  a_c1 
)
inlinestatic

Rotate the plane containing two coordinates such that c0 -> c1.

Note that swapping the order of the inputs reverses the direction or rotation.

◆ define()

void Proto::CoordPermutation::define ( std::vector< Array< int, 3 >> &  a_args)
inline

◆ defineMatrix()

void Proto::CoordPermutation::defineMatrix ( Array< Array< int, DIM >, DIM >  a_matrix)
inline

◆ operator()()

Point Proto::CoordPermutation::operator() ( Point  a_pt) const
inline

Direct Matrix Construction.

Permute the coordinates of a Point

◆ inverse()

CoordPermutation Proto::CoordPermutation::inverse ( ) const
inline

Compute and return the inverse Permutation.

Referenced by Proto::MBBoundaryData< T, C, MEM >::define().

◆ rotateCell()

Point Proto::CoordPermutation::rotateCell ( Point  a_point,
const Box a_srcBox,
const Box a_dstBox 
) const
inline

Rotate Cell.

Given a Point and it's containing Box in unrotated coordinates, compute the Point associated with the same finite volume cell in rotated coordinates. Note that because a finite-volume cell is designated by it's low corner, this function is not the same as rotatePoint.

◆ rotatePoint()

Point Proto::CoordPermutation::rotatePoint ( Point  a_point,
const Box a_srcBox,
const Box a_dstBox 
) const
inline

Rotate Point.

Given a Point and it's containing Box in unrotated coordinates, compute the Point associated with the same Point (vertex) in rotated coordinates.

◆ rotateBuffer()

template<typename T , unsigned int C = 1, unsigned int D = 1, unsigned int E = 1>
void Proto::CoordPermutation::rotateBuffer ( T *  srcData,
T *  dstData,
const Box srcBox,
const Box dstBox 
) const
inline

◆ matrix()

Array<Array<int, DIM>, DIM> Proto::CoordPermutation::matrix ( ) const
inline

◆ operator==()

bool Proto::CoordPermutation::operator== ( const CoordPermutation a_rhs) const
inline

Referenced by matrix().

◆ isIdentity()

bool Proto::CoordPermutation::isIdentity ( ) const
inline

Referenced by matrix().

◆ print()

void Proto::CoordPermutation::print ( ) const
inline

Referenced by matrix().

◆ printMatrix()

void Proto::CoordPermutation::printMatrix ( ) const
inline

Referenced by matrix().

◆ isValid()

bool Proto::CoordPermutation::isValid ( ) const
inlineprivate

Referenced by matrix().

Member Data Documentation

◆ m_matrix

Array<Array<int, DIM>, DIM> Proto::CoordPermutation::m_matrix
private

Referenced by matrix().


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