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

Class MultiblockPatchHierarchy<DIM> manages an array of patch hierarchies that represent a multiblock domain, and describes the relationship between these hierarchies. More...

#include <MultiblockPatchHierarchy.h>

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

Classes

struct  Neighbor
 Structure to represent the neighbor of a given block. More...
 

Public Types

enum  RotationIdentifier {
  NO_ROTATE = 0, IUP_JUP = 0, JUP_IDOWN = 1, IDOWN_JDOWN = 2,
  JDOWN_IUP = 3, IUP_JUP_KUP = 0, KUP_IUP_JUP = 1, JUP_KUP_IUP = 2,
  IDOWN_KUP_JUP = 3, KUP_JUP_IDOWN = 4, JUP_IDOWN_KUP = 5, KDOWN_JUP_IUP = 6,
  IUP_KDOWN_JUP = 7, JUP_IUP_KDOWN = 8, KDOWN_IDOWN_JUP = 9, IDOWN_JUP_KDOWN = 10,
  JUP_KDOWN_IDOWN = 11, JDOWN_IUP_KUP = 12, IUP_KUP_JDOWN = 13, KUP_JDOWN_IUP = 14,
  JDOWN_KUP_IDOWN = 15, IDOWN_JDOWN_KUP = 16, KUP_IDOWN_JDOWN = 17, JDOWN_KDOWN_IUP = 18,
  KDOWN_IUP_JDOWN = 19, IUP_JDOWN_KDOWN = 20, JDOWN_IDOWN_KDOWN = 21, KDOWN_JDOWN_IDOWN = 22,
  IDOWN_KDOWN_JDOWN = 23
}
 

Public Member Functions

 MultiblockPatchHierarchy (const std::string &object_name, tbox::Pointer< tbox::Database > input_db, tbox::Pointer< hier::MultiblockGridGeometry< DIM > > &geometry, const bool register_for_restart=true)
 Constructor for MultiblockPatchHierarchy. More...
 
 ~MultiblockPatchHierarchy ()
 Destructor for multiblock. More...
 
tbox::Pointer< hier::PatchHierarchy< DIM > > & getHierarchy (const int block_num)
 Get a pointer to a single patch hierarchy represented by the specified block number. More...
 
tbox::Pointer< MultiblockPatchLevel< DIM > > getMultiblockPatchLevel (const int level_num) const
 Get a pointer to a MultiblockPatchLevel<DIM> associated with the given level number. More...
 
tbox::Pointer< hier::BasePatchLevel< DIM > > getPatchLevel (const int level_num) const
 Get a pointer to a hier::BasePatchLevel<DIM> association with the given level number. More...
 
void adjustMultiblockPatchLevelBoundaries (tbox::Pointer< MultiblockPatchLevel< DIM > > level)
 Adjust boundary data of a level to be consistent with the multiblock nature of the domain. More...
 
int getNumberOfBlocks () const
 Returns the number of blocks in the multiblock domain. More...
 
int getNumberOfNeighbors (const int block_number)
 Return the number of neighbors a specific block of the Multiblock domain has. More...
 
tbox::List< Neighbor > & getNeighbors (const int block_number)
 Return a list of Neighbor objects describing all of the neighbors of the block indicated by the block_number. More...
 
hier::BoxList< DIM > & getSingularityBoxList (const int block_number)
 Return a BoxList that describes all of the singularities touched by the block indicated by block_number. More...
 
void getTranslatedBlock (hier::BoxArray< DIM > &block_boxes, const int base_block, const int translated_block)
 Get a box array that describes the coarse-level domain of the translated_block in terms of the index space of base_block. More...
 
void translateBoxArray (hier::BoxArray< DIM > &boxes, const hier::IntVector< DIM > &ratio, const int base_block, const int translated_block)
 Modify boxes by rotating and shifting from the index space of the translated_block to the index space of the base_block at the resolution level defined by ratio. More...
 
int getFinestLevelNumber () const
 Get finest level number existing in multiblock patch hierarchy. More...
 
int getNumberOfLevels () const
 
bool finerLevelExists (const int ln) const
 Returns true if the array of patch levels contains a patch level finer than the specified patch level. Otherwise, false is returned. More...
 
