IBAMR  IBAMR version 0.19.
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
SAMRAI::hier::BoundaryLookupTable< DIM > Class Template Reference

#include <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). More...
 
const tbox::Array< int > & getMaxLocationIndices () const
 Get array of maximum number of locations for each codimension boundary case. More...
 
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). More...
 
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). More...
 
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. More...
 
const tbox::Array< IntVector< DIM > > & getBoundaryDirections (int codim) const
 Get array of boundary direction IntVectors. More...
 

Static Public Member Functions

static BoundaryLookupTable< DIM > * getLookupTable ()
 Return pointer to singleton instance of the boundary lookup table. More...
 
static void freeLookupTable ()
 Deallocate the BoundaryLookupTable<DIM> instance. More...
 
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. More...
 

Protected Member Functions

 BoundaryLookupTable ()
 
 ~BoundaryLookupTable ()
 

Private Member Functions

void buildTable (int *table, int codim, int ibeg, int(&work)[DIM], int &lvl, int *&ptr)
 
void buildBoundaryDirectionVectors ()
 

Private Attributes

tbox::Array< intd_ncomb
 
tbox::Array< intd_max_li
 
tbox::Array< tbox::Array< int > > d_table [DIM]
 
tbox::Array< tbox::Array< hier::IntVector< DIM > > > d_bdry_dirs
 

Static Private Attributes

static BoundaryLookupTable< DIM > * s_lookup_table_instance
 
static bool s_registered_callback
 
static bool s_using_original_locations
 

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

◆ BoundaryLookupTable()

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.

◆ ~BoundaryLookupTable()

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

◆ getLookupTable()

template<int DIM>
static BoundaryLookupTable<DIM>* SAMRAI::hier::BoundaryLookupTable< DIM >::getLookupTable ( )
static

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.

◆ freeLookupTable()

template<int DIM>
static void SAMRAI::hier::BoundaryLookupTable< DIM >::freeLookupTable ( )
static

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

◆ setUsingOriginalLocations()

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

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_originalbool argument true if original location index numbering scheme is desired

◆ getDirections()

template<int DIM>
const tbox::Array<int>& SAMRAI::hier::BoundaryLookupTable< DIM >::getDirections ( int  loc,
int  codim 
) const
Returns
const reference to integer array of length codim containing the active directions for boundary case.
Parameters
locinteger location index of boundary region
codiminteger codimension of boundary region

◆ getMaxLocationIndices()

template<int DIM>
const tbox::Array<int>& SAMRAI::hier::BoundaryLookupTable< DIM >::getMaxLocationIndices ( ) const
Returns
integer array of length DIM, each entry of which indicates the maximum number of boundary locations for each codimension

◆ isLower()

template<int DIM>
bool SAMRAI::hier::BoundaryLookupTable< DIM >::isLower ( int  loc,
int  codim,
int  index 
) const
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
locinteger location index of boundary region
codiminteger codimension of boundary region
indexinteger spatial dimension identifier

◆ isUpper()

template<int DIM>
bool SAMRAI::hier::BoundaryLookupTable< DIM >::isUpper ( int  loc,
int  codim,
int  index 
) const
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
locinteger location index of boundary region
codiminteger codimension of boundary region
indexinteger spatial dimension identifier

◆ mapLocationIndex()

template<int DIM>
int SAMRAI::hier::BoundaryLookupTable< DIM >::mapLocationIndex ( int  loc) const
Returns
integer location index for other numbering scheme.
Parameters
locinteger location index of boundary region

◆ getBoundaryDirections()

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

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
codimcodimension

◆ buildTable()

template<int DIM>
void SAMRAI::hier::BoundaryLookupTable< DIM >::buildTable ( int table,
int  codim,
int  ibeg,
int(&)  work[DIM],
int lvl,
int *&  ptr 
)
private

◆ buildBoundaryDirectionVectors()

template<int DIM>
void SAMRAI::hier::BoundaryLookupTable< DIM >::buildBoundaryDirectionVectors ( )
private

Member Data Documentation

◆ s_lookup_table_instance

template<int DIM>
BoundaryLookupTable<DIM>* SAMRAI::hier::BoundaryLookupTable< DIM >::s_lookup_table_instance
staticprivate

◆ s_registered_callback

template<int DIM>
bool SAMRAI::hier::BoundaryLookupTable< DIM >::s_registered_callback
staticprivate

◆ s_using_original_locations

template<int DIM>
bool SAMRAI::hier::BoundaryLookupTable< DIM >::s_using_original_locations
staticprivate

◆ d_ncomb

template<int DIM>
tbox::Array<int> SAMRAI::hier::BoundaryLookupTable< DIM >::d_ncomb
private

◆ d_max_li

template<int DIM>
tbox::Array<int> SAMRAI::hier::BoundaryLookupTable< DIM >::d_max_li
private

◆ d_table

template<int DIM>
tbox::Array< tbox::Array<int> > SAMRAI::hier::BoundaryLookupTable< DIM >::d_table[DIM]
private

◆ d_bdry_dirs

template<int DIM>
tbox::Array< tbox::Array< hier::IntVector<DIM> > > SAMRAI::hier::BoundaryLookupTable< DIM >::d_bdry_dirs
private

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