Repository navigation
Bugfix: Curve dual support - #76
Merged
Merged
Conversation
The type for the tolerance came from the barycentric coordinates of the
point, which are empty for a cell of dimension zero, so eltype returned
Union{} and eps threw a MethodError.
Now take the type from the cell instead. The rest of the function
already treats a point cell correctly.
This makes inclosure_gpredicate usable on the boundary of a curve, which
is a mesh of nodes.
Refining a curve returned a plain Mesh, so refines reported false and callers pairing a dual space on the refinement with a primal space on the coarse curve silently fell back to conforming quadrature, which applies singular rules to overlapping segments. Build the refinement through the generic mesh interface so it also accepts a submesh, return a BarycentricRefinement as the surface and volume versions do, and add the parent override, since the generic one returns the child index rather than the parent cell.
Owner
|
Thanks. I'll bump and release once BEAST can handle these changes. |
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.
Fixes that were needed to build dual Lagrange spaces on one-dimensional meshes:
Fixes
isinclosureon a zero-dimensional simplex threw, becauseisinside.jltakesT=eltype(u)which isUnion{}for point cells, soeps(T)failed. In practice this means that no junction predicate could be built fromboundary(curve). Fix is usingcoordtype(cell)for the tolerance.barycentric_refinementon a curve returns a plainMeshand has no method for a one-dimensionalSubMesh. The result is not tagged as a refinement, sorefines(barycentric_refinement(curve),curve)is false, and hence downstream code cannot tell that the two meshes are related. This is now replaced by writingbarycentric_refinement(::AbstractMesh{U,2})against the generic mesh API and the return type is now aBarycentricRefinement, with a matchingparentmethod. This also allowsSubMeshinput.Compatibility
Since the return type for one-dimensional input changes from
MeshtoBarycentricRefinement, code annotated concretely as::Meshor reaching for.facesbreaks. Generic code is unaffected sinceBarycenrticRefinement <: AbstractRefinement <: AbstractMesh.Unfortunately, the current BEAST master contains such code:
duallagrangec0d1(..., Val{2})accessesmesh2.faces, so merging this alone breaks curve duals in BEAST.The BEAST PR that rewrite this function follows shortly.
I have not bumped the version yet, but one will be needed before BEAST can pin it in [compat].