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

SAMRAI::math::HierarchyDataOpsManager< DIM > Class Template Reference

#include <source/mathops/hierarchy/HierarchyDataOpsManager.h>

List of all members.

Public Member Functions

virtual tbox::Pointer< HierarchyDataOpsReal<
DIM, double > > 
getOperationsDouble (const tbox::Pointer< hier::Variable< DIM > > &variable, tbox::Pointer< hier::PatchHierarchy< DIM > > &hierarchy, bool get_unique=false)
 Return pointer to operation object for a double variable on the given hierarchy.
virtual tbox::Pointer< HierarchyDataOpsInteger<
DIM > > 
getOperationsInteger (const tbox::Pointer< hier::Variable< DIM > > &variable, tbox::Pointer< hier::PatchHierarchy< DIM > > &hierarchy, bool get_unique=false)
 Return pointer to operation object for a integer variable on the given hierarchy.

Static Public Member Functions

static HierarchyDataOpsManager<
DIM > * 
getManager ()
static void freeManager ()

Protected Member Functions

 HierarchyDataOpsManager ()
virtual ~HierarchyDataOpsManager ()
void registerSingletonSubclassInstance (HierarchyDataOpsManager< DIM > *subclass_instance)


Detailed Description

template<int DIM>
class SAMRAI::math::HierarchyDataOpsManager< DIM >

Class HierarchyDataOpsManager<DIM> is a Singleton class that serves as a single point of control for gaining access to operation objects which to treat patch data over multiple levels in an AMR hierarchy. Specifically, this manager returns a pointer to a hierarchy data operation object given a variable and a hierarchy. Currently, this manager class supports patch data operation objects for cell-, face-, and node-centered data of type double, float, integer and dcomplex. Although it may be used to manage data operations for multiple patch hierarchies, it supports only one data operations per variable centering and data type per hierarchy. The manager will create and return a default hierarchy operation object when queried for an operation object if the operation does not already exist. If a matching operation object exists and is known to the manager, that operation object will be returned. This manager class may be extended using class inheritance and implementing a manager subclass. So, for example, if more than one operation object per variable type is needed on a hierarchy, such inheritance should be used to add this capability to the manager.

Important note: This manager class is incomplete. Specifically, one cannot set an operation object to over-ride the default . This feature will be added in the near future.

Important note: If the manager must construct a new hierarchy data operation object, the range of levels used in the operation object must be set explicitly before the operations can be used.

See the Design Patterns book by Gamma {et al.} for more information about the singleton pattern.

See also:
math::HierarchyDataOpsComplex

math::HierarchyDataOpsInteger

math::HierarchyDataOpsReal


Constructor & Destructor Documentation

template<int DIM>
SAMRAI::math::HierarchyDataOpsManager< DIM >::HierarchyDataOpsManager  )  [protected]
 

The constructor for HierarchyDataOpsManager<DIM> is protected. Consistent with the definition of a Singleton class, only subclasses have access to the constructor for the class.

template<int DIM>
SAMRAI::math::HierarchyDataOpsManager< DIM >::~HierarchyDataOpsManager  )  [protected, virtual]
 

The destructor for HierarchyDataOpsManager<DIM> is protected. See the comments for the constructor.


Member Function Documentation

template<int DIM>
HierarchyDataOpsManager< DIM > * SAMRAI::math::HierarchyDataOpsManager< DIM >::getManager  )  [static]
 

Return a pointer to the single instance of the patch data operation manager. All access to the HierarchyDataOpsManager<DIM> object is through the getManager() function. For example, to obtain a pointer to a hierarchy data operation object appropriate for a variable of type double one makes the following call: HierarchyDataOpsManager<DIM>::getManager()->getOperationsDouble( var, hierarchy), where ``var'' is a pointer to the variable, and hierarchy is a pointer to the AMR hierarchy.

Note that when the manager is accessed for the first time, the Singleton instance is registered with the ShutdownRegistry class which destroys such objects at program completion. Thus, users of this class do not explicitly allocate or deallocate the Singleton instance.

template<int DIM>
void SAMRAI::math::HierarchyDataOpsManager< DIM >::freeManager  )  [static]
 

Deallocate the HierarchyDataOpsManager instance. It is not necessary to explicitly call freeManager() at program termination, since it is automatically called by the ShutdownRegistry class.

template<int DIM>
tbox::Pointer< HierarchyDataOpsReal< DIM, double > > SAMRAI::math::HierarchyDataOpsManager< DIM >::getOperationsDouble const tbox::Pointer< hier::Variable< DIM > > &  variable,
tbox::Pointer< hier::PatchHierarchy< DIM > > &  hierarchy,
bool  get_unique = false
[virtual]
 

Return pointer to operation object for a double variable on the given hierarchy.

Return pointer to operation object for a double variable on the given hierarchy.

If a unique operator object is not requested, and if one already exists for the hierarchy and variable specified, the existing one will be created and returned. Otherwise, a new one is created. Objects created created for unique requests will not be used later when an equivalent request is made.

Parameters:
variable  operation should correspond to this variable
hierarchy  operation should correspond to this hierarchy
get_unique  Whether a unique operator is requested

template<int DIM>
tbox::Pointer< HierarchyDataOpsInteger< DIM > > SAMRAI::math::HierarchyDataOpsManager< DIM >::getOperationsInteger const tbox::Pointer< hier::Variable< DIM > > &  variable,
tbox::Pointer< hier::PatchHierarchy< DIM > > &  hierarchy,
bool  get_unique = false
[virtual]
 

Return pointer to operation object for a integer variable on the given hierarchy.

Return pointer to operation object for an integer variable on the given hierarchy.

If a unique operator object is not requested, and if one already exists for the hierarchy and variable specified, the existing one will be created and returned. Otherwise, a new one is created. Objects created created for unique requests will not be used later when an equivalent request is made.

Parameters:
variable  operation should correspond to this variable
hierarchy  operation should correspond to this hierarchy
get_unique  Whether a unique operator is requested

template<int DIM>
void SAMRAI::math::HierarchyDataOpsManager< DIM >::registerSingletonSubclassInstance HierarchyDataOpsManager< DIM > *  subclass_instance  )  [protected]
 

Initialize Singleton instance with instance of subclass. This function is used to make the singleton object unique when inheriting from this base class.


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