#include <source/hierarchy/patches/PatchConfigurationUtilities.h>
SAMRAI::hier::PatchConfigurationUtilities< DIM >::PatchConfigurationUtilities | ( | const std::string & | object_name, | |
tbox::Pointer< PatchHierarchy< DIM > > | hierarchy = 0 | |||
) |
The constructor for PatchConfigurationUtilities initializes the utilities object to manage data operations for the given patch hierarchy.
Note that the constructed utilities object cannot do anything useful until hierarchy patch level information is initialized via the initialize() or reset() methods.
object_name | String name identifier for utilities object. Cannot be empty when assertion checking is turned on. Should be unique among names used for other utilities objects for proper error checking and restart functionality. | |
hierarchy | Optional pointer to patch hierarchy containing patch levels for which requests for patch information will be made. If null (default), then this object can only be used to obtain information about relationships between patches on a single level, which is set in the call to initialize() or reset. |
SAMRAI::hier::PatchConfigurationUtilities< DIM >::~PatchConfigurationUtilities | ( | ) | [virtual] |
Virtual destructor for utilities objects.
bool SAMRAI::hier::PatchConfigurationUtilities< DIM >::levelIsSet | ( | const LevelNumber & | level_num | ) | const |
Check whether information is set for given level number.
level_num | Const reference to hier::LevelNumber type indicating level number of interest. When assertion checking is active, an assertion is thrown if number does not correspond to level in patch hierarchy. |
bool SAMRAI::hier::PatchConfigurationUtilities< DIM >::patchIsSet | ( | const PatchNumber & | patch_num, | |
const LevelNumber & | level_num | |||
) | const |
Check whether information is set for given patch and level number.
Note that this routine will always return false if the patch is not mapped to this processor.
patch_num | Const reference to hier::PatchNumber type indicating patch number of interest. When assertion checking is active, an assertion is thrown if number does not correspond to a patch on the patch level. | |
level_num | Const reference to hier::LevelNumber type indicating level number of interest. When assertion checking is active, an assertion is thrown if number does not correspond to level in patch hierarchy. |
void SAMRAI::hier::PatchConfigurationUtilities< DIM >::initialize | ( | tbox::Pointer< PatchLevel< DIM > > | level = 0 |
) |
Initialize utilities object so that it can service requests for patch information for the given patch level or for all patch levels in the hierarchy.
If this method is called more than once, then patch information is built only for patch levels for which information has not been built already. In particular, if the method is called with the same patch level more than once, each call after the first is essentially a no-op.
This method cannot be used to replace patch info associated with a given patch level number with that for a new level with the same level number. For that to occur, the clear() method must be called first.
For consistency and to prevent unexpected behavior, this routine issues warnings and will not perform operations in certain situations. These situations include: the given patch level is not in the patch hierarchy passed to the constructor when this object was created, and the given patch level does not match the level with the same level number used to build patch information in the most recent call to this initialization routine. Either of these situations indicates potentially erroneous usage such as mixing levels from different patch hierarchied in a single utilities object.
level | Optional pointer to patch level. If a non-null level pointer is supplied, patch information is built only for the level. Otherwise, information is built for all hierarchy levels for which it has not been built already. |
void SAMRAI::hier::PatchConfigurationUtilities< DIM >::clear | ( | tbox::Pointer< PatchLevel< DIM > > | level = 0 |
) |
Clear patch information for the given patch level or for all patch levels in the hierarchy.
For consistency and to prevent unexpected behavior, this routine issues warnings and will not perform operations in certain situations. These situations include: the given patch level is not in the patch hierarchy passed to the constructor when this object was created, and the given patch level does not match the level with the same level number used to build patch information in the most recent call to the initialization routine. Either of these situations indicates potentially erroneous usage such as mixing levels from different patch hierarchied in a single utilities object.
If no patch level argument is supplied. this method returns state of object to default state at construction. In particular, only the object name and hierarchy (if passed to constructor originally) remain intact.
level | Optional pointer to patch level. If a non-null level pointer is supplied, patch information is cleared only for the level. Otherwise, information is cleared for all hierarchy levels. |
const tbox::Array< typename PatchConfigurationUtilities< DIM >::NeighborPatchInfo > & SAMRAI::hier::PatchConfigurationUtilities< DIM >::getNodeNeighborInfo | ( | const PatchNumber & | patch_num, | |
const LevelNumber & | level_num = LevelNumber(-1) | |||
) | const |
Get an array of NeighborPatchInfo structs describing the patches on the same patch level that are node neighbors of the given patch. A node neighbor intersects the patch at a single corner point.
patch_num | Const reference to hier::PatchNumber type indicating patch number of patch of interest. When assertion checking is active, an assertion is thrown if number does not correspond to a patch on the patch level. | |
level_num | Optional const reference to hier::LevelNumber type indicating level number of patch of interest. The level number must be given when this object is used to manage information for a patch hierarchy (as opposed to a single level). When assertion checking is active, an assertion is thrown if number does not correspond to level in patch hierarchy. If no patch hierarchy was passed to the constructor when this object was created, then the level number is ignored. |
const tbox::Array< typename PatchConfigurationUtilities< DIM >::NeighborPatchInfo > & SAMRAI::hier::PatchConfigurationUtilities< DIM >::getEdgeNeighborInfo | ( | const PatchNumber & | patch_num, | |
const LevelNumber & | level_num = LevelNumber(-1) | |||
) | const |
Get an array of NeighborPatchInfo structs describing the patches on the same patch level that are edge neighbors of the given patch. An edge neighbor intersects the patch along a 1-dimensional edge.
patch_num | Const reference to hier::PatchNumber type indicating patch number of patch of interest. When assertion checking is active, an assertion is thrown if number does not correspond to a patch on the patch level. | |
level_num | Optional const reference to hier::LevelNumber type indicating level number of patch of interest. The level number must be given when this object is used to manage information for a patch hierarchy (as opposed to a single level). When assertion checking is active, an assertion is thrown if number does not correspond to level in patch hierarchy. If no patch hierarchy was passed to the constructor when this object was created, then the level number is ignored. |
const tbox::Array< typename PatchConfigurationUtilities< DIM >::NeighborPatchInfo > & SAMRAI::hier::PatchConfigurationUtilities< DIM >::getFaceNeighborInfo | ( | const PatchNumber & | patch_num, | |
const LevelNumber & | level_num = LevelNumber(-1) | |||
) | const |
Get an array of NeighborPatchInfo structs describing the patches on the same patch level that are face neighbors of the given patch. A face neighbor intersects the patch along a 2-dimensional face.
patch_num | Const reference to hier::PatchNumber type indicating patch number of patch of interest. When assertion checking is active, an assertion is thrown if number does not correspond to a patch on the patch level. | |
level_num | Optional const reference to hier::LevelNumber type indicating level number of patch of interest. The level number must be given when this object is used to manage information for a patch hierarchy (as opposed to a single level). When assertion checking is active, an assertion is thrown if number does not correspond to level in patch hierarchy. If no patch hierarchy was passed to the constructor when this object was created, then the level number is ignored. |
const tbox::Array< typename PatchConfigurationUtilities< DIM >::NeighborPatchInfo > & SAMRAI::hier::PatchConfigurationUtilities< DIM >::getCodimensionNeighborPatchInfo | ( | int | codim, | |
const PatchNumber & | patch_num, | |||
const LevelNumber & | level_num = LevelNumber(-1) | |||
) | const |
Get an array of NeighborPatchInfo structs describing the patches on the same patch level that are neighbors along an (DIM - codim)-dimensional region of the given patch.
For spatial dimensions less than 4, this routine operates similarly to the functions above. Specifically,
if DIM == 1: (codim == 1) => same components as getNodeBoundary.
if DIM == 2, (codim == 1) => same components as getEdgeBoundary. (codim == 2) => same components as getNodeBoundary.
if DIM == 3, (codim == 1) => same components as getFaceBoundary. (codim == 2) => same components as getEdgeBoundary. (codim == 3) => same components as getNodeBoundary.
codim | Integer codimension of neighbor boundary. The value should satisfy 0 < codim <= DIM. If not, an array of size zero will be returned. | |
patch_num | Const reference to hier::PatchNumber type indicating patch number of patch of interest. When assertion checking is active, an assertion is thrown if number does not correspond to a patch on the patch level. | |
level_num | Optional const reference to hier::LevelNumber type indicating level number of patch of interest. The level number must be given when this object is used to manage information for a patch hierarchy (as opposed to a single level). When assertion checking is active, an assertion is thrown if number does not correspond to level in patch hierarchy. If no patch hierarchy was passed to the constructor when this object was created, then the level number is ignored. |
const tbox::Array< int > & SAMRAI::hier::PatchConfigurationUtilities< DIM >::getFinerLevelOverlapPatchIndices | ( | const PatchNumber & | patch_num, | |
const LevelNumber & | level_num | |||
) | const |
Get array of integer patch numbers of patches on the next finer hierarchy level that overlap the specified patch.
patch_num | Const reference to hier::PatchNumber type indicating patch number of patch of interest. When assertion checking is active, an assertion is thrown if number does not correspond to a patch on the patch level. | |
level_num | Const reference to hier::LevelNumber type indicating level number of patch of interest. When assertion checking is active, an assertion is thrown if number does not correspond to a level in patch hierarchy if a non-null patch hierarchy pointer was passed to the constructor. |
const Box< DIM > & SAMRAI::hier::PatchConfigurationUtilities< DIM >::getCoarsenedFinerLevelPatchBox | ( | const PatchNumber & | finer_level_patch_num, | |
const LevelNumber & | level_num | |||
) | const |
Get box representing the coarsening of a patch box on the next finer hierarchy level to the index space of the specified level.
finer_level_patch_num | Const reference to hier::PatchNumber type indicating patch number of patch on next finer level. When assertion checking is active, an assertion is thrown if number does not correspond to a patch on the patch level. | |
level_num | Const reference to hier::LevelNumber type indicating level number of interest. When assertion checking is active, an assertion is thrown if number does not correspond to level in patch hierarchy. |
const tbox::Array< int > & SAMRAI::hier::PatchConfigurationUtilities< DIM >::getCoarserLevelOverlapPatchIndices | ( | const PatchNumber & | patch_num, | |
const LevelNumber & | level_num | |||
) | const |
Get array of integer patch numbers of patches on the next coarser hierarchy level that overlap the specified patch.
patch_num | Const reference to hier::PatchNumber type indicating patch number of patch of interest. When assertion checking is active, an assertion is thrown if number does not correspond to a patch on the patch level. | |
level_num | Const reference to hier::LevelNumber type indicating level number of patch of interest. When assertion checking is active, an assertion is thrown if number does not correspond to a level in patch hierarchy if a non-null patch hierarchy pointer was passed to the constructor. |
const Box< DIM > & SAMRAI::hier::PatchConfigurationUtilities< DIM >::getRefinedCoarserLevelPatchBox | ( | const PatchNumber & | coarser_level_patch_num, | |
const LevelNumber & | level_num | |||
) | const |
Get box representing the refinement of a patch box on the next coarser hierarchy level to the index space of the specified level.
coarser_level_patch_num | Const reference to hier::PatchNumber type indicating patch number of patch on next coarser level. When assertion checking is active, an assertion is thrown if number does not correspond to a patch on the patch level. | |
level_num | Const reference to hier::LevelNumber type indicating level number of interest. When assertion checking is active, an assertion is thrown if number does not correspond to level in patch hierarchy. |
void SAMRAI::hier::PatchConfigurationUtilities< DIM >::printPatchLevelData | ( | const LevelNumber & | level_num = LevelNumber(-1) , |
|
std::ostream & | os = tbox::plog | |||
) | const |
Print internal data structures for patch level to given output stream.
level_num | Optional const reference to hier::LevelNumber type indicating number of patch level of interest. If not given and this utilities object is set up for a patch hierarchy, data for all patch levels is output. If a valid level number is given and this utilities object is set up for a patch hierarchy, only data for the specified level is output. If the value is not a valid hierarchy level number, the routine does nothing. In the case that this utilities object is set up for a single patch level, the value is ignored and data for the level is output. | |
os | Optional output stream. If not given, tbox::plog is used. |
void SAMRAI::hier::PatchConfigurationUtilities< DIM >::printPatchData | ( | const PatchNumber & | patch_num, | |
const LevelNumber & | level_num = LevelNumber(-1) , |
|||
std::ostream & | os = tbox::plog | |||
) | const |
Print internal data structures for patch to given output stream.
patch_num | Const reference to hier::PatchNumber type indicating number of patch of interest. When assertion checking is active, an assertion results when this value is not a valid patch number for the level of interest. | |
level_num | Optional const reference to hier::LevelNumber type indicating number of patch level of interest. When this utilities object is set up for a single patch level, the value is ignored and level passed in to the constructor of this object is assumed. If this object is set up for a patch hierarchy, this value must be given and must be a valid level number for the patch hierarchy. If not, an assertion results, when assertion checking is active. | |
os | Optional output stream. If not given, tbox::plog is used. |