IBAMR  IBAMR version 0.19.
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
SAMRAI::hier::PatchData< DIM > Class Template Referenceabstract

#include <ibtk/LSetDataFactory.h>

Inheritance diagram for SAMRAI::hier::PatchData< DIM >:
Inheritance graph
[legend]

Public Member Functions

 PatchData (const Box< DIM > &domain, const IntVector< DIM > &ghosts)
 
virtual ~PatchData ()
 
const Box< DIM > & getBox () const
 
const Box< DIM > & getGhostBox () const
 
const IntVector< DIM > & getGhostCellWidth () const
 
void setTime (const double timestamp)
 
double getTime () const
 
virtual void copy (const PatchData< DIM > &src)=0
 
virtual void copy2 (PatchData< DIM > &dst) const =0
 
virtual void copy (const PatchData< DIM > &src, const BoxOverlap< DIM > &overlap)=0
 
virtual void copy2 (PatchData< DIM > &dst, const BoxOverlap< DIM > &overlap) const =0
 
virtual bool canEstimateStreamSizeFromBox () const =0
 
virtual int getDataStreamSize (const BoxOverlap< DIM > &overlap) const =0
 
virtual void packStream (tbox::AbstractStream &stream, const BoxOverlap< DIM > &overlap) const =0
 
virtual void unpackStream (tbox::AbstractStream &stream, const BoxOverlap< DIM > &overlap)=0
 
virtual void getFromDatabase (tbox::Pointer< tbox::Database > database)
 
virtual void putToDatabase (tbox::Pointer< tbox::Database > database)
 
virtual void getSpecializedFromDatabase (tbox::Pointer< tbox::Database > database)=0
 
virtual void putSpecializedToDatabase (tbox::Pointer< tbox::Database > database)=0
 

Protected Member Functions

void setGhostBox (const Box< DIM > &ghost_box)
 

Private Member Functions

 PatchData (const PatchData< DIM > &)
 
void operator= (const PatchData< DIM > &)
 

Private Attributes

Box< DIM > d_box
 
Box< DIM > d_ghost_box
 
IntVector< DIM > d_ghosts
 
double d_timestamp
 

Detailed Description

template<int DIM>
class SAMRAI::hier::PatchData< DIM >

Class PatchData<DIM> is a pure virtual base class for the data storage defined over a box. Patch data objects are generally contained within a patch. Patch data defines the abstract virtual functions for data management and communication that must be supplied by the subclasses. Subclasses implement the virtual functions as appropriate for the derived type; for example, cell centered objects will copy data differently than face centered objects.

Patch data objects are created by patch data factories and associated subclasses. This separation into abstract factory and concrete implementation subclasses facilitates the creation of new patch data subtypes. See the Design Patterns book for more details about the Abstract Factory pattern.

The copy and pack/unpack functions in the patch data object take box overlap descriptions that describe the index space over which data is to be copied or packed/unpacked. Box overlaps are computed by the box geometry classes, which are accessed through the patch data factories. Box geometry classes are created by the patch data factories instead of the patch data objects because patch data objects are distributed across memory with patches and therefore may not exist on a particular processor. Patch data factories are guaranteed to exist on all processors independent of the patch-to-processor mapping.

See also
hier::BoxOverlap
hier::BoxGeometry
hier::Patch
hier::PatchDataFactory
hier::PatchDescriptor

Constructor & Destructor Documentation

◆ PatchData() [1/2]

template<int DIM>
SAMRAI::hier::PatchData< DIM >::PatchData ( const Box< DIM > &  domain,
const IntVector< DIM > &  ghosts 
)

The constructor for a patch data object. Patch data objects will manage the interior box over which they are defined and the associated ghost cell width.

◆ ~PatchData()

template<int DIM>
virtual SAMRAI::hier::PatchData< DIM >::~PatchData ( )
virtual

The virtual destructor for a patch data object.

◆ PatchData() [2/2]

template<int DIM>
SAMRAI::hier::PatchData< DIM >::PatchData ( const PatchData< DIM > &  )
private

