#include <LevelData.H>
Contains a BoxLayout which defines the valid patches of the domain. Each patch is represented by a RectMDArray which holds the actual data.
Public Member Functions | |
LevelData () | |
Default Constructor. | |
LevelData (const BoxLayout a_boxLayout, int a_ghostSize=0, int a_coarseningFactor=1) | |
Construct a LevelData from a BoxLayout. | |
~LevelData () | |
Destructor. | |
Box | getGhostBox (const Box &a_validBox, const int a_idir, const int &a_side) |
Returns a Box which contains the ghost cells of a_validBox based on m_ghostSize on a particular side and direction. | |
void | define (const BoxLayout a_boxLayoutm, int a_ghostSize=0, int a_coarseningFactor=1) |
const RectMDArray< T, C, D, E > & | operator[] (int a_index) const |
Index into a const LevelData using an integer. Returns the associated RectMDArray. | |
const RectMDArray< T, C, D, E > & | operator[] (Point &a_pt) const |
Index into a const LevelData using a Point in bit-space. Used by the iterator. | |
RectMDArray< T, C, D, E > & | operator[] (int a_index) |
RectMDArray< T, C, D, E > & | operator[] (Point &a_pt) |
BoxLayout | getBoxLayout () const |
void | exchange () |
Fills in the ghost cells of the RectMDArrays. | |
void | copyTo (LevelData &a_dest, bool a_copyGhost=false) const |
Point | getNeighbor (const Point &a_p, const Point &a_dir) |
int | getGhostSize () const |
Returns the number of ghost cells in the ghost box. | |
void | operator+= (const LevelData< T > &a_src) |
void | setVal (const T &a_val) |
Sets all values of each RectMDArray in *this to a_val. | |
void | print () |
Private Member Functions | |
LevelData (const LevelData< T > &a_levelData) | |
LevelData & | operator= (const LevelData< T > &a_levelData) |
T | mod (T &a_lhs, T &a_rhs) const |
void | generateBoxes (const Box &a_box, const Point &a_point, Box &a_ghostCells, Box &a_neighborBox) |
void | getPeriodicFlapNeighborInfo (Point &a_neighborPt, Box &a_neighborValid, Point &a_shiftdom, const Point &a_p, const int &a_idir, const int &a_iside) |
void | getPeriodicEdgeNeighborInfo (Point &a_neighborPt, Box &a_neighborValid, Point &a_shiftdom, const Point &a_p, const int &a_idir, const int &a_iside, const int &a_jdir, const int &a_jside) |
void | getPeriodicCornerNeighborInfo (Point &a_neighborPt, Box &a_neighborValid, Point &a_shiftdom, const Point &a_p, const int &a_idir, const int &a_iside, const int &a_jdir, const int &a_jside, const int &a_kdir, const int &a_kside) |
void | exchangeSingleBox (const Point &a_p) |
Private Attributes | |
BoxLayout | m_boxLayout |
vector< RectMDArray< T, C, D, E > > | m_data |
int | m_ghostSize |
Number of cells in the ghost region. | |
int | m_coarseningFactor |
LevelData< T, C, D, E >::LevelData | ( | ) | [inline] |
Default Constructor.
LevelData< T, C, D, E >::~LevelData | ( | ) | [inline] |
Destructor.
LevelData< T, C, D, E >::LevelData | ( | const LevelData< T > & | a_levelData | ) | [private] |
The assignment operator and the copy constructor is declared private to prevent deep copies and passing LevelData as a value.
Box LevelData< T, C, D, E >::getGhostBox | ( | const Box & | a_validBox, | |
const int | a_idir, | |||
const int & | a_side | |||
) | [inline] |
Returns a Box which contains the ghost cells of a_validBox based on m_ghostSize on a particular side and direction.
a_validBox | Box whose ghost cells are desired | |
a_idir | Integer representing the direction of the desired ghost cells with respect to a_validBox. e.g. if a_idir=0, getGhostBox() will return the ghost box which is adjacent to a_validBox in the 0 direction. | |
a_side | Integer which defines if the returned GhostBox is adjacent to a_validBox in the positive or negative a_idir direction. a_side = 1 defines positive, all other values signify negative. |
References Box::getHighCorner(), Box::getLowCorner(), getUnitv(), LevelData< T, C, D, E >::m_ghostSize, and Box::size().
const RectMDArray< T, C, D, E > & LevelData< T, C, D, E >::operator[] | ( | int | a_index | ) | const [inline] |
Index into a const LevelData using an integer. Returns the associated RectMDArray.
References LevelData< T, C, D, E >::m_data.
const RectMDArray< T, C, D, E > & LevelData< T, C, D, E >::operator[] | ( | Point & | a_pt | ) | const [inline] |
Index into a const LevelData using a Point in bit-space. Used by the iterator.
We are assuming only the iterator will be used to index. We do the validation in the iterator, so we dont need it here.
References BoxLayout::getPatchIndex(), LevelData< T, C, D, E >::m_boxLayout, and LevelData< T, C, D, E >::m_data.
RectMDArray< T, C, D, E > & LevelData< T, C, D, E >::operator[] | ( | int | a_index | ) | [inline] |
References LevelData< T, C, D, E >::m_data.
RectMDArray< T, C, D, E > & LevelData< T, C, D, E >::operator[] | ( | Point & | a_pt | ) | [inline] |
We are assuming only the iterator will be used to index. We do the validation in the iterator, so we dont need it here.
References BoxLayout::getPatchIndex(), LevelData< T, C, D, E >::m_boxLayout, and LevelData< T, C, D, E >::m_data.
BoxLayout LevelData< T, C, D, E >::getBoxLayout | ( | ) | const [inline] |
Referenced by LevelData< T, C, D, E >::copyTo(), and forall().
void LevelData< T, C, D, E >::exchange | ( | ) | [inline] |
Fills in the ghost cells of the RectMDArrays.
Periodicity is assumed. Any ghost cells which are not within the domain are unchanged.
References CH_TIMERS, LevelData< T, C, D, E >::exchangeSingleBox(), BoxLayout::getBitmap(), RectMDArray< T, C, D, E >::getBox(), Box::getLowCorner(), Box::increment(), LevelData< T, C, D, E >::m_boxLayout, and Box::notDone().
void LevelData< T, C, D, E >::copyTo | ( | LevelData< T, C, D, E > & | a_dest, | |
bool | a_copyGhost = false | |||
) | const [inline] |
Copies data from from this object to a_dest.
References BLIterator::begin(), CH_TIMERS, RectMDArray< T, C, D, E >::copyTo(), BLIterator::end(), BoxLayout::getBitmap(), BoxLayout::getBlockPower(), LevelData< T, C, D, E >::getBoxLayout(), BoxLayout::getBoxsize(), BoxLayout::getDomain(), getZeros(), LevelData< T, C, D, E >::m_boxLayout, and BoxLayout::sameBLI().
int LevelData< T, C, D, E >::getGhostSize | ( | ) | const [inline] |
Returns the number of ghost cells in the ghost box.
References LevelData< T, C, D, E >::m_ghostSize.
void LevelData< T, C, D, E >::operator+= | ( | const LevelData< T > & | a_src | ) |
void LevelData< T, C, D, E >::setVal | ( | const T & | a_val | ) | [inline] |
Sets all values of each RectMDArray in *this to a_val.
References BLIterator::begin(), BLIterator::end(), LevelData< T, C, D, E >::m_boxLayout, and RectMDArray< T, C, D, E >::setVal().
void LevelData< T, C, D, E >::print | ( | ) | [inline] |
LevelData& LevelData< T, C, D, E >::operator= | ( | const LevelData< T > & | a_levelData | ) | [private] |
T LevelData< T, C, D, E >::mod | ( | T & | a_lhs, | |
T & | a_rhs | |||
) | const [inline, private] |
Computes a_lhs mod a_rhs. Also works for negative numbers.
Referenced by LevelData< T, C, D, E >::generateBoxes(), and LevelData< T, C, D, E >::getNeighbor().
void LevelData< T, C, D, E >::getPeriodicEdgeNeighborInfo | ( | Point & | a_neighborPt, | |
Box & | a_neighborValid, | |||
Point & | a_shiftdom, | |||
const Point & | a_p, | |||
const int & | a_idir, | |||
const int & | a_iside, | |||
const int & | a_jdir, | |||
const int & | a_jside | |||
) | [inline, private] |
void LevelData< T, C, D, E >::getPeriodicCornerNeighborInfo | ( | Point & | a_neighborPt, | |
Box & | a_neighborValid, | |||
Point & | a_shiftdom, | |||
const Point & | a_p, | |||
const int & | a_idir, | |||
const int & | a_iside, | |||
const int & | a_jdir, | |||
const int & | a_jside, | |||
const int & | a_kdir, | |||
const int & | a_kside | |||
) | [inline, private] |
void LevelData< T, C, D, E >::exchangeSingleBox | ( | const Point & | a_p | ) | [inline, private] |
References Box::contains(), RectMDArray< T, C, D, E >::copyTo(), BoxLayout::getBitBox(), BoxLayout::getBitmap(), BoxLayout::getBoxsize(), Box::getLowCorner(), getOnes(), BoxLayout::getPatchIndex(), getZeros(), Box::increment(), LevelData< T, C, D, E >::m_boxLayout, LevelData< T, C, D, E >::m_data, and Box::notDone().
Referenced by LevelData< T, C, D, E >::exchange().
BoxLayout LevelData< T, C, D, E >::m_boxLayout [private] |
Referenced by LevelData< T, C, D, E >::copyTo(), LevelData< T, C, D, E >::define(), LevelData< T, C, D, E >::exchange(), LevelData< T, C, D, E >::exchangeSingleBox(), LevelData< T, C, D, E >::generateBoxes(), LevelData< double >::getBoxLayout(), LevelData< T, C, D, E >::getNeighbor(), LevelData< T, C, D, E >::getPeriodicCornerNeighborInfo(), LevelData< T, C, D, E >::getPeriodicEdgeNeighborInfo(), LevelData< T, C, D, E >::getPeriodicFlapNeighborInfo(), LevelData< T, C, D, E >::operator[](), LevelData< double >::print(), and LevelData< T, C, D, E >::setVal().
vector<RectMDArray<T, C, D, E> > LevelData< T, C, D, E >::m_data [private] |
int LevelData< T, C, D, E >::m_ghostSize [private] |
Number of cells in the ghost region.
Referenced by LevelData< T, C, D, E >::define(), LevelData< T, C, D, E >::generateBoxes(), LevelData< T, C, D, E >::getGhostBox(), LevelData< T, C, D, E >::getGhostSize(), and LevelData< double >::print().
int LevelData< T, C, D, E >::m_coarseningFactor [private] |