MFEM  v4.5.2
Finite element discretization library
Classes | Functions
mfem::SubMeshUtils Namespace Reference

Classes

struct  UniqueIndexGenerator
 Convenience object to create unique indices. More...
 

Functions

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 of attributes. More...
 
std::tuple< Array< int >, Array< int > > AddElementsToMesh (const Mesh &parent, Mesh &mesh, const Array< int > &attributes, bool from_boundary=false)
 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. More...
 
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. More...
 
Array< int > BuildFaceMap (const Mesh &parent, const Mesh &mesh, const Array< int > &parent_element_ids)
 Given two meshes that have a parent to SubMesh relationship create a face map, using a SubMesh to parent Mesh element id map. More...
 
template<class T , class RT = decltype(std::declval<T>().GetParent())>
RT GetRootParent (const T &m)
 Identify the root parent of a given SubMesh. More...
 

Function Documentation

◆ AddElementsToMesh()

std::tuple< Array< int >, Array< int > > mfem::SubMeshUtils::AddElementsToMesh ( const Mesh parent,
Mesh mesh,
const Array< int > &  attributes,
bool  from_boundary = false 
)

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.

It also returns a tuple containing first the parent vertex ids (mapping from mesh vertex ids (index of the array), to the parent vertex ids) and second the parent element ids (mapping from submesh element ids (index of the array), to the parent element ids)

Note
Works with ParMesh.
Parameters
parentThe Mesh where the elements are "extracted" from.
meshThe Mesh where the elements are extracted to.
attributesThe attributes of the desired elements.
from_boundaryIndication if the desired elements come from the boundary of the parent.

Definition at line 47 of file submesh_utils.cpp.

◆ BuildFaceMap()

Array< int > mfem::SubMeshUtils::BuildFaceMap ( const Mesh parent,
const Mesh mesh,
const Array< int > &  parent_element_ids 
)

Given two meshes that have a parent to SubMesh relationship create a face map, using a SubMesh to parent Mesh element id map.

Parameters
parentThe parent Mesh.
meshThe Mesh to match its parents faces.
parent_element_idsThe Mesh element to parent element id map.

Definition at line 180 of file submesh_utils.cpp.

◆ BuildVdofToVdofMap()

void mfem::SubMeshUtils::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.

Given two FiniteElementSpace objects and the map parent_element_ids, which maps the element ids of the subfes to elements on the parentfes (or boundary elements depending on the type of transfer, volume or surface), create a vdof to vdof map.

This map is entirely serial and has no knowledge about parallel groups.

Parameters
[in]subfes
[in]parentfes
[in]from
[in]parent_element_ids
[out]vdof_to_vdof_map

Definition at line 89 of file submesh_utils.cpp.

◆ ElementHasAttribute()

bool mfem::SubMeshUtils::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 of attributes.

Parameters
elThe element
attributesThe attributes

Definition at line 34 of file submesh_utils.cpp.

◆ GetRootParent()

template<class T , class RT = decltype(std::declval<T>().GetParent())>
RT mfem::SubMeshUtils::GetRootParent ( const T &  m)

Identify the root parent of a given SubMesh.

Template Parameters
TThe type of the input object which has to fulfill the SubMesh::GetParent() interface.

Definition at line 115 of file submesh_utils.hpp.