SAMRAI::hier::BoundaryLookupTable< DIM > Class Template Reference

#include <source/hierarchy/patches/BoundaryLookupTable.h>

List of all members.

Public Member Functions

const tbox::Array< int > & getDirections (int loc, int codim) const
 Get array of active directions for specific boundary region case. Such active directions refer to those coordinate directions in which the boundary region would have to be shifted to be contained in the corresponding box region (whose boundary we are interested in).
const tbox::Array< int > & getMaxLocationIndices () const
 Get array of maximum number of locations for each codimension boundary case.
bool isLower (int loc, int codim, int index) const
 Determines if given boundary information indicates a a lower boundary region (i.e., the associated box region contains higher values along the axis in the coordinate direction than the boundary region).
bool isUpper (int loc, int codim, int index) const
 Determines if given boundary information indicates a an upper boundary region (i.e., the associated box region contains lower values along the axis in the coordinate direction than the boundary region).
int mapLocationIndex (int loc) const
 Map boundary box location index between the original numbering and new scheme. In particular, for codimension 2 in 3 spatial dimensions, the value of the argument is mapped from the original numbering scheme to the new scheme, or vice versa.
const tbox::Array< IntVector<
DIM > > & 
getBoundaryDirections (int codim) const
 Get array of boundary direction IntVectors.

Static Public Member Functions

static BoundaryLookupTable<
DIM > * 
getLookupTable ()
 Return pointer to singleton instance of the boundary lookup table.
static void freeLookupTable ()
 Deallocate the BoundaryLookupTable<DIM> instance.
static void setUsingOriginalLocations (bool use_original)
 Set the lookup table to use boundary box location numbering scheme used in SAMRAI prior to version 2.0, when all spatial geometry dependent classes became templated on the spatial dimension.

Protected Member Functions

 BoundaryLookupTable ()
 ~BoundaryLookupTable ()


Detailed Description

template<int DIM>
class SAMRAI::hier::BoundaryLookupTable< DIM >

Class BoundaryLookupTable<DIM> is a singleton class that maintains a table that organizes all of the possible boundary region cases for a patch. It is used primarily by the hier::GridGeometry<DIM> during the construction of physical boundary boxes for patches and by the hier::PatchGeometry<DIM> class to determine box regions to be filled during a physical boundary fill.

This class is useful for any situation where enumerating the cases for boundary regions around a box is needed. The main advantage of using this class is that such calculations can be programmed in a dimension-independent way.

See also:
hier::BoundaryBox

hier::GridGeometry

hier::PatchGeometry


Constructor & Destructor Documentation

template<int DIM>
SAMRAI::hier::BoundaryLookupTable< DIM >::BoundaryLookupTable (  )  [protected]

The constructor for BoundaryLookupTable<DIM> is protected. Consistent with the definition of a Singleton class, only the database object has access to the constructor for the class.

The constructor initializes the state of lookup table contents.

template<int DIM>
SAMRAI::hier::BoundaryLookupTable< DIM >::~BoundaryLookupTable (  )  [protected]

The destructor for BoundaryLookupTable<DIM> is protected. See the comments for the constructor.

The destructor deallocates lookup table contents.


Member Function Documentation

template<int DIM>
BoundaryLookupTable< DIM > * SAMRAI::hier::BoundaryLookupTable< DIM >::getLookupTable (  )  [inline, static]

Return pointer to singleton instance of the boundary lookup table.

Note that when the database is accessed for the first time, the Singleton instance is registered with the ShutdownRegistry class which destroys such objects at program completion. Thus, users of this class do not explicitly allocate or deallocate the Singleton instance.

Returns:
tbox::Pointer to lookup table instance.

template<int DIM>
void SAMRAI::hier::BoundaryLookupTable< DIM >::freeLookupTable (  )  [inline, static]

Deallocate the BoundaryLookupTable<DIM> instance.

It is not necessary to call this function at program termination, since it is automatically called by the ShutdownRegistry class.