void getDomainOutsideBlock (hier::BoxList< DIM > &domain_outside_block, const int block_number)
 
bool reducedConnectivityExists (const int block_number) const
 Return true if block represented by block_number touches a reduced-connectivity singularity. More...
 
void putToDatabase (tbox::Pointer< tbox::Database > database)
 Writes the state of the PatchHierarchy object and the PatchLevels it contains to the database. It should be noted that only those patch data which have been registered for restart with the hier::VariableDatabase<DIM> will be written to the database. This method implements the pure virtual method in tbox::Serializable class which is used by the tbox::RestartManager for writing the MultiblockPatchHierarchy to a restart file. More...
 
void putToDatabase (tbox::Pointer< tbox::Database > database, const hier::ComponentSelector &patchdata_write_table)
 
void getFromRestart (const int max_levels)
 Read in the entire hierarchy from the restart file. The database from which the restart data is read is determined by the object_name specified in the constructor. More...
 

Static Public Member Functions

static RotationIdentifier getReverseRotationIdentifier (const RotationIdentifier rotation)
 static routine to get a reverse rotation identifier More...
 
static void calculateReverseShift (hier::IntVector< DIM > &back_shift, const hier::IntVector< DIM > &shift, const RotationIdentifier back_rotation)
 static routine to get a reverse shift More...
 

Private Member Functions

bool areNeighbors (const int a, const int b)
 Returns true if block a and block b are neighbors. More...
 
Neighbor createNeighbor (int id, hier::BoxArray< DIM > &domain, const RotationIdentifier rotation, const hier::IntVector< DIM > &shift, const bool is_singularity)
 Create a neighbor. More...
 
void registerNeighbors (int block_a, int block_b, RotationIdentifier rotation_b_to_a, hier::IntVector< DIM > &shift_b_to_a, const int neighbor_type)
 Register a relationship between two neighboring blocks of a multiblock domain. More...
 
RotationIdentifier getRotationIdentifier (const tbox::Array< std::string > &rotation_string) const
 Map a string identifier of a rotation operation to an integer id. More...
 
void adjustBoundaryBoxesOnPatch (const hier::Patch< DIM > &patch, const tbox::Pointer< hier::GridGeometry< DIM > > geometry, const hier::BoxList< DIM > &pseudo_domain, const hier::IntVector< DIM > &gcw, const hier::BoxList< DIM > &singularity)
 

Private Attributes

std::string d_object_name
 
bool d_registered_for_restart
 
int d_number_blocks
 
tbox::Array< tbox::Pointer< hier::PatchHierarchy< DIM > > > d_hierarchies
 
tbox::Array< tbox::List< Neighbor > > d_block_neighbors
 
tbox::Array< hier::BoxList< DIM > > d_singularity
 
tbox::Pointer< hier::MultiblockGridGeometry< DIM > > d_geometry
 
tbox::Array< boold_reduced_connect
 

Detailed Description

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

Each patch hierarchy contained in the array of patch hierarchies represents a logically rectangular block of a multiblock domain. This class contains this array, and also contains information that describes the relationship between neighboring blocks. It also contains information about the point or points of singularity that exist in the multiblock domain.

See also
hier::BasePatchHierarchy
hier::PatchHierarchy
hier::MultiblockPatchLevel
hier::PatchLevel

Member Enumeration Documentation

◆ RotationIdentifier

Enumerator
NO_ROTATE 
IUP_JUP 
JUP_IDOWN 
IDOWN_JDOWN 
JDOWN_IUP 
IUP_JUP_KUP 
KUP_IUP_JUP 
JUP_KUP_IUP 
IDOWN_KUP_JUP 
KUP_JUP_IDOWN 
JUP_IDOWN_KUP 
KDOWN_JUP_IUP 
IUP_KDOWN_JUP 
JUP_IUP_KDOWN 
KDOWN_IDOWN_JUP 
IDOWN_JUP_KDOWN 
JUP_KDOWN_IDOWN 
JDOWN_IUP_KUP 
IUP_KUP_JDOWN 
KUP_JDOWN_IUP 
JDOWN_KUP_IDOWN 
IDOWN_JDOWN_KUP 
KUP_IDOWN_JDOWN 
JDOWN_KDOWN_IUP 
KDOWN_IUP_JDOWN 
IUP_JDOWN_KDOWN 
JDOWN_IDOWN_KDOWN 
KDOWN_JDOWN_IDOWN 
IDOWN_KDOWN_JDOWN 

