IBAMR  IBAMR version 0.19.
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
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 <LocallyActiveVariableDatabase.h>

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

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=NULL) const
 
void allocateAllPatchData (double timestamp=0.0, tbox::Pointer< tbox::Arena > pool=NULL) const
 
void allocateAllPatchData (const PatchNumber &patch_number, double timestamp=0.0, tbox::Pointer< tbox::Arena > pool=NULL) 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
 

Private Attributes

tbox::Pointer< hier::PatchLevel< DIM > > d_patch_level
 
int d_number_patches
 
tbox::Array< tbox::Pointer< hier::ComponentSelector > > d_active_patch_data
 

Friends

class LocallyActiveDataPatchLevelIterator< DIM >
 

Detailed Description

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

See also
hier::PatchLevel
hier::ComponentSelector
hier::LocallyActiveDataPatchLevelIterator

Member Typedef Documentation

◆ 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

◆ LocallyActiveDataPatchLevelManager() [1/3]

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.

◆ LocallyActiveDataPatchLevelManager() [2/3]

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

Parameters
levelconst reference to patch level.

◆ LocallyActiveDataPatchLevelManager() [3/3]

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

Parameters
levelconst pointer to patch level.

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

◆ ~LocallyActiveDataPatchLevelManager()

Destructor for LocallyActiveDataPatchLevelManager class frees internal storage.

Member Function Documentation

◆ getIterator() [1/2]

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

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_idconst 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).

◆ getIterator() [2/2]

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

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
variablepointer 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
variableconst smart pointer to variable.

◆ getPatchLevel()

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

Return pointer to patch level associated with this manager object.

◆ checkLevel() [1/3]

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

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

Parameters
levelconst reference to level.

◆ checkLevel() [2/3]

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

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

Parameters
levelconst smart pointer to level.

◆ checkLevel() [3/3]

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

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

Parameters
levelconst pointer to level.

◆ reset() [1/2]

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
levelconst reference to patch level.

◆ reset() [2/2]

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
levelconst smart pointer to patch level.

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

◆ getPatchDataActive()

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

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_idconst reference to PatchDataId type indicating the patch data index of interest.
patch_numberconst 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).

◆ getAllPatchDataActive()

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

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

Parameters
patch_numberconst 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.

◆ setPatchDataActive() [1/3]

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

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

Parameters
patch_data_idconst reference to PatchDataId type indicating the patch data index of interest.
patch_numberconst 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).

◆ setPatchDataActive() [2/3]

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

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_indicesconst reference to component selector containing active/inactive patch data index information.
patch_numberconst 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.

◆ setAllPatchDataActive()

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

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

Parameters
patch_numberconst 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.

◆ setPatchDataActive() [3/3]

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

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_indicesconst 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.

◆ setPatchDataInactive()

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

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

Parameters
patch_data_idconst reference to PatchDataId type indicating the patch data index of interest.
patch_numberconst 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).

◆ setAllPatchDataInactive() [1/2]

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

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

Parameters
patch_numberconst 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.

◆ setAllPatchDataInactive() [2/2]

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

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.

◆ clearAllActiveDataInfo()

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

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.

◆ checkAllocated()

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_idconst 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).

◆ allocatePatchData()

template<int DIM>
void SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::allocatePatchData ( const PatchDataId patch_data_id,
double  timestamp = 0.0,
tbox::Pointer< tbox::Arena pool = NULL 
) 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_idconst reference to PatchDataId type indicating the patch data index of interest.
timestampoptional double data timestamp.
pooloptional 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).

◆ allocateAllPatchData() [1/2]

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

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
timestampoptional double data timestamp.
pooloptional 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.

◆ allocateAllPatchData() [2/2]

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

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

Parameters
patch_numberconst reference to PatchNumber type indicating the number of the patch of interest.
timestampoptional double data timestamp.
pooloptional 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.

◆ deallocatePatchData()

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_idconst 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).

◆ deallocateAllPatchData() [1/2]

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

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.

◆ deallocateAllPatchData() [2/2]

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

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

Parameters
patch_numberconst 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.

◆ printClassData()

template<int DIM>
virtual 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
osoptional reference to output stream (default is plog).

Friends And Related Function Documentation

◆ LocallyActiveDataPatchLevelIterator< DIM >

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

Member Data Documentation

◆ d_patch_level

template<int DIM>
tbox::Pointer< hier::PatchLevel<DIM> > SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::d_patch_level
private

◆ d_number_patches

template<int DIM>
int SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::d_number_patches
private

◆ d_active_patch_data

template<int DIM>
tbox::Array< tbox::Pointer< hier::ComponentSelector > > SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >::d_active_patch_data
private

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