#include <BaseEBCellFAB.H>
An BaseEBCellFAB is a templated holder for cell-centered data over the intersection of a box and an EbisBox. At every uncovered VolIndex in this intersection, the BaseEBCellFAB contains a specified number of data values. At singly valued cells, the data is stored internally in a BaseFab. At multiply-valued cells, the data is stored internally in an BaseIVFAB. BaseEBCellFAB provides indexing by VolIndex. This class does not provide a copy constructor or assignment operator for all the usual reasons.
Public Member Functions | |
BaseEBCellFAB () | |
BaseEBCellFAB (const EBISBox &a_ebisBox, const Box &a_region, int a_nVar) | |
void | define (const EBISBox &a_ebisBox, const Box &a_region, int a_nVar) |
BaseEBCellFAB (const Interval &a_comps, BaseEBCellFAB< T > &a_original) | |
aliasing copy-ish constructor. Used when the 'alias' function is invoked on LevelData | |
virtual | ~BaseEBCellFAB () |
void | clear () |
void | setVal (const T &value) |
void | setVal (int ivar, const T &value) |
void | setVal (const T &value, const Box &a_box, int a_nstart, int a_numcomp) |
bool | isDefined () const |
int | nComp () const |
const Box & | getRegion () const |
const Box & | box () const |
const IntVectSet & | getMultiCells () const |
const BaseIVFAB< T > & | getMultiValuedFAB () const |
BaseIVFAB< T > & | getMultiValuedFAB () |
const BaseFab< T > & | getSingleValuedFAB () const |
BaseFab< T > & | getSingleValuedFAB () |
const T & | operator() (const VolIndex &a_ndin, int a_nVarLoc, int a_isKnownMultiValued=0) const |
T & | operator() (const VolIndex &a_ndin, int a_nVarLoc, int a_isKnownMultiValued=0) |
void | fill (T *array, const VolIndex &a_ndin, const Interval &a_comps) const |
void | assign (const T *array, const VolIndex &a_ndin, const Interval &a_comps) |
void | copy (const Box &RegionFrom, const Interval &destInt, const Box &RegionTo, const BaseEBCellFAB< T > &source, const Interval &srcInt) |
BaseEBCellFAB< T > & | copy (const BaseEBCellFAB< T > &source) |
int | size (const Box &R, const Interval &comps) const |
void | linearOut (void *buf, const Box &R, const Interval &comps) const |
void | linearIn (void *buf, const Box &R, const Interval &comps) |
BaseEBCellFAB (const Box &a_region, int a_nVar) | |
invalid but necessary for leveldata to compile | |
const EBISBox & | getEBISBox () const |
void | setCoveredCellVal (const T &a_val, const int &a_comp, const bool &a_doMulti=true) |
Static Public Member Functions | |
static int | preAllocatable () |
Protected Member Functions | |
void | setDefaultValues () |
Protected Attributes | |
MiniIVFAB< T > | m_irrFAB |
data at multi-valued cells | |
BaseFab< T > | m_regFAB |
data at single-valued cells | |
EBISBox | m_ebisBox |
int | m_nComp |
Box | m_region |
region over which the BaseEBCellFAB exists | |
IntVectSet | m_multiCells |
whether each given cell is multi-valued | |
bool | m_hasMultiCells |
is m_multiCells not empty? | |
bool | m_isDefined |
has full define function been called? | |
Private Member Functions | |
void | operator= (const BaseEBCellFAB< T > &ebcin) |
BaseEBCellFAB (const BaseEBCellFAB< T > &ebcin) |
BaseEBCellFAB< T >::BaseEBCellFAB | ( | ) | [inline] |
References BaseEBCellFAB< T >::setDefaultValues().
BaseEBCellFAB< T >::BaseEBCellFAB | ( | const EBISBox & | a_ebisBox, | |
const Box & | a_region, | |||
int | a_nVar | |||
) | [inline] |
References BaseEBCellFAB< T >::define(), and BaseEBCellFAB< T >::setDefaultValues().
BaseEBCellFAB< T >::BaseEBCellFAB | ( | const Interval & | a_comps, | |
BaseEBCellFAB< T > & | a_original | |||
) |
aliasing copy-ish constructor. Used when the 'alias' function is invoked on LevelData
Constructs an 'aliased' BaseEBCellFab of the requested interval of the argument BaseEBCellFab. This BaseEBCellFab does not allocate any memory, but sets its data pointer into the memory pointed to by the argument BaseEBCellFab. It is the users responsiblity to ensure this aliased BaseEBCellFab is not used after the original BaseEBCellFab has deleted its data ptr (resize, define(..) called, or destruction, etc.).
This aliased BaseEBCellFab will also generate side effects (modifying the values of data in one will modify the other's data).
This aliased BaseFab will have a_comps.size() components, starting at zero.
BaseEBCellFAB< T >::~BaseEBCellFAB | ( | ) | [inline, virtual] |
References BaseEBCellFAB< T >::clear().
BaseEBCellFAB< T >::BaseEBCellFAB | ( | const Box & | a_region, | |
int | a_nVar | |||
) | [inline] |
invalid but necessary for leveldata to compile
BaseEBCellFAB< T >::BaseEBCellFAB | ( | const BaseEBCellFAB< T > & | ebcin | ) | [inline, private] |
void BaseEBCellFAB< T >::define | ( | const EBISBox & | a_ebisBox, | |
const Box & | a_region, | |||
int | a_nVar | |||
) | [inline] |
References Box::cellCentered(), BaseEBCellFAB< T >::clear(), EBISBox::getEBGraph(), EBISBox::getMultiCells(), EBISBox::getRegion(), IntVectSet::isEmpty(), Box::isEmpty(), BaseEBCellFAB< T >::m_ebisBox, BaseEBCellFAB< T >::m_hasMultiCells, BaseEBCellFAB< T >::m_irrFAB, BaseEBCellFAB< T >::m_isDefined, BaseEBCellFAB< T >::m_multiCells, BaseEBCellFAB< T >::m_nComp, BaseEBCellFAB< T >::m_regFAB, and BaseEBCellFAB< T >::m_region.
Referenced by BaseEBCellFAB< T >::BaseEBCellFAB().
void BaseEBCellFAB< T >::clear | ( | ) | [inline] |
void BaseEBCellFAB< T >::setVal | ( | const T & | value | ) | [inline] |
References BaseEBCellFAB< T >::m_irrFAB, and BaseEBCellFAB< T >::m_regFAB.
void BaseEBCellFAB< T >::setVal | ( | int | ivar, | |
const T & | value | |||
) | [inline] |
References BaseEBCellFAB< T >::m_irrFAB, and BaseEBCellFAB< T >::m_regFAB.
void BaseEBCellFAB< T >::setVal | ( | const T & | value, | |
const Box & | a_box, | |||
int | a_nstart, | |||
int | a_numcomp | |||
) | [inline] |
bool BaseEBCellFAB< T >::isDefined | ( | ) | const [inline] |
References BaseEBCellFAB< T >::m_isDefined.
Referenced by BaseEBCellFAB< T >::assign(), BaseEBCellFAB< T >::copy(), BaseEBCellFAB< T >::fill(), BaseEBCellFAB< T >::getMultiCells(), BaseEBCellFAB< T >::getMultiValuedFAB(), BaseEBCellFAB< T >::getRegion(), BaseEBCellFAB< T >::getSingleValuedFAB(), BaseEBCellFAB< T >::nComp(), BaseEBCellFAB< T >::operator()(), and BaseEBCellFAB< T >::setVal().
int BaseEBCellFAB< T >::nComp | ( | ) | const [inline] |
References BaseEBCellFAB< T >::isDefined(), and BaseEBCellFAB< T >::m_nComp.
const Box & BaseEBCellFAB< T >::getRegion | ( | ) | const [inline] |
References BaseEBCellFAB< T >::isDefined(), and BaseEBCellFAB< T >::m_region.
Referenced by BaseEBCellFAB< T >::box().
const Box & BaseEBCellFAB< T >::box | ( | ) | const [inline] |
References BaseEBCellFAB< T >::getRegion().
const IntVectSet & BaseEBCellFAB< T >::getMultiCells | ( | ) | const [inline] |
References BaseEBCellFAB< T >::isDefined(), and BaseEBCellFAB< T >::m_irrFAB.
Referenced by BaseEBCellFAB< T >::setCoveredCellVal().
const BaseIVFAB< T > & BaseEBCellFAB< T >::getMultiValuedFAB | ( | ) | const [inline] |
References BaseEBCellFAB< T >::isDefined(), and BaseEBCellFAB< T >::m_irrFAB.
BaseIVFAB< T > & BaseEBCellFAB< T >::getMultiValuedFAB | ( | ) | [inline] |
References BaseEBCellFAB< T >::isDefined(), and BaseEBCellFAB< T >::m_irrFAB.
const BaseFab< T > & BaseEBCellFAB< T >::getSingleValuedFAB | ( | ) | const [inline] |
References BaseEBCellFAB< T >::isDefined(), and BaseEBCellFAB< T >::m_regFAB.
BaseFab< T > & BaseEBCellFAB< T >::getSingleValuedFAB | ( | ) | [inline] |
References BaseEBCellFAB< T >::isDefined(), and BaseEBCellFAB< T >::m_regFAB.
const T & BaseEBCellFAB< T >::operator() | ( | const VolIndex & | a_ndin, | |
int | a_nVarLoc, | |||
int | a_isKnownMultiValued = 0 | |||
) | const [inline] |
Arg a_isKnownMultiValued should be set to: -1 if arg a_ndin is known to be in a single-valued cell; +1 if arg a_ndin is known to be in a multi-valued cell; 0 if you're not sure (in which case the expensive IntVectSet::contains() function gets called.
Note: BVS says third arg is a wart that makes this operator look less like a logical array access.
References IntVectSet::contains(), VolIndex::gridIndex(), EBISBox::isCovered(), BaseEBCellFAB< T >::isDefined(), BaseEBCellFAB< T >::m_ebisBox, BaseEBCellFAB< T >::m_irrFAB, BaseEBCellFAB< T >::m_multiCells, BaseEBCellFAB< T >::m_nComp, and BaseEBCellFAB< T >::m_regFAB.
T & BaseEBCellFAB< T >::operator() | ( | const VolIndex & | a_ndin, | |
int | a_nVarLoc, | |||
int | a_isKnownMultiValued = 0 | |||
) | [inline] |
Arg a_isKnownMultiValued should be set to: -1 if arg a_ndin is known to be in a single-valued cell; +1 if arg a_ndin is known to be in a multi-valued cell; 0 if you're not sure (in which case the expensive IntVectSet::contains() function gets called.
References IntVectSet::contains(), Box::contains(), MayDay::Error(), VolIndex::gridIndex(), EBISBox::isCovered(), BaseEBCellFAB< T >::isDefined(), IntVectSet::isEmpty(), BaseEBCellFAB< T >::m_ebisBox, BaseEBCellFAB< T >::m_irrFAB, BaseEBCellFAB< T >::m_multiCells, BaseEBCellFAB< T >::m_nComp, BaseEBCellFAB< T >::m_regFAB, and BaseEBCellFAB< T >::m_region.
void BaseEBCellFAB< T >::fill | ( | T * | array, | |
const VolIndex & | a_ndin, | |||
const Interval & | a_comps | |||
) | const [inline] |
References Interval::begin(), IntVectSet::contains(), Box::contains(), VolIndex::gridIndex(), i, EBISBox::isCovered(), BaseEBCellFAB< T >::isDefined(), BaseEBCellFAB< T >::m_ebisBox, BaseEBCellFAB< T >::m_irrFAB, BaseEBCellFAB< T >::m_multiCells, BaseEBCellFAB< T >::m_regFAB, BaseEBCellFAB< T >::m_region, and Interval::size().
void BaseEBCellFAB< T >::assign | ( | const T * | array, | |
const VolIndex & | a_ndin, | |||
const Interval & | a_comps | |||
) | [inline] |
References Interval::begin(), IntVectSet::contains(), Box::contains(), VolIndex::gridIndex(), i, EBISBox::isCovered(), BaseEBCellFAB< T >::isDefined(), BaseEBCellFAB< T >::m_ebisBox, BaseEBCellFAB< T >::m_irrFAB, BaseEBCellFAB< T >::m_multiCells, BaseEBCellFAB< T >::m_regFAB, BaseEBCellFAB< T >::m_region, and Interval::size().
void BaseEBCellFAB< T >::copy | ( | const Box & | RegionFrom, | |
const Interval & | destInt, | |||
const Box & | RegionTo, | |||
const BaseEBCellFAB< T > & | source, | |||
const Interval & | srcInt | |||
) | [inline] |
References Interval::begin(), CH_START, CH_STOP, CH_TIMER, CH_TIMERS, Interval::end(), EBISBox::getDomain(), BaseEBCellFAB< T >::isDefined(), Box::isEmpty(), BaseEBCellFAB< T >::m_ebisBox, BaseEBCellFAB< T >::m_hasMultiCells, BaseEBCellFAB< T >::m_irrFAB, BaseEBCellFAB< T >::m_nComp, BaseEBCellFAB< T >::m_regFAB, and Interval::size().
Referenced by BaseEBCellFAB< T >::copy().
BaseEBCellFAB< T > & BaseEBCellFAB< T >::copy | ( | const BaseEBCellFAB< T > & | source | ) | [inline] |
static int BaseEBCellFAB< T >::preAllocatable | ( | ) | [inline, static] |
This stuff required by LevelData in parallel:
int BaseEBCellFAB< T >::size | ( | const Box & | R, | |
const Interval & | comps | |||
) | const [inline] |
References BaseEBCellFAB< T >::m_irrFAB, and BaseEBCellFAB< T >::m_regFAB.
void BaseEBCellFAB< T >::linearOut | ( | void * | buf, | |
const Box & | R, | |||
const Interval & | comps | |||
) | const [inline] |
References BaseEBCellFAB< T >::m_irrFAB, and BaseEBCellFAB< T >::m_regFAB.
void BaseEBCellFAB< T >::linearIn | ( | void * | buf, | |
const Box & | R, | |||
const Interval & | comps | |||
) | [inline] |
References BaseEBCellFAB< T >::m_irrFAB, and BaseEBCellFAB< T >::m_regFAB.
const EBISBox & BaseEBCellFAB< T >::getEBISBox | ( | ) | const [inline] |
References BaseEBCellFAB< T >::m_ebisBox.
void BaseEBCellFAB< T >::setCoveredCellVal | ( | const T & | a_val, | |
const int & | a_comp, | |||
const bool & | a_doMulti = true | |||
) | [inline] |
void BaseEBCellFAB< T >::setDefaultValues | ( | ) | [inline, protected] |
References BaseEBCellFAB< T >::m_isDefined, and BaseEBCellFAB< T >::m_nComp.
Referenced by BaseEBCellFAB< T >::BaseEBCellFAB().
void BaseEBCellFAB< T >::operator= | ( | const BaseEBCellFAB< T > & | ebcin | ) | [inline, private] |
MiniIVFAB<T> BaseEBCellFAB< T >::m_irrFAB [protected] |
data at multi-valued cells
Referenced by BaseEBCellFAB< T >::assign(), BaseEBCellFAB< T >::clear(), BaseEBCellFAB< T >::copy(), BaseEBCellFAB< T >::define(), BaseEBCellFAB< T >::fill(), BaseEBCellFAB< T >::getMultiCells(), BaseEBCellFAB< T >::getMultiValuedFAB(), BaseEBCellFAB< T >::linearIn(), BaseEBCellFAB< T >::linearOut(), BaseEBCellFAB< T >::operator()(), BaseEBCellFAB< T >::setVal(), and BaseEBCellFAB< T >::size().
BaseFab<T> BaseEBCellFAB< T >::m_regFAB [protected] |
data at single-valued cells
Referenced by BaseEBCellFAB< T >::assign(), BaseEBCellFAB< T >::clear(), BaseEBCellFAB< T >::copy(), BaseEBCellFAB< T >::define(), BaseEBCellFAB< T >::fill(), BaseEBCellFAB< T >::getSingleValuedFAB(), BaseEBCellFAB< T >::linearIn(), BaseEBCellFAB< T >::linearOut(), BaseEBCellFAB< T >::operator()(), BaseEBCellFAB< T >::setCoveredCellVal(), BaseEBCellFAB< T >::setVal(), and BaseEBCellFAB< T >::size().
EBISBox BaseEBCellFAB< T >::m_ebisBox [protected] |
int BaseEBCellFAB< T >::m_nComp [protected] |
Box BaseEBCellFAB< T >::m_region [protected] |
region over which the BaseEBCellFAB exists
Referenced by BaseEBCellFAB< T >::assign(), BaseEBCellFAB< T >::copy(), BaseEBCellFAB< T >::define(), BaseEBCellFAB< T >::fill(), BaseEBCellFAB< T >::getRegion(), BaseEBCellFAB< T >::operator()(), and BaseEBCellFAB< T >::setCoveredCellVal().
IntVectSet BaseEBCellFAB< T >::m_multiCells [protected] |
whether each given cell is multi-valued
Referenced by BaseEBCellFAB< T >::assign(), BaseEBCellFAB< T >::clear(), BaseEBCellFAB< T >::define(), BaseEBCellFAB< T >::fill(), and BaseEBCellFAB< T >::operator()().
bool BaseEBCellFAB< T >::m_hasMultiCells [protected] |
is m_multiCells not empty?
Referenced by BaseEBCellFAB< T >::copy(), and BaseEBCellFAB< T >::define().
bool BaseEBCellFAB< T >::m_isDefined [protected] |
has full define function been called?
Referenced by BaseEBCellFAB< T >::clear(), BaseEBCellFAB< T >::define(), BaseEBCellFAB< T >::isDefined(), and BaseEBCellFAB< T >::setDefaultValues().