|
IBAMR
IBAMR version 0.19.
|
Class CoarsenSchedule<DIM> performs the communication operations to coarsen data from a finer level to a coarser level.
More...
#include <ibtk/SideDataSynchronization.h>

Public Member Functions | |
| CoarsenSchedule (tbox::Pointer< hier::PatchLevel< DIM > > crse_level, tbox::Pointer< hier::PatchLevel< DIM > > fine_level, const tbox::Pointer< xfer::CoarsenClasses< DIM > > coarsen_classes, tbox::Pointer< xfer::CoarsenTransactionFactory< DIM > > transaction_factory, xfer::CoarsenPatchStrategy< DIM > *patch_strategy, bool fill_coarse_data) | |
| virtual | ~CoarsenSchedule () |
| void | reset (const tbox::Pointer< xfer::CoarsenClasses< DIM > > coarsen_classes) |
| void | coarsenData () const |
| const tbox::Pointer< xfer::CoarsenClasses< DIM > > & | getEquivalenceClasses () const |
| virtual void | printClassData (std::ostream &stream) const |
Static Public Member Functions | |
| static void | setScheduleGenerationMethod (const std::string &method) |
Private Member Functions | |
| CoarsenSchedule (const CoarsenSchedule< DIM > &) | |
| void | operator= (const CoarsenSchedule< DIM > &) |
| void | generateSchedule () |
| Main schedule generation routine which passes control to one of the algorithmic variations based on value of s_schedule_generation_method. More... | |
| void | generateScheduleNSquared () |
| This version of the schedule generation procedure uses N^2 algorithms to determine box intersections; i.e., the original SAMRAI implementation which checks every box against every other. More... | |
| void | generateScheduleBoxGraph () |
| This version of the schedule generation procedure uses a bipartite graph algorithm to determine which source patches contribute data to each destination patch. More... | |
| void | generateScheduleBoxTree () |
| This version of the schedule generation procedure uses a recursive binary box tree algorithm to determine which source patches contribute data to each destination patch and to compute unfilled_boxes. More... | |
| void | generateTemporaryLevel () |
| Generate a temporary coarse level by coarsening the fine level. Note that this function does not allocate patch data storage. More... | |
| void | setupRefineAlgorithm () |
| Set up refine algorithms to transfer coarsened data and to fill temporary coarse level before coarsening operations, if needed. More... | |
| void | coarsenSourceData (xfer::CoarsenPatchStrategy< DIM > *patch_strategy) const |
| Coarsen source patch data from the fine patch level into the source patch data on the coarse temporary patch level. More... | |
| hier::IntVector< DIM > | getMaxGhostsToGrow () const |
| Calculate the maximum ghost cell width to grow boxes to check for overlaps. More... | |
| void | constructScheduleTransactions (tbox::Pointer< hier::PatchLevel< DIM > > dst_level, int dst_patch_id, tbox::Pointer< hier::PatchLevel< DIM > > src_level, int src_patch_id) |
| Function that constructs schedule transactions that move data from source patch on source level to destination patch on destination level. More... | |
| void | setCoarsenItems (const tbox::Pointer< xfer::CoarsenClasses< DIM > > coarsen_classes) |
| Utility function to set up local copies of patch data source, destination, etc. indices and necessary data coarsening information stored in the coarsen classes object generated by the coarsen algorithm. More... | |
| void | clearCoarsenItems () |
| Utility function to clear local copies of coarsen items. More... | |
| void | initialCheckCoarsenClassItems () const |
| Utility function to check coarsen items to see whether source and destination patch data components have sufficient ghost cell widths to satisfy the "ghost width to coarsen" functionality described in the CoarsenAlgorithm<DIM> class header. More... | |
Static Private Attributes | |
| static const hier::IntVector< DIM > | s_constant_zero_intvector |
| static const hier::IntVector< DIM > | s_constant_one_intvector |
| static std::string | s_schedule_generation_method |
Typically, data is coarsened from the interiors of source patch components on the source patch level into interiors of destination patch components on
the destination level. However, variations are possible for special situations; see the CoarsenAlgorithm<DIM> class header for more information. Generally, the source patch data must contain sufficient ghost cells to satisfy the coarsening operators involved. If a coarsen operator has a non-zero ghost cell width, then the source ghost cells must be filled before the coarsen schedule is executed. The communication schedule is executed by calling member function coarsenData().
Each schedule object is typically created by a coarsen algorithm and represents communication dependencies for a particular configuration of the AMR hierarchy. The communication schedule is only valid for that particular configuration and must be regenerated when the AMR patch hierarchy changes. However, as long as the patch levels involved in the creation of the schedule remain unchanged, the schedule may be used for multiple communication cycles. For more information about creating refine schedules, see the CoarsenAlgorithm<DIM> header file.
NOTE: Algorithmic variations are available by calling the static method CoarsenSchedule<DIM>::setScheduleGenerationMethod(), which sets the option for all instances of the class.
| SAMRAI::xfer::CoarsenSchedule< DIM >::CoarsenSchedule | ( | tbox::Pointer< hier::PatchLevel< DIM > > | crse_level, |
| tbox::Pointer< hier::PatchLevel< DIM > > | fine_level, | ||
| const tbox::Pointer< xfer::CoarsenClasses< DIM > > | coarsen_classes, | ||
| tbox::Pointer< xfer::CoarsenTransactionFactory< DIM > > | transaction_factory, | ||
| xfer::CoarsenPatchStrategy< DIM > * | patch_strategy, | ||
| bool | fill_coarse_data | ||
| ) |
Constructor to create a coarsen schedule that coarsens data from source patch data components on the fine level into the destination patch data components on the coarse level. In general, this constructor is called by a CoarsenAlgorithm<DIM> object. For possible variations on data coarsening, see the CoarsenAlgorithm<DIM> class header information.
If the coarsening operators require data from ghost cells, then the associated source patch data components must have a sufficient ghost cell width and and they must be filled with valid data before calling coarsenData().
| crse_level | Pointer to coarse (destination) patch level. |
| fine_level | Pointer to fine (source) patch level. |
| coarsen_classes | Pointer to structure containing patch data and operator information. In general, this is constructed by the calling CoarsenAlgorithm<DIM> object. |
| transaction_factory | Pointer to a factory object that will create data transactions. |
| patch_strategy | Pointer to a coarsen patch strategy object that provides user-defined coarsen operations. This ponter may be null, in which case no user-defined coarsen operations will be performed. |
| fill_coarse_data | Boolean indicating whether coarse data should be filled before coarsening operations are done. |
When assertion checking is active, unrecoverable assertions will result if either patch level pointer, the refine classes pointer, or the transaction factory pointer, is null.
|
virtual |
The virtual destructor for the schedule releases all internal storage.
|
private |
|
static |
Static function to set box intersection algorithm to use during schedule construction for all CoarsenSchedule objects.
If this method is not called, the default will be used.
| method | string identifying box intersection method. Valid choices are: "BOX_TREE" (default case), "BOX_GRAPH", and "ORIG_NSQUARED". More details can be found below in the comments for the generateSchedule() routine. |
If an invalid string is passed, an unrecoverable error will result.
| void SAMRAI::xfer::CoarsenSchedule< DIM >::reset | ( | const tbox::Pointer< xfer::CoarsenClasses< DIM > > | coarsen_classes | ) |
Reset this coarsen schedule to perform data transfers asssociated with coarsen class items in function argument. In general, this function is called by a CoarsenAlgorithm<DIM> object.
| coarsen_classes | Pointer to structure containing patch data and operator information. In general, this is constructed by the calling CoarsenAlgorithm<DIM> object. This pointer must be non-null. |
| void SAMRAI::xfer::CoarsenSchedule< DIM >::coarsenData | ( | ) | const |
Execute the stored communication schedule and perform the data movement.
| const tbox::Pointer< xfer::CoarsenClasses<DIM> >& SAMRAI::xfer::CoarsenSchedule< DIM >::getEquivalenceClasses | ( | ) | const |
Return const reference to the pointer to coarsen equivalence classes used in schedule.
|
virtual |
Print the coarsen schedule state to the specified data stream.
| stream | Output data stream. |
|
private |
|
private |
The resulting communication schedule will move source patch data from a temporary coarse level (i.e., coarsened version of fine level) into the destination patch data of the destination (coarse) level.
The generateSchedule() routine invokes various versions of the schedule generation process implemented in the similarly named routines below based on the chosen schedule generation method. The different options will not change the result of the application but may improve its performance, especially for large numbers of processors. Note that the algorithm choice may be changed by calling the setScheduleGenerationMethod() routine.
The possibilities are as follows:
|
private |
|
private |
|
private |
|
private |
|
private |
The associated schedules are set in the generateSchedule() routine.
|
private |
|
private |
|
private |
|
private |
An array of coarsen data items is stored locally here to facilitate interaction with transations.
|
private |
|
private |
Specifically, the destination data must have a ghost cell width at least as large as the ghost cell width to coarsen. The source data must have a ghost cell width at least as large as the ghost cell width to coarsen refined to the source (finer) level index space. Although it is redundant if the coarsen algorithm created the coarsen classes, the routine CoarsenClasses<DIM>::checkCoarsenItem() is also called.
If any entries are erroneous an assertion is thrown with a descriptive error message and program halts.
|
staticprivate |
Constant int vectors used to avoid recreating these vectors in loops.
|
staticprivate |
|
staticprivate |
Selects algorithm used to generate communication schedule.
|
private |
Structures that store coarsen data items.
|
private |
|
private |
|
private |
Cached pointers to the coarse, fine, and temporary patch levels.
|
private |
|
private |
|
private |
Object supporting interface to user-defined spatial data coarsening operations.
|
private |
Factory object used to create data transactions when schedule is constructed.
|
private |
Cached ratio between source (fine) level and destination (coarse) level.
|
private |
Stored source patch data indices for rapid data allocation/deallocation.
|
private |
Level-to-level communication schedule between the temporary coarse level and (actual) destination level.
|
private |
Boolean indicating whether source data on the coarse temporary level must be filled before coarsening operations (see comments for class constructor in header file), and refine algorithm and schedule needed to peform up these fill operations.
|
private |
|
private |
|
private |
Timer objects for performance measurement.
|
private |
|
private |
|
private |
1.8.17