LevelData< T, C, D, E > Class Template Reference

#include <LevelData.H>

Inheritance diagram for LevelData< T, C, D, E >:

Inheritance graph
[legend]

List of all members.


Detailed Description

template<class T = double, unsigned int C = 1, unsigned char D = 1, unsigned char E = 1>
class LevelData< T, C, D, E >

Structure which holds all of the data in a computational domain for a given level of refinement.

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)
LevelDataoperator= (const LevelData< T > &a_levelData)
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


Constructor & Destructor Documentation

template<class T, unsigned int C, unsigned char D, unsigned char E>
LevelData< T, C, D, E >::LevelData (  )  [inline]

Default Constructor.

template<class T, unsigned int C, unsigned char D, unsigned char E>
LevelData< T, C, D, E >::LevelData ( const BoxLayout  a_boxLayout,
int  a_ghostSize = 0,
int  a_coarseningFactor = 1 
) [inline]

Construct a LevelData from a BoxLayout.

template<class T, unsigned int C, unsigned char D, unsigned char E>
LevelData< T, C, D, E >::~LevelData (  )  [inline]

Destructor.

template<class T = double, unsigned int C = 1, unsigned char D = 1, unsigned char E = 1>
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.


Member Function Documentation

template<class T, unsigned int C, unsigned char D, unsigned char E>
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.

Parameters:
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.
Bug:
Does not return "corner" regions of the GhostBox. Unsure if this is intentional.

References Box::getHighCorner(), Box::getLowCorner(), getUnitv(), LevelData< T, C, D, E >::m_ghostSize, and Box::size().

template<class T, unsigned int C, unsigned char D, unsigned char E>
void LevelData< T, C, D, E >::define ( const BoxLayout  a_boxLayoutm,
int  a_ghostSize = 0,
int  a_coarseningFactor = 1 
) [inline]

template<class T, unsigned int C, unsigned char D, unsigned char E>
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.

template<class T, unsigned int C, unsigned char D, unsigned char E>
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.

template<class T, unsigned int C, unsigned char D, unsigned char E>
RectMDArray< T, C, D, E > & LevelData< T, C, D, E >::operator[] ( int  a_index  )  [inline]

template<class T, unsigned int C, unsigned char D, unsigned char E>
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.

template<class T = double, unsigned int C = 1, unsigned char D = 1, unsigned char E = 1>
BoxLayout LevelData< T, C, D, E >::getBoxLayout (  )  const [inline]

template<class T, unsigned int C, unsigned char D, unsigned char E>
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().

template<class T, unsigned int C, unsigned char D, unsigned char E>
void LevelData< T, C, D, E >::copyTo ( LevelData< T, C, D, E > &  a_dest,
bool  a_copyGhost = false 
) const [inline]

template<class T, unsigned int C, unsigned char D, unsigned char E>
Point LevelData< T, C, D, E >::getNeighbor ( const Point a_p,
const Point a_dir 
) [inline]

template<class T, unsigned int C, unsigned char D, unsigned char E>
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.

template<class T = double, unsigned int C = 1, unsigned char D = 1, unsigned char E = 1>
void LevelData< T, C, D, E >::operator+= ( const LevelData< T > &  a_src  ) 

Todo:
Not yet implemented. Unsure what is intended given the signature.

template<class T, unsigned int C, unsigned char D, unsigned char E>
void LevelData< T, C, D, E >::setVal ( const T &  a_val  )  [inline]

template<class T = double, unsigned int C = 1, unsigned char D = 1, unsigned char E = 1>
void LevelData< T, C, D, E >::print (  )  [inline]

template<class T = double, unsigned int C = 1, unsigned char D = 1, unsigned char E = 1>
LevelData& LevelData< T, C, D, E >::operator= ( const LevelData< T > &  a_levelData  )  [private]

template<class T, unsigned int C, unsigned char D, unsigned char E>
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().

template<class T, unsigned int C, unsigned char D, unsigned char E>
void LevelData< T, C, D, E >::generateBoxes ( const Box a_box,
const Point a_point,
Box a_ghostCells,
Box a_neighborBox 
) [inline, private]

template<class T, unsigned int C, unsigned char D, unsigned char E>
void LevelData< T, C, D, E >::getPeriodicFlapNeighborInfo ( Point a_neighborPt,
Box a_neighborValid,
Point a_shiftdom,
const Point a_p,
const int &  a_idir,
const int &  a_iside 
) [inline, private]

template<class T, unsigned int C, unsigned char D, unsigned char E>
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]

template<class T, unsigned int C, unsigned char D, unsigned char E>
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]

template<class T, unsigned int C, unsigned char D, unsigned char E>
void LevelData< T, C, D, E >::exchangeSingleBox ( const Point a_p  )  [inline, private]


Member Data Documentation

template<class T = double, unsigned int C = 1, unsigned char D = 1, unsigned char E = 1>
BoxLayout LevelData< T, C, D, E >::m_boxLayout [private]

template<class T = double, unsigned int C = 1, unsigned char D = 1, unsigned char E = 1>
vector<RectMDArray<T, C, D, E> > LevelData< T, C, D, E >::m_data [private]

template<class T = double, unsigned int C = 1, unsigned char D = 1, unsigned char E = 1>
int LevelData< T, C, D, E >::m_ghostSize [private]

template<class T = double, unsigned int C = 1, unsigned char D = 1, unsigned char E = 1>
int LevelData< T, C, D, E >::m_coarseningFactor [private]


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

Generated on Fri Mar 11 12:53:44 2016 for AMRStencil by  doxygen 1.5.5