IBAMR  IBAMR version 0.19.
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
IBTK::SubdomainToPatchLevelTranslation Class Reference

#include <ibtk/FEDataManager.h>

Public Member Functions

 SubdomainToPatchLevelTranslation (const int max_level_number, const std::set< libMesh::subdomain_id_type > &subdomain_ids, const SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > &input_db)
 
const intoperator[] (const libMesh::subdomain_id_type id) const
 
bool levelHasElements (const int level_number) const
 

Private Member Functions

intget (const libMesh::subdomain_id_type id)
 

Private Attributes

int d_max_level_number = IBTK::invalid_level_number
 
std::array< int, fixed_array_sized_fixed
 
std::map< libMesh::subdomain_id_type, intd_map
 

Static Private Attributes

static constexpr int fixed_array_size = 1024
 

Detailed Description

Class that can translate libMesh subdomain IDs into patch level numbers.

The primary use of this class is multilevel IBFE - i.e., enabling a finite element mesh to interact with multiple patch levels.

Constructor & Destructor Documentation

◆ SubdomainToPatchLevelTranslation()

IBTK::SubdomainToPatchLevelTranslation::SubdomainToPatchLevelTranslation ( const int  max_level_number,
const std::set< libMesh::subdomain_id_type > &  subdomain_ids,
const SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > &  input_db 
)

Constructor. Takes as argument the maximum level number in the Cartesian grid patch hierarchy, a set of all subdomain ids (including those not on the current processor), and an input database enumerating the level-to-subdomain mapping, e.g.,

{
level_1 = 1, 2
level_2 = 3
}

Any unspecified subdomain ids will be assigned to the finest patch level. Duplicated assignments are not permitted.

Member Function Documentation

◆ operator[]()

const int& IBTK::SubdomainToPatchLevelTranslation::operator[] ( const libMesh::subdomain_id_type  id) const
inline

Given a libMesh subdomain id, return the patch level of the Cartesian grid hierarchy on which that subdomain id interacts.

◆ levelHasElements()

bool IBTK::SubdomainToPatchLevelTranslation::levelHasElements ( const int  level_number) const
inline

Return whether or not there are any elements on a given patch level.

◆ get()

int& IBTK::SubdomainToPatchLevelTranslation::get ( const libMesh::subdomain_id_type  id)
inlineprivate

like operator[], but returns a mutable reference. Used to set up the object.

Member Data Documentation

◆ d_max_level_number

int IBTK::SubdomainToPatchLevelTranslation::d_max_level_number = IBTK::invalid_level_number
private

Maximum level number.

◆ fixed_array_size

constexpr int IBTK::SubdomainToPatchLevelTranslation::fixed_array_size = 1024
staticconstexprprivate

Size of the fixed-size array.

◆ d_fixed

std::array<int, fixed_array_size> IBTK::SubdomainToPatchLevelTranslation::d_fixed
private

The overwhelming majority of subdomain IDs used with IBAMR come from block IDs set by ExodusII - these are numbered sequentially from zero. However, in principle, a subdomain ID could be any signed 64-bit integer so we cannot use a small fixed length array.

Since we look up element levels a lot optimize for the common case by using a fixed-length array and a map for everything else.

◆ d_map

std::map<libMesh::subdomain_id_type, int> IBTK::SubdomainToPatchLevelTranslation::d_map
private

The map used for everything else.


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