Chombo + EB + MF
3.2
|
A strange but true thing to make copying from one boxlayoutdata to another fast. More...
#include <Copier.H>
Public Member Functions | |
Copier () | |
null constructor, copy constructor and operator= can be compiler defined. More... | |
Copier (const Copier &a_rhs) | |
Copier (const DisjointBoxLayout &a_level, const BoxLayout &a_dest, bool a_exchange=false, IntVect a_shift=IntVect::Zero) | |
Copier (const DisjointBoxLayout &a_level, const BoxLayout &a_dest, const ProblemDomain &a_domain, bool a_exchange=false, IntVect a_shift=IntVect::Zero) | |
this constructor contains support for periodic BC's More... | |
Copier (const DisjointBoxLayout &a_level, const BoxLayout &a_dest, const IntVect &a_destGhost, bool a_exchange=false, IntVect a_shift=IntVect::Zero) | |
Copier to copy data into the valid and invalid regions of a_dest from a_level. More... | |
Copier (const DisjointBoxLayout &a_level, const BoxLayout &a_dest, const ProblemDomain &a_domain, const IntVect &a_destGhost, bool a_exchange=false, IntVect a_shift=IntVect::Zero) | |
Copier to copy data into the valid and invalid regions of a_dest from a_level with support for periodic BCs. More... | |
virtual | ~Copier () |
virtual void | define (const DisjointBoxLayout &a_level, const BoxLayout &a_dest, bool a_exchange=false, IntVect a_shift=IntVect::Zero) |
virtual void | define (const DisjointBoxLayout &a_level, const BoxLayout &a_dest, const ProblemDomain &a_domain, bool a_exchange=false, IntVect a_shift=IntVect::Zero) |
contains support for periodic BCs More... | |
virtual void | define (const DisjointBoxLayout &a_level, const BoxLayout &a_dest, const IntVect &a_destGhost, bool a_exchange=false, IntVect a_shift=IntVect::Zero) |
virtual void | define (const BoxLayout &a_level, const BoxLayout &a_dest, const ProblemDomain &a_domain, const IntVect &a_destGhost, bool a_exchange=false, IntVect a_shift=IntVect::Zero) |
contains support for periodic BCs More... | |
virtual void | exchangeDefine (const DisjointBoxLayout &a_grids, const IntVect &a_ghost, bool a_includeSelf=false) |
alternative version of define for exchange copiers that uses new optimized neighborIterator More... | |
void | defineFixedBoxSize (const DisjointBoxLayout &a_src, const LMap &a_lmap, const IntVect &a_ghost, const ProblemDomain &a_domain, bool a_includeSelf=false, bool a_reverse=false) |
void | defineFixedBoxSize (const DisjointBoxLayout &a_src, const LMap &a_lmapSrc, const IntVect &a_refRatioSrc, const DisjointBoxLayout &a_dst, const LMap &a_lmapDst, const IntVect &a_refRatioDst, const IntVect &a_ghost, const ProblemDomain &a_domain, bool a_reverse=false) |
void | defineFixedSizeNodesCollect (const DisjointBoxLayout &a_layout, const LMap &a_lmap, const IntVect &a_ghostSrc, const IntVect &a_ghostDst, const ProblemDomain &a_domain) |
void | defineFixedSizeNodesCollect (const DisjointBoxLayout &a_src, const LMap &a_lmapSrc, const IntVect &a_refRatioSrc, const IntVect &a_ghostSrc, const DisjointBoxLayout &a_dst, const LMap &a_lmapDst, const IntVect &a_refRatioDst, const IntVect &a_ghostDst, const ProblemDomain &a_domain) |
void | ghostDefine (const DisjointBoxLayout &a_src, const DisjointBoxLayout &a_dest, const ProblemDomain &a_domain, const IntVect &a_srcGhost) |
performs the computation necessary for moving from ghost+valid cells to all valid cells in a_dest More... | |
void | ghostDefine (const DisjointBoxLayout &a_src, const DisjointBoxLayout &a_dest, const ProblemDomain &a_domain, const IntVect &a_srcGhost, const IntVect &a_destGhost) |
performs the computation necessary for moving from ghost+valid cells to all valid+ghost cells in a_dest More... | |
virtual void | clear () |
Copier & | operator= (const Copier &b) |
void | reverse () |
void | trimEdges (const DisjointBoxLayout &a_exchangedLayout, const IntVect &ghost) |
void | coarsen (int a_refRatio) |
bool | operator== (const Copier &rhs) const |
int | print () const |
bool | bufferAllocated () const |
void | setBufferAllocated (bool arg) const |
int | numLocalCellsToCopy () const |
int | numFromCellsToCopy () const |
int | numToCellsToCopy () const |
bool | isDefined () const |
Public Attributes | |
CopierBuffer | m_buffers |
std::vector< IndexTM< int, 2 > > | m_range |
Protected Member Functions | |
void | trimMotion (const DisjointBoxLayout &a_exchangedLayout, const IntVect &a_ghost, const Vector< MotionItem *> &a_oldItems, Vector< MotionItem *> &a_newItems) |
void | sort () |
const ProblemDomain & | getPhysDomain (const DisjointBoxLayout &a_level) const |
Protected Attributes | |
Vector< MotionItem * > | m_localMotionPlan |
Vector< MotionItem * > | m_fromMotionPlan |
Vector< MotionItem * > | m_toMotionPlan |
bool | buffersAllocated |
DisjointBoxLayout | m_originPlan |
BoxLayout | m_dest |
bool | m_isDefined |
Static Protected Attributes | |
static Pool | s_motionItemPool |
Friends | |
class | CopyIterator |
void | dumpmemoryatexit () |
A strange but true thing to make copying from one boxlayoutdata to another fast.
class to handle the organization of data from a LevelData to a BoxLayoutData defined over the same index space. The idea behind this object is twofold: A) there is a significant amount of information that can be computed once and reused from one copy to the next for a LevelData and BoxLayoutData that have unchanging BoxLayouts underneath them. In these cases, LevelData::copyTo methods has an optional argument. That way, in cases where the operation is only performed a single time, we do not waste our time building optimizing data, etc. B) when we interface with KeLP, this class maps quite well with the existing KeLP API (class MotionPlan).
pains have been taken to not have this class be templated. Thus it does not actually perform the copying itself (which would require knowledge of the template class type). It provides an iterator interface to MotionItems that specify the required work. LevelData provides the copyTo methods.
|
inline |
null constructor, copy constructor and operator= can be compiler defined.
References coarsen(), MotionItem::operator==(), MotionItem::reverse(), and IntVect::Zero.
Copier::Copier | ( | const Copier & | a_rhs | ) |
Copier::Copier | ( | const DisjointBoxLayout & | a_level, |
const BoxLayout & | a_dest, | ||
bool | a_exchange = false , |
||
IntVect | a_shift = IntVect::Zero |
||
) |
Copier::Copier | ( | const DisjointBoxLayout & | a_level, |
const BoxLayout & | a_dest, | ||
const ProblemDomain & | a_domain, | ||
bool | a_exchange = false , |
||
IntVect | a_shift = IntVect::Zero |
||
) |
this constructor contains support for periodic BC's
Copier::Copier | ( | const DisjointBoxLayout & | a_level, |
const BoxLayout & | a_dest, | ||
const IntVect & | a_destGhost, | ||
bool | a_exchange = false , |
||
IntVect | a_shift = IntVect::Zero |
||
) |
Copier to copy data into the valid and invalid regions of a_dest from a_level.
Copier::Copier | ( | const DisjointBoxLayout & | a_level, |
const BoxLayout & | a_dest, | ||
const ProblemDomain & | a_domain, | ||
const IntVect & | a_destGhost, | ||
bool | a_exchange = false , |
||
IntVect | a_shift = IntVect::Zero |
||
) |
Copier to copy data into the valid and invalid regions of a_dest from a_level with support for periodic BCs.
|
virtual |
|
virtual |
|
virtual |
contains support for periodic BCs
|
virtual |
|
virtual |
contains support for periodic BCs
|
virtual |
alternative version of define for exchange copiers that uses new optimized neighborIterator
void Copier::defineFixedBoxSize | ( | const DisjointBoxLayout & | a_src, |
const LMap & | a_lmap, | ||
const IntVect & | a_ghost, | ||
const ProblemDomain & | a_domain, | ||
bool | a_includeSelf = false , |
||
bool | a_reverse = false |
||
) |
void Copier::defineFixedBoxSize | ( | const DisjointBoxLayout & | a_src, |
const LMap & | a_lmapSrc, | ||
const IntVect & | a_refRatioSrc, | ||
const DisjointBoxLayout & | a_dst, | ||
const LMap & | a_lmapDst, | ||
const IntVect & | a_refRatioDst, | ||
const IntVect & | a_ghost, | ||
const ProblemDomain & | a_domain, | ||
bool | a_reverse = false |
||
) |
void Copier::defineFixedSizeNodesCollect | ( | const DisjointBoxLayout & | a_layout, |
const LMap & | a_lmap, | ||
const IntVect & | a_ghostSrc, | ||
const IntVect & | a_ghostDst, | ||
const ProblemDomain & | a_domain | ||
) |
void Copier::defineFixedSizeNodesCollect | ( | const DisjointBoxLayout & | a_src, |
const LMap & | a_lmapSrc, | ||
const IntVect & | a_refRatioSrc, | ||
const IntVect & | a_ghostSrc, | ||
const DisjointBoxLayout & | a_dst, | ||
const LMap & | a_lmapDst, | ||
const IntVect & | a_refRatioDst, | ||
const IntVect & | a_ghostDst, | ||
const ProblemDomain & | a_domain | ||
) |
void Copier::ghostDefine | ( | const DisjointBoxLayout & | a_src, |
const DisjointBoxLayout & | a_dest, | ||
const ProblemDomain & | a_domain, | ||
const IntVect & | a_srcGhost | ||
) |
performs the computation necessary for moving from ghost+valid cells to all valid cells in a_dest
instead of copying from the valid of a_src to the valid+ghost of a_dest, this routine defines a Copier that moves data from the ghost+valid region of a_src to a_dest. This is used by LevelFluxRegister.
Referenced by BlockBaseRegister< FArrayBox >::copyToSrcRegister().
void Copier::ghostDefine | ( | const DisjointBoxLayout & | a_src, |
const DisjointBoxLayout & | a_dest, | ||
const ProblemDomain & | a_domain, | ||
const IntVect & | a_srcGhost, | ||
const IntVect & | a_destGhost | ||
) |
performs the computation necessary for moving from ghost+valid cells to all valid+ghost cells in a_dest
instead of copying from the valid of a_src to the valid+ghost of a_dest, this routine defines a Copier that moves data from the ghost+valid region of a_src to valid+ghost a_dest. This is used by BlockBaseRegister. Note that this does not handle periodic matchings here. That is handled by different code in the MappedMultiBlock libraries. Sending in a null-constructed ProblemDomain just results in a computation that ignores domain boundaries.
|
virtual |
Reimplemented in CoDimCopier, and CornerCopier.
Referenced by LevelData< BaseFab< int > >::define(), and LevelData< BaseFab< int > >::setExchangeCopier().
void Copier::reverse | ( | ) |
reverse the communication of this Copier.
void Copier::trimEdges | ( | const DisjointBoxLayout & | a_exchangedLayout, |
const IntVect & | ghost | ||
) |
Under the right algorithmic circumstances, a user might know that they no not need corner cells filled in exchanges, what they really need are just sufficient ghost cells in each CH_SPACEDIM direction for each valid cell. This operation eliminates copy operations that do not contribute to such cells. Under reasonable 3D configurations this can eliminate more than half the copy operations.
void Copier::coarsen | ( | int | a_refRatio | ) |
bool Copier::operator== | ( | const Copier & | rhs | ) | const |
int Copier::print | ( | ) | const |
Referenced by BoxLayoutData< BaseFab< int > >::makeItSo().
bool Copier::bufferAllocated | ( | ) | const |
void Copier::setBufferAllocated | ( | bool | arg | ) | const |
int Copier::numLocalCellsToCopy | ( | ) | const |
int Copier::numFromCellsToCopy | ( | ) | const |
int Copier::numToCellsToCopy | ( | ) | const |
|
inline |
|
protected |
|
protected |
|
protected |
|
friend |
|
friend |
CopierBuffer Copier::m_buffers |
std::vector<IndexTM<int,2> > Copier::m_range |
|
protected |
Referenced by CopyIterator::CopyIterator().
|
protected |
Referenced by CopyIterator::CopyIterator().
|
protected |
Referenced by CopyIterator::CopyIterator().
|
staticprotected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |