-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Making quadrature_rule
a public method on relevant element groups
#160
Comments
Thanks for writing up a summary of this! Suppose we go with the direction that inducer/modepy#33 seems to be leaning (?) (i.e. allow feeding
|
(Opinions?) cc @alexfikl |
I agree with this. This would allow Though is this not well-conditioned, right? You mentioned at one point that this is equivalent to Newton-Cotes, which is... problematic for high order 😅 |
Yep. At least as long as the polynomial space contains P^N (see the current, kinda hokey, definition of
Newton-Cotes with equispaced nodes is obviously terrible. Newton-Cotes with edge-clustered nodes is not that bad. (After all, Newton-Cotes with Legendre nodes is just Gaussian quadrature.) Here's a demo: https://gist.github.com/inducer/19eb49ff7702d4bf5b12477208540731 |
(Note how even the weights stay positive in the demo.) |
(But how the rule has obviously lost the 2*n accuracy of Gauss.) |
Very nice! I've also gone ahead and started working on this issue: 44606a7 |
This is based on a discussion in inducer/grudge#62.
Currently NodalElementGroupBase has a public user-facing method
weights
. This is used internally ingrudge
when integrating on these elements, using theunit_nodes
as quadrature points.Should we move
_quadrature_rule
(found in here and similar places) out and addquadrature_rule
as a public method toNodalElementGroupBase
. This would return amodepy.Quadrature
object that can be used for reasoning about quadrature accuracy (and integration obviously 😄 ).I am in favor of this. However, we have a problem that we need to address.
Problem:
As briefly described in this issue, some element groups do not have a concrete subclass of
modepy.Quadrature
(e.g.JacobiGaussQuadrature
,LegendreGaussQuadrature
, etc.) As a concrete example, consider subclasses of _MassMatrixQuadratureElementGroup. Grudge uses theweights
method via the mass matrix and the interpolation nodes (unit_nodes
) to compute using "mass matrix quadrature" (using @inducer's terminology here). It's easy enough to create amodepy.Quadrature
object with the relevant weights/nodes, BUT when we have code that wants to check the order of accuracy viaquad.exact_to
, we run into problems.Quick summary:
Creating a generic
Quadrature
object as a bag ofnodes
andweights
lacks sufficient information to determine whatexact_to
needs to be. Currently, you can create a generic quadrature rule, but you cannot askquad.exact_to
(because it's NOT defined!)If we want
quadrature_rule
to be a public-facing method, we should resolve the problem.The text was updated successfully, but these errors were encountered: