Repository navigation
Add Witherden-Vincent quadrature rules - #1094
Draft
garth-wells wants to merge 2 commits into
Draft
garth-wells wants to merge 2 commits into
garth-wells wants to merge 2 commits into
Conversation
Add quadrature::type::witherden_vincent, providing the symmetric quadrature rules of F. D. Witherden and P. E. Vincent, "On the identification of symmetric quadrature rules for finite element methods", Comput. Math. Appl. 69 (2015) 1232-1241. Rules are available on triangles (degree <= 20), quadrilaterals (<= 21), tetrahedra (<= 10), hexahedra (<= 11), prisms (<= 10) and pyramids (<= 10). All have positive weights and points inside the cell. On an interval the family reduces to Gauss-Legendre, so that the type can also be used for facet integrals. On non-simplex cells the rules use considerably fewer points than the collapsed Gauss-Jacobi rules, e.g. 58 rather than 125 points for degree 9 on a hexahedron. The default rules are unchanged. In particular, Gauss-Jacobi remains the default on a pyramid, where the collapsed rule is also exact for the rational pyramid polyset. Co-Authored-By: Claude Opus 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.
Closes #608.
Adds
quadrature::type::witherden_vincent, providing the symmetric quadrature rules of F. D. Witherden and P. E. Vincent, On the identification of symmetric quadrature rules for finite element methods, Comput. Math. Appl. 69 (2015) 1232-1241.What is included
All rules have positive weights and points strictly inside the cell. On an interval the family reduces to Gauss-Legendre, so the type can also be used for facet integrals of 2D cells.
On non-simplex cells the rules need considerably fewer points than the collapsed Gauss-Jacobi rules currently used there:
Defaults are unchanged
get_default_ruleis untouched, so this PR changes no existing results. Switching the default on hexahedra, prisms and quadrilaterals would be a worthwhile follow-up, but it changes every generated kernel and is better considered separately.Gauss-Jacobi should probably remain the default on pyramids regardless: the collapsed rule is also exact for the rational pyramid polyset (
xy/(1-z)is polynomial in collapsed coordinates), whereas the Witherden-Vincent rules are exact for polynomials only. This is noted in thequadrature::typedocumentation.Provenance of the data
The coefficients are the paper's tables, taken from the rule files distributed with PyFR (BSD-3-Clause), and mapped from PyFR's
[-1, 1]-based reference cells onto the Basix reference cells. This includes the sheared pyramid map, from PyFR's base[-1, 1]^2atz = -1with apex(0, 0, 1)to the Basix base[0, 1]^2atz = 0with apex(0, 0, 1).Each transformed rule was checked against exact rational monomial integrals before the C++ was generated; the worst relative error over all 65 rules, after rounding to
double, is 7e-16.Tests
test/test_quadrature.py: 89 cases checking that every rule integrates all monomials of total degree at mostmexactly, that weights are positive, and that unsupported degrees and cell types raise.cpp/test/quadrature.cpp: the same properties plus the weight sum againstcell::volume, 8403 assertions.🤖 Generated with Claude Code