Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

SAMRAI::hier::PatchDataFactory< DIM > Class Template Reference

#include <source/hierarchy/variables/PatchDataFactory.h>

Inheritance diagram for SAMRAI::hier::PatchDataFactory< DIM >:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 PatchDataFactory ()
virtual ~PatchDataFactory ()
virtual tbox::Pointer< PatchDataFactory<
DIM > > 
cloneFactory ()=0
virtual tbox::Pointer< PatchData<
DIM > > 
allocate (const Box< DIM > &box, tbox::Pointer< tbox::Arena > pool=(tbox::Arena *) NULL) const =0
virtual tbox::Pointer< BoxGeometry<
DIM > > 
getBoxGeometry (const Box< DIM > &box) const =0
virtual const IntVector< DIM > & getDefaultGhostCellWidth () const =0
virtual void setDefaultGhostCellWidth (const IntVector< DIM > &ghosts)=0
virtual size_t getSizeOfMemory (const Box< DIM > &box) const =0
virtual bool fineBoundaryRepresentsVariable () const =0
virtual bool dataLivesOnPatchBorder () const =0
virtual bool validCopyTo (const tbox::Pointer< PatchDataFactory< DIM > > &dst_pdf) const =0

Detailed Description

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

Class PatchDataFactory<DIM> is an abstract base class used to allocate new instances of patch data objects. Recall that patch data objects (PDs) are the data storage containers that exist within a patch. PDs are created using patch data factory (PDF) objects; this is an example of the ``Abstract Factory'' method described in the Design Patterns book by Gamma, et al.

The separation of PDF from PD simplifies the creation of new concrete PD classes since it separates the definition of the concrete class type from the actual instantiation. The actual concrete class associated with the PDF is unknown to most of the framework; the PDF only defines enough information to create the PD instance. For example, to add a new type of PD object MyPD (MyPatchData): {enumerate}

In addition to the generation of patch data, the patch data factory also generates box geometry descriptions used to calculate the overlap between two patch data objects. The allocation of the box geometry object is managed by the patch data factory instead of the patch data object since patch data factories are guaranteed to exist on all of the processors independent of the mapping of patches to processors. Patch data is guaranteed to exist only on those patches local to a processor.

See also:
hier::BoxGeometry

hier::PatchData

hier::PatchDescriptor


Constructor & Destructor Documentation

template<int DIM>
SAMRAI::hier::PatchDataFactory< DIM >::PatchDataFactory  )  [inline]
 

The default constructor for the patch data factory class.

template<int DIM>
SAMRAI::hier::PatchDataFactory< DIM >::~PatchDataFactory  )  [virtual]
 

Virtual destructor for the patch data factory class.


Member Function Documentation

template<int DIM>
virtual tbox::Pointer< PatchDataFactory<DIM> > SAMRAI::hier::PatchDataFactory< DIM >::cloneFactory  )  [pure virtual]
 

Abstract virtual function to clone a patch data factory. This will return a new instantiation of the abstract factory with the same properties. The properties of the cloned factory can then be changed without modifying the original.

Implemented in SAMRAI::pdat::CellDataFactory< DIM, TYPE >, SAMRAI::pdat::EdgeDataFactory< DIM, TYPE >, SAMRAI::pdat::FaceDataFactory< DIM, TYPE >, SAMRAI::pdat::IndexDataFactory< DIM, TYPE >, SAMRAI::pdat::NodeDataFactory< DIM, TYPE >, SAMRAI::pdat::OuteredgeDataFactory< DIM, TYPE >, SAMRAI::pdat::OuterfaceDataFactory< DIM, TYPE >, SAMRAI::pdat::OuternodeDataFactory< DIM, TYPE >, SAMRAI::pdat::OutersideDataFactory< DIM, TYPE >, and SAMRAI::pdat::SideDataFactory< DIM, TYPE >.

template<int DIM>
virtual tbox::Pointer< PatchData<DIM> > SAMRAI::hier::PatchDataFactory< DIM >::allocate const Box< DIM > &  box,
tbox::Pointer< tbox::Arena pool = (tbox::Arena *) NULL
const [pure virtual]
 

Abstract virtual function to allocate a concrete patch data object. The default information about the object (e.g., ghost cell width) is taken from the factory. If no memory pool is provided, then the allocation routine assumes some default memory pool.

template<int DIM>
virtual tbox::Pointer< BoxGeometry<DIM> > SAMRAI::hier::PatchDataFactory< DIM >::getBoxGeometry const Box< DIM > &  box  )  const [pure virtual]
 

Abstract virtual function to allocate a concrete box geometry object. The box geometry object will be used in the calculation of box intersections for the computation of data dependencies.

