Skip to content

Buffa-Christiansen spaces and local operators on curvilinear meshes - #233

Open
PaulOlyslager wants to merge 4 commits into
krcools:masterfrom
PaulOlyslager:feature/curvilinear-buffachristiansen
Open

PaulOlyslager wants to merge 4 commits into
krcools:masterfrom
PaulOlyslager:feature/curvilinear-buffachristiansen

Conversation

@PaulOlyslager

Copy link
Copy Markdown
Contributor

Summary

Buffa-Christiansen and dual Lagrange spaces on curvilinear meshes, and local operators between a curvilinear mesh and its barycentric refinement.

Changes

  • buffachristiansen on curvilinear meshes. The fine vertex on a coarse edge is now the corner closest to the center of the edge chart, because the curved midpoint does not lie on the straight segment between the end points. buildhalfbc uses the corner indices (CompScienceMeshes.indices) instead of all interpolation nodes. The line-of-sight refinement (ibscaled=true) keeps the previous search.
  • Lagrange spaces. lagrangec0 local indices accept any AbstractSimplex{<:Any,2}; the dual and discontinuous Lagrange spaces work unchanged.
  • Local operator quadrature. quaddata for triangles accepts curvilinear charts.
  • Local operators between a mesh and its refinement, in both directions:
    • assemble_local_refines! (fine test, coarse trial) maps a curved child's parameter domain into its parent's (chartinparent) instead of intersecting the cells geometrically.
    • The new assemble_local_refinedby! covers the mirror case (coarse test, fine trial, e.g. RT x BC), which used to go to the mixed path.
    • Both dispatch on the cell type through helper methods; flat cells take the previous path.
  • RT interpolate. The normal is computed from the tangents at the point, which is also right for curved charts and gives the same result as before for flat charts.
  • Mixed local assembly on curvilinear meshes (geometries from the same mesh family that are not related by refinement, e.g. spaces on a copy of the mesh), through the curvilinear intersection in CompScienceMeshes. elementstree now averages all nodes of a cell.

The default quadrature strategies of the integral operators are unchanged. The Wilton-based defaults are for flat triangles and stop with an assertion error on curvilinear meshes, so a strategy such as DoubleNumSauterQstrat has to be passed explicitly, as in the curvilinear examples.

Tests

  • New: test_curvilinear_spaces.jl and test_curvilinear_localops.jl. Both directions equal the flat matrices on an order-1 curvilinear mesh, are each other's (anti)transposes for orders 2 and 3, and agree with the mixed path.
  • On flat meshes (sphere, plate), the matrices of Identity, NCross, the Maxwell single and double layer and the Helmholtz single layer and hypersingular operator, on RT, BC and Lagrange spaces, are bitwise identical to master. The exception is coarse test x refined trial pairs, which now take assemble_local_refinedby! and agree to about 1e-16.
  • The full test suite passes.

Dependency

This requires the companion CompScienceMeshes.jl PR (curvilinear barycentric refinement, chartinparent, curvilinear intersection). The compat entry CompScienceMeshes = "1.1" needs raising to the release that includes it.

🤖 Generated with Claude Code

PaulOlyslager and others added 4 commits November 23, 2026 10:29
buffachristiansen on a curvilinear mesh (with the curvilinear barycentric
refinement of CompScienceMeshes):
- the fine vertex the refinement inserts on a coarse edge was found by testing
  for points on the straight segment between the edge's end points, which a
  curved edge's midpoint is not. It is now the corner of the fine cells around
  the edge closest to the center of the edge's chart (the exact position for
  the barycentric refinement). The line-of-sight refinement (ibscaled=true)
  keeps the previous search.
- buildhalfbc took the local structure of the fine cells from `indices`, which
  for curvilinear cells lists all interpolation nodes: neighbours share O+1
  nodes instead of 2, and findfirst could return an edge node. It now uses the
  corner indices, CompScienceMeshes.indices(fine, cell).

lagrangec0 on curvilinear triangles: localindices for the global Lagrange
degrees of freedom of triangles dispatched on the flat Simplex only; it depends
on the polynomial order alone and now accepts any AbstractSimplex{<:Any,2}.
duallagrangec0d1, duallagrangecxd0 and lagrangecxd0 work unchanged.

On flat meshes all spaces are bitwise identical to before (raviartthomas,
buffachristiansen, lagrangec0d1, lagrangecxd0, duallagrangec0d1,
duallagrangecxd0 on a sphere, a cube and a torus, closed, and a plate and a
folded plate, open). New test test_curvilinear_spaces.jl: on a curvilinear
mesh of order 1 the spaces equal those of the flat mesh; for orders 2 and 3 the
numbers of functions agree, the BC functions live on the curved refinement,
and the dual constant functions keep unit integral.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VmP8j8Kddkr1XembbhG7UZ
quaddata for local operators on triangles accepts any AbstractSimplex{U,2},
the rule being one on the reference triangle.

The default strategies of the integral operators remain those for flat
triangles: on curvilinear meshes a strategy for curved charts, such as
DoubleNumSauterQstrat, is to be passed explicitly, as in the curvilinear
examples.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VmP8j8Kddkr1XembbhG7UZ
- assemble_local_refines! (the test geometry refines the trial geometry): a
  curved child cannot be intersected with or located in its parent
  geometrically. Its parametric domain is mapped into the parent's by
  CompScienceMeshes.chartinparent, and the trial functions on the parent are
  restricted to it exactly through restrict(..., dom2todom1); the test
  restriction is the identity. _assemble_testchild_interaction! dispatches
  on the type of the child cell; flat children take the previous path.
- assemble_local_refinedby! (new: the trial geometry refines the test
  geometry, as for RT x BC) is its mirror image, through
  _assemble_trialchild_interaction!. This case went to
  assemble_local_mixed!, which intersects cells geometrically and works for
  flat cells only.
- RT interpolation (interpolate): the normal is computed from the tangents at
  the point, which also holds for curved charts, whose tangents depend on
  the point. As before for flat charts it follows the vertex order: the
  stored normal of a flat chart from intersection can be flipped against it.

New test test_curvilinear_localops.jl: Identity and NCross between RT and BC
and Identity between constant and dual linear Lagrange spaces, in both
directions, equal the flat matrices on a curvilinear mesh of order 1, and
the two directions are each other's (anti)transposes for orders 2 and 3.

On flat meshes (sphere, plate) the matrices of Identity, NCross, the Maxwell
single and double layer and the Helmholtz single layer and hypersingular
operator on RT, BC and Lagrange spaces are bitwise identical to before,
except those with a coarse test and a refined trial space: these take
assemble_local_refinedby! and agree to rounding (relative difference about
1e-16).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VmP8j8Kddkr1XembbhG7UZ
assemble_local_mixed! intersects the cells of the test and the trial
geometry, which CompScienceMeshes now does for curvilinear triangles that are
affine reparametrizations of one another: a cell and its children, also when
the spaces on the barycentric refinement are built on a copy of the mesh.
elementstree, which bounds the cells in the search for overlapping ones,
divided the sum of all the nodes of a cell by its number of corners; it now
takes their mean, which for flat cells is the same.

New testset in test_curvilinear_localops.jl: Identity and NCross between RT
and BC and Identity between constant and dual linear Lagrange spaces, with
the refined space on a copy of the mesh, equal the matrices of the
refinement paths for orders 2 and 3, in both directions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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