Element-local primitives for h-refinement of 2-D quadrilateral spectral element meshes
(AMR Stage 2). These routines are deliberately free of the Mesh2D 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_2D) assembles a Mesh2D_t from them.
Child ordering and quadrant convention
A parent quadrilateral is split into four children indexed 1..4, each covering one quadrant
of the parent reference square [-1,1]^2 and attached to the parent corner of the same index
(SELF's CGNS corner order):
with (ax,ay) = (0,0),(1,0),(1,1),(0,1) for c = 1,2,3,4 (0 = lower/left half, 1 = upper/right).
Local side numbering follows SELF: 1=South, 2=East, 3=North, 4=West. A child's local side k
that lies on the parent boundary lies on parent side k (subdivision is orientation
preserving), which is what makes the connectivity below inherit the parent's neighbor/flip
data directly.
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, baseCorner, nodeOffset, nUniqueSidesBase, refSideInfo, refCorner, nUniqueSidesRef)
Build the connectivity of a uniformly (2:1 in each direction) refined 2-D mesh from its
base connectivity. Every base element p is split into four children (global id
4*(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 four
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 square. 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.