Constructor & Destructor Documentation

◆ MultiblockPatchHierarchy()

template<int DIM>
SAMRAI::hier::MultiblockPatchHierarchy< DIM >::MultiblockPatchHierarchy ( const std::string &  object_name,
tbox::Pointer< tbox::Database input_db,
tbox::Pointer< hier::MultiblockGridGeometry< DIM > > &  geometry,
const bool  register_for_restart = true 
)
Parameters
object_nameString identifier for database operations
input_dbInput Database
geometryGeometry
register_for_restartBoolean switch for restart registration

◆ ~MultiblockPatchHierarchy()

Member Function Documentation

◆ getHierarchy()

template<int DIM>
tbox::Pointer< hier::PatchHierarchy<DIM> >& SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getHierarchy ( const int  block_num)
Parameters
block_numInteger block number, corresponding to array index of the hiearchy array passed into the constructor

◆ getMultiblockPatchLevel()

template<int DIM>
tbox::Pointer< MultiblockPatchLevel<DIM> > SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getMultiblockPatchLevel ( const int  level_num) const

The MultiblockPatchLevel<DIM> will give access to an array of pointers to hier::PatchLevel<DIM>, each member of which represents a level from one block of the hierarchy corresponding to the specified level number.

Parameters
level_numLevel number in AMR hierachy of desired multiblock patch level.

◆ getPatchLevel()

template<int DIM>
tbox::Pointer< hier::BasePatchLevel<DIM> > SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getPatchLevel ( const int  level_num) const
virtual

Returns a pointer to an object of the virtual base class hier::BasePatchLevel<DIM>. The object being pointed to can be cast to MultiblockPatchLevel<DIM>.

Parameters
level_numLevel number in AMR hierachy of desired multiblock patch level.

Implements SAMRAI::hier::BasePatchHierarchy< DIM >.

◆ adjustMultiblockPatchLevelBoundaries()

template<int DIM>
void SAMRAI::hier::MultiblockPatchHierarchy< DIM >::adjustMultiblockPatchLevelBoundaries ( tbox::Pointer< MultiblockPatchLevel< DIM > >  level)

On a MultiblockPatchHierarchy, each hier::PatchHierarchy<DIM> will contain PatchLevels with patches that were constructed independent of any knowledge of the multiblock nature of the complete domain. Thus the patches will contain boundary data that recognizes no difference between a physical domain boundary and a block boundary. Calling this routine will adjust the boundary data on all patches in the given level such that the true boundaries of the domain are represented.

Parameters
levelMultiblock level where boundaries need to be adjusted.

◆ getNumberOfBlocks()

template<int DIM>
int SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getNumberOfBlocks ( ) const

◆ getNumberOfNeighbors()

template<int DIM>
int SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getNumberOfNeighbors ( const int  block_number)

The block_number argument identifies a specific block by the array index of the array of pointers to hierarchies given the constructor of this class. A block is the neighbor of another block if the two blocks abut at a point, a 1D line, or a 2D plane

Parameters
block_numberThe block of which the number of neighbors is sought

◆ getNeighbors()

template<int DIM>
tbox::List<Neighbor>& SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getNeighbors ( const int  block_number)
Parameters
block_numberA list of neighbors of the given block is returned

◆ getSingularityBoxList()

template<int DIM>
hier::BoxList<DIM>& SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getSingularityBoxList ( const int  block_number)

For every singularity point the block touches, the BoxList will contain a single-cell box that lies just outside the block domain, touching the block only at the singularity point. For line singularities, the BoxList will contain boxes of width 1 in all dimensions except 1, lying outside the block's coarse-level domain and touching the domain only along the line of singularity.

Parameters
block_numberIdentifies block for which singularityes will be retrieved

◆ getTranslatedBlock()

