#include <IndicesTransformation.H>
Public Member Functions | |
IndicesTransformation () | |
null constructor leaves object in undefined state. | |
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) |
IndicesTransformation::IndicesTransformation | ( | ) |
null constructor leaves object in undefined state.
void IndicesTransformation::define | ( | const IntVect & | a_permutation, | |
const IntVect & | a_sign, | |||
const IntVect & | a_translation | |||
) |
void IndicesTransformation::defineFromSwap | ( | int | a_ind1, | |
int | a_ind2 | |||
) |
void IndicesTransformation::defineFromTranslation | ( | const IntVect & | a_translation | ) |
void IndicesTransformation::defineFromPivot | ( | const IntVect & | a_pivotOld, | |
const IntVect & | a_pivotNew, | |||
const IntVect & | a_permutation, | |||
const IntVect & | a_sign | |||
) |
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 | |||
) |
bool IndicesTransformation::isDefined | ( | ) | const |
bool IndicesTransformation::operator== | ( | const IndicesTransformation & | a_itOther | ) | const |
bool IndicesTransformation::operator!= | ( | const IndicesTransformation & | a_itOther | ) | 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]
Referenced by transform(), transformBack(), and transformFwd().
RealVect IndicesTransformation::transformMapped | ( | const RealVect & | a_pointOld, | |
const RealVect & | a_dxOld, | |||
const RealVect & | a_dxNew | |||
) | const |
Transform coordinates in mapped space, not an index.
Transform a vector, not an index. There may be permutation of indices and sign change, but no translation.
IntVect IndicesTransformation::transformVector | ( | const IntVect & | a_vec, | |
bool | a_forward = true | |||
) | const |
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().
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.
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().
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().
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] |
Apply forward or inverse transformation on a Box within a BaseFab.
References Interval::begin(), BaseFab< T >::box(), CH_assert, CH_SPACEDIM, Box::contains(), BaseFab< T >::dataPtr(), Interval::end(), FortranArrayIndex(), Box::isEmpty(), Box::numPts(), Box::size(), Interval::size(), Box::smallEnd(), SpaceDim, transform(), transformWithType(), and Box::type().
IndicesTransformation IndicesTransformation::inverse | ( | ) | const |
Return the inverse transformation.
IndicesTransformation IndicesTransformation::compose | ( | const IndicesTransformation & | a_next | ) | const |
Return the composite transformation: that is, this transformation followed by a_next.
IndicesTransformation IndicesTransformation::coarsen | ( | int | a_refRatio | ) | const |
Return this transformation with index spaces coarsened by a_refRatio.
IndicesTransformation IndicesTransformation::refine | ( | int | a_refRatio | ) | const |
Return this transformation with index spaces refined by a_refRatio.
IntVect IndicesTransformation::getPermutation | ( | ) | const [inline] |
References m_permutation.
IntVect IndicesTransformation::getTranslation | ( | ) | const [inline] |
References m_translation.
static int IndicesTransformation::InitStatics | ( | ) | [static] |
Initializes IndicesTransformation::Identity .
std::ostream& operator<< | ( | std::ostream & | a_os, | |
const IndicesTransformation & | a_it | |||
) | [friend] |
const IntVect IndicesTransformation::NoPermutation [static] |
const IndicesTransformation IndicesTransformation::Identity [static] |
The identity transformation, which has no permutation, no sign change, and no translation.
const IndicesTransformation IndicesTransformation::Undefined [static] |
The undefined transformation.
IntVect IndicesTransformation::m_permutation [protected] |
Referenced by getPermutation().
IntVect IndicesTransformation::m_sign [protected] |
Referenced by getSign().
IntVect IndicesTransformation::m_translation [protected] |
Referenced by getTranslation().