Chombo + EB + MF  3.2
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Friends | List of all members
IndicesTransformation Class Reference

Class to describe transformation of indices from one block to another. More...

#include <IndicesTransformation.H>

Public Member Functions

 IndicesTransformation ()
 null constructor leaves object in undefined state. More...
 
 IndicesTransformation (const IntVect &a_permutation, const IntVect &a_sign, const IntVect &a_translation)
 
void define (const IntVect &a_permutation, const IntVect &a_sign, const IntVect &a_translation)
 
void defineFromSwap (int a_ind1, int a_ind2)
 
void defineFromTranslation (const IntVect &a_translation)
 
void defineFromPivot (const IntVect &a_pivotOld, const IntVect &a_pivotNew, const IntVect &a_permutation, const IntVect &a_sign)
 
void defineFromFaces (const Box &a_srcBox, int a_srcDim, Side::LoHiSide a_srcSide, const Box &a_dstBox, int a_dstDim, Side::LoHiSide a_dstSide, const IntVect &a_sign=IntVect::Unit)
 
bool isDefined () const
 
bool operator== (const IndicesTransformation &a_itOther) const
 
bool operator!= (const IndicesTransformation &a_itOther) const
 
IntVect transformFwd (const IntVect &a_ivOld) const
 
IntVect transformBack (const IntVect &a_ivNew) const
 
IntVect transform (const IntVect &a_iv, bool a_forward=true) const
 
IntVect transformNode (const IntVect &a_iv) const
 
RealVect transformMapped (const RealVect &a_pointOld, const RealVect &a_dxOld, const RealVect &a_dxNew) const
 
IntVect transformVectorFwd (const IntVect &a_vecOld) const
 
IntVect transformVectorBack (const IntVect &a_vecNew) const
 
IntVect transformVector (const IntVect &a_vec, bool a_forward=true) const
 
IntVect transformWithType (const IntVect &a_iv, const IntVect &a_tp, bool a_forward=true) const
 
IntVect transformType (const IntVect &a_tp, bool a_forward=true) const
 
Box transformFwd (const Box &a_bxOld) const
 
Box transformBack (const Box &a_bxNew) const
 
Box transform (const Box &a_bx, bool a_forward=true) const
 
template<typename T >
void transformFwd (BaseFab< T > &a_dstFab, const BaseFab< T > &a_srcFab, const Box &a_srcBox, const Interval &a_dstIntvl, const Interval &a_srcIntvl) const
 
template<typename T >
void transformBack (BaseFab< T > &a_dstFab, const BaseFab< T > &a_srcFab, const Box &a_srcBox, const Interval &a_dstIntvl, const Interval &a_srcIntvl) const
 
template<typename T >
void transform (BaseFab< T > &a_dstFab, const BaseFab< T > &a_srcFab, const Box &a_srcBox, const Interval &a_dstIntvl, const Interval &a_srcIntvl, bool a_forward=true) const
 
IndicesTransformation inverse () const
 
IndicesTransformation compose (const IndicesTransformation &a_next) const
 
IndicesTransformation coarsen (int a_refRatio) const
 
IndicesTransformation refine (int a_refRatio) const
 
IntVect getPermutation () const
 
IntVect getSign () const
 
IntVect getTranslation () const
 

Static Public Member Functions

static int InitStatics ()
 

Static Public Attributes

static const IntVect NoPermutation
 
static const IndicesTransformation Identity
 
static const IndicesTransformation Undefined
 

Protected Attributes

IntVect m_permutation
 
IntVect m_sign
 
IntVect m_translation
 

Friends

std::ostream & operator<< (std::ostream &a_os, const IndicesTransformation &a_it)
 

Detailed Description

Class to describe transformation of indices from one block to another.

Constructor & Destructor Documentation

◆ IndicesTransformation() [1/2]

IndicesTransformation::IndicesTransformation ( )

null constructor leaves object in undefined state.

◆ IndicesTransformation() [2/2]

IndicesTransformation::IndicesTransformation ( const IntVect a_permutation,
const IntVect a_sign,
const IntVect a_translation 
)

Constructor.

IntVect pOld: indices of a cell in old index space IntVect pNew: indices of the same cell in new index space

Then for each direction idir: pNew[idir] = a_sign[idir]*pOld[a_permutation[idir]] + a_translation[idir].

Member Function Documentation

◆ define()

void IndicesTransformation::define ( const IntVect a_permutation,
const IntVect a_sign,
const IntVect a_translation 
)

◆ defineFromSwap()

void IndicesTransformation::defineFromSwap ( int  a_ind1,
int  a_ind2 
)

◆ defineFromTranslation()

void IndicesTransformation::defineFromTranslation ( const IntVect a_translation)

◆ defineFromPivot()

void IndicesTransformation::defineFromPivot ( const IntVect a_pivotOld,
const IntVect a_pivotNew,
const IntVect a_permutation,
const IntVect a_sign 
)

◆ defineFromFaces()

void IndicesTransformation::defineFromFaces ( const Box a_srcBox,
int  a_srcDim,
Side::LoHiSide  a_srcSide,
const Box a_dstBox,
int  a_dstDim,
Side::LoHiSide  a_dstSide,
const IntVect a_sign = IntVect::Unit 
)

◆ isDefined()

bool IndicesTransformation::isDefined ( ) const

◆ operator==()

bool IndicesTransformation::operator== ( const IndicesTransformation a_itOther) const

◆ operator!=()

bool IndicesTransformation::operator!= ( const IndicesTransformation a_itOther) const

◆ transformFwd() [1/3]

IntVect IndicesTransformation::transformFwd ( const IntVect a_ivOld) const

IntVect pOld: indices of a cell in old index space IntVect pNew: indices of the same cell in new index space

Then for each direction idir: pNew[idir] = m_sign[idir]*pOld[m_permutation[idir]] + m_translation[idir] and hence: pOld[m_permutation[idir]] = m_sign[idir]*pNew[idir]

  • m_sign[idir]*m_translation[idir]

Referenced by BlockBaseRegister< FArrayBox >::buildBoxVectors(), and BlockBaseRegister< FArrayBox >::getSrcBlockBdryIndex().

◆ transformBack() [1/3]

IntVect IndicesTransformation::transformBack ( const IntVect a_ivNew) const

◆ transform() [1/3]

IntVect IndicesTransformation::transform ( const IntVect a_iv,
bool  a_forward = true 
) const

◆ transformNode()

IntVect IndicesTransformation::transformNode ( const IntVect a_iv) const

Transform NODE indices.

◆ transformMapped()

RealVect IndicesTransformation::transformMapped ( const RealVect a_pointOld,
const RealVect a_dxOld,
const RealVect a_dxNew 
) const

Transform coordinates in mapped space, not an index.

◆ transformVectorFwd()

IntVect IndicesTransformation::transformVectorFwd ( const IntVect a_vecOld) const

Transform a vector, not an index. There may be permutation of indices and sign change, but no translation.

◆ transformVectorBack()

IntVect IndicesTransformation::transformVectorBack ( const IntVect a_vecNew) const

◆ transformVector()

IntVect IndicesTransformation::transformVector ( const IntVect a_vec,
bool  a_forward = true 
) const

◆ transformWithType()

IntVect IndicesTransformation::transformWithType ( const IntVect a_iv,
const IntVect a_tp,
bool  a_forward = true 
) const

Transform indices of either cells or nodes or faces or edges.

Referenced by transform().

◆ transformType()

IntVect IndicesTransformation::transformType ( const IntVect a_tp,
bool  a_forward = true 
) const

Transform the type of Box: no change if a_tp is the cell type or the node type, but if a face or edge type, then the transformed type may differ.

◆ transformFwd() [2/3]

Box IndicesTransformation::transformFwd ( const Box a_bxOld) const

Transform a whole box.

◆ transformBack() [2/3]

Box IndicesTransformation::transformBack ( const Box a_bxNew) const

◆ transform() [2/3]

Box IndicesTransformation::transform ( const Box a_bx,
bool  a_forward = true 
) const

◆ transformFwd() [3/3]

template<typename T >
void IndicesTransformation::transformFwd ( BaseFab< T > &  a_dstFab,
const BaseFab< T > &  a_srcFab,
const Box a_srcBox,
const Interval a_dstIntvl,
const Interval a_srcIntvl 
) const
inline

Apply forward transformation on a Box within a BaseFab.

References transform().

◆ transformBack() [3/3]

template<typename T >
void IndicesTransformation::transformBack ( BaseFab< T > &  a_dstFab,
const BaseFab< T > &  a_srcFab,
const Box a_srcBox,
const Interval a_dstIntvl,
const Interval a_srcIntvl 
) const
inline

Apply inverse transformation on a Box within a BaseFab.

References transform().

◆ transform() [3/3]

template<typename T >
void IndicesTransformation::transform ( BaseFab< T > &  a_dstFab,
const BaseFab< T > &  a_srcFab,
const Box a_srcBox,
const Interval a_dstIntvl,
const Interval a_srcIntvl,
bool  a_forward = true 
) const
inline

◆ inverse()

IndicesTransformation IndicesTransformation::inverse ( ) const

Return the inverse transformation.

Referenced by transform().

◆ compose()

IndicesTransformation IndicesTransformation::compose ( const IndicesTransformation a_next) const

Return the composite transformation: that is, this transformation followed by a_next.

Referenced by transform().

◆ coarsen()

IndicesTransformation IndicesTransformation::coarsen ( int  a_refRatio) const

Return this transformation with index spaces coarsened by a_refRatio.

Referenced by transform().

◆ refine()

IndicesTransformation IndicesTransformation::refine ( int  a_refRatio) const

Return this transformation with index spaces refined by a_refRatio.

Referenced by transform().

◆ getPermutation()

IntVect IndicesTransformation::getPermutation ( ) const
inline

◆ getSign()

IntVect IndicesTransformation::getSign ( ) const
inline

◆ getTranslation()

IntVect IndicesTransformation::getTranslation ( ) const
inline

◆ InitStatics()

static int IndicesTransformation::InitStatics ( )
static

Initializes IndicesTransformation::Identity .

Referenced by getTranslation().

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  a_os,
const IndicesTransformation a_it 
)
friend

Member Data Documentation

◆ NoPermutation

const IntVect IndicesTransformation::NoPermutation
static

◆ Identity

const IndicesTransformation IndicesTransformation::Identity
static

The identity transformation, which has no permutation, no sign change, and no translation.

◆ Undefined

const IndicesTransformation IndicesTransformation::Undefined
static

The undefined transformation.

◆ m_permutation

IntVect IndicesTransformation::m_permutation
protected

Referenced by getPermutation().

◆ m_sign

IntVect IndicesTransformation::m_sign
protected

Referenced by getSign().

◆ m_translation

IntVect IndicesTransformation::m_translation
protected

Referenced by getTranslation().


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