Column operators on extruded meshes (Mesh3D%ExtrudedMesh).
An extruded mesh stacks nz = mesh%nLayers hexahedra above every surface element
e2 of a Mesh2D. Local element e3 = (e2-1)*nz + k is layer k of that column, k = 1 at
the bottom, and a column is never split across MPI ranks. Every element maps
so the lines of constant (xi,eta), the third index of SELF's interior arrays, are
vertical. The operators below act along those lines. They are local to a column,
so none of them communicates.
Notation. N is the polynomial degree, w_l (l = 0..N) the quadrature weights,
M = diag(w), D the nodal derivative matrix, D(row=i,col=m) = interp%dMatrix(m,i),
e_0 and e_N the unit vectors of the bottom (zeta = -1) and the top (zeta = 1) node,
and Z_zeta = dz/dzeta, the (z,zeta) entry dxds%interior(...,1,3,3) of the covariant
basis SEMHex stores at the solution nodes. A superscript (k) is the layer.
ColumnIntegral, volume to surface, in the unit of q times metres:
(C q)ij = sum w_l (Z_zeta)^(k)_ijl q^(k)_ijl .} sum_{l=0..N
Broadcast, surface to volume, unit unchanged:
(B Q)^(k)_ijl = Q_ij .
Because the Jacobian of an extruded element factors as J = J_2 Z_zeta at every node,
with J_2 the surface Jacobian, B is the adjoint of C,
VerticalSweepUp and VerticalSweepDown solve, on every vertical line of every element,
the one dimensional upwind DG problems of SELF-HPE's continuity equation and hydrostatic
relation. Upward, from a given bottom trace,
A q^(k) = r^(k) + M^{-1} e_0 q_in^(k) , A = D + M^{-1} e_0 e_0^T ,
q_in^(1) = qBottom , q_in^(k) = q^(k-1)_N ;
downward, from a given top trace,
At q^(k) = r^(k) - M^{-1} e_N q_in^(k) , At = D - M^{-1} e_N e_N^T ,
q_in^(nz) = qTop , q_in^(k) = q^(k+1)_0 .
The right hand side r is in reference scaling: the sweeps solve dq/dzeta = r in the
reference coordinate of each element, and they apply no metric factor. A caller that
solves a physical equation such as J2c dw/dzeta = -(horizontal terms) folds the metric
factors into r before the call. Since A 1 = M^{-1} e_0 and At 1 = -M^{-1} e_N, the
solution is the inflow value plus an element-local particular solution,
with A^{-1} and At^{-1} precomputed once in Init. The layers of a column are visited
in order, because each takes its inflow from the one before; columns, the nodes (i,j)
of a column and the variables are independent. By the summation-by-parts property
M D + D^T M = e_N e_N^T - e_0 e_0^T of Gauss-Lobatto nodes the two sweeps are adjoint:
with w from the upward sweep and p from the downward sweep, on every vertical line,
sum_k [ p^(k)T M r_w^(k) + w^(k)T M r_p^(k) ] = p_in^(nz) w^(nz)_N - p^(1)_0 w_in^(1) .
The sweeps need nodes at zeta = -1 and zeta = 1, so they require Gauss-Lobatto control
nodes. The column integral and the broadcast work with any quadrature.
Fields. Volume fields are Scalar3D, or any extension such as MappedScalar3D, on the
extruded mesh with nElem = nz*nColumns. Surface fields are Scalar2D, or any extension
such as MappedScalar2D, with nElem = nColumns, the same interpolant degree and the same
number of variables; surface element e2 is the column above the caller's surface
element e2. Only nodal values are touched, so neither field needs a geometry. On GPU
builds every operator works on the device copies (interior_gpu) and leaves the host
copies untouched.
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.
Inverts the n x n matrix a by Gauss-Jordan elimination with partial pivoting, in
double precision. Used once in Init for the (N+1) x (N+1) sweep matrices, which
are small and well enough conditioned for a direct solve; this follows the
routine of the same name in SELF_RefinementIndicator_3D_t.