SubMesh

Represents a subset of a Mesh.

template <
  class Context>
class SubMesh;

Overview

A SubMesh is a mesh that represents a subset of another mesh, typically corresponding to a specific region or boundary. It maintains references to its parent mesh and provides mappings between polytope indices in the child and parent meshes.

Mapping Between SubMesh and Parent Mesh

A SubMesh object holds a reference to its parent Mesh and includes information about how polytopes and vertices are mapped between the child and parent. This allows finite element operations on the SubMesh to properly reference degrees of freedom in the parent mesh.

Downcasting

A Mesh that is also a SubMesh can be downcasted to access SubMesh functionality. The following example uses that interface.

if (mesh.isSubMesh())
{
  // The cast is well defined
  auto& submesh = static_cast<SubMesh&>(mesh);
  const auto& parent = submesh.getParent();
}

Use Cases

  • Boundary condition application
  • Interface problem formulation
  • Region-specific operations
SpecializationDescription
Context::Local
Full specialization
template <>
class SubMesh<
  Context::Local> final;
SubMesh representing a subregion of a parent mesh.
Context::MPI
Full specialization
template <>
class SubMesh<
  Context::MPI> final;
SubMesh representing a distributed subregion of a parent MPI mesh.