Member Function Documentation

◆ getBox()

template<int DIM>
const Box<DIM>& SAMRAI::hier::PatchData< DIM >::getBox ( ) const

Return the box over which this patch data object is defined. All objects in the same patch are defined over the same box, although the patch data objects may interpret how to allocate storage for that box in different ways.

◆ getGhostBox()

template<int DIM>
const Box<DIM>& SAMRAI::hier::PatchData< DIM >::getGhostBox ( ) const

Return the ghost cell box. The ghost cell box is defined to be the interior box grown by the ghost cell width.

◆ getGhostCellWidth()

template<int DIM>
const IntVector<DIM>& SAMRAI::hier::PatchData< DIM >::getGhostCellWidth ( ) const

Get the ghost cell width associated with this patch data object.

◆ setTime()

template<int DIM>
void SAMRAI::hier::PatchData< DIM >::setTime ( const double  timestamp)

Set the simulation time stamp for the patch data type. The simulation time is initialized to zero when the patch data type is created.

◆ getTime()

template<int DIM>
double SAMRAI::hier::PatchData< DIM >::getTime ( ) const

Get the simulation time stamp for the patch data type.

◆ copy() [1/2]

template<int DIM>
virtual void SAMRAI::hier::PatchData< DIM >::copy ( const PatchData< DIM > &  src)
pure virtual

A fast copy between the source and destination. Data is copied from the source into the destination where there is overlap in the underlying index space. The copy is performed on the interior plus the ghost cell width (for both the source and destination). If this copy does not understand how to copy data from the argument, then copy2() is called on the source object.

Implemented in SAMRAI::pdat::OuteredgeData< DIM, TYPE >, SAMRAI::pdat::OuternodeData< DIM, TYPE >, SAMRAI::pdat::OutersideData< DIM, TYPE >, SAMRAI::pdat::OuterfaceData< DIM, TYPE >, SAMRAI::pdat::SideData< DIM, TYPE >, SAMRAI::pdat::FaceData< DIM, TYPE >, SAMRAI::pdat::EdgeData< DIM, TYPE >, SAMRAI::pdat::NodeData< DIM, TYPE >, SAMRAI::pdat::CellData< DIM, TYPE >, SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >, SAMRAI::pdat::IndexData< NDIM, LSet< T >, SAMRAI::pdat::CellGeometry< NDIM > >, and SAMRAI::pdat::IndexData< DIM, IBTK::LSet< T >, SAMRAI::pdat::CellGeometry< NDIM > >.

◆ copy2() [1/2]

template<int DIM>
virtual void SAMRAI::hier::PatchData< DIM >::copy2 ( PatchData< DIM > &  dst) const
pure virtual

A fast copy between the source and destination. Data is copied from the source into the destination where there is overlap in the underlying index space. The copy is performed on the interior plus the ghost cell width (for both the source and destination). If this copy does not understand how to copy data from the destination, then it may throw an exception (aka dump core in a failed assertion).

Implemented in SAMRAI::pdat::OuteredgeData< DIM, TYPE >, SAMRAI::pdat::OuternodeData< DIM, TYPE >, SAMRAI::pdat::OutersideData< DIM, TYPE >, SAMRAI::pdat::OuterfaceData< DIM, TYPE >, SAMRAI::pdat::SideData< DIM, TYPE >, SAMRAI::pdat::FaceData< DIM, TYPE >, SAMRAI::pdat::EdgeData< DIM, TYPE >, SAMRAI::pdat::NodeData< DIM, TYPE >, SAMRAI::pdat::CellData< DIM, TYPE >, SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >, SAMRAI::pdat::IndexData< NDIM, LSet< T >, SAMRAI::pdat::CellGeometry< NDIM > >, and SAMRAI::pdat::IndexData< DIM, IBTK::LSet< T >, SAMRAI::pdat::CellGeometry< NDIM > >.

◆ copy() [2/2]

