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

Class RefineSchedule<DIM> performs the communication operations that refine data to, copy data to, or fill physical boundary data on a destination patch level. More...

#include <ibtk/SideDataSynchronization.h>

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

Public Member Functions

 RefineSchedule (const std::string &fill_pattern, tbox::Pointer< hier::PatchLevel< DIM > > dst_level, tbox::Pointer< hier::PatchLevel< DIM > > src_level, const tbox::Pointer< xfer::RefineClasses< DIM > > refine_classes, tbox::Pointer< xfer::RefineTransactionFactory< DIM > > transaction_factory, xfer::RefinePatchStrategy< DIM > *patch_strategy, bool use_time_interpolation=false)
 Constructor to create a refine schedule that moves data from the interiors of source patch data components on the source level into the interiors and ghost cells of destination patch data components on the destination level. More...
 
 RefineSchedule (const std::string &fill_pattern, tbox::Pointer< hier::PatchLevel< DIM > > dst_level, tbox::Pointer< hier::PatchLevel< DIM > > src_level, int next_coarser_level, tbox::Pointer< hier::PatchHierarchy< DIM > > hierarchy, const tbox::Pointer< xfer::RefineClasses< DIM > > refine_classes, tbox::Pointer< xfer::RefineTransactionFactory< DIM > > transaction_factory, xfer::RefinePatchStrategy< DIM > *patch_strategy, bool use_time_interpolation=false)
 Constructor to create a refine schedule that moves data from the interiors of source patch data components on the source level and coarser levels in the patch hierarchy into the interiors and ghost cells of destination patch data components on the destination level.
More...
 
virtual ~RefineSchedule ()
 
void reset (const tbox::Pointer< xfer::RefineClasses< DIM > > refine_classes)
 Reset this refine schedule to perform data transfers asssociated with refine class items in function argument. More...
 
void fillData (double fill_time, bool do_physical_boundary_fill=true) const
 Execute the stored communication schedule and perform the data movement. More...
 
void initializeSourceVector (hier::ComponentSelector &allocate_vector) const
 Initialize a component selector to store the components needed to allocate source data. More...
 
void allocateDestinationSpace (double fill_time, hier::ComponentSelector &allocate_vector) const
 Allocate destination space on the destination level and return the allocated patch data indices in the component selector for later deallocation. More...
 
void allocateScratchSpace (tbox::Pointer< hier::PatchLevel< DIM > > level, double fill_time, hier::ComponentSelector &allocate_vector) const
 Allocate scratch space on the specified level and return the allocated patch data indices in the component selector for later deallocation. More...
 
void initializeDestinationVector (hier::ComponentSelector &allocate_vector) const
 
const tbox::Pointer< RefineClasses< DIM > > & getEquivalenceClasses () const
 Return const reference to the pointer to refine equivalence classes used in schedule. More...
 
const hier::IntVector< DIM > & getBoundaryFillGhostWidth () const
 
virtual void printClassData (std::ostream &stream) const
 

Static Public Member Functions

static void setScheduleGenerationMethod (const std::string &method)
 

Private Member Functions

 RefineSchedule (const RefineSchedule< DIM > &)
 
void operator= (const RefineSchedule< DIM > &)
 
 RefineSchedule (tbox::Pointer< hier::PatchLevel< DIM > > dst_level, tbox::Pointer< hier::PatchLevel< DIM > > src_level, int next_coarser_level, tbox::Pointer< hier::PatchHierarchy< DIM > > hierarchy, const tbox::Pointer< xfer::RefineClasses< DIM > > refine_classes, tbox::Pointer< xfer::RefineTransactionFactory< DIM > > transaction_factory, const tbox::Array< xfer::FillBoxSet< DIM > > &fill_boxes, xfer::RefinePatchStrategy< DIM > *patch_strategy)
 This private constructor creates a communication schedule that fills the destination level on the specified fill boxes only. More...
 
void finishScheduleConstruction (tbox::Pointer< hier::PatchLevel< DIM > > src_level, int next_coarser_level, tbox::Pointer< hier::PatchHierarchy< DIM > > hierarchy, const tbox::Array< xfer::FillBoxSet< DIM > > &fill_boxes, bool use_time_interpolation, bool skip_generate_schedule)
 Finish the schedule construction for the two constructors that take a hierarchy as an argument. More...
 
void recursiveFill (double fill_time, bool do_physical_boundary_fill) const
 Recursively fill the destination level with data at the given time. More...
 
void fillPhysicalBoundaries (tbox::Pointer< hier::PatchLevel< DIM > > level, double fill_time) const
 Fill the physical boundaries for each patch on the specified patch level. More...
 
void copyScratchToDestination (tbox::Pointer< hier::PatchLevel< DIM > > level) const
 Copy the scratch space into the destination space. More...
 
void refineScratchData () const
 Refine scratch data between coarse and fine patch levels. More...
 