template<int DIM>
virtual const IntVector<DIM>& SAMRAI::hier::PatchDataFactory< DIM >::getDefaultGhostCellWidth  )  const [pure virtual]
 

Get the default ghost cell width. This is the ghost cell width that will be used in the instantiation of concrete patch data instances.

Implemented in SAMRAI::pdat::CellDataFactory< DIM, TYPE >, SAMRAI::pdat::EdgeDataFactory< DIM, TYPE >, SAMRAI::pdat::FaceDataFactory< DIM, TYPE >, SAMRAI::pdat::IndexDataFactory< DIM, TYPE >, SAMRAI::pdat::NodeDataFactory< DIM, TYPE >, SAMRAI::pdat::OuteredgeDataFactory< DIM, TYPE >, SAMRAI::pdat::OuterfaceDataFactory< DIM, TYPE >, SAMRAI::pdat::OuternodeDataFactory< DIM, TYPE >, SAMRAI::pdat::OutersideDataFactory< DIM, TYPE >, and SAMRAI::pdat::SideDataFactory< DIM, TYPE >.

template<int DIM>
virtual void SAMRAI::hier::PatchDataFactory< DIM >::setDefaultGhostCellWidth const IntVector< DIM > &  ghosts  )  [pure virtual]
 

Set the default ghost cell width for concrete classes created from the factory.

template<int DIM>
virtual size_t SAMRAI::hier::PatchDataFactory< DIM >::getSizeOfMemory const Box< DIM > &  box  )  const [pure virtual]
 

Abstract virtual function to compute the amount of memory needed to allocate for object data and to represent the object itself. This includes any dynamic storage, such as arrays, needed by the concrete patch data instance. Although the patch data subclass may choose not to allocate memory from the provided memory pool, it must not use more memory than requested here.

template<int DIM>
virtual bool SAMRAI::hier::PatchDataFactory< DIM >::fineBoundaryRepresentsVariable  )  const [pure virtual]
 

Return true if the fine data values represent the data quantity on coarse-fine interfaces if data lives on patch borders; false otherwise. The boolean return value is supplied by the concrete patch data factory subclass.

Implemented in SAMRAI::pdat::CellDataFactory< DIM, TYPE >, SAMRAI::pdat::EdgeDataFactory< DIM, TYPE >, SAMRAI::pdat::FaceDataFactory< DIM, TYPE >, SAMRAI::pdat::IndexDataFactory< DIM, TYPE >, SAMRAI::pdat::NodeDataFactory< DIM, TYPE >, SAMRAI::pdat::OuteredgeDataFactory< DIM, TYPE >, SAMRAI::pdat::OuterfaceDataFactory< DIM, TYPE >, SAMRAI::pdat::OuternodeDataFactory< DIM, TYPE >, SAMRAI::pdat::OutersideDataFactory< DIM, TYPE >, and SAMRAI::pdat::SideDataFactory< DIM, TYPE >.

template<int DIM>
virtual bool SAMRAI::hier::PatchDataFactory< DIM >::dataLivesOnPatchBorder  )  const [pure virtual]
 

Return true if the variable data lives on patch borders; false otherwise. The boolean return value is supplied by the concrete patch data factory subclass.

Implemented in SAMRAI::pdat::CellDataFactory< DIM, TYPE >, SAMRAI::pdat::EdgeDataFactory< DIM, TYPE >, SAMRAI::pdat::FaceDataFactory< DIM, TYPE >, SAMRAI::pdat::IndexDataFactory< DIM, TYPE >, SAMRAI::pdat::NodeDataFactory< DIM, TYPE >, SAMRAI::pdat::OuteredgeDataFactory< DIM, TYPE >, SAMRAI::pdat::OuterfaceDataFactory< DIM, TYPE >, SAMRAI::pdat::OuternodeDataFactory< DIM, TYPE >, SAMRAI::pdat::OutersideDataFactory< DIM, TYPE >, and SAMRAI::pdat::SideDataFactory< DIM, TYPE >.

template<int DIM>
virtual bool SAMRAI::hier::PatchDataFactory< DIM >::validCopyTo const tbox::Pointer< PatchDataFactory< DIM > > &  dst_pdf  )  const [pure virtual]
 

Abstract virtual function that returns whether the current PatchDataFactory can be copied to the supplied destination PatchDataFactory. Mechanisms to check for valid types are implemented in the patch data factory subclasses for particular datatypes.


The documentation for this class was generated from the following files:
Generated on Fri Dec 2 11:24:43 2005 for SAMRAI by  doxygen 1.4.2