template<int DIM>
virtual void SAMRAI::hier::PatchData< DIM >::copy ( const PatchData< DIM > &  src,
const BoxOverlap< DIM > &  overlap 
)
pure virtual

Copy data from the source into the destination using the designated overlap descriptor. The overlap description will have been computed using the appropriate box geometry objects. If this member function cannot complete the copy from source (e.g., if it doesn't understand the type of source), then copy2() is called on the source object.

Implemented in SAMRAI::pdat::OuteredgeData< DIM, TYPE >, SAMRAI::pdat::OuternodeData< DIM, TYPE >, SAMRAI::pdat::OutersideData< DIM, TYPE >, SAMRAI::pdat::OuterfaceData< DIM, TYPE >, SAMRAI::pdat::SideData< DIM, TYPE >, SAMRAI::pdat::FaceData< DIM, TYPE >, SAMRAI::pdat::EdgeData< DIM, TYPE >, SAMRAI::pdat::NodeData< DIM, TYPE >, SAMRAI::pdat::CellData< DIM, TYPE >, SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >, SAMRAI::pdat::IndexData< NDIM, LSet< T >, SAMRAI::pdat::CellGeometry< NDIM > >, and SAMRAI::pdat::IndexData< DIM, IBTK::LSet< T >, SAMRAI::pdat::CellGeometry< NDIM > >.

◆ copy2() [2/2]

template<int DIM>
virtual void SAMRAI::hier::PatchData< DIM >::copy2 ( PatchData< DIM > &  dst,
const BoxOverlap< DIM > &  overlap 
) const
pure virtual

Copy data from the source into the destination using the designated overlap descriptor. The overlap description will have been computed using the appropriate box geometry objects If this member function cannot complete the copy from the destination, then it may throw an exception (aka dump core in a failed assertion).

Implemented in SAMRAI::pdat::OuteredgeData< DIM, TYPE >, SAMRAI::pdat::OuternodeData< DIM, TYPE >, SAMRAI::pdat::OutersideData< DIM, TYPE >, SAMRAI::pdat::OuterfaceData< DIM, TYPE >, SAMRAI::pdat::SideData< DIM, TYPE >, SAMRAI::pdat::FaceData< DIM, TYPE >, SAMRAI::pdat::EdgeData< DIM, TYPE >, SAMRAI::pdat::NodeData< DIM, TYPE >, SAMRAI::pdat::CellData< DIM, TYPE >, SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >, SAMRAI::pdat::IndexData< NDIM, LSet< T >, SAMRAI::pdat::CellGeometry< NDIM > >, and SAMRAI::pdat::IndexData< DIM, IBTK::LSet< T >, SAMRAI::pdat::CellGeometry< NDIM > >.

◆ canEstimateStreamSizeFromBox()

template<int DIM>
virtual bool SAMRAI::hier::PatchData< DIM >::canEstimateStreamSizeFromBox ( ) const
pure virtual

Determines whether the patch data subclass can estimate the necessary stream size using only index space information. The return value will most likely be true for data types that are fixed size (such as doubles) but will be false for complex data types that allocate their own storage (such as lists of particles). This routine is used to estimate whether a processor can estimate space for incoming messages or whether it needs to receive a message size from the sending processor.

Implemented in SAMRAI::pdat::OuteredgeData< DIM, TYPE >, SAMRAI::pdat::OuternodeData< DIM, TYPE >, SAMRAI::pdat::OutersideData< DIM, TYPE >, SAMRAI::pdat::OuterfaceData< DIM, TYPE >, SAMRAI::pdat::SideData< DIM, TYPE >, SAMRAI::pdat::FaceData< DIM, TYPE >, SAMRAI::pdat::EdgeData< DIM, TYPE >, SAMRAI::pdat::NodeData< DIM, TYPE >, SAMRAI::pdat::CellData< DIM, TYPE >, and SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >.

◆ getDataStreamSize()

template<int DIM>
virtual int SAMRAI::hier::PatchData< DIM >::getDataStreamSize ( const BoxOverlap< DIM > &  overlap) const
pure virtual

Calculate the number of bytes needed to stream the data lying in the specified box domain. This estimate must be an upper bound on the size of the data in the actual message stream. The upper bound should be close, however, since buffer space will be allocated according to these values, and excess buffer space will waste memory resources.

Implemented in SAMRAI::pdat::OuteredgeData< DIM, TYPE >, SAMRAI::pdat::OuternodeData< DIM, TYPE >, SAMRAI::pdat::OutersideData< DIM, TYPE >, SAMRAI::pdat::OuterfaceData< DIM, TYPE >, SAMRAI::pdat::SideData< DIM, TYPE >, SAMRAI::pdat::FaceData< DIM, TYPE >, SAMRAI::pdat::EdgeData< DIM, TYPE >, SAMRAI::pdat::NodeData< DIM, TYPE >, SAMRAI::pdat::CellData< DIM, TYPE >, SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >, SAMRAI::pdat::IndexData< NDIM, LSet< T >, SAMRAI::pdat::CellGeometry< NDIM > >, and SAMRAI::pdat::IndexData< DIM, IBTK::LSet< T >, SAMRAI::pdat::CellGeometry< NDIM > >.

◆ packStream()

template<int DIM>
virtual void SAMRAI::hier::PatchData< DIM >::packStream ( tbox::AbstractStream stream,
const BoxOverlap< DIM > &  overlap 
) const
pure virtual

◆ unpackStream()

template<int DIM>
virtual void SAMRAI::hier::PatchData< DIM >::unpackStream ( tbox::AbstractStream stream,
const BoxOverlap< DIM > &  overlap 
)
pure virtual

◆ getFromDatabase()

template<int DIM>
virtual void SAMRAI::hier::PatchData< DIM >::getFromDatabase ( tbox::Pointer< tbox::Database database)
virtual

Checks that class version and restart file version are equal. If so, reads in the data members common to all patch data types from database. This method then calls the getSpecializedFromDatabase() method to retrieve the data special to the concrete patch data type.

◆ putToDatabase()

template<int DIM>
virtual void SAMRAI::hier::PatchData< DIM >::putToDatabase ( tbox::Pointer< tbox::Database database)
virtual

Writes out the class version number to the database. Then, writes the data members common to all patch data types from database. After the common data is written to the database, the putSpecializedToDatabase() method is invoked.

◆ getSpecializedFromDatabase()

template<int DIM>
virtual void SAMRAI::hier::PatchData< DIM >::getSpecializedFromDatabase ( tbox::Pointer< tbox::Database database)
pure virtual

◆ putSpecializedToDatabase()

template<int DIM>
virtual void SAMRAI::hier::PatchData< DIM >::putSpecializedToDatabase ( tbox::Pointer< tbox::Database database)
pure virtual

◆ setGhostBox()

template<int DIM>
void SAMRAI::hier::PatchData< DIM >::setGhostBox ( const Box< DIM > &  ghost_box)
protected

This protected method is used by concrete patch data subclasses to set the ghost box over which the patch data will be allocated. Note that this allows the ghost box to be inconsistant with its standard interpretation as the patch domain box grown by the ghost cell width (as set in the constructor).

This function is included to treat some special cases for concrete patch data types and should be used with caution.

◆ operator=()

template<int DIM>
void SAMRAI::hier::PatchData< DIM >::operator= ( const PatchData< DIM > &  )
private

Member Data Documentation

◆ d_box

template<int DIM>
Box<DIM> SAMRAI::hier::PatchData< DIM >::d_box
private

◆ d_ghost_box

template<int DIM>
Box<DIM> SAMRAI::hier::PatchData< DIM >::d_ghost_box
private

◆ d_ghosts

template<int DIM>
IntVector<DIM> SAMRAI::hier::PatchData< DIM >::d_ghosts
private

◆ d_timestamp

template<int DIM>
double SAMRAI::hier::PatchData< DIM >::d_timestamp
private

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