template<int DIM>
void SAMRAI::hier::BoundaryLookupTable< DIM >::setUsingOriginalLocations ( bool  use_original  )  [static]

Set the lookup table to use boundary box location numbering scheme used in SAMRAI prior to version 2.0, when all spatial geometry dependent classes became templated on the spatial dimension.

To use the older numbering scheme for backward compatibility, call this function with the argument set to true. Otherwise, the new numbering scheme is applied.

In the newer (version 2.0 and beyond) the location numbering scheme for boundary boxes of codimension 2 in 3 spatial dimensions changed so that the numbering scheme generalizes consistently to all spatial dimensions.

Parameters:
use_original bool argument true if original location index numbering scheme is desired

template<int DIM>
const tbox::Array< int > & SAMRAI::hier::BoundaryLookupTable< DIM >::getDirections ( int  loc,
int  codim 
) const [inline]

Get array of active directions for specific boundary region case. Such active directions refer to those coordinate directions in which the boundary region would have to be shifted to be contained in the corresponding box region (whose boundary we are interested in).

Returns:
const reference to integer array of length codim containing the active directions for boundary case.
Parameters:
loc integer location index of boundary region
codim integer codimension of boundary region

template<int DIM>
const tbox::Array< int > & SAMRAI::hier::BoundaryLookupTable< DIM >::getMaxLocationIndices (  )  const [inline]

Get array of maximum number of locations for each codimension boundary case.

Returns:
integer array of length DIM, each entry of which indicates the maximum number of boundary locations for each codimension

template<int DIM>
bool SAMRAI::hier::BoundaryLookupTable< DIM >::isLower ( int  loc,
int  codim,
int  index 
) const [inline]

Determines if given boundary information indicates a a lower boundary region (i.e., the associated box region contains higher values along the axis in the coordinate direction than the boundary region).

Returns:
bool true if the boundary type of codimension codim indexed by loc is a lower boundary in the specified dimension; return false if the boundary is an upper boundary.
Parameters:
loc integer location index of boundary region
codim integer codimension of boundary region
index integer spatial dimension identifier

template<int DIM>
bool SAMRAI::hier::BoundaryLookupTable< DIM >::isUpper ( int  loc,
int  codim,
int  index 
) const [inline]

Determines if given boundary information indicates a an upper boundary region (i.e., the associated box region contains lower values along the axis in the coordinate direction than the boundary region).

Returns:
bool true if the boundary type of codimension codim indexed by loc is an upper boundary in the specified dimension; return false if the boundary is a lower boundary.
Parameters:
loc integer location index of boundary region
codim integer codimension of boundary region
index integer spatial dimension identifier

template<int DIM>
int SAMRAI::hier::BoundaryLookupTable< DIM >::mapLocationIndex ( int  loc  )  const [inline]

Map boundary box location index between the original numbering and new scheme. In particular, for codimension 2 in 3 spatial dimensions, the value of the argument is mapped from the original numbering scheme to the new scheme, or vice versa.

Returns:
integer location index for other numbering scheme.
Parameters:
loc integer location index of boundary region

template<int DIM>
const tbox::Array< IntVector< DIM > > & SAMRAI::hier::BoundaryLookupTable< DIM >::getBoundaryDirections ( int  codim  )  const [inline]

Get array of boundary direction IntVectors.

For any codimension, there is a particular number of valid boundary locations. This function returns an array of IntVectors that provide information about where each boundary location lies in relation to a patch. The array's length is the number of valid locations for the given codimension, and the array is indexed by the location id's that are set up by this BoundaryLookupTable class.

For a particular location, each element of the IntVector tells whether the location is on the lower or upper side, or neither, of the patch in a specific coordinate direction. -1 indicates lower, 0 indicates neither, and 1 indicates upper.

Returns:
Array of IntVectors, one element for each valid location
Parameters:
codim codimension


The documentation for this class was generated from the following files:
Generated on Thu Jun 18 11:28:29 2009 for SAMRAI by  doxygen 1.5.1