void generateCommunicationSchedule (tbox::Pointer< tbox::Schedule > coarse_priority_schedule, tbox::Pointer< tbox::Schedule > fine_priority_schedule, tbox::Pointer< hier::PatchLevel< DIM > > dst_level, tbox::Pointer< hier::PatchLevel< DIM > > src_level, const tbox::Array< xfer::FillBoxSet< DIM > > &fill_boxes, tbox::Array< xfer::FillBoxSet< DIM > > &unfilled_boxes, const bool use_time_interpolation)
 Main schedule generation routine which passes control to one of the algorithmic variations based on value of s_default_schedule_generation_method. More...
 
void generateCommunicationScheduleNSquared (tbox::Pointer< tbox::Schedule > coarse_priority_schedule, tbox::Pointer< tbox::Schedule > fine_priority_schedule, tbox::Pointer< hier::PatchLevel< DIM > > dst_level, tbox::Pointer< hier::PatchLevel< DIM > > src_level, const tbox::Array< xfer::FillBoxSet< DIM > > &fill_boxes, tbox::Array< xfer::FillBoxSet< DIM > > &unfilled_boxes, const bool use_time_interpolation)
 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 generateCommunicationScheduleBoxGraph (tbox::Pointer< tbox::Schedule > coarse_priority_schedule, tbox::Pointer< tbox::Schedule > fine_priority_schedule, tbox::Pointer< hier::PatchLevel< DIM > > dst_level, tbox::Pointer< hier::PatchLevel< DIM > > src_level, const tbox::Array< xfer::FillBoxSet< DIM > > &fill_boxes, tbox::Array< xfer::FillBoxSet< DIM > > &unfilled_boxes, const bool use_time_interpolation)
 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 generateCommunicationScheduleBoxTree (tbox::Pointer< tbox::Schedule > coarse_priority_schedule, tbox::Pointer< tbox::Schedule > fine_priority_schedule, tbox::Pointer< hier::PatchLevel< DIM > > dst_level, tbox::Pointer< hier::PatchLevel< DIM > > src_level, const tbox::Array< xfer::FillBoxSet< DIM > > &fill_boxes, tbox::Array< xfer::FillBoxSet< DIM > > &unfilled_boxes, const bool use_time_interpolation)
 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 allocateFillBoxes (const std::string &fill_pattern, tbox::Array< xfer::FillBoxSet< DIM > > &fill_boxes, tbox::Pointer< hier::PatchLevel< DIM > > level, const hier::IntVector< DIM > &fill_ghost_width)
 Calculate the fill boxes for the specified patch level. More...
 
hier::IntVector< DIM > getMaxDestinationGhosts () const
 Calculate the maximum ghost cell width of all destination patch data components. More...
 
hier::IntVector< DIM > getMaxScratchGhosts () const
 Calculate the maximum ghost cell width of all scratch patch data components. More...
 
hier::IntVector< DIM > getMaxStencilGhosts () const
 Calculate the maximum ghost cell width required for all stencils. More...
 
void makeUnfilledBoxesNSquared (tbox::Array< xfer::FillBoxSet< DIM > > &unfilled_boxes, const tbox::Array< xfer::FillBoxSet< DIM > > &fill_boxes, tbox::Pointer< hier::PatchLevel< DIM > > dst_level, tbox::Pointer< hier::PatchLevel< DIM > > src_level) const
 Utility function to generate unfilled box regions for a level. More...
 
void constructScheduleTransactions (tbox::Pointer< tbox::Schedule > fine_priority_schedule, tbox::Pointer< tbox::Schedule > coarse_priority_schedule, const hier::BoxList< DIM > &fill_boxes, tbox::Pointer< hier::PatchLevel< DIM > > dst_level, int dst_patch_id, tbox::Pointer< hier::PatchLevel< DIM > > src_level, int src_patch_id, bool use_time_interpolation)
 Function that constructs schedule transactions that move data from source patch on source level to destination patch on destination level on regions defined by list of fill boxes. More...
 
void initializeDomainAndGhostInformation (bool recursive_schedule)
 This function is called from each constructor to cache local copies of hierachy information and to compute the necessary scratch data, destination data, and interpolation stencil ghost cell widths used during schedule construction. More...
 
void setRefineItems (const tbox::Pointer< xfer::RefineClasses< DIM > > refine_classes)
 Utility function to set up local copies of patch data source, destination, etc. indices and necessary data interpolation information stored in the refine classes object generated by the refine algorithm. More...
 
void clearRefineItems ()
 
void initialCheckRefineClassItems () const
 
void firstConstructorTasks ()
 Set up things for the entire class. More...
 

Static Private Member Functions

static void initializeTimers ()
 
static void freeTimers ()
 

Private Attributes

tbox::Pointer< xfer::RefineClasses< DIM > > d_refine_classes
 
int d_number_refine_items
 
