Skip to content

Conversation

@pbrubeck
Copy link

@pbrubeck pbrubeck commented Sep 30, 2025

Enables quadrature spaces on a QuadratureRule defined by a finat element

from finat.quadrature import QuadratureRule
V = FunctionSpace(mesh, "CG", degree, variant="integral")

fe = V.finat_element
_, ps = fe.dual_basis
scheme = QuadratureRule(ps, numpy.full(len(ps.points), numpy.nan), ref_el=fe.cell)

Q = FunctionSpace(mesh, "Quadrature", degree, quad_scheme=scheme)

@pbrubeck pbrubeck force-pushed the pbrubeck/quad-element branch from 617510b to ba18ca2 Compare September 30, 2025 17:30
@pbrubeck
Copy link
Author

This approach applied to RT1 gives a scalar FunctionSpace with the same DOFs and entity associations/continuity as Crouzeix-Raviart. The reference values of RT1 live on this space, but maybe CrossMeshInterpolator would want a fully-discontinuous vector-valued quadrature space.

@pbrubeck
Copy link
Author

pbrubeck commented Sep 30, 2025

This approach applied to RT1 gives a scalar FunctionSpace with the same DOFs and entity associations/continuity as Crouzeix-Raviart. The reference values of RT1 live on this space, but maybe CrossMeshInterpolator would want a fully-discontinuous vector-valued quadrature space.

Maybe we shouldn't care about the discontinuities of the tangential components, as they are not involved in the DOFs. It should be fine as long as the normal component gets interpolated into the vector-valued quadrature space.

@pbrubeck pbrubeck force-pushed the pbrubeck/quad-element branch 5 times, most recently from 6f938d4 to f803556 Compare October 8, 2025 10:20
@pbrubeck pbrubeck changed the base branch from pbrubeck/quad-scheme to main October 8, 2025 19:11
@pbrubeck pbrubeck closed this Oct 16, 2025
@pbrubeck pbrubeck deleted the pbrubeck/quad-element branch October 16, 2025 09:57
@pbrubeck pbrubeck restored the pbrubeck/quad-element branch October 16, 2025 10:00
@pbrubeck pbrubeck reopened this Oct 16, 2025
@pbrubeck pbrubeck changed the title Quadrature elements constructed from non-Lagrange elements QuadratureElement: construct directly from a QuadratureRule Dec 18, 2025
Copy link

@rckirby rckirby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me, do we have a use case? Or is this just a convenience function to go straight from rules to elements?

Also, I'm not sure what it means to apply this to RT1?

@pbrubeck
Copy link
Author

Looks fine to me, do we have a use case? Or is this just a convenience function to go straight from rules to elements?

The use case is cross-mesh interpolation, which currently only works on target spaces that have point evaluation DOFs only. This PR enables creating an auxiliary point-evaluation-only space using the PointSet in the dual basis of the target element, for which cross-mesh interpolation is implemented. From there, we can further interpolate into the actual target space by computing the DOFs using the point data at the quadrature points.

@pbrubeck
Copy link
Author

Also, I'm not sure what it means to apply this to RT1?

For cross-mesh interpolation into RT1 we need to generate a vertex only mesh on the quadrature points used by RT1. On this vertex-only mesh we then create a vector-valued P0 space. The interpolation is performed in two steps first go from the source space into the P0 space, and then evaluate the RT1 dofs from the P0 point data.

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.

3 participants