Element-local primitives for h-refinement of 3-D hexahedral spectral element meshes.
These routines are deliberately free of the Mesh3D container, MPI, and GPU dependencies
so that the numerically and topologically delicate pieces - isoparametric child geometry
and refined-mesh connectivity - are pure, deterministic, and unit-testable in isolation.
The mesh-level driver (SELF_MeshRefinement_3D) assembles a Mesh3D_t from them. Direct
3-D analogue of SELF_RefinementPrimitives_2D.
Child ordering and octant convention
A parent hexahedron is split into eight children indexed 1..8, each covering one octant
of the parent reference cube [-1,1]^3 and attached to the parent corner of the same
index (SELF's CGNS corner order: counter-clockwise looking in -xi3, bottom then top):
child c covers xi1 in [ax-1,ax], xi2 in [ay-1,ay], xi3 in [az-1,az], with
(ax,ay,az) = (0,0,0),(1,0,0),(1,1,0),(0,1,0),(0,0,1),(1,0,1),(1,1,1),(0,1,1)
for c = 1..8 (0 = lower half, 1 = upper half per direction).
Local face numbering follows SELF: 1=Bottom, 2=South, 3=East, 4=North, 5=West, 6=Top.
A child's local face k that lies on the parent boundary lies on parent face k
(subdivision is orientation preserving), which is what makes the connectivity below
inherit the parent's neighbor/flip data directly.
Face quadrant convention
A parent face is split into four sub-faces ("quadrants") indexed in the face's trace
coordinates (SELF's BoundaryInterp convention: faces 1,6 -> (xi1,xi2); faces 2,4 ->
(xi1,xi3); faces 3,5 -> (xi2,xi3)) as q = kx + 2*(ky-1), where kx, ky in {1,2} are the
half-interval indices along the face's first and second coordinate.
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.
public subroutine RefineConnectivity(nElem, baseSideInfo, refSideInfo, nUniqueSidesRef)
Build the connectivity of a uniformly (2:1 in each direction) refined 3-D mesh from
its base connectivity. Every base element p is split into eight children (global id
8*(p-1)+c). The scheme is fully deterministic integer bookkeeping - no coordinate
hashing, no flip recomputation, no MPI:
public subroutine SubdivideNodeCoords(geomInterp, nGeo, parentCoords, childCoords)
Isoparametric subdivision of one element's geometry node coordinates into its eight
children. The parent geometry is the degree-nGeo Lagrange interpolant through
parentCoords (sampled at geomInterp's control points, i.e. the mesh geometry nodes);
each child node coordinate is that interpolant evaluated at the corresponding point
of the parent reference cube. Exact for any polynomial geometry of degree <= nGeo
and for any control-node type, so straight-sided and curved (isoparametric) elements
are both handled without approximation.