#include <BoxLayout.H>
Public Member Functions | |
BoxLayout () | |
Default Constructor. | |
BoxLayout (int a_M, const vector< Point > &a_points) | |
Construct a BoxLayout from an integer and a vector of Points. | |
BoxLayout (int a_M) | |
Construct a BoxLayout with (2^a_M)^DIM boxes of equal size. The domain is all of *this.m_domain. | |
~BoxLayout () | |
Destructor. | |
const RectMDArray< bool > & | getBitmap () const |
Return a Boolean, scalar valued RectMDArray which defines the computational domain. | |
const Box & | getDomain () const |
Return a Box object which encloses the entire computational domain. | |
const Box & | getBitBox () const |
Return a Box object which encloses the entire computational domain. | |
int | getBoxsize () const |
Returns the linear dimension of a single Box. | |
BoxLayout | coarsen (unsigned int a_numLevels=1) const |
Returns a coarsened version of the present BoxLayout. | |
bool | canCoarsen (unsigned int a_numLevels=1) const |
Determines whether the current BL can be coarsened. | |
BoxLayout | deepCoarsen (unsigned int a_numLevels=1) const |
Returns a BL that covers the same region. | |
bool | sameBLI (const BoxLayout &a_bli) const |
Determines whether the current BL can be coarsened. | |
Box | operator[] (const Point &a_pt) const |
Returns a Box representing the patch corresponding to this point in the bitmap. | |
int | getPatchIndex (const Point &a_point) const |
Return the linear index of the patch whose lowCorner is a_point. | |
Point | getCornerFromBitpoint (const Point &a_point) |
Returns the low corner (in physical space) of the patch specified by a_point (in bit space). | |
bool | neighborExists (const Point &a_p, const int a_dir, const int a_face) |
Check if a neighboring patch is in the domain. | |
vector< Point > & | getPatchLocs () const |
Returns a vector of Points in bit space representing the patches that make up the domain. | |
int | size () |
Returns the number of patches in the domain. | |
Point | getNeighbor (const Point &a_p, const Point &a_dir) |
Outputs the Point associated with the neighboring patch to a_p in the direction a_dir. | |
Box | shift (const Box &a_bx, const Point &a_pt) |
int | getBlockPower () const |
Return m_blockPower. | |
void | print () const |
Prints information about *this to the command line. | |
Private Attributes | |
Box | m_domain |
Box representing the physical domain. A refinement of m_bitbox by Power(2,m_blocksize). | |
Box | m_bitbox |
Box representing an array of blocks. Each Point in m_bitbox corresponds to a block. | |
int | m_blockPower |
Determines the number N of blocks in any direction. N = 2^m_blockPower. | |
int | m_blocksize |
Size of a single block = 2^m_blocksize. MINBLOCKSIZE_EXP<= m_blocksize <= MAXBLOCKSIZE_EXP. |
BoxLayout::BoxLayout | ( | ) |
Default Constructor.
BoxLayout::BoxLayout | ( | int | a_M, | |
const vector< Point > & | a_points | |||
) |
BoxLayout::BoxLayout | ( | int | a_M | ) |
Construct a BoxLayout with (2^a_M)^DIM boxes of equal size. The domain is all of *this.m_domain.
BoxLayout::~BoxLayout | ( | ) |
Destructor.
const RectMDArray<bool>& BoxLayout::getBitmap | ( | ) | const |
Return a Boolean, scalar valued RectMDArray which defines the computational domain.
Referenced by LevelData< T, C, D, E >::copyTo(), LevelData< T, C, D, E >::exchange(), LevelData< T, C, D, E >::exchangeSingleBox(), LevelData< T, C, D, E >::getNeighbor(), LevelData< T, C, D, E >::getPeriodicCornerNeighborInfo(), LevelData< T, C, D, E >::getPeriodicEdgeNeighborInfo(), and LevelData< T, C, D, E >::getPeriodicFlapNeighborInfo().
const Box& BoxLayout::getDomain | ( | ) | const |
Return a Box object which encloses the entire computational domain.
Referenced by LevelData< T, C, D, E >::copyTo(), LevelData< T, C, D, E >::generateBoxes(), LevelData< T, C, D, E >::getPeriodicCornerNeighborInfo(), LevelData< T, C, D, E >::getPeriodicEdgeNeighborInfo(), and LevelData< T, C, D, E >::getPeriodicFlapNeighborInfo().
const Box& BoxLayout::getBitBox | ( | ) | const [inline] |
Return a Box object which encloses the entire computational domain.
References m_bitbox.
Referenced by LevelData< T, C, D, E >::exchangeSingleBox().
int BoxLayout::getBoxsize | ( | ) | const [inline] |
Returns the linear dimension of a single Box.
References m_blocksize, and Power().
Referenced by LevelData< T, C, D, E >::copyTo(), LevelData< T, C, D, E >::define(), and LevelData< T, C, D, E >::exchangeSingleBox().
BoxLayout BoxLayout::coarsen | ( | unsigned int | a_numLevels = 1 |
) | const |
Returns a coarsened version of the present BoxLayout.
bool BoxLayout::canCoarsen | ( | unsigned int | a_numLevels = 1 |
) | const |
Determines whether the current BL can be coarsened.
BoxLayout BoxLayout::deepCoarsen | ( | unsigned int | a_numLevels = 1 |
) | const |
Returns a BL that covers the same region.
bool BoxLayout::sameBLI | ( | const BoxLayout & | a_bli | ) | const |
Determines whether the current BL can be coarsened.
Referenced by LevelData< T, C, D, E >::copyTo().
int BoxLayout::getPatchIndex | ( | const Point & | a_point | ) | const |
Return the linear index of the patch whose lowCorner is a_point.
The returned index is associated with the patch that has a_point as the lowCorner. If a_point is not associated with a patch in the domain, -1 is returned.
a_point | A Point in the bitbox space (not in the physical domain) |
Referenced by LevelData< T, C, D, E >::define(), LevelData< T, C, D, E >::exchangeSingleBox(), BLIterator::operator()(), and LevelData< T, C, D, E >::operator[]().
Returns the low corner (in physical space) of the patch specified by a_point (in bit space).
a_point | Point in bitspace representing the low corner of the desired patch. |
bool BoxLayout::neighborExists | ( | const Point & | a_p, | |
const int | a_dir, | |||
const int | a_face | |||
) |
Check if a neighboring patch is in the domain.
Returns true if neighboring patch is in the domain. Returns false if neighboring patch is not in the domain (either because it has a FALSE bitmap value or because it is not within the bitbox)
a_p | Point in bit space | |
a_dir | Direction of neighbor relative to a_p | |
a_face | Integer representing orientation of neighbor. a_face = 0 represents -a_dir direction, otherwise direction is +a_dir |
vector<Point>& BoxLayout::getPatchLocs | ( | ) | const |
Returns a vector of Points in bit space representing the patches that make up the domain.
Each Point in the output is the lowCorner of the Box that represents the patch in the domain.
Referenced by LevelData< T, C, D, E >::define().
int BoxLayout::size | ( | ) | [inline] |
Returns the number of patches in the domain.
Outputs the Point associated with the neighboring patch to a_p in the direction a_dir.
int BoxLayout::getBlockPower | ( | ) | const [inline] |
void BoxLayout::print | ( | ) | const [inline] |
Prints information about *this to the command line.
References m_bitbox, m_blockPower, m_domain, and Box::print().
Referenced by LevelData< double >::print().
Box BoxLayout::m_domain [private] |
Box BoxLayout::m_bitbox [private] |
Box representing an array of blocks. Each Point in m_bitbox corresponds to a block.
Referenced by getBitBox(), and print().
int BoxLayout::m_blockPower [private] |
Determines the number N of blocks in any direction. N = 2^m_blockPower.
Referenced by getBlockPower(), and print().
int BoxLayout::m_blocksize [private] |
Size of a single block = 2^m_blocksize. MINBLOCKSIZE_EXP<= m_blocksize <= MAXBLOCKSIZE_EXP.
Referenced by getBoxsize(), and operator[]().