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

#include <CoarsenClasses.h>

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

Classes

struct  Data
 

Public Member Functions

 CoarsenClasses (bool fill_coarse_data)
 
virtual ~CoarsenClasses ()
 
int getNumberOfEquivalenceClasses () const
 
int getNumberOfItemsInEquivalenceClass (int equiv_class_id) const
 
const CoarsenClasses< DIM >::DatagetClassRepresentative (int equiv_class_id) const
 
tbox::List< typename CoarsenClasses< DIM >::Data >::Iterator getIterator (int equiv_class_id)
 
void insertEquivalenceClassItem (const typename CoarsenClasses< DIM >::Data &data, tbox::Pointer< hier::PatchDescriptor< DIM > > descriptor=(hier::PatchDescriptor< DIM > *) NULL)
 
bool checkCoarsenItem (const typename CoarsenClasses< DIM >::Data &data_item, tbox::Pointer< hier::PatchDescriptor< DIM > > descriptor=(hier::PatchDescriptor< DIM > *) NULL) const
 
bool checkConsistency (tbox::Pointer< CoarsenClasses< DIM > > test_classes, tbox::Pointer< hier::PatchDescriptor< DIM > > descriptor=(hier::PatchDescriptor< DIM > *) NULL) const
 
virtual void printClassData (std::ostream &stream) const
 
void printCoarsenItem (std::ostream &stream, const typename CoarsenClasses< DIM >::Data &data) const
 

Private Member Functions

 CoarsenClasses (const CoarsenClasses< DIM > &)
 
void operator= (const CoarsenClasses< DIM > &)
 
bool checkPatchDataItemConsistency (int item_id1, int item_id2, tbox::Pointer< hier::PatchDescriptor< DIM > > pd) const
 
int getEquivalenceClassIndex (const typename CoarsenClasses< DIM >::Data &data, tbox::Pointer< hier::PatchDescriptor< DIM > > descriptor=(hier::PatchDescriptor< DIM > *) NULL) const
 

Private Attributes

bool d_fill_coarse_data
 
tbox::Array< tbox::List< typename CoarsenClasses< DIM >::Data > > d_coarsen_equivalence_classes
 

Detailed Description

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

Class CoarsenClasses<DIM> is used by the CoarsenSchedule<DIM> and CoarsenAlgorithm<DIM> classes to manage a set of data coarsening items that describe coarsening of patch data between two levels in an AMR hierarchy.
Specifically, this class organizes these items into equivalence clases. Two items are equivalent if their source and destination data represent the same data types and have the same ghost cell widths, respectively.

Constructor & Destructor Documentation

◆ CoarsenClasses() [1/2]

template<int DIM>
SAMRAI::xfer::CoarsenClasses< DIM >::CoarsenClasses ( bool  fill_coarse_data)

The constructor sets boolean for filling coarse data and creates an empty array of coarsen classes.

◆ ~CoarsenClasses()

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

The virtual destructor destroys the coarsen data items owned by this object (and the associated CoarsenAlgorithm<DIM> object).

◆ CoarsenClasses() [2/2]

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

Member Function Documentation

◆ getNumberOfEquivalenceClasses()

template<int DIM>
int SAMRAI::xfer::CoarsenClasses< DIM >::getNumberOfEquivalenceClasses ( ) const

Return number of equivalence classes maintained by this object (i.e., the number of lists of coarsen data items).

◆ getNumberOfItemsInEquivalenceClass()

template<int DIM>
int SAMRAI::xfer::CoarsenClasses< DIM >::getNumberOfItemsInEquivalenceClass ( int  equiv_class_id) const

Return number of coarsen data items in the equivalence classes represented by the given integer identifier.

◆ getClassRepresentative()

template<int DIM>
const CoarsenClasses<DIM>::Data& SAMRAI::xfer::CoarsenClasses< DIM >::getClassRepresentative ( int  equiv_class_id) const

Return const reference to representative element of equivalence class with the given integer identifier. When assertion checking is active, the id will be checked for validity.

◆ getIterator()

template<int DIM>
tbox::List<typename CoarsenClasses<DIM>::Data>::Iterator SAMRAI::xfer::CoarsenClasses< DIM >::getIterator ( int  equiv_class_id)

