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>
template<int DIM>
class SAMRAI::hier::LocallyActiveDataPatchLevelManager< DIM >
- See also
- hier::PatchLevel
-
hier::ComponentSelector
-
hier::LocallyActiveDataPatchLevelIterator
◆ 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.
◆ 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]
◆ LocallyActiveDataPatchLevelManager() [3/3]
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.
◆ ~LocallyActiveDataPatchLevelManager()
◆ getIterator() [1/2]
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).
◆ getIterator() [2/2]
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. |
◆ getPatchLevel()
Return pointer to patch level associated with this manager object.
◆ checkLevel() [1/3]
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. |
◆ checkLevel() [2/3]
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. |
◆ checkLevel() [3/3]
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. |
◆ reset() [1/2]
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. |
◆ reset() [2/2]
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.
◆ getPatchDataActive()
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).
◆ getAllPatchDataActive()
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.
◆ setPatchDataActive() [1/3]
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).
◆ setPatchDataActive() [2/3]
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.
◆ setAllPatchDataActive()
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.
◆ setPatchDataActive() [3/3]
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.
◆ setPatchDataInactive()
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).
◆ setAllPatchDataInactive() [1/2]
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.
◆ setAllPatchDataInactive() [2/2]
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()
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()
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).
◆ allocatePatchData()
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).
◆ allocateAllPatchData() [1/2]
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.
◆ allocateAllPatchData() [2/2]
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.
◆ deallocatePatchData()
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).
◆ deallocateAllPatchData() [1/2]
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]
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.
◆ printClassData()
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). |
◆ LocallyActiveDataPatchLevelIterator< DIM >
◆ d_patch_level
◆ d_number_patches
◆ d_active_patch_data
The documentation for this class was generated from the following file: