Helper for setting up a contiguous index for a given range of elements that are known by this processor. More...
#include <ElemIndexHelper.h>
Public Member Functions | |
ElemIndexHelper (libMesh::MeshBase &mesh, const std::string &extra_elem_integer_name) | |
Constructor. More... | |
void | initialize (const libMesh::SimpleRange< libMesh::MeshBase::element_iterator > elems) |
Initializes the indices in a contiguous manner for the given element range. More... | |
bool | hasIndex (const libMesh::Elem *elem) const |
Whether or not the element elem has an index set for it using this object. More... | |
libMesh::dof_id_type | getIndex (const libMesh::Elem *elem) const |
Get the index associated with the element elem . More... | |
libMesh::dof_id_type | maxIndex () const |
Gets the maximum index generated using this object. More... | |
Private Attributes | |
libMesh::MeshBase & | _mesh |
unsigned int | _extra_integer |
The extra elem integer that stores the index. More... | |
bool | _initialized |
Whether or not this object is initialized. More... | |
libMesh::dof_id_type | _max_index |
The max index generated. More... | |
Helper for setting up a contiguous index for a given range of elements that are known by this processor.
The contiguous index is useful for indexing into alternate data structures for each element without the need for a map.
The index is stored on each elem for quick access.
Definition at line 29 of file ElemIndexHelper.h.
ElemIndexHelper::ElemIndexHelper | ( | libMesh::MeshBase & | mesh, |
const std::string & | extra_elem_integer_name | ||
) |
Constructor.
mesh | The mesh that contains the elements that are to be index into. |
extra_elem_integer_name | A name for the extra element integer that will store the index. |
Make sure to call initialize() after construction!
Definition at line 14 of file ElemIndexHelper.C.
|
inline |
Get the index associated with the element elem
.
Definition at line 61 of file ElemIndexHelper.h.
Referenced by RayTracingStudy::internalSidesetSetup(), RayTracingStudy::nonPlanarSideSetup(), and RayTracingStudy::sideIsNonPlanar().
|
inline |
Whether or not the element elem
has an index set for it using this object.
Definition at line 50 of file ElemIndexHelper.h.
Referenced by getIndex().
void ElemIndexHelper::initialize | ( | const libMesh::SimpleRange< libMesh::MeshBase::element_iterator > | elems | ) |
Initializes the indices in a contiguous manner for the given element range.
Definition at line 21 of file ElemIndexHelper.C.
Referenced by RayTracingStudy::localElemIndexSetup().
|
inline |
Gets the maximum index generated using this object.
Useful for initializing data structures that will be indexed using the indices provided by this object.
Definition at line 73 of file ElemIndexHelper.h.
Referenced by RayTracingStudy::internalSidesetSetup(), and RayTracingStudy::nonPlanarSideSetup().
|
private |
The extra elem integer that stores the index.
Definition at line 79 of file ElemIndexHelper.h.
Referenced by ElemIndexHelper(), getIndex(), hasIndex(), and initialize().
|
private |
Whether or not this object is initialized.
Definition at line 81 of file ElemIndexHelper.h.
Referenced by hasIndex(), and initialize().
|
private |
The max index generated.
Definition at line 83 of file ElemIndexHelper.h.
Referenced by initialize(), and maxIndex().
|
private |
Definition at line 77 of file ElemIndexHelper.h.
Referenced by hasIndex(), and initialize().