const xfer::RefineClasses< DIM >::Data ** d_refine_items
 
tbox::Pointer< hier::PatchLevel< DIM > > d_dst_level
 
xfer::RefinePatchStrategy< DIM > * d_refine_patch_strategy
 
tbox::Pointer< xfer::RefineTransactionFactory< DIM > > d_transaction_factory
 
hier::IntVector< DIM > d_max_stencil_gcw
 
hier::IntVector< DIM > d_max_scratch_gcw
 
hier::IntVector< DIM > d_boundary_fill_ghost_width
 
bool d_force_boundary_fill
 
bool d_domain_is_one_box
 
hier::Box< DIM > d_domain_box
 
int d_num_periodic_directions
 
hier::IntVector< DIM > d_periodic_shift
 
tbox::Pointer< tbox::Scheduled_coarse_priority_level_schedule
 
tbox::Pointer< tbox::Scheduled_fine_priority_level_schedule
 
tbox::Pointer< xfer::RefineSchedule< DIM > > d_coarse_schedule
 
tbox::Pointer< hier::PatchLevel< DIM > > d_coarse_level
 
tbox::Array< intd_coarse_to_fine_mapping
 
tbox::Array< xfer::FillBoxSet< DIM > > d_fine_fill_boxes
 
tbox::Array< tbox::Pointer< hier::BoxOverlap< DIM > > > d_overlaps
 
int d_max_fill_boxes
 
hier::BoxArray< DIM > d_src_masks
 

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
 
static tbox::Pointer< tbox::Timert_fill_data
 
static tbox::Pointer< tbox::Timert_recursive_fill
 
static tbox::Pointer< tbox::Timert_refine_scratch_data
 
static tbox::Pointer< tbox::Timert_gen_sched_n_squared
 
static tbox::Pointer< tbox::Timert_gen_sched_box_graph
 
static tbox::Pointer< tbox::Timert_gen_sched_box_tree
 
static tbox::Pointer< tbox::Timert_gen_comm_sched
 
static tbox::Pointer< tbox::Timert_finish_sched_const
 

Detailed Description

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

Source data is copied into the provided scratch space for temporary processing. The scratch space must contain sufficient ghost cells to accommodate the stencil width of the given interpolation operators and any physical boundary data that must be filled. The scratch data is copied into the destination space at the end of the process. The communication schedule is executed by calling member function fillData().

Each schedule object is typically created by a refine algorithm and represents the 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 RefineAlgorithm<DIM> header file.

NOTE: Algorithmic variations are available by calling the static method RefineSchedule<DIM>::setScheduleGenerationMethod(), which sets the option for all instances of the class.

Some constructors accept the argument fill_pattern. This string controls which types of cells are filled and which are omitted from the filling process. Valid values are:

See also
xfer::RefineAlgorithm
xfer::RefinePatchStrategy
xfer::RefineClasses

Constructor & Destructor Documentation

◆ RefineSchedule() [1/4]

template<int DIM>
SAMRAI::xfer::RefineSchedule< DIM >::RefineSchedule ( const std::string &  fill_pattern,
tbox::Pointer< hier::PatchLevel< DIM > >  dst_level,
tbox::Pointer< hier::PatchLevel< DIM > >  src_level,
const tbox::Pointer< xfer::RefineClasses< DIM > >  refine_classes,
tbox::Pointer< xfer::RefineTransactionFactory< DIM > >  transaction_factory,
xfer::RefinePatchStrategy< DIM > *  patch_strategy,
bool  use_time_interpolation = false 
)

Only data on the intersection of the source and destination patch components will be copied. The source and destination patch levels must reside in the same index space. However, the levels do not have to be in the same AMR patch hierarchy. Generally, this constructor is called by a RefineAlgorithm<DIM> object.

Parameters
fill_patternIndicates which parts of the destination level to fill. See RefineSchedule for valid values.
dst_levelPointer to destination patch level.
src_levelPointer to source patch level.
refine_classesPointer to structure containing patch data and operator information. In general, this is constructed by the calling RefineAlgorithm<DIM> object.
transaction_factoryPointer to a factory object that will create data transactions.
patch_strategyPointer to a refine patch strategy object that provides user-defined physical boundary filling operations. This pointer may be null, in which case no boundary filling operations will occur.
use_time_interpolationOptional boolean flag indicating whether to use time interpolation when setting data on the destination level. Default is no time interpolation.

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.

◆ RefineSchedule() [2/4]

template<int DIM>
SAMRAI::xfer::RefineSchedule< DIM >::RefineSchedule ( const std::string &  fill_pattern,
tbox::Pointer< hier::PatchLevel< DIM > >  dst_level,
tbox::Pointer< hier::PatchLevel< DIM > >  src_level,
int  next_coarser_level,
tbox::Pointer< hier::PatchHierarchy< DIM > >  hierarchy,
const tbox::Pointer< xfer::RefineClasses< DIM > >  refine_classes,
tbox::Pointer< xfer::RefineTransactionFactory< DIM > >  transaction_factory,
xfer::RefinePatchStrategy< DIM > *  patch_strategy,
bool  use_time_interpolation = false 
)