template<int DIM>
void SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getTranslatedBlock ( hier::BoxArray< DIM > &  block_boxes,
const int  base_block,
const int  translated_block 
)
Parameters
block_boxesOutput consisting of the coarse-leve domain of the block identified by translated_block, represented in the index space of the block identified by base_block
base_blockInteger identifier of the block whose index space will be used for the output boxes
translated_blockInteger identifier of another block whose domain will be represented in the index space of the base block

◆ translateBoxArray()

template<int DIM>
void SAMRAI::hier::MultiblockPatchHierarchy< DIM >::translateBoxArray ( hier::BoxArray< DIM > &  boxes,
const hier::IntVector< DIM > &  ratio,
const int  base_block,
const int  translated_block 
)
Parameters
boxesInput and output. The boxes will be translated from the translated_block index space to the base_block index space.
ratioThe boxes will be refined to the ratio given. This should represent the refinement ratio of a level in the AMR hierarchy.
base_blockInteger identifier of the block whose index space will be represented in the boxes output
translated_blockInteger identifier of the block whose index space is represented in the boxes input

◆ getReverseRotationIdentifier()

template<int DIM>
static RotationIdentifier SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getReverseRotationIdentifier ( const RotationIdentifier  rotation)
static

A rotation identifier signifies a specific rotation of an index space. For each rotation there is another rotation that rotates in the exact opposite manner. This routine returns the identifier of the reverse rotation corresponding to the given rotation.

Parameters
rotationRotation for which the reverse rotation is sought

◆ calculateReverseShift()

template<int DIM>
static void SAMRAI::hier::MultiblockPatchHierarchy< DIM >::calculateReverseShift ( hier::IntVector< DIM > &  back_shift,
const hier::IntVector< DIM > &  shift,
const RotationIdentifier  back_rotation 
)
static

◆ getFinestLevelNumber()

template<int DIM>
int SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getFinestLevelNumber ( ) const
virtual

◆ getNumberOfLevels()

template<int DIM>
int SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getNumberOfLevels ( ) const
virtual

Return the number of levels that currently exist in the hierarchy.

Implements SAMRAI::hier::BasePatchHierarchy< DIM >.

◆ finerLevelExists()

template<int DIM>
bool SAMRAI::hier::MultiblockPatchHierarchy< DIM >::finerLevelExists ( const int  ln) const
virtual
Parameters
lnA given level number

Implements SAMRAI::hier::BasePatchHierarchy< DIM >.

◆ getDomainOutsideBlock()

template<int DIM>
void SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getDomainOutsideBlock ( hier::BoxList< DIM > &  domain_outside_block,
const int  block_number 
)

Get a BoxList that contains all of the index space of all other blocks in the multiblock domain.

A BoxList will be constructed that contains the full set of the coarse level domains of all blocks except the one identified by block_number. The domains will all be translated into the index space represented by block_number.

Parameters
domain_outside_blockOutput box list
block_numberdomain_outside_block will represent the domains of all blocks except this one.

◆ reducedConnectivityExists()

template<int DIM>
bool SAMRAI::hier::MultiblockPatchHierarchy< DIM >::reducedConnectivityExists ( const int  block_number) const
Parameters
block_numberNumber of block to be tested

◆ putToDatabase() [1/2]

template<int DIM>
void SAMRAI::hier::MultiblockPatchHierarchy< DIM >::putToDatabase ( tbox::Pointer< tbox::Database database)
virtual

When assertion checking is active, the database pointer must be non-null.

Implements SAMRAI::hier::BasePatchHierarchy< DIM >.

◆ putToDatabase() [2/2]

template<int DIM>
void SAMRAI::hier::MultiblockPatchHierarchy< DIM >::putToDatabase ( tbox::Pointer< tbox::Database database,
const hier::ComponentSelector patchdata_write_table 
)
virtual

!brief Writes the state of the MultiblockPatchHierarchy object and the PatchHierarchies it contains to the database. Only those patchdata corresponding to the set bits in the hier::ComponentSelector are written to the specified database.

When assertion checking is active, the database pointer must be non-null.

Implements SAMRAI::hier::BasePatchHierarchy< DIM >.

◆ getFromRestart()

template<int DIM>
void SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getFromRestart ( const int  max_levels)
virtual

Notes:

  • This method handles the memory allocation for each PatchLevel it reads in.
  • The number of levels read in is the minimum of the max_levels argument and the number of levels stored in the database.

When assertion checking is active, the max_levels argument must be greater than zero. An unrecoverable exception will result if the database cannot be found in the restart file or the data in the restart file is erroneous.

Parameters
max_levelsmaximum number of levels to read in.

Implements SAMRAI::hier::BasePatchHierarchy< DIM >.

◆ areNeighbors()

template<int DIM>
bool SAMRAI::hier::MultiblockPatchHierarchy< DIM >::areNeighbors ( const int  a,
const int  b 
)
private

◆ createNeighbor()

template<int DIM>
Neighbor SAMRAI::hier::MultiblockPatchHierarchy< DIM >::createNeighbor ( int  id,
hier::BoxArray< DIM > &  domain,
const RotationIdentifier  rotation,
const hier::IntVector< DIM > &  shift,
const bool  is_singularity 
)
private
Parameters
idThe block number of the neighboring block
domainThe neighboring block's domain in the current block's index space
rotationThe rotation to represent the neighboring block in the current index space.
shiftThe shift needed to shift the neighboring block to its correct position in the current index space.
is_singularityBoolean telling whether the current block and the neighboring block abut at a singularity

◆ registerNeighbors()

template<int DIM>
void SAMRAI::hier::MultiblockPatchHierarchy< DIM >::registerNeighbors ( int  block_a,
int  block_b,
RotationIdentifier  rotation_b_to_a,
hier::IntVector< DIM > &  shift_b_to_a,
const int  neighbor_type 
)
private
Parameters
block_aOne block in the relationship
block_bThe other block
rotation_b_to_aThe rotation that align's block b's index space with block a's
shift_b_to_aThe post-rotation shift to move b into its correct location within a's index space
neighbor_typeThe type (codimension) of the neighbor relationship

◆ getRotationIdentifier()

template<int DIM>
RotationIdentifier SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getRotationIdentifier ( const tbox::Array< std::string > &  rotation_string) const
private
Parameters
rotation_string

◆ adjustBoundaryBoxesOnPatch()

template<int DIM>
void SAMRAI::hier::MultiblockPatchHierarchy< DIM >::adjustBoundaryBoxesOnPatch ( const hier::Patch< DIM > &  patch,
const tbox::Pointer< hier::GridGeometry< DIM > >  geometry,
const hier::BoxList< DIM > &  pseudo_domain,
const hier::IntVector< DIM > &  gcw,
const hier::BoxList< DIM > &  singularity 
)
private

Member Data Documentation

◆ d_object_name

template<int DIM>
std::string SAMRAI::hier::MultiblockPatchHierarchy< DIM >::d_object_name
private

◆ d_registered_for_restart

template<int DIM>
bool SAMRAI::hier::MultiblockPatchHierarchy< DIM >::d_registered_for_restart
private

◆ d_number_blocks

template<int DIM>
int SAMRAI::hier::MultiblockPatchHierarchy< DIM >::d_number_blocks
private

◆ d_hierarchies

template<int DIM>
tbox::Array< tbox::Pointer<hier::PatchHierarchy<DIM> > > SAMRAI::hier::MultiblockPatchHierarchy< DIM >::d_hierarchies
private

◆ d_block_neighbors

template<int DIM>
tbox::Array< tbox::List<Neighbor> > SAMRAI::hier::MultiblockPatchHierarchy< DIM >::d_block_neighbors
private

◆ d_singularity

template<int DIM>
tbox::Array< hier::BoxList<DIM> > SAMRAI::hier::MultiblockPatchHierarchy< DIM >::d_singularity
private

◆ d_geometry

template<int DIM>
tbox::Pointer< hier::MultiblockGridGeometry<DIM> > SAMRAI::hier::MultiblockPatchHierarchy< DIM >::d_geometry
private

◆ d_reduced_connect

template<int DIM>
tbox::Array<bool> SAMRAI::hier::MultiblockPatchHierarchy< DIM >::d_reduced_connect
private

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