Conservative transfer 3D - #350
Draft
jacobmerson wants to merge 4 commits into
Draft
Conversation
Factor the repeated mesh construction, function-space creation, field
sampling and evaluation boilerplate out of the individual test
translation units and into field_test_utils.h:
- BuildUnitSquare / MakeP1Space / MakeP0Space for the unit-square
simplex meshes used across the transfer and evaluation tests
- IntegrateP0Field / IntegrateP1Field for conservation checks
- EvaluateAndAssemble for the sample-then-assemble pattern shared by
the linear form integrator tests
- StandardOutsideCoords2D for out-of-bounds policy tests
SetField now dispatches on the arity of the supplied callable so the
same helper covers 2D and 3D layouts, and it samples the layout's DOF
coordinates directly instead of copying them into a fixed-rank view.
The evaluation helpers use rank-2 output views through MakeRank2View
rather than hand-built Rank2Views over rank-1 storage.
No behavioral change to the tests themselves.
Generalize the intersection-based and Monte Carlo transfer machinery
from 2D triangles to linear simplices in both 2D and 3D:
- get_vert_coords_of_elem and adjBasedIntersectSearch are templated on
the spatial dimension and gather Dim+1 vertices per element
- the form integrator utilities compute reference-element mappings,
barycentric coordinates and quadrature on triangles or tetrahedra
- MassMatrixIntegrator sizes its element blocks from
FieldElement::MeshEntDim + 1 rather than a hard coded 3, and
integrates against the unsigned volume element so tets with negative
orientation contribute positively
- the MC RHS integrator carries the number of barycentric DOFs per
sample instead of assuming 3
The BFS ring buffers in queue_visited.hpp are enlarged for 3D, where a
target tet can overlap many more source elements than a triangle, and
their capacities are now exposed as the PCMS_INTERSECTION_QUEUE_SIZE and
PCMS_INTERSECTION_TRACK_SIZE cache variables so device builds can lower
the per-thread stack footprint.
Cover the tetrahedral paths added to the transfer machinery:
- test_omega_h_3d_conservative_projection.cpp exercises conservative
L2 projection between 3D tet meshes and checks that the integral of
the field is preserved
- test_omega_h_form_integrator_utils.cpp unit tests the reference
mapping and barycentric helpers in 2D and 3D
- test_intersections.cpp is updated for the dimension-templated
intersection search
Both new tests use the shared helpers in field_test_utils.h.
jacobmerson
force-pushed
the
conservative-transfer-3D
branch
from
August 6, 2026 14:28
835fffc to
c1dbc2a
Compare
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.
No description provided.