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

Class LocallyActiveDataPatchLevelManager is a utility class for managing data on a patch level where each data item may be defined on a different set of patches; i.e., the data is "locally-active". A separate object of this class is needed for each patch level on which locally-active data is defined. Typical usage involves constructing an instance of this class with a patch level and then defining the active patches for each patch data integer identifier. Then, this class supports various patch level operations asscociated with the locally-active data, such as allocation and deallocation of data and iteration over patches for which a particular data id is active. More...

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

List of all members.

Public Types

typedef LocallyActiveDataPatchLevelIterator<
DIM > 
Iterator

Public Member Functions

 LocallyActiveDataPatchLevelManager ()
 LocallyActiveDataPatchLevelManager (const hier::PatchLevel< DIM > &level)
 LocallyActiveDataPatchLevelManager (const tbox::Pointer< hier::PatchLevel< DIM > > level)
 ~LocallyActiveDataPatchLevelManager ()
Iterator getIterator (const PatchDataId &patch_data_id) const
Iterator getIterator (const tbox::Pointer< hier::Variable< DIM > > variable) const
tbox::Pointer< hier::PatchLevel<
DIM > > 
getPatchLevel () const
bool checkLevel (const hier::PatchLevel< DIM > &level) const
bool checkLevel (const tbox::Pointer< hier::PatchLevel< DIM > > level) const
bool checkLevel (const hier::PatchLevel< DIM > *level) const
void reset (const hier::PatchLevel< DIM > &level)
void reset (const tbox::Pointer< hier::PatchLevel< DIM > > level)
bool getPatchDataActive (const PatchDataId &patch_data_id, const PatchNumber &patch_number) const
const hier::ComponentSelectorgetAllPatchDataActive (const PatchNumber &patch_number) const
void setPatchDataActive (const PatchDataId &patch_data_id, const PatchNumber &patch_number)
void setPatchDataActive (const hier::ComponentSelector &active_indices, const PatchNumber &patch_number)
void setAllPatchDataActive (const PatchNumber &patch_number)
void setPatchDataActive (const hier::ComponentSelector &active_indices)
void setPatchDataInactive (const PatchDataId &patch_data_id, const PatchNumber &patch_number)
void setAllPatchDataInactive (const PatchNumber &patch_number)
void setAllPatchDataInactive ()
void clearAllActiveDataInfo ()
bool checkAllocated (const PatchDataId &patch_data_id) const
void allocatePatchData (const PatchDataId &patch_data_id, double timestamp=0.0, tbox::Pointer< tbox::Arena > pool=0) const
void allocateAllPatchData (double timestamp=0.0, tbox::Pointer< tbox::Arena > pool=0) const
void allocateAllPatchData (const PatchNumber &patch_number, double timestamp=0.0, tbox::Pointer< tbox::Arena > pool=0) const
void deallocatePatchData (const PatchDataId &patch_data_id) const
void deallocateAllPatchData () const
void deallocateAllPatchData (const PatchNumber &patch_number) const
virtual void printClassData (std::ostream &os=tbox::plog) const

Friends

class LocallyActiveDataPatchLevelIterator< DIM >


Detailed Description

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

Class LocallyActiveDataPatchLevelManager is a utility class for managing data on a patch level where each data item may be defined on a different set of patches; i.e., the data is "locally-active". A separate object of this class is needed for each patch level on which locally-active data is defined. Typical usage involves constructing an instance of this class with a patch level and then defining the active patches for each patch data integer identifier. Then, this class supports various patch level operations asscociated with the locally-active data, such as allocation and deallocation of data and iteration over patches for which a particular data id is active.

See also:
hier::PatchLevel

hier::ComponentSelector

hier::LocallyActiveDataPatchLevelIterator


Member Typedef Documentation

template<int DIM>
typedef LocallyActiveDataPatchLevelIterator<DIM> SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::Iterator

An iterator over patches on the patch level. The iterator will enumerate the patches that live on the local processor and on which a given patch data index is active (see constructor for LocallyActiveDataPatchLevelIterator).

