Repository navigation
Buffa-Christiansen spaces and local operators on curvilinear meshes - #233
Open
PaulOlyslager wants to merge 4 commits into
Open
PaulOlyslager wants to merge 4 commits into
PaulOlyslager wants to merge 4 commits into
Conversation
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
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.
Summary
Buffa-Christiansen and dual Lagrange spaces on curvilinear meshes, and local operators between a curvilinear mesh and its barycentric refinement.
Changes
buffachristiansenon 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.buildhalfbcuses the corner indices (CompScienceMeshes.indices) instead of all interpolation nodes. The line-of-sight refinement (ibscaled=true) keeps the previous search.lagrangec0local indices accept anyAbstractSimplex{<:Any,2}; the dual and discontinuous Lagrange spaces work unchanged.quaddatafor triangles accepts curvilinear charts.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.assemble_local_refinedby!covers the mirror case (coarse test, fine trial, e.g. RT x BC), which used to go to the mixed path.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.elementstreenow 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
DoubleNumSauterQstrathas to be passed explicitly, as in the curvilinear examples.Tests
test_curvilinear_spaces.jlandtest_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.assemble_local_refinedby!and agree to about 1e-16.Dependency
This requires the companion CompScienceMeshes.jl PR (curvilinear barycentric refinement,
chartinparent, curvilinear intersection). The compat entryCompScienceMeshes = "1.1"needs raising to the release that includes it.🤖 Generated with Claude Code