Skip to content

Expose the 1D Gauss-Lobatto points and weights - #4580

Closed
lindsayad wants to merge 1 commit into
libMesh:develfrom
lindsayad:gll-quadrature-points
Closed

lindsayad wants to merge 1 commit into
libMesh:develfrom
lindsayad:gll-quadrature-points

Conversation

@lindsayad

@lindsayad lindsayad commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Exposes the 1D Gauss-Lobatto points and weights as QGaussLobatto::points_1D() and weights_1D(), keyed by number of points. n_points_1D() maps a rule order to that key. This lets a nodal basis collocated on the GLL points read exactly the same values as the rule, so a mass matrix assembled with that rule is exactly diagonal instead of diagonal to round-off. The basis is in #4583 (L2_LAGRANGE_GLL) and #4552 (LAGRANGE_GLL).

The diff to quadrature_gauss_lobatto_1D.C is large, but the point and weight values are unchanged. The table is restructured so init_1D copies from it, and each rule is built once on first use so that reading one needs no lock.

🤖 Generated with Claude Code

@moosebuild

moosebuild commented Sep 30, 2026 •

Copy link
Copy Markdown

Job Coverage, step Generate coverage on 7412d67 wanted to post the following:

Coverage

a8b8c2 #4580 7412d6
Total Total +/- New
Rate 66.05% 66.06% +0.01% 100.00%
Hits 79869 79887 +18 614
Misses 41046 41045 -1 0

Diff coverage report

Full coverage report

This comment will be updated on new commits.

A nodal basis interpolating at the points of a quadrature rule is collocated with it, so
the mass matrix that rule assembles is diagonal. That holds exactly only if the basis and
the rule carry bit-identical points, so both should read them from the same table.

QGaussLobatto::points_and_weights_1D fills the one-dimensional rule keyed by its number of
points n. A rule of n points is exact through degree 2n-3, so the orders 2n-4 and 2n-3
share it, which n_points_1D inverts. init_1D now reads its rule the same way. The table's
values are unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
@lindsayad
lindsayad force-pushed the gll-quadrature-points branch from e663f42 to 7412d67 Compare September 30, 2026 23:37
@lindsayad
lindsayad marked this pull request as ready for review September 30, 2026 23:37
@lindsayad

Copy link
Copy Markdown
Member Author

This PR is a stepping stone for #4583 which is a stepping stone for #4552. I could consolidate #4583 into this PR in order to give it some more motivation, but have started with this current split with an eye towards reviewability/smaller-chunking

@roystgnr

roystgnr commented Oct 1, 2026

Copy link
Copy Markdown
Member

What's the advantage of this over just constructing and using a QGaussLobatto qgl(1,n)? We use that idiom (mostly with QGauss and QJacobi, but even with QGaussLobatto) all over in src/quadrature/ to construct higher-dimensional rules from lower-dimensional ones.

I've noticed that multiple coding agents have a tendency to rewrite rather than reuse existing APIs, and that sure feels like what's happening here.

@lindsayad

Copy link
Copy Markdown
Member Author

You nailed it. We don't need this for the basis work

image

@lindsayad lindsayad closed this Oct 1, 2026
@jwpeterson

Copy link
Copy Markdown
Member

"That's on me"

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.

4 participants