IBAMR  IBAMR version 0.19.
Public Member Functions | List of all members
SAMRAI::hier::CoarseFineBoundary< DIM > Class Template Reference

Utility class to construct and maintain a description of the coarse-fine boundary between a patch level and some coarser level. More...

#include <ibtk/PETScMatUtilities.h>

Inheritance diagram for SAMRAI::hier::CoarseFineBoundary< DIM >:
Inheritance graph
[legend]

Public Member Functions

 CoarseFineBoundary ()
 Construct a CoarseFineBoundary<DIM> object with no boundary boxes. More...
 
 CoarseFineBoundary (const PatchHierarchy< DIM > &hierarchy, int ln, const IntVector< DIM > &max_ghost_width)
 Construct a CoarseFineBoundary<DIM> object for the specified level in the given patch hierarchy. More...
 
 CoarseFineBoundary (const tbox::Pointer< MultiblockPatchHierarchy< DIM > > &hierarchy, int ln, const IntVector< DIM > &max_ghost_width)
 Construct a CoarseFineBoundary<DIM> object for the specified level in the given multiblock patch hierarchy. More...
 
 ~CoarseFineBoundary ()
 
void computeFromHierarchy (const PatchHierarchy< DIM > &hierarchy, int ln, const IntVector< DIM > &max_ghost_width)
 Construct a CoarseFineBoundary<DIM> object for the specified level in the given patch hierarchy. More...
 
void computeFromHierarchy (const MultiblockPatchHierarchy< DIM > &hierarchy, int ln, const IntVector< DIM > &max_ghost_width)
 Construct a CoarseFineBoundary<DIM> object for the specified level in the given multiblock patch hierarchy. More...
 
void computeFromLevel (const PatchLevel< DIM > &level, const PatchLevel< DIM > &level0, const IntVector< DIM > &max_ghost_width)
 Construct a CoarseFineBoundary<DIM> object for the specified level based on a given level which is assumed to be the coarsest level (i.e., level zero) in some patch hierarchy. More...
 
void computeFromLevel (const MultiblockPatchLevel< DIM > &level, const MultiblockPatchLevel< DIM > &level0, const IntVector< DIM > &max_ghost_width)
 Construct a CoarseFineBoundary<DIM> object for the specified multibock level based on a given level which is assumed to be the coarsest level (i.e., level zero) in some patch hierarchy. More...
 
void clear (const int block_number=0)
 Clear all boundary data. More...
 

Functions to get the computed coarse-fine boundaries.

tbox::Array< intd_npatches
 Number of patches on the level for which coarse-fine boundary has been computed. More...
 
int d_nblocks
 Number of blocks in the hierarchy on which coarse-fine boundary has been computed. More...
 
tbox::Pointer< MultiblockPatchHierarchy< DIM > > d_mblk_hierarchy
 pointer to the multiblock hierarchy on which the coarse-fine boundary was computed. Alway null in the single block case. More...
 
tbox::Array< tbox::Array< tbox::Array< BoundaryBox< DIM > > > > d_boundary_boxes
 Patch boundary boxes describing the coarse-fine boundary. More...
 
const tbox::Array< BoundaryBox< DIM > > & getBoundaries (int patch_num, int boundary_type, int block_num=0) const
 Get an array of boundary boxes of a given type for a specified patch. More...
 
const tbox::Array< BoundaryBox< DIM > > & getNodeBoundaries (int patch_num, int block_num=0) const
 Get an array of node boundary boxes for a specified patch (see BoundaryBox class). More...
 
const tbox::Array< BoundaryBox< DIM > > & getEdgeBoundaries (int patch_num, int block_num=0) const
 Get an array of edge boundary boxes for a specified patch (see BoundaryBox class). More...
 
const tbox::Array< BoundaryBox< DIM > > & getFaceBoundaries (int patch_num, int block_num=0) const
 Get an array of face boundary boxes for a specified patch (see BoundaryBox class). More...
 
virtual void printClassData (std::ostream &os) const
 Print out class data (mostly for debugging). More...
 
void addPeriodicImageBoxes (BoxArray< DIM > &boxes, const tbox::Array< tbox::List< IntVector< DIM > > > &shifts)
 Take a set of boxes representing some domain and append to it the immediate periodic images of the boxes. More...
 

Detailed Description

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

A coarse-fine boundary box is a BoundaryBox object, but it is generated differently than a typical boundary box maintained by a patch geometry object. The boundary type and location identifiers for regular boundary boxes apply to coarse-fine boundary boxes. However, a boundary box serving as a coarse-fine boundary box describes part of the boundary of a given patch with its next coarser AMR hierarchy level. It does not intersect any other patch on the same level nor does it lie on a physical domain boundary, except where the physical boundary is periodic and the appropriate continuation of that boundary is part of a coarser patch level.

The coarse-fine boundary is created from two adjacent hierarchy levels (typically), but the description lives on (refers to the index space of) the finer level. Since the coarse-fine boundary describes the boundary to the next coarser level, the coarsest level (i.e., level zero in an AMR hierarchy) has no coarse-fine boundary.

Each CoarseFineBoundary object corresponds to one level, so to represent a hierarchy, you would need an array or list of such objects.

Constructor & Destructor Documentation

◆ CoarseFineBoundary() [1/3]

◆ CoarseFineBoundary() [2/3]

template<int DIM>
SAMRAI::hier::CoarseFineBoundary< DIM >::CoarseFineBoundary ( const PatchHierarchy< DIM > &  hierarchy,
int  ln,
const IntVector< DIM > &  max_ghost_width 
)
Parameters
hierarchyPatch hierarchy in which the patch level resides.
lnLevel number of level of computed coarse-fine boundary.
max_ghost_widthMax ghost width for which to generate boundary boxes. The ghost width determines the extent of the boundary boxes along the level domain boundary, similar to regular domain boundary boxes. Note that as in the case of regular boundary boxes, each box will always be one cell wide in the direction perpendicular to the patch boundary.

Note that if level number is zero, the coarse-fine boundary will be empty.

◆ CoarseFineBoundary() [3/3]

template<int DIM>
SAMRAI::hier::CoarseFineBoundary< DIM >::CoarseFineBoundary ( const tbox::Pointer< MultiblockPatchHierarchy< DIM > > &  hierarchy,
int  ln,
const IntVector< DIM > &  max_ghost_width 
)
Parameters
hierarchymultiblock atch hierarchy in which the patch level resides.
lnLevel number of level of computed coarse-fine boundary.
max_ghost_widthMax ghost width for which to generate boundary boxes. The ghost width determines the extent of the boundary boxes along the level domain boundary, similar to regular domain boundary boxes. Note that as in the case of regular boundary boxes, each box will always be one cell wide in the direction perpendicular to the patch boundary.

Note that if level number is zero, the coarse-fine boundary will be empty.

◆ ~CoarseFineBoundary()

template<int DIM>
SAMRAI::hier::CoarseFineBoundary< DIM >::~CoarseFineBoundary ( )

Member Function Documentation

◆ computeFromHierarchy() [1/2]

template<int DIM>
void SAMRAI::hier::CoarseFineBoundary< DIM >::computeFromHierarchy ( const PatchHierarchy< DIM > &  hierarchy,
int  ln,
const IntVector< DIM > &  max_ghost_width 
)
Parameters
hierarchyPatch hierarchy in which the patch level resides.
lnLevel number of level of computed coarse-fine boundary.
max_ghost_widthMax ghost width for which to generate boundary boxes. The ghost width determines the extent of the boundary boxes along the level domain boundary, similar to regular domain boundary boxes. Note that as in the case of regular boundary boxes, each box will always be one cell wide in the direction perpendicular to the patch boundary.

Note that if level number is zero, the coarse-fine boundary will be empty.

◆ computeFromHierarchy() [2/2]

template<int DIM>
void SAMRAI::hier::CoarseFineBoundary< DIM >::computeFromHierarchy ( const MultiblockPatchHierarchy< DIM > &  hierarchy,
int  ln,
const IntVector< DIM > &  max_ghost_width 
)
Parameters
hierarchyPatch hierarchy in which the patch level resides.
lnLevel number of level of computed coarse-fine boundary.
max_ghost_widthMax ghost width for which to generate boundary boxes. The ghost width determines the extent of the boundary boxes along the level domain boundary, similar to regular domain boundary boxes. Note that as in the case of regular boundary boxes, each box will always be one cell wide in the direction perpendicular to the patch boundary.

Note that if level number is zero, the coarse-fine boundary will be empty.

◆ computeFromLevel() [1/2]

template<int DIM>
void SAMRAI::hier::CoarseFineBoundary< DIM >::computeFromLevel ( const PatchLevel< DIM > &  level,
const PatchLevel< DIM > &  level0,
const IntVector< DIM > &  max_ghost_width 
)
Parameters
levelPatch level of computed coarse-fine boundary.
level0Coarsest patch level in hierarchy used to compute coarse-fine boundary.
max_ghost_widthMax ghost width for which to generate boundary boxes. The ghost width determines the extent of the boundary boxes along the level domain boundary, similar to regular domain boundary boxes. Note that as in the case of regular boundary boxes, each box will always be one cell wide in the direction perpendicular to the patch boundary.

Note that if level and level0 are the same, the coarse-fine boundary will be empty.

◆ computeFromLevel() [2/2]

template<int DIM>
void SAMRAI::hier::CoarseFineBoundary< DIM >::computeFromLevel ( const MultiblockPatchLevel< DIM > &  level,
const MultiblockPatchLevel< DIM > &  level0,
const IntVector< DIM > &  max_ghost_width 
)
Parameters
levelPatch level of computed coarse-fine boundary.
level0Coarsest patch level in hierarchy used to compute coarse-fine boundary.
max_ghost_widthMax ghost width for which to generate boundary boxes. The ghost width determines the extent of the boundary boxes along the level domain boundary, similar to regular domain boundary boxes. Note that as in the case of regular boundary boxes, each box will always be one cell wide in the direction perpendicular to the patch boundary.