Only data on the intersection of the source and destination patch components will be copied. If portions of the destination level remain unfilled, then the algorithm recursively fills those unfilled portions from coarser levels in the AMR hierarchy. The source and destination patch levels must reside in the same index space. However, the levels do not have to be in the same AMR patch hierarchy. In general, this constructor is called by a RefineAlgorithm<DIM> object.

Parameters
fill_patternIndicates which parts of the destination level to fill. See RefineSchedule for valid values.
dst_levelPointer to destination patch level.
src_levelPointer to source patch level; must be in same index space as destination level. This pointer may be null, in which case the destination level will be filled only using data interpolated from coarser levels in the AMR hierarchy.
next_coarser_levelInteger number of next coarser level in AMR patch hierarchy relative to the destination level. Note that when the destination level has number zero (i.e., the coarsest level), this value should be < 0.
hierarchyPointer to patch hierarchy. This pointer may be null only if the next_coarser_level value is < 0, indicating that there is no level in the hierarchy coarser than the destination level.
refine_classesPointer to structure containing patch data and operator information. In general, this is constructed by the calling RefineAlgorithm<DIM> object.
transaction_factoryPointer to a factory object that will create data transactions.
patch_strategyPointer to a refine patch strategy object that provides user-defined physical boundary filling operations. This pinter may be null, in which case no boundary filling or user-defined refine operations will occur.
use_time_interpolationOptional boolean flag indicating whether to use time interpolation when setting data on the destination level. Default is no time interpolation.

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.

◆ ~RefineSchedule()

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

Virtual destructor for the schedule releases all internal storage.

◆ RefineSchedule() [3/4]

template<int DIM>
SAMRAI::xfer::RefineSchedule< DIM >::RefineSchedule ( const RefineSchedule< DIM > &  )
private

◆ RefineSchedule() [4/4]

template<int DIM>
SAMRAI::xfer::RefineSchedule< DIM >::RefineSchedule ( tbox::Pointer< hier::PatchLevel< DIM > >  dst_level,
tbox::Pointer< hier::PatchLevel< DIM > >  src_level,
int  next_coarser_level,
tbox::Pointer< hier::PatchHierarchy< DIM > >  hierarchy,
const tbox::Pointer< xfer::RefineClasses< DIM > >  refine_classes,
tbox::Pointer< xfer::RefineTransactionFactory< DIM > >  transaction_factory,
const tbox::Array< xfer::FillBoxSet< DIM > > &  fill_boxes,
xfer::RefinePatchStrategy< DIM > *  patch_strategy 
)
private

This constructor is used by the refine schedule algorithm during the recursive schedule generation process. Internal flags are to reflect that fact.

Member Function Documentation

◆ setScheduleGenerationMethod()

template<int DIM>
static void SAMRAI::xfer::RefineSchedule< DIM >::setScheduleGenerationMethod ( const std::string &  method)
static

Static function to set box intersection algorithm to use during schedule construction for all RefineSchedule objects. If this method is not called, the default will be used.

Parameters
methodstring 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.

◆ reset()

template<int DIM>
void SAMRAI::xfer::RefineSchedule< DIM >::reset ( const tbox::Pointer< xfer::RefineClasses< DIM > >  refine_classes)

In general, this function is called by a RefineAlgorithm<DIM> object.

Parameters
refine_classesPointer to structure containing patch data and operator information. In general, this is constructed by the calling RefineAlgorithm<DIM> object. This pointer must be non-null.

◆ fillData()

