Repository navigation
experimental/adrh: Lagrange spaces (P1, P2 simplices; Q1 cubes) with isoparametric geometry, regression over every space - #100
Merged
Merged
Conversation
… geometry; P2 regression against Proteus
spaces.h: a Space gives basis values and reference gradients at a reference point, the map
from a face's own coordinates to the element's, the outward reference normal scaled so that
n dS = |det J| J^{-T} n_ref d(eta) against the face quadrature weights, and the vertices of
each face. PointGeometry builds the isoparametric map from the same basis at every quadrature
point: Jacobian, |det|, inverse, physical gradients, the point, and the face normal and measure.
P1Simplex and P2Simplex (proteus's edge order: 2D (0,1),(1,2),(0,2); 3D (0,1),(1,2),(2,3),
(0,2),(1,3),(0,3)) in 2 and 3 dimensions.
engine.h: elementKernelSpace<Coefficients, Space>, the masked weak form with the basis and
Jacobian taken per quadrature point. boundary.h: exteriorFaceKernel takes the Space as a third
template parameter (default P1) and gets its geometry from the same map, so segments, triangles
and later quadrilaterals share one code path. The module dispatches on (nd, space) and exposes
basis_values for the driver's norms.
ad_regression.py: AD_SPACE=p1|p2; element dof coordinates come from the dof map's Lagrange
nodes, faces are picked by their vertices, Dirichlet rows by every Lagrange node on the plane.
Engine vs Proteus nodal solutions, 7 boundary modes x 2 spaces x 2 dimensions (28 runs): all
<= 2.0e-14 (P2) and <= 4.6e-14 (P1, unchanged through the generic kernel). P2 L2 rates
3.00 (2D) and 2.9-3.0 (3D).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…er every space spaces.h: Q1Cube<nS> on proteus's reference cube [-1, 1]^nS with ReferenceCube.nodeList's node order; faces k = 2 I + side with the other reference coordinates as the face's own, on [-1, 1]^(nS-1) like CubeGaussQuadrature(nS - 1). The trilinear map goes through the same PointGeometry as the simplices. The face diameter for the penalty, the longest distance between the face's vertices, includes the hexahedral face's diagonals, as proteus's computeGeometricInfo_hexahedron does. The module dispatches "q1" and exposes space_info (dofs, vertices, each face's vertices) and quadrature_geometry (points and |det J|) so the driver picks boundary faces by the space's face-vertex lists and computes norms with the engine's geometry for any space. ad_sine_n.py selects the Q1 space, CubeGaussQuadrature and a regular quadrilateral / hexahedral mesh for AD_SPACE=q1. Engine vs proteus nodal solutions, 7 boundary modes: Q1 2D (nn 9-65) <= 1.1e-14, 3D (nn 5-17) <= 1.2e-14, L2 rates 2.0; the P1 and P2 numbers are unchanged. 42 runs in all over the three spaces and two dimensions. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows #96 (merged). Nothing outside
experimental/adrh/changes. This is the "all finite-element spaces" item of the engine decisions, for the Lagrange spaces Proteus's regular meshes offer.spaces.h: a Space gives basis values and reference gradients at a reference point, the map from a face's own coordinates to the element's, each face's outward reference normal (scaled son dS = |det J| J^{-T} n_ref d(eta)against the face quadrature weights) and each face's vertices.PointGeometrybuilds the isoparametric map from the same basis at every quadrature point: Jacobian, inverse,|det|, physical gradients, the point, the face normal and measure.P1Simplex,P2Simplex(Proteus's edge order) andQ1Cube(Proteus's reference cube[-1,1]^dand node order), each in 2 and 3 dimensions.engine.h:elementKernelSpace<Coefficients, Space>, the masked weak form ofmasked.hwith basis and Jacobian per point.boundary.h:exteriorFaceKerneltakes the Space as a third template parameter (default P1), so segments, triangles, quadrilateral edges and hexahedral faces share one code path; the penalty'shis the longest distance between the face's vertices, which for hexahedra includes the diagonals as Proteus'scomputeGeometricInfo_hexahedrondoes.(nd, space)and exposesspace_info,basis_valuesandquadrature_geometryfor the driver's face selection and norms.ad_regression.pytakesAD_SPACE=p1|p2|q1; element DOF coordinates come from the dof map's Lagrange nodes, Dirichlet rows are every Lagrange node on the plane, boundary faces are picked by the space's face-vertex lists.Engine vs Proteus nodal solutions, all seven boundary modes (strong, mixed, inflow, robin, iipg, nipg, sipg) per space and dimension, 42 runs:
P1 through the generic kernel reproduces the previous kernel's numbers exactly. Design note
ADRH_ENGINE_DESIGN.mdsection 17 (beside the campaign notes, not in this repo).🤖 Generated with Claude Code