Use iterator LocallyActiveDataPatchLevelManager::Iterator instead of LocallyActiveDataPatchLevelIterator<DIM>, since the iterator may be defined as a nested class in the future.


Constructor & Destructor Documentation

template<int DIM>
SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::LocallyActiveDataPatchLevelManager (  ) 

Default constructor for LocallyActiveDataPatchLevelManager class. The object state is invalid, hence the object cannot do anything useful, until it is set using the initialize() member function.

template<int DIM>
SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::LocallyActiveDataPatchLevelManager ( const hier::PatchLevel< DIM > &  level  ) 

Construct a new LocallyActiveDataPatchLevelManager object and initialize it based on the given patch level reference.

Parameters:
level const reference to patch level.

template<int DIM>
SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::LocallyActiveDataPatchLevelManager ( const tbox::Pointer< hier::PatchLevel< DIM > >  level  ) 

Construct a new LocallyActiveDataPatchLevelManager object and initialize it based on the given patch level pointer.

Parameters:
level const pointer to patch level.
When assertion checking is active, an assertion will result when the patch level pointer is null.

template<int DIM>
SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::~LocallyActiveDataPatchLevelManager (  ) 

Destructor for LocallyActiveDataPatchLevelManager class frees internal storage.


Member Function Documentation

template<int DIM>
LocallyActiveDataPatchLevelManager< DIM >::Iterator SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::getIterator ( const PatchDataId patch_data_id  )  const [inline]

Return an iterator that will enumerate the patches on the local processor and on which the given patch data index is active.

Returns:
iterator.
Parameters:
patch_data_id const reference to PatchDataId type indicating the patch data index of interest.
When assertion checking is active, an assertion will result when the manager has not been initialized with a level, or the patch data id is invalid (< 0).

template<int DIM>
LocallyActiveDataPatchLevelManager< DIM >::Iterator SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::getIterator ( const tbox::Pointer< hier::Variable< DIM > >  variable  )  const [inline]

Return an iterator that will enumerate the patches on the local processor and on which data for the given variable is active. Note that we assume that a variable is associated with only one patch data index.

Returns:
iterator.
Parameters:
variable pointer to variable.
When assertion checking is active, an assertion will result when the manager has not been initialized with a level, or if the variable is not registered with the locally-active variable database.

Parameters:
variable const smart pointer to variable.

template<int DIM>
tbox::Pointer< hier::PatchLevel< DIM > > SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::getPatchLevel (  )  const [inline]

Return pointer to patch level associated with this manager object.

template<int DIM>
bool SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::checkLevel ( const hier::PatchLevel< DIM > &  level  )  const [inline]

Return true if argument level is same as that with which this LocallyActiveDataPatchLevelManager object was initialized; otherwise return false.

Parameters:
level const reference to level.

template<int DIM>
bool SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::checkLevel ( const tbox::Pointer< hier::PatchLevel< DIM > >  level  )  const [inline]

Return true if argument level is same as that with which this LocallyActiveDataPatchLevelManager object was initialized; otherwise return false.

Parameters:
level const smart pointer to level.

template<int DIM>
bool SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::checkLevel ( const hier::PatchLevel< DIM > *  level  )  const [inline]

Return true if argument level is same as that with which this LocallyActiveDataPatchLevelManager object was initialized; otherwise return false.

Parameters:
level const pointer to level.

template<int DIM>
void SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::reset ( const hier::PatchLevel< DIM > &  level  ) 

Reset the state of the LocallyActiveDataPatchLevelManager object to that associated with the given level. If the object was previously initialized based on a different level, that information is destroyed. and replaced with information from the argument level. Note that, at that point, it is impossible to recover the manager state associated with the previous level via this object.

Parameters:
level const reference to patch level.

template<int DIM>
void SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::reset ( const tbox::Pointer< hier::PatchLevel< DIM > >  level  ) 

Initialize the state of the LocallyActiveDataPatchLevelManager object to that associated with the given level. If the object was previously initialized based on a different level, that information is destroyed. and replaced with information from the argument level. Note that, at that point, it is impossible to recover the manager state associated with the previous level via this object.

Parameters:
level const smart pointer to patch level.
When assertion checking is active, an assertion will result when the patch level pointer is null.

template<int DIM>
bool SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::getPatchDataActive ( const PatchDataId patch_data_id,
const PatchNumber patch_number 
) const [inline]

Check whether given patch data index is active on given patch and return boolean true if data is active on patch; false otherwise.

Parameters:
patch_data_id const reference to PatchDataId type indicating the patch data index of interest.
patch_number const reference to PatchNumber type indicating the number of the patch of interest.
When assertion checking is active, an assertion will result when the manager has not been initialized with a level, when the patch number is invalid for the level, or the data index is invalid (< 0).

template<int DIM>
const hier::ComponentSelector & SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::getAllPatchDataActive ( const PatchNumber patch_number  )  const [inline]

Return const reference to component selector indicating active/inactive patch data indices for given patch.

Parameters:
patch_number const reference to PatchNumber type indicating the number of the patch of interest.
When assertion checking is active, an assertion will result when the manager has not been initialized with a level, or when the patch number is invalid for the level.

template<int DIM>
void SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::setPatchDataActive ( const PatchDataId patch_data_id,
const PatchNumber patch_number 
) [inline]

Set specified patch data active on given patch. Note that this function does not allocate the corresponding patch data.

Parameters:
patch_data_id const reference to PatchDataId type indicating the patch data index of interest.
patch_number const reference to PatchNumber type indicating the number of the patch of interest.
When assertion checking is active, an assertion will result when the manager has not been initialized with a level, when the patch number is invalid for the level, or the data index is invalid (< 0).

template<int DIM>
void SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::setPatchDataActive ( const hier::ComponentSelector active_indices,
const PatchNumber patch_number 
) [inline]

Set patch data active/inactive for given patch based on component selector information. Note that this function does not allocate/deallocate the corresponding patch data.

Parameters:
active_indices const reference to component selector containing active/inactive patch data index information.
patch_number const reference to PatchNumber type indicating the number of the patch of interest.
When assertion checking is active, an assertion will result when the manager has not been initialized with a level or when the patch number is invalid for the level.

template<int DIM>
void SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::setAllPatchDataActive ( const PatchNumber patch_number  )  [inline]

Set all patch data active for given patch. Note that this function does not allocate the corresponding patch data.

Parameters:
patch_number const reference to PatchNumber type indicating the number of the patch of interest.
When assertion checking is active, an assertion will result when the manager has not been initialized with a level or when the patch number is invalid for the level.

template<int DIM>
void SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::setPatchDataActive ( const hier::ComponentSelector active_indices  )  [inline]

Set patch data active/inactive for all patches based on component selector information. Note that this function does not allocate/deallocate the corresponding patch data.

Parameters:
active_indices const reference to component selector containing active/inactive patch data index information.
When assertion checking is active, an assertion will result when the manager has not been initialized with a level.

template<int DIM>
void SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::setPatchDataInactive ( const PatchDataId patch_data_id,
const PatchNumber patch_number 
) [inline]

Set specified patch data inactive on given patch. Note that this function does not deallocate the corresponding patch data.

Parameters:
patch_data_id const reference to PatchDataId type indicating the patch data index of interest.
patch_number const reference to PatchNumber type indicating the number of the patch of interest.
When assertion checking is active, an assertion will result when the manager has not been initialized with a level, when the patch number is invalid for the level, or the data index is invalid (< 0).

template<int DIM>
void SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::setAllPatchDataInactive ( const PatchNumber patch_number  )  [inline]

Set all patch data inactive for given patch. Note that this function does not deallocate the corresponding patch data.

Parameters:
patch_number const reference to PatchNumber type indicating the number of the patch of interest.
When assertion checking is active, an assertion will result when the manager has not been initialized with a level or when the patch number is invalid for the level.

template<int DIM>
void SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::setAllPatchDataInactive (  )  [inline]

