IBAMR  IBAMR version 0.19.
Classes | Public Member Functions | List of all members
IBTK::SAMRAIDataCache Class Reference

Class SAMRAIDataCache is a utility class for caching cloned SAMRAI patch data. Patch data are allocated as needed and should not be deallocated by the caller.

#include <ibtk/SAMRAIDataCache.h>

Inheritance diagram for IBTK::SAMRAIDataCache:
Inheritance graph
[legend]

Classes

class  CachedPatchDataIndex
 Class for accessing cached patch data indices. More...
 

Public Member Functions

 SAMRAIDataCache ()=default
 Default constructor. More...
 
 ~SAMRAIDataCache ()
 Destructor. More...
 

Methods to set the hierarchy and range of levels.

using key_type = std::tuple< std::type_index, int, int >
 Key type for looking up cached data. More...
 
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > d_hierarchy
 The patch hierarchy under consideration. More...
 
int d_coarsest_ln = IBTK::invalid_level_number
 Coarsest level of allocated patch data. More...
 
int d_finest_ln = IBTK::invalid_level_number
 Coarsest level of allocated patch data. More...
 
std::multimap< key_type, intd_available_data_idx_map
 Mappings from data type to registered patch data indices. More...
 
std::multimap< key_type, intd_unavailable_data_idx_map
 
std::set< intd_all_cloned_patch_data_idxs
 Set of all patch data indices cloned by this object. More...
 
void setPatchHierarchy (SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy)
 Set the patch hierarchy to use in allocating patch data. More...
 
void resetLevels (int coarsest_ln, int finest_ln)
 Reset the range of patch levels over which operations occur. More...
 
int getCoarsestLevelNumber () const
 
int getFinestLevelNumber () const
 
CachedPatchDataIndex getCachedPatchDataIndex (int idx)
 Gets the cached patch data index. More...
 
int lookupCachedPatchDataIndex (int idx)
 Lookup the cached patch data index. More...
 
void restoreCachedPatchDataIndex (int cached_idx)
 Restore the cached patch data index, to allow other to use the corresponding data. More...
 
 SAMRAIDataCache (const SAMRAIDataCache &from)=delete
 Disable the copy constructor. More...
 
SAMRAIDataCacheoperator= (const SAMRAIDataCache &that)=delete
 Disable the assignment operator. More...
 
static key_type construct_data_descriptor (int idx)
 Construct the data descriptor for a given variable and patch data index. More...
 

Member Typedef Documentation

◆ key_type

using IBTK::SAMRAIDataCache::key_type = std::tuple<std::type_index, int, int>
private

Constructor & Destructor Documentation

◆ SAMRAIDataCache() [1/2]

IBTK::SAMRAIDataCache::SAMRAIDataCache ( )
default

◆ ~SAMRAIDataCache()

IBTK::SAMRAIDataCache::~SAMRAIDataCache ( )

◆ SAMRAIDataCache() [2/2]

IBTK::SAMRAIDataCache::SAMRAIDataCache ( const SAMRAIDataCache from)
privatedelete

Member Function Documentation

◆ setPatchHierarchy()

void IBTK::SAMRAIDataCache::setPatchHierarchy ( SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  hierarchy)
Parameters
[in]hierarchyThe patch hierarchy

◆ resetLevels()

void IBTK::SAMRAIDataCache::resetLevels ( int  coarsest_ln,
int  finest_ln 
)
Parameters
[in]coarsest_lnThe coarsest level number
[in]finest_lnThe finest level number

◆ getCoarsestLevelNumber()

int IBTK::SAMRAIDataCache::getCoarsestLevelNumber ( ) const

Return the coarsest patch level for which scratch data is allocated.

◆ getFinestLevelNumber()

int IBTK::SAMRAIDataCache::getFinestLevelNumber ( ) const

Return the finest patch level for which scratch data is allocated.

◆ getCachedPatchDataIndex()

CachedPatchDataIndex IBTK::SAMRAIDataCache::getCachedPatchDataIndex ( int  idx)
inline
Parameters
[in]idxThe patch data index clone or lookup.
Returns
The cached patch data index.

◆ lookupCachedPatchDataIndex()

int IBTK::SAMRAIDataCache::lookupCachedPatchDataIndex ( int  idx)
private
Parameters
[in]idxThe patch data index clone or lookup.
Returns
The cached patch data index.
Note
Patch data indices should be restored to the caching object via restoreCachedPatchDataIndex().

◆ restoreCachedPatchDataIndex()

void IBTK::SAMRAIDataCache::restoreCachedPatchDataIndex ( int  cached_idx)
private
Parameters
[in]cached_idxThe cached index
Note
cached_idx must have been obtained via getCachedPatchDataIndex().

◆ operator=()

SAMRAIDataCache& IBTK::SAMRAIDataCache::operator= ( const SAMRAIDataCache that)
privatedelete

◆ construct_data_descriptor()

static key_type IBTK::SAMRAIDataCache::construct_data_descriptor ( int  idx)
staticprivate

Member Data Documentation

◆ d_hierarchy

SAMRAI::tbox::Pointer<SAMRAI::hier::PatchHierarchy<NDIM> > IBTK::SAMRAIDataCache::d_hierarchy
private

◆ d_coarsest_ln

int IBTK::SAMRAIDataCache::d_coarsest_ln = IBTK::invalid_level_number
private

◆ d_finest_ln

int IBTK::SAMRAIDataCache::d_finest_ln = IBTK::invalid_level_number
private

◆ d_available_data_idx_map

std::multimap<key_type, int> IBTK::SAMRAIDataCache::d_available_data_idx_map
private

◆ d_unavailable_data_idx_map

std::multimap<key_type, int> IBTK::SAMRAIDataCache::d_unavailable_data_idx_map
private

◆ d_all_cloned_patch_data_idxs

std::set<int> IBTK::SAMRAIDataCache::d_all_cloned_patch_data_idxs
private

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