12#ifndef MFEM_SUBMESH_UTILS
13#define MFEM_SUBMESH_UTILS
16#include <unordered_map>
31 std::unordered_map<int, int>
idx;
40 int Get(
int i,
bool &new_index);
73 bool from_boundary =
false);
114template <class T, class RT = decltype(std::declval<T>().GetParent())>
117 RT parent = m.GetParent();
120 const T* next =
dynamic_cast<const T*
>(parent);
121 if (next ==
nullptr) {
return parent; }
122 else { parent = next->GetParent(); }
Abstract data type element.
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
From
Indicator from which part of the parent Mesh the SubMesh is created.
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,...
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.
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...
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 ...
RT GetRootParent(const T &m)
Identify the root parent of a given SubMesh.
Convenience object to create unique indices.
std::unordered_map< int, int > idx
int Get(int i, bool &new_index)
Returns the unique index from an index set.