IBAMR  IBAMR version 0.19.
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SAMRAI::xfer::MultiblockCoarsenSchedule< DIM > Class Template Reference

Class MultiblockCoarsenSchedule<DIM> encapsulates the AMR communication pattern to coarsen data from a finer level to a coarser level. More...

#include <MultiblockCoarsenSchedule.h>

Inheritance diagram for SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >:
Inheritance graph
[legend]

Public Member Functions

 MultiblockCoarsenSchedule (tbox::Pointer< hier::MultiblockPatchLevel< DIM > > crse_level, tbox::Pointer< hier::MultiblockPatchLevel< DIM > > fine_level, const tbox::Pointer< xfer::CoarsenClasses< DIM > > coarsen_classes, tbox::Pointer< hier::MultiblockPatchHierarchy< DIM > > multiblock, MultiblockCoarsenPatchStrategy< DIM > *coarsen_strategy, MultiblockRefinePatchStrategy< DIM > *refine_strategy, bool fill_coarse_data)
 Constructor for coarsen schedule from fine level to coarse level. More...
 
virtual ~MultiblockCoarsenSchedule ()
 The virtual destructor for the schedule releases all internal storage. More...
 
void coarsenData () const
 Execute the stored communication schedule and perform the data movement. More...
 
const tbox::Pointer< xfer::CoarsenClasses< DIM > > & getEquivalenceClasses () const
 Return const reference to the pointer to coarsen equivalence classes used in schedule. More...
 

Private Member Functions

 MultiblockCoarsenSchedule (const MultiblockCoarsenSchedule< DIM > &)
 
void operator= (const MultiblockCoarsenSchedule< DIM > &)
 
void setCoarsenItems (const tbox::Pointer< xfer::CoarsenClasses< DIM > > coarsen_classes)
 set the internal pointer to equivalence classes More...
 
void initialCheckCoarsenClassItems () const
 Utility function to check that patch data has sufficient ghosts. More...
 
void setupRefineAlgorithm ()
 Set up refine algorithm for temporary coarse level filling. More...
 
void generateSchedule ()
 Generate schedule for moving data from temp storage to destination. More...
 
void coarsenSourceData (MultiblockCoarsenPatchStrategy< DIM > *patch_strategy) const
 Execute the coarsening operation. More...
 
void generateTemporaryLevel ()
 Create a temporary coarse level for data storage during coarsen. More...
 

Private Attributes

tbox::Pointer< xfer::CoarsenClasses< DIM > > d_coarsen_classes
 
int d_number_coarsen_items
 
const xfer::CoarsenClasses< DIM >::Data ** d_coarsen_items
 
tbox::Pointer< hier::MultiblockPatchLevel< DIM > > d_mblk_crse_level
 
tbox::Pointer< hier::MultiblockPatchLevel< DIM > > d_mblk_fine_level
 
tbox::Pointer< hier::MultiblockPatchLevel< DIM > > d_mblk_temp_crse_level
 
MultiblockCoarsenPatchStrategy< DIM > * d_mblk_coarsen_patch_strategy
 
MultiblockRefinePatchStrategy< DIM > * d_mblk_refine_strategy
 
tbox::Pointer< tbox::Scheduled_schedule
 
bool d_fill_coarse_data
 
tbox::Pointer< MultiblockRefineAlgorithm< DIM > > d_mblk_refine_alg
 
tbox::Pointer< MultiblockRefineSchedule< DIM > > d_mblk_refine_sched
 
hier::ComponentSelector d_sources
 
hier::IntVector< DIM > d_ratio
 
tbox::Pointer< hier::MultiblockPatchHierarchy< DIM > > d_multiblock_hier
 
tbox::Pointer< tbox::Timert_gen_sched
 

Detailed Description

template<int DIM>
class SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >

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. 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 coarsen schedules, see the MultiblockCoarsenAlgorithm<DIM> header file.

See also
xfer::MultiblockCoarsenAlgorithm
xfer::CoarsenAlgorithm
xfer::CoarsenPatchStrategy
xfer::CoarsenClasses

Constructor & Destructor Documentation

◆ MultiblockCoarsenSchedule() [1/2]

template<int DIM>
SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::MultiblockCoarsenSchedule ( tbox::Pointer< hier::MultiblockPatchLevel< DIM > >  crse_level,
tbox::Pointer< hier::MultiblockPatchLevel< DIM > >  fine_level,
const tbox::Pointer< xfer::CoarsenClasses< DIM > >  coarsen_classes,
tbox::Pointer< hier::MultiblockPatchHierarchy< DIM > >  multiblock,
MultiblockCoarsenPatchStrategy< DIM > *  coarsen_strategy,
MultiblockRefinePatchStrategy< DIM > *  refine_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 MultiblockCoarsenAlgorithm<DIM> object. For possible variations on data coarsening, see the Multiblock_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().

Parameters
crse_levelPointer to coarse (destination) patch level.
fine_levelPointer to fine (source) patch level.
coarsen_classesPointer to structure containing patch data and operator information. In general, this is constructed by the calling xfer::CoarsenAlgorithm<DIM> object.
multiblockMultiblock hierarchy where the operation occurs
coarsen_strategyPointer to a coarsen patch strategy object that provides user-defined coarsen operations. This pointer may be null, in which case no user-defined coarsen operations will be performed.
refine_strategyPointer to a refine patch strategy object that provides user-defined coarsen operations. This is needed in specific cases where a user-defined coarsen operation requires data to be filled on the coarse scratch level prior to execution of the coarsening operator. If such functionality is not needed, set this pointer to null.
fill_coarse_dataBoolean 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, or the refine classes pointer, is null.

◆ ~MultiblockCoarsenSchedule()

template<int DIM>
virtual SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::~MultiblockCoarsenSchedule ( )
virtual

◆ MultiblockCoarsenSchedule() [2/2]

Member Function Documentation

◆ coarsenData()

template<int DIM>
void SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::coarsenData ( ) const

◆ getEquivalenceClasses()

template<int DIM>
const tbox::Pointer< xfer::CoarsenClasses<DIM> >& SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::getEquivalenceClasses ( ) const

◆ operator=()

template<int DIM>
void SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::operator= ( const MultiblockCoarsenSchedule< DIM > &  )
private

◆ setCoarsenItems()

template<int DIM>
void SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::setCoarsenItems ( const tbox::Pointer< xfer::CoarsenClasses< DIM > >  coarsen_classes)
private

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. An array of coarsen data items is stored locally here to facilitate interaction with transations.

Parameters
coarsen_classesThe equivalence classes which store the identifiers of the data to be

◆ initialCheckCoarsenClassItems()

template<int DIM>
void SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::initialCheckCoarsenClassItems ( ) const
private

Utility function to check 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 xfer::CoarsenAlgorithm<DIM> class header. 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 xfer::CoarsenClasses<DIM>::checkCoarsenItem() is also called.

If any entries are erroneous an assertion is thrown with a descriptive error message and program halts.

◆ setupRefineAlgorithm()

template<int DIM>
void SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::setupRefineAlgorithm ( )
private

Set up refine algorithm to fill temporary coarse level before coarsening operations, if necessary. The associated refine schedule is set in the generateSchedule() routine.

◆ generateSchedule()

template<int DIM>
void SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::generateSchedule ( )
private

Generate communication schedule that moves source patch data from the temporary level into the destination patch data of the destination (coarse) level.

◆ coarsenSourceData()

template<int DIM>
void SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::coarsenSourceData ( MultiblockCoarsenPatchStrategy< DIM > *  patch_strategy) const
private

Coarsen source patch data from the fine patch level into the source patch data on the coarse temporary patch level.

◆ generateTemporaryLevel()

template<int DIM>
void SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::generateTemporaryLevel ( )
private

Member Data Documentation

◆ d_coarsen_classes

template<int DIM>
tbox::Pointer< xfer::CoarsenClasses<DIM> > SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::d_coarsen_classes
private

◆ d_number_coarsen_items

template<int DIM>
int SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::d_number_coarsen_items
private

◆ d_coarsen_items

template<int DIM>
const xfer::CoarsenClasses<DIM>::Data** SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::d_coarsen_items
private

◆ d_mblk_crse_level

template<int DIM>
tbox::Pointer< hier::MultiblockPatchLevel<DIM> > SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::d_mblk_crse_level
private

◆ d_mblk_fine_level

template<int DIM>
tbox::Pointer< hier::MultiblockPatchLevel<DIM> > SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::d_mblk_fine_level
private

◆ d_mblk_temp_crse_level

template<int DIM>
tbox::Pointer< hier::MultiblockPatchLevel<DIM> > SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::d_mblk_temp_crse_level
private

◆ d_mblk_coarsen_patch_strategy

template<int DIM>
MultiblockCoarsenPatchStrategy<DIM>* SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::d_mblk_coarsen_patch_strategy
private

◆ d_mblk_refine_strategy

template<int DIM>
MultiblockRefinePatchStrategy<DIM>* SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::d_mblk_refine_strategy
private

◆ d_schedule

template<int DIM>
tbox::Pointer< tbox::Schedule> SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::d_schedule
private

◆ d_fill_coarse_data

template<int DIM>
bool SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::d_fill_coarse_data
private

◆ d_mblk_refine_alg

template<int DIM>
tbox::Pointer< MultiblockRefineAlgorithm<DIM> > SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::d_mblk_refine_alg
private

◆ d_mblk_refine_sched

template<int DIM>
tbox::Pointer< MultiblockRefineSchedule<DIM> > SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::d_mblk_refine_sched
private

◆ d_sources

template<int DIM>
hier::ComponentSelector SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::d_sources
private

◆ d_ratio

template<int DIM>
hier::IntVector<DIM> SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::d_ratio
private

◆ d_multiblock_hier

template<int DIM>
tbox::Pointer< hier::MultiblockPatchHierarchy<DIM> > SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::d_multiblock_hier
private

◆ t_gen_sched

template<int DIM>
tbox::Pointer<tbox::Timer> SAMRAI::xfer::MultiblockCoarsenSchedule< DIM >::t_gen_sched
private

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