Partition a 3-D mesh into element sets and extract one sub-mesh per set.
An element set is the collection of all global elements that share a set id
s(e) in {1, ..., nSets}, for example one set per material type. Each set is run by
its own DG model on its own Mesh3D, and a parent model (MultiSetModel3D) couples the
sets where they share faces. This module builds those sub-meshes.
Numbering. Global elements are numbered e = 1..nGlobalElem and rank r (0-based) owns
the contiguous range offsetElem(r+1)+1 .. offsetElem(r+2) of the global mesh. Within
set k, the set-global id of element e with s(e) = k is
g_k(e) = #{ e' <= e : s(e') = k },
i.e. set-global ids follow global element order. Each rank's elements of set k
therefore form one contiguous block of set-global ids, and every sub-mesh keeps the
global mesh's element ownership: no element changes rank.
Faces. A face between two elements of the same set stays an interior face of that
set's sub-mesh, with its neighbour renumbered to g_k. A face between elements of
different sets becomes an interface face of both sub-meshes:
with sideInfo(2) keeping the global side id. An interface face is never a physical
boundary; the parent model fills its exterior state. Domain boundary faces are copied
unchanged. Every sub-mesh keeps the global nUniqueSides and global side ids, because
the CPU halo exchange derives its message tags from them.
Mortars. A 2:1 or anisotropic mortar must lie entirely inside one set
(ValidateSetPartition). Mortars inside a set are copied with their element ids
renumbered to g_k, and the mortar index in sideInfo(1) is renumbered to the
sub-mesh's mortar tables.
Collectives. GatherSetOfElem is a collective over the global mesh's communicator, and
so is ExtractSubMesh (through the decomposition it builds). Every rank must call
them for every set, including sets in which it owns no elements. The other routines
are rank-local and return the same result on every rank.
Boundary-condition id that marks an interface face between two element sets in a
sub-mesh. It is not a physical boundary condition: the parent model writes the
exterior state on these faces. The value is outside the range of HOHQMesh boundary
indices and of the ids defined in SELF_Mesh.
Nodes of different colours represent the following:
Solid arrows point from a submodule to the (sub)module which it is
descended from. Dashed arrows point from a module or program unit to
modules which it uses. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Nodes of different colours represent the following:
Solid arrows point from a submodule to the (sub)module which it is
descended from. Dashed arrows point from a module or program unit to
modules which it uses. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.