Set all patch data inactive for all patches. Note that this function does not deallocate any patch data.

When assertion checking is active, an assertion will result when the manager has not been initialized with a level.

template<int DIM>
void SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::clearAllActiveDataInfo (  )  [inline]

Clear all information from locally-active data patch level manager object, setting object state to that created by the default constructor.

Note that this function does not deallocate any patch data.

template<int DIM>
bool SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::checkAllocated ( const PatchDataId patch_data_id  )  const

Check if data corresponding to given index is allocated on all active patches on the level.

Returns:
bool true if data is allocated on all active patches; false otherwise. Note that if no patch is active for data, true is returned.
Parameters:
patch_data_id const reference to PatchDataId type indicating the patch data index of interest.
When assertion checking is active, an assertion will result when the manager has not been initialized with a level or when the data index is invalid (< 0).

template<int DIM>
void SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::allocatePatchData ( const PatchDataId patch_data_id,
double  timestamp = 0.0,
tbox::Pointer< tbox::Arena pool = 0 
) const

Allocate data for given patch data index on all level patches on which the data is active. Each allocated patch data object will be stamped with the given time value.

Parameters:
patch_data_id const reference to PatchDataId type indicating the patch data index of interest.
timestamp optional double data timestamp.
pool optional pointer to memory arena for data.
When assertion checking is active, an assertion will result when the manager has not been initialized with a level or when the data index is invalid (< 0).

template<int DIM>
void SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::allocateAllPatchData ( double  timestamp = 0.0,
tbox::Pointer< tbox::Arena pool = 0 
) const [inline]

Allocate all active patch data on all level patches associated with this manager object. Each allocated patch data object will be stamped with the given time value.

Parameters:
timestamp optional double data timestamp.
pool optional pointer to memory arena for data.
When assertion checking is active, an assertion will result when the manager has not been initialized with a level.

template<int DIM>
void SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::allocateAllPatchData ( const PatchNumber patch_number,
double  timestamp = 0.0,
tbox::Pointer< tbox::Arena pool = 0 
) const [inline]

Allocate all active patch data for given patch. Each allocated patch data object will be stamped with the given time value.

Parameters:
patch_number const reference to PatchNumber type indicating the number of the patch of interest.
timestamp optional double data timestamp.
pool optional pointer to memory arena for data.
When assertion checking is active, an assertion will result when the manager has not been initialized with a level or when the patch number is invalid for the level.

template<int DIM>
void SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::deallocatePatchData ( const PatchDataId patch_data_id  )  const

Deallocate data for given patch data index on all level patches on which the data is active. Note that the state of this manager object remains intact after this operation.

Parameters:
patch_data_id const reference to PatchDataId type indicating the patch data index of interest.
When assertion checking is active, an assertion will result when the manager has not been initialized with a level or when the data index is invalid (< 0).

template<int DIM>
void SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::deallocateAllPatchData (  )  const [inline]

Deallocate all active patch data on all level patches associated with this manager object. Note that the state of this manager object remains intact after this operation.

When assertion checking is active, an assertion will result when the manager has not been initialized with a level.

template<int DIM>
void SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::deallocateAllPatchData ( const PatchNumber patch_number  )  const [inline]

Deallocate all active patch data for given patch. Note that the state of this manager object remains intact after this operation.

Parameters:
patch_number const reference to PatchNumber type indicating the number of the patch of interest.
When assertion checking is active, an assertion will result when the manager has not been initialized with a level or when the patch number is invalid for the level.

template<int DIM>
void SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::printClassData ( std::ostream &  os = tbox::plog  )  const [virtual]

Print all active patch data information contained in the locally-active box set to the specified output stream.

Parameters:
os optional reference to output stream (default is plog).


Friends And Related Function Documentation

template<int DIM>
friend class LocallyActiveDataPatchLevelIterator< DIM > [friend]


The documentation for this class was generated from the following files:
Generated on Thu Jun 18 11:28:30 2009 for SAMRAI by  doxygen 1.5.1