12 #ifndef MFEM_SUBMESH_UTILS
13 #define MFEM_SUBMESH_UTILS
15 #include <type_traits>
16 #include <unordered_map>
18 #include "../../fem/fespace.hpp"
22 namespace SubMeshUtils
31 std::unordered_map<int, int>
idx;
40 int Get(
int i,
bool &new_index);
73 bool from_boundary =
false);
114 template <
class T,
class RT>
117 const RT* parent = m.GetParent();
120 const T* next =
dynamic_cast<const T*
>(parent);
123 return static_cast<const RT *
>(parent);
127 parent = next->GetParent();
std::unordered_map< int, int > idx
Convenience object to create unique indices.
void BuildVdofToVdofMap(const FiniteElementSpace &subfes, const FiniteElementSpace &parentfes, const SubMesh::From &from, const Array< int > &parent_element_ids, Array< int > &vdof_to_vdof_map)
Build the vdof to vdof mapping between two FiniteElementSpace objects.
const RT * GetRootParent(const T &m)
Identify the root parent of a given SubMesh.
int Get(int i, bool &new_index)
Returns the unique index from an index set.
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
std::tuple< Array< int >, Array< int > > AddElementsToMesh(const Mesh &parent, Mesh &mesh, const Array< int > &attributes, bool from_boundary)
Given a Mesh parent and another Mesh mesh using the list of attributes in attributes, this function adds matching elements with those attributes from parent to mesh.
Array< int > BuildFaceMap(const Mesh &pm, const Mesh &sm, const Array< int > &parent_element_ids)
Given two meshes that have a parent to SubMesh relationship create a face map, using a SubMesh to par...
From
Indicator from which part of the parent Mesh the SubMesh is created.
bool ElementHasAttribute(const Element &el, const Array< int > &attributes)
Given an element el and a list of attributes, determine if that element is in at least one attribute ...
Abstract data type element.