Return an iterator for the coarsen data list corresponding to the equivalence class with the given integer identifier. The number of equivalence classes can be determined via the getNumberOfEquivalenceClasses() member function. Valid integer arguments are 0,...,getNumberOfEquivalenceClasses()-1. When assertion checking is active, the id will be checked for validity.

Note that the list should not be modified through this iterator. When assertion checking is active, the id will be checked for validity.

◆ insertEquivalenceClassItem()

template<int DIM>
void SAMRAI::xfer::CoarsenClasses< DIM >::insertEquivalenceClassItem ( const typename CoarsenClasses< DIM >::Data data,
tbox::Pointer< hier::PatchDescriptor< DIM > >  descriptor = (hier::PatchDescriptor< DIM > *) NULL 
)

Insert a data item into the coarsen data list for the proper equivalence class. Items are inserted in order of operator priority so that communication algorithms apply coarsen operators with the lowest numerical priority before those with higher numerical priority.

If a null patch descriptor argument is passed (or ommitted), the descriptor associated with the variable database Singleton object will be used to determine the equivalence class.

◆ checkCoarsenItem()

template<int DIM>
bool SAMRAI::xfer::CoarsenClasses< DIM >::checkCoarsenItem ( const typename CoarsenClasses< DIM >::Data data_item,
tbox::Pointer< hier::PatchDescriptor< DIM > >  descriptor = (hier::PatchDescriptor< DIM > *) NULL 
) const

Check coarsen data item so that the source and destination data entries have an appropriate number of ghost cells to support the stencil width of the operator passed to the CoarsenAlgorithm::registerCoarsen() routine. Also, if the boolean argument passed to CoarsenAlgorithm constructor was true, indicating that coarse level data must be filled before coarsening, this routine checks that copying between source and destination data types is a valid operation. If both checks are successful, return true; else return false. A descriptive error message will be reported when a problem appears and the program halts.

If a null patch descriptor argument is passed (or omitted), the descriptor ownded by the variable database Singleton object is used.

◆ checkConsistency()

template<int DIM>
bool SAMRAI::xfer::CoarsenClasses< DIM >::checkConsistency ( tbox::Pointer< CoarsenClasses< DIM > >  test_classes,
tbox::Pointer< hier::PatchDescriptor< DIM > >  descriptor = (hier::PatchDescriptor< DIM > *) NULL 
) const

Compare coarsen data items in this coarsen classes object against those in the argument coarsen classes object. Return true if they all match with regard to the patch data types, patch data ghost cell widths, operator stencils, etc. that they refer to and return false otherwise.

If a null patch descriptor argument is passed (or ommitted), the descriptor associated with the variable database Singleton object will be used.

◆ printClassData()

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

Print all equivalence class data to the specified output stream.

◆ printCoarsenItem()

template<int DIM>
void SAMRAI::xfer::CoarsenClasses< DIM >::printCoarsenItem ( std::ostream &  stream,
const typename CoarsenClasses< DIM >::Data data 
) const

Print single equivalence class item to the specified output stream.

◆ operator=()

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

◆ checkPatchDataItemConsistency()

template<int DIM>
bool SAMRAI::xfer::CoarsenClasses< DIM >::checkPatchDataItemConsistency ( int  item_id1,
int  item_id2,
tbox::Pointer< hier::PatchDescriptor< DIM > >  pd 
) const
private

◆ getEquivalenceClassIndex()

template<int DIM>
int SAMRAI::xfer::CoarsenClasses< DIM >::getEquivalenceClassIndex ( const typename CoarsenClasses< DIM >::Data data,
tbox::Pointer< hier::PatchDescriptor< DIM > >  descriptor = (hier::PatchDescriptor< DIM > *) NULL 
) const
private

Member Data Documentation

◆ d_fill_coarse_data

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

◆ d_coarsen_equivalence_classes

template<int DIM>
tbox::Array< tbox::List<typename CoarsenClasses<DIM>::Data> > SAMRAI::xfer::CoarsenClasses< DIM >::d_coarsen_equivalence_classes
private

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