#include <source/hierarchy/multiblock/MultiblockPatchHierarchy.h>
Inheritance diagram for SAMRAI::hier::MultiblockPatchHierarchy< DIM >:
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. | |
~MultiblockPatchHierarchy () | |
Destructor for multiblock. | |
tbox::Pointer< hier::PatchHierarchy< DIM > > & | getHierarchy (const int block_num) |
Get a pointer to a single patch hierarchy represented by the specified block number. | |
tbox::Pointer< MultiblockPatchLevel< DIM > > | getMultiblockPatchLevel (const int level_num) const |
Get a pointer to a MultiblockPatchLevel<DIM> associated with the given level number. | |
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. | |
void | adjustMultiblockPatchLevelBoundaries (tbox::Pointer< MultiblockPatchLevel< DIM > > level) |
Adjust boundary data of a level to be consistent with the multiblock nature of the domain. | |
int | getNumberOfBlocks () const |
Returns the number of blocks in the multiblock domain. | |
int | getNumberOfNeighbors (const int block_number) |
Return the number of neighbors a specific block of the Multiblock domain has. | |
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. | |
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. | |
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. | |
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. | |
int | getFinestLevelNumber () const |
Get finest level number existing in multiblock patch hierarchy. | |
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. | |
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. | |
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. | |
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. | |
Static Public Member Functions | |
static RotationIdentifier | getReverseRotationIdentifier (const RotationIdentifier rotation) |
static routine to get a reverse rotation identifier | |
static void | calculateReverseShift (hier::IntVector< DIM > &back_shift, const hier::IntVector< DIM > &shift, const RotationIdentifier back_rotation) |
static routine to get a reverse shift | |
Classes | |
struct | Neighbor |
Structure to represent the neighbor of a given block. More... |
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.
enum SAMRAI::hier::MultiblockPatchHierarchy::RotationIdentifier |
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 | |||
) |
Constructor for MultiblockPatchHierarchy.
object_name | String identifier for database operations | |
input_db | Input Database | |
geometry | Geometry | |
register_for_restart | Boolean switch for restart registration |
SAMRAI::hier::MultiblockPatchHierarchy< DIM >::~MultiblockPatchHierarchy | ( | ) |
Destructor for multiblock.
tbox::Pointer< hier::PatchHierarchy< DIM > > & SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getHierarchy | ( | const int | block_num | ) |
Get a pointer to a single patch hierarchy represented by the specified block number.
block_num | Integer block number, corresponding to array index of the hiearchy array passed into the constructor |
tbox::Pointer< MultiblockPatchLevel< DIM > > SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getMultiblockPatchLevel | ( | const int | level_num | ) | const |
Get a pointer to a MultiblockPatchLevel<DIM> associated with the given level number.
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.
level_num | Level number in AMR hierachy of desired multiblock patch level. |
tbox::Pointer< hier::BasePatchLevel< DIM > > SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getPatchLevel | ( | const int | level_num | ) | const [virtual] |
Get a pointer to a hier::BasePatchLevel<DIM> association with the given level number.
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>.
level_num | Level number in AMR hierachy of desired multiblock patch level. |
Implements SAMRAI::hier::BasePatchHierarchy< DIM >.
void SAMRAI::hier::MultiblockPatchHierarchy< DIM >::adjustMultiblockPatchLevelBoundaries | ( | tbox::Pointer< MultiblockPatchLevel< DIM > > | level | ) |
Adjust boundary data of a level to be consistent with the multiblock nature of the domain.
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.
level | Multiblock level where boundaries need to be adjusted. |
int SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getNumberOfBlocks | ( | ) | const |
Returns the number of blocks in the multiblock domain.
int SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getNumberOfNeighbors | ( | const int | block_number | ) |
Return the number of neighbors a specific block of the Multiblock domain has.
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
block_number | The block of which the number of neighbors is sought |
tbox::List< typename MultiblockPatchHierarchy< DIM >::Neighbor > & SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getNeighbors | ( | const int | block_number | ) |
Return a list of Neighbor objects describing all of the neighbors of the block indicated by the block_number.
block_number | A list of neighbors of the given block is returned |
hier::BoxList< DIM > & SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getSingularityBoxList | ( | const int | block_number | ) |
Return a BoxList that describes all of the singularities touched by the block indicated by 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.
block_number | Identifies block for which singularityes will be retrieved |
void SAMRAI::hier::MultiblockPatchHierarchy< DIM >::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.
block_boxes | Output 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_block | Integer identifier of the block whose index space will be used for the output boxes | |
translated_block | Integer identifier of another block whose domain will be represented in the index space of the base block |
void SAMRAI::hier::MultiblockPatchHierarchy< DIM >::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.
boxes | Input and output. The boxes will be translated from the translated_block index space to the base_block index space. | |
ratio | The boxes will be refined to the ratio given. This should represent the refinement ratio of a level in the AMR hierarchy. | |
base_block | Integer identifier of the block whose index space will be represented in the boxes output | |
translated_block | Integer identifier of the block whose index space is represented in the boxes input |
MultiblockPatchHierarchy< DIM >::RotationIdentifier SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getReverseRotationIdentifier | ( | const RotationIdentifier | rotation | ) | [static] |
static routine to get a reverse rotation identifier
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.
rotation | Rotation for which the reverse rotation is sought |
void SAMRAI::hier::MultiblockPatchHierarchy< DIM >::calculateReverseShift | ( | hier::IntVector< DIM > & | back_shift, | |
const hier::IntVector< DIM > & | shift, | |||
const RotationIdentifier | back_rotation | |||
) | [static] |
static routine to get a reverse shift
int SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getFinestLevelNumber | ( | ) | const [virtual] |
Get finest level number existing in multiblock patch hierarchy.
Implements SAMRAI::hier::BasePatchHierarchy< 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 >.
bool SAMRAI::hier::MultiblockPatchHierarchy< DIM >::finerLevelExists | ( | const int | ln | ) | const [virtual] |
Returns true if the array of patch levels contains a patch level finer than the specified patch level. Otherwise, false is returned.
ln | A given level number |
Implements SAMRAI::hier::BasePatchHierarchy< 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.
domain_outside_block | Output box list | |
block_number | domain_outside_block will represent the domains of all blocks except this one. |
bool SAMRAI::hier::MultiblockPatchHierarchy< DIM >::reducedConnectivityExists | ( | const int | block_number | ) | const |
Return true if block represented by block_number touches a reduced-connectivity singularity.
block_number | Number of block to be tested |
void SAMRAI::hier::MultiblockPatchHierarchy< DIM >::putToDatabase | ( | tbox::Pointer< tbox::Database > | database | ) | [virtual] |
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.
When assertion checking is active, the database pointer must be non-null.
Implements SAMRAI::hier::BasePatchHierarchy< 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 >.
void SAMRAI::hier::MultiblockPatchHierarchy< DIM >::getFromRestart | ( | const int | max_levels | ) | [virtual] |
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.
Notes:
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.
max_levels | maximum number of levels to read in. |
Implements SAMRAI::hier::BasePatchHierarchy< DIM >.