Note that if level and level0 are the same, the coarse-fine boundary will be empty.

◆ clear()

template<int DIM>
void SAMRAI::hier::CoarseFineBoundary< DIM >::clear ( const int  block_number = 0)

◆ getBoundaries()

template<int DIM>
const tbox::Array< BoundaryBox<DIM> >& SAMRAI::hier::CoarseFineBoundary< DIM >::getBoundaries ( int  patch_num,
int  boundary_type,
int  block_num = 0 
) const

The specified patch must exist in the level used to compute the internal state or it is an error.

Parameters
patch_numPatch number
boundary_typeBoundary box type (see BoundaryBox class).
block_numBlock number (defaults to 0 for non-multiblock case)

◆ getNodeBoundaries()

template<int DIM>
const tbox::Array< BoundaryBox<DIM> >& SAMRAI::hier::CoarseFineBoundary< DIM >::getNodeBoundaries ( int  patch_num,
int  block_num = 0 
) const

The specified patch must exist in the level used to compute the internal state or it is an error.

Parameters
patch_numPatch number
block_numBlock number (defaults to 0 for non-multiblock case)

◆ getEdgeBoundaries()

template<int DIM>
const tbox::Array< BoundaryBox<DIM> >& SAMRAI::hier::CoarseFineBoundary< DIM >::getEdgeBoundaries ( int  patch_num,
int  block_num = 0 
) const

Note that edge boxes are only meaningful if problem dimension is > 1. The specified patch must exist in the level used to compute the internal state or it is an error.

Parameters
patch_numPatch number
block_numBlock number (defaults to 0 for non-multiblock case)

◆ getFaceBoundaries()

template<int DIM>
const tbox::Array< BoundaryBox<DIM> >& SAMRAI::hier::CoarseFineBoundary< DIM >::getFaceBoundaries ( int  patch_num,
int  block_num = 0 
) const

Note that face boxes are only meaningful if problem dimension is > 2. The specified patch must exist in the level used to compute the internal state or it is an error.

Parameters
patch_numPatch number
block_numBlock number (defaults to 0 for non-multiblock case)

◆ printClassData()

template<int DIM>
virtual void SAMRAI::hier::CoarseFineBoundary< DIM >::printClassData ( std::ostream &  os) const
virtual

◆ addPeriodicImageBoxes()

template<int DIM>
void SAMRAI::hier::CoarseFineBoundary< DIM >::addPeriodicImageBoxes ( BoxArray< DIM > &  boxes,
const tbox::Array< tbox::List< IntVector< DIM > > > &  shifts 
)
private

If there is no periodic directions in the grid, there will be no change.

The image boxes help form a virtual domain with which to trick the grid geometry object to compute the coarse-fine boundary instead of the physical boundary.

Parameters
boxesBox array to append to. This function will append the periodic image boxes to this array.
shiftsPeriodic shifts.

Member Data Documentation

◆ d_npatches

template<int DIM>
tbox::Array<int> SAMRAI::hier::CoarseFineBoundary< DIM >::d_npatches
private

This is set to >= 0 when the boundary boxes are generated. Otherwise, it is set to -1. We do not use the size of d_boundary_boxes to determine if boundary has been generated because it is possible to have no patch on a level.

This is stored as an array so that it can be used with a multiblock hierarchy. Each entry in the array represents the number of patches in a particular block on the level. For single-block cases, the array is always of length 1.

◆ d_nblocks

template<int DIM>
int SAMRAI::hier::CoarseFineBoundary< DIM >::d_nblocks
private

◆ d_mblk_hierarchy

template<int DIM>
tbox::Pointer<MultiblockPatchHierarchy<DIM> > SAMRAI::hier::CoarseFineBoundary< DIM >::d_mblk_hierarchy
private

◆ d_boundary_boxes

template<int DIM>
tbox::Array< tbox::Array< tbox::Array< BoundaryBox<DIM> > > > SAMRAI::hier::CoarseFineBoundary< DIM >::d_boundary_boxes
private

The outer array is sized by the number of blocks in the hierarchy. This size is always one for non-multiblock hierarchies.

The first inner array, sized by DIM times the number of patches on the level, representing for each patch, the DIM types of boundary boxes. The innermost array is sized by the number of BoundaryBox<DIM> of a given type, for a given patch. So, the array of BoundaryBox<DIM> of type i for patch number pn in a single block problem is d_boundary_boxes[0][pn*DIM+(i-1)]. The reason for this is due to the way the boundary boxes are computed in GridGeometry<DIM>::computeBoundaryGeometry.


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