template<int DIM>
void SAMRAI::xfer::RefineSchedule< DIM >::fillData ( double  fill_time,
bool  do_physical_boundary_fill = true 
) const
Parameters
fill_timeDouble time for filling operation.
do_physical_boundary_fillBoolean flag used to bypass the physical boundary data filling operations on the destination level. The default value is true indicating that boundary data will be filled (assuming a non-null refine patch strategy pointer was passed to the createSchedule() function. Note that even when the value is false, boundary routines may be called on levels coarser than the destination level if such data is needed for proper interpolation.

◆ initializeSourceVector()

template<int DIM>
void SAMRAI::xfer::RefineSchedule< DIM >::initializeSourceVector ( hier::ComponentSelector allocate_vector) const
Parameters
allocate_vectorAn empty hier::ComponentSelector that will be set to contain the patch data indices for source data.

◆ allocateDestinationSpace()

template<int DIM>
void SAMRAI::xfer::RefineSchedule< DIM >::allocateDestinationSpace ( double  fill_time,
hier::ComponentSelector allocate_vector 
) const
Parameters
fill_timeDouble time for filling operation.
allocate_vectorComponent selector that will store the allocated patch data indices.

◆ allocateScratchSpace()

template<int DIM>
void SAMRAI::xfer::RefineSchedule< DIM >::allocateScratchSpace ( tbox::Pointer< hier::PatchLevel< DIM > >  level,
double  fill_time,
hier::ComponentSelector allocate_vector 
) const

◆ initializeDestinationVector()

template<int DIM>
void SAMRAI::xfer::RefineSchedule< DIM >::initializeDestinationVector ( hier::ComponentSelector allocate_vector) const

Initialize a component selector to store the components needed to allocate source data.

Parameters
allocate_vectorAn empty hier_ComponentSelector that will be set to contain the patch data indices for destination data.

◆ getEquivalenceClasses()

template<int DIM>
const tbox::Pointer< RefineClasses<DIM> >& SAMRAI::xfer::RefineSchedule< DIM >::getEquivalenceClasses ( ) const

◆ getBoundaryFillGhostWidth()

template<int DIM>
const hier::IntVector<DIM>& SAMRAI::xfer::RefineSchedule< DIM >::getBoundaryFillGhostWidth ( ) const

Return width of ghost cell region to fill which is passed to user supplied physical boundary condition routine.

◆ printClassData()

template<int DIM>
virtual void SAMRAI::xfer::RefineSchedule< DIM >::printClassData ( std::ostream &  stream) const
virtual

Print the refine schedule data to the specified data stream.

Parameters
streamOutput data stream.

◆ operator=()

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

◆ finishScheduleConstruction()

template<int DIM>
void SAMRAI::xfer::RefineSchedule< DIM >::finishScheduleConstruction ( tbox::Pointer< hier::PatchLevel< DIM > >  src_level,
int  next_coarser_level,
tbox::Pointer< hier::PatchHierarchy< DIM > >  hierarchy,
const tbox::Array< xfer::FillBoxSet< DIM > > &  fill_boxes,
bool  use_time_interpolation,
bool  skip_generate_schedule 
)
private

◆ recursiveFill()

template<int DIM>
void SAMRAI::xfer::RefineSchedule< DIM >::recursiveFill ( double  fill_time,
bool  do_physical_boundary_fill 
) const
private
Parameters
fill_timesolution time when the fill takes place
do_physical_boundary_fillBoolean indicating whether to call user-supplied boundary filling routines regardless of whether this is needed based on ghost cell width of destination data components or stencil width of some interpolation operator.

◆ fillPhysicalBoundaries()

template<int DIM>
void SAMRAI::xfer::RefineSchedule< DIM >::fillPhysicalBoundaries ( tbox::Pointer< hier::PatchLevel< DIM > >  level,
double  fill_time 
) const
private
Parameters
levellevel to file physical boundaries
fill_timesolution time when the fill takes place

◆ copyScratchToDestination()

template<int DIM>
void SAMRAI::xfer::RefineSchedule< DIM >::copyScratchToDestination ( tbox::Pointer< hier::PatchLevel< DIM > >  level) const
private

If the scratch and destination spaces are the same, then no copying is performed.

◆ refineScratchData()

template<int DIM>
void SAMRAI::xfer::RefineSchedule< DIM >::refineScratchData ( ) const
private

◆ generateCommunicationSchedule()

template<int DIM>
void SAMRAI::xfer::RefineSchedule< DIM >::generateCommunicationSchedule ( tbox::Pointer< tbox::Schedule coarse_priority_schedule,
tbox::Pointer< tbox::Schedule fine_priority_schedule,
tbox::Pointer< hier::PatchLevel< DIM > >  dst_level,
tbox::Pointer< hier::PatchLevel< DIM > >  src_level,
const tbox::Array< xfer::FillBoxSet< DIM > > &  fill_boxes,
tbox::Array< xfer::FillBoxSet< DIM > > &  unfilled_boxes,
const bool  use_time_interpolation 
)
private

The resulting transactions will only fill the regions of intersection between the fill_boxes and the destination level boxes. The remaining box regions are returned in unfilled_boxes.

The generateCommunicationSchedule() 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 is set in the getFromInput() method.

The possibilities are as follows:

  • if setScheduleGenerationMethod("BOX_TREE") is called use generateScheduleBoxTree() to generate the schedule. NOTE: THIS IS THE DEFAULT OPTION.
  • if setScheduleGenerationMethod("BOX_GRAPH") is called use generateScheduleBoxGraph() to generate the schedule.
  • if setScheduleGenerationMethod("ORIG_NSQUARED") is called use generateScheduleNSquared() to generate the schedule.

◆ generateCommunicationScheduleNSquared()

template<int DIM>
void SAMRAI::xfer::RefineSchedule< DIM >::generateCommunicationScheduleNSquared ( tbox::Pointer< tbox::Schedule coarse_priority_schedule,
tbox::Pointer< tbox::Schedule fine_priority_schedule,
tbox::Pointer< hier::PatchLevel< DIM > >  dst_level,
tbox::Pointer< hier::PatchLevel< DIM > >  src_level,
const tbox::Array< xfer::FillBoxSet< DIM > > &  fill_boxes,
tbox::Array< xfer::FillBoxSet< DIM > > &  unfilled_boxes,
const bool  use_time_interpolation 
)
private

◆ generateCommunicationScheduleBoxGraph()

template<int DIM>
void SAMRAI::xfer::RefineSchedule< DIM >::generateCommunicationScheduleBoxGraph ( tbox::Pointer< tbox::Schedule coarse_priority_schedule,
tbox::Pointer< tbox::Schedule fine_priority_schedule,
tbox::Pointer< hier::PatchLevel< DIM > >  dst_level,
tbox::Pointer< hier::PatchLevel< DIM > >  src_level,
const tbox::Array< xfer::FillBoxSet< DIM > > &  fill_boxes,
tbox::Array< xfer::FillBoxSet< DIM > > &  unfilled_boxes,
const bool  use_time_interpolation 
)
private

◆ generateCommunicationScheduleBoxTree()

template<int DIM>
void SAMRAI::xfer::RefineSchedule< DIM >::generateCommunicationScheduleBoxTree ( tbox::Pointer< tbox::Schedule coarse_priority_schedule,
tbox::Pointer< tbox::Schedule fine_priority_schedule,
tbox::Pointer< hier::PatchLevel< DIM > >  dst_level,
tbox::Pointer< hier::PatchLevel< DIM > >  src_level,
const tbox::Array< xfer::FillBoxSet< DIM > > &  fill_boxes,
tbox::Array< xfer::FillBoxSet< DIM > > &  unfilled_boxes,
const bool  use_time_interpolation 
)
private

◆ allocateFillBoxes()

template<int DIM>
void SAMRAI::xfer::RefineSchedule< DIM >::allocateFillBoxes ( const std::string &  fill_pattern,
tbox::Array< xfer::FillBoxSet< DIM > > &  fill_boxes,
tbox::Pointer< hier::PatchLevel< DIM > >  level,
const hier::IntVector< DIM > &  fill_ghost_width 
)
private

Acceptable values for fill_pattern is discussed in the class documentation.

◆ getMaxDestinationGhosts()

template<int DIM>
hier::IntVector<DIM> SAMRAI::xfer::RefineSchedule< DIM >::getMaxDestinationGhosts ( ) const
private

◆ getMaxScratchGhosts()

template<int DIM>
hier::IntVector<DIM> SAMRAI::xfer::RefineSchedule< DIM >::getMaxScratchGhosts ( ) const
private

◆ getMaxStencilGhosts()

template<int DIM>
hier::IntVector<DIM> SAMRAI::xfer::RefineSchedule< DIM >::getMaxStencilGhosts ( ) const
private

◆ makeUnfilledBoxesNSquared()

template<int DIM>
void SAMRAI::xfer::RefineSchedule< DIM >::makeUnfilledBoxesNSquared ( tbox::Array< xfer::FillBoxSet< DIM > > &  unfilled_boxes,
const tbox::Array< xfer::FillBoxSet< DIM > > &  fill_boxes,
tbox::Pointer< hier::PatchLevel< DIM > >  dst_level,
tbox::Pointer< hier::PatchLevel< DIM > >  src_level 
) const
private

This is the original N^2 algorithm in SAMRAI before the development of box tree and box graph algorithms.

◆ constructScheduleTransactions()

template<int DIM>
void SAMRAI::xfer::RefineSchedule< DIM >::constructScheduleTransactions ( tbox::Pointer< tbox::Schedule fine_priority_schedule,
tbox::Pointer< tbox::Schedule coarse_priority_schedule,
const hier::BoxList< DIM > &  fill_boxes,
tbox::Pointer< hier::PatchLevel< DIM > >  dst_level,
int  dst_patch_id,
tbox::Pointer< hier::PatchLevel< DIM > >  src_level,
int  src_patch_id,
bool  use_time_interpolation 
)
private

◆ initializeDomainAndGhostInformation()

template<int DIM>
void SAMRAI::xfer::RefineSchedule< DIM >::initializeDomainAndGhostInformation ( bool  recursive_schedule)
private

◆ setRefineItems()

template<int DIM>
void SAMRAI::xfer::RefineSchedule< DIM >::setRefineItems ( const tbox::Pointer< xfer::RefineClasses< DIM > >  refine_classes)
private

An array of refine data items is stored locally here to facilitate interaction with transations.

◆ clearRefineItems()

template<int DIM>
void SAMRAI::xfer::RefineSchedule< DIM >::clearRefineItems ( )
private

◆ initialCheckRefineClassItems()

template<int DIM>
void SAMRAI::xfer::RefineSchedule< DIM >::initialCheckRefineClassItems ( ) const
private

◆ firstConstructorTasks()

template<int DIM>
void SAMRAI::xfer::RefineSchedule< DIM >::firstConstructorTasks ( )
private

◆ initializeTimers()

template<int DIM>
static void SAMRAI::xfer::RefineSchedule< DIM >::initializeTimers ( )
staticprivate

Allocate static timers.

◆ freeTimers()

template<int DIM>
static void SAMRAI::xfer::RefineSchedule< DIM >::freeTimers ( )
staticprivate

Free static timers.

To be called by shutdown registry to make sure memory for timers does not leak.

Member Data Documentation

◆ s_constant_zero_intvector

template<int DIM>
const hier::IntVector<DIM> SAMRAI::xfer::RefineSchedule< DIM >::s_constant_zero_intvector
staticprivate

Constant int vectors used to avoid recreating these vectors in loops.

◆ s_constant_one_intvector

template<int DIM>
const hier::IntVector<DIM> SAMRAI::xfer::RefineSchedule< DIM >::s_constant_one_intvector
staticprivate

◆ s_schedule_generation_method

template<int DIM>
std::string SAMRAI::xfer::RefineSchedule< DIM >::s_schedule_generation_method
staticprivate

Selects algorithm used to generate communication schedule.

◆ d_refine_classes

template<int DIM>
tbox::Pointer< xfer::RefineClasses<DIM> > SAMRAI::xfer::RefineSchedule< DIM >::d_refine_classes
private

Structures that store refine data items.

◆ d_number_refine_items

template<int DIM>
int SAMRAI::xfer::RefineSchedule< DIM >::d_number_refine_items
private

◆ d_refine_items

template<int DIM>
const xfer::RefineClasses<DIM>::Data** SAMRAI::xfer::RefineSchedule< DIM >::d_refine_items
private

◆ d_dst_level

template<int DIM>
tbox::Pointer< hier::PatchLevel<DIM> > SAMRAI::xfer::RefineSchedule< DIM >::d_dst_level
private

Cached pointer to the destination patch level.

◆ d_refine_patch_strategy

template<int DIM>
xfer::RefinePatchStrategy<DIM>* SAMRAI::xfer::RefineSchedule< DIM >::d_refine_patch_strategy
private

Object supporting interface to user-defined boundary filling and spatial data interpolation operations.

◆ d_transaction_factory

template<int DIM>
tbox::Pointer< xfer::RefineTransactionFactory<DIM> > SAMRAI::xfer::RefineSchedule< DIM >::d_transaction_factory
private

Factory object used to create data transactions when schedule is constructed.

◆ d_max_stencil_gcw

template<int DIM>
hier::IntVector<DIM> SAMRAI::xfer::RefineSchedule< DIM >::d_max_stencil_gcw
private

Cached copy of maximum stencil ghost cell widths.

◆ d_max_scratch_gcw

template<int DIM>
hier::IntVector<DIM> SAMRAI::xfer::RefineSchedule< DIM >::d_max_scratch_gcw
private

Cached copy of maximum scratch ghost cell widths.

◆ d_boundary_fill_ghost_width

template<int DIM>
hier::IntVector<DIM> SAMRAI::xfer::RefineSchedule< DIM >::d_boundary_fill_ghost_width
private

Width of ghost cell region to fill passed to user supplied physical boundary condition routine.

◆ d_force_boundary_fill

template<int DIM>
bool SAMRAI::xfer::RefineSchedule< DIM >::d_force_boundary_fill
private

Flag indicating whether user's physical boundary data filling routine should be forced at last step of level filling process.

This flag is true when doing recursive filling, because the ghost data may be needed by finer levels (regardless of whether the user requested ghost boundary filling). This variable is set in the constructors, which knows whether the object is being constructed for recursive filling.

For efficiency, we only force boundary filling when, during object construction, we determine that the ghost cells do exist.

◆ d_domain_is_one_box

template<int DIM>
bool SAMRAI::xfer::RefineSchedule< DIM >::d_domain_is_one_box
private

Boolean flag indicating whether physical domain is comprised as a single box region.

◆ d_domain_box

template<int DIM>
hier::Box<DIM> SAMRAI::xfer::RefineSchedule< DIM >::d_domain_box
private

Cached box describing physical domain when that domain is comprised as a single box region

◆ d_num_periodic_directions

template<int DIM>
int SAMRAI::xfer::RefineSchedule< DIM >::d_num_periodic_directions
private

Number of non-zero entries in periodic shift vector.

◆ d_periodic_shift

template<int DIM>
hier::IntVector<DIM> SAMRAI::xfer::RefineSchedule< DIM >::d_periodic_shift
private

Cached copy of the periodic shift vector.

◆ d_coarse_priority_level_schedule

template<int DIM>
tbox::Pointer<tbox::Schedule> SAMRAI::xfer::RefineSchedule< DIM >::d_coarse_priority_level_schedule
private

Level-to-level communication schedule between the source and destination.

d_coarse_priority_level_schedule handles the situation where coarse data should take precedence at coarse-fine boundaries for data types holding values at patch boundaries but which are considered interior values. d_fine_priority_level_schedule handles the situation where fine data should take precedence.

◆ d_fine_priority_level_schedule

template<int DIM>
tbox::Pointer<tbox::Schedule> SAMRAI::xfer::RefineSchedule< DIM >::d_fine_priority_level_schedule
private

Level-to-level communication schedule between the source and destination.

d_coarse_priority_level_schedule handles the situation where coarse data should take precedence at coarse-fine boundaries for data types holding values at patch boundaries but which are considered interior values. d_fine_priority_level_schedule handles the situation where fine data should take precedence.

◆ d_coarse_schedule

template<int DIM>
tbox::Pointer< xfer::RefineSchedule<DIM> > SAMRAI::xfer::RefineSchedule< DIM >::d_coarse_schedule
private

Schedule to recursively fill data from the next coarser hierarchy level.

This schedule describes how to fill the coarser level so that the coarse data can be interpolated into the fine fill boxes on the destination. If no coarser data is needed to fill the fill boxes on the destination level, then this pointer is NULL.

◆ d_coarse_level

template<int DIM>
tbox::Pointer< hier::PatchLevel<DIM> > SAMRAI::xfer::RefineSchedule< DIM >::d_coarse_level
private

Pointer to the coarser level necessary to interpolate data into the fill boxes of the destination.

This coarser level is filled by the refine schedule above. If no coarser level data is needed, then this pointer will be NULL. Note that the coarser level may not have the same mapping as the destination level; see the mapping array below.

◆ d_coarse_to_fine_mapping

template<int DIM>
tbox::Array<int> SAMRAI::xfer::RefineSchedule< DIM >::d_coarse_to_fine_mapping
private

The mapping between the patches on the coarser level and the patches on the fine level.

For each destination patch on the fine level, there may be zero or more coarse patches, depending on the fill boxes for the destination patch and also any extending to the physical boundaries required to maintain proper box relationships.

◆ d_fine_fill_boxes

template<int DIM>
tbox::Array< xfer::FillBoxSet<DIM> > SAMRAI::xfer::RefineSchedule< DIM >::d_fine_fill_boxes
private

An array of fill boxes used when refining between coarse and fine patches.

This array has one entry for each local patch on the coarse patch level.

◆ d_overlaps

template<int DIM>
tbox::Array< tbox::Pointer< hier::BoxOverlap<DIM> > > SAMRAI::xfer::RefineSchedule< DIM >::d_overlaps
private

Arrays for overlaps and source mask boxes used in the private member function constructScheduleTransactions().

They are declared in the class to make memory management efficient since that function is called many times.

The size of these arrays is controlled by d_max_fill_boxes, which is is set by taking the max over the number of fill boxes for each destination patch to be filled.

◆ d_max_fill_boxes

template<int DIM>
int SAMRAI::xfer::RefineSchedule< DIM >::d_max_fill_boxes
private

◆ d_src_masks

template<int DIM>
hier::BoxArray<DIM> SAMRAI::xfer::RefineSchedule< DIM >::d_src_masks
private

◆ t_fill_data

template<int DIM>
tbox::Pointer<tbox::Timer> SAMRAI::xfer::RefineSchedule< DIM >::t_fill_data
staticprivate

Timer objects for performance measurement.

◆ t_recursive_fill

template<int DIM>
tbox::Pointer<tbox::Timer> SAMRAI::xfer::RefineSchedule< DIM >::t_recursive_fill
staticprivate

◆ t_refine_scratch_data

template<int DIM>
tbox::Pointer<tbox::Timer> SAMRAI::xfer::RefineSchedule< DIM >::t_refine_scratch_data
staticprivate

◆ t_gen_sched_n_squared

template<int DIM>
tbox::Pointer<tbox::Timer> SAMRAI::xfer::RefineSchedule< DIM >::t_gen_sched_n_squared
staticprivate

◆ t_gen_sched_box_graph

template<int DIM>
tbox::Pointer<tbox::Timer> SAMRAI::xfer::RefineSchedule< DIM >::t_gen_sched_box_graph
staticprivate

◆ t_gen_sched_box_tree

template<int DIM>
tbox::Pointer<tbox::Timer> SAMRAI::xfer::RefineSchedule< DIM >::t_gen_sched_box_tree
staticprivate

◆ t_gen_comm_sched

template<int DIM>
tbox::Pointer<tbox::Timer> SAMRAI::xfer::RefineSchedule< DIM >::t_gen_comm_sched
staticprivate

◆ t_finish_sched_const

template<int DIM>
tbox::Pointer<tbox::Timer> SAMRAI::xfer::RefineSchedule< DIM >::t_finish_sched_const
staticprivate

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