#include <source/hierarchy/patches/BoundaryLookupTable.h>
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 () |
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.
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.
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.
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.
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.
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.
use_original | bool argument true if original location index numbering scheme is desired |
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).
loc | integer location index of boundary region | |
codim | integer codimension of boundary region |
const tbox::Array< int > & SAMRAI::hier::BoundaryLookupTable< DIM >::getMaxLocationIndices | ( | ) | const [inline] |
Get array of maximum number of locations for each codimension boundary case.
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).
loc | integer location index of boundary region | |
codim | integer codimension of boundary region | |
index | integer spatial dimension identifier |
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).
loc | integer location index of boundary region | |
codim | integer codimension of boundary region | |
index | integer spatial dimension identifier |
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.
loc | integer location index of boundary region |
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.
codim | codimension |