BoxLayout Class Reference

#include <BoxLayout.H>

List of all members.


Detailed Description

An organization of Boxes that represents the computational domain.

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 BoxgetDomain () const
 Return a Box object which encloses the entire computational domain.
const BoxgetBitBox () 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.

Constructor & Destructor Documentation

BoxLayout::BoxLayout (  ) 

Default Constructor.

BoxLayout::BoxLayout ( int  a_M,
const vector< Point > &  a_points 
)

Construct a BoxLayout from an integer and a vector of Points.

Parameters:
a_M Desired value of m_blockPower. Each direction in the domain will contain Pow(2,a_M) blocks.
a_points Vector of Point objects. Each Point is in bit space and represents the lowCorner of a patch in the domain.

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.


Member Function Documentation

const RectMDArray<bool>& BoxLayout::getBitmap (  )  const

const Box& BoxLayout::getDomain (  )  const

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]

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().

Box BoxLayout::operator[] ( const Point a_pt  )  const [inline]

Returns a Box representing the patch corresponding to this point in the bitmap.

bi, where bi is a BoxIterator, is an appropriate argument. Returns the Box for which a_pt maps to the lowCorner.

Parameters:
a_pt A Point in the bit space.

References getOnes(), m_blocksize, and Power().

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.

Parameters:
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[]().

Point BoxLayout::getCornerFromBitpoint ( const Point a_point  ) 

Returns the low corner (in physical space) of the patch specified by a_point (in bit space).

Parameters:
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)

Parameters:
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.

Point BoxLayout::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 BoxLayout::shift ( const Box a_bx,
const Point a_pt 
)

Bug:
Determine the purpose of this function. It appears unfinished.

int BoxLayout::getBlockPower (  )  const [inline]

Return m_blockPower.

References m_blockPower.

Referenced by LevelData< T, C, D, E >::copyTo().

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().


Member Data Documentation

Box representing the physical domain. A refinement of m_bitbox by Power(2,m_blocksize).

Referenced by print().

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[]().


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

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