Skip to content

Conservative transfer 3D - #350

Draft
jacobmerson wants to merge 4 commits into
SCOREC:developfrom
jacobmerson:conservative-transfer-3D
Draft

Conservative transfer 3D#350
jacobmerson wants to merge 4 commits into
SCOREC:developfrom
jacobmerson:conservative-transfer-3D

Conversation

@jacobmerson

Copy link
Copy Markdown
Collaborator

No description provided.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant