p-multigrid: remove custom interpolation code - #5289
Open
pbrubeck wants to merge 5 commits into
Open
Conversation
pbrubeck
force-pushed
the
pbrubeck/remove-pmg-parloop
branch
from
July 29, 2026 10:25
a79a5c0 to
2c9e9a1
Compare
pbrubeck
marked this pull request as ready for review
July 29, 2026 10:31
pbrubeck
force-pushed
the
pbrubeck/remove-pmg-parloop
branch
from
July 29, 2026 10:33
2c9e9a1 to
8b84e62
Compare
This was referenced Jul 29, 2026
leo-collins
reviewed
Jul 29, 2026
pbrubeck
commented
Jul 29, 2026
Comment on lines
+371
to
+374
| if is_dual(Vrow): | ||
| Vrow = Vrow.dual() | ||
| if is_dual(Vcol): | ||
| Vcol = Vcol.dual() |
Contributor
Author
There was a problem hiding this comment.
Suggested change
| if is_dual(Vrow): | |
| Vrow = Vrow.dual() | |
| if is_dual(Vcol): | |
| Vcol = Vcol.dual() | |
| Vcol = Vcol.dual() |
pbrubeck
commented
Jul 29, 2026
pbrubeck
force-pushed
the
pbrubeck/remove-pmg-parloop
branch
from
July 29, 2026 18:30
8b84e62 to
41c33c8
Compare
pbrubeck
force-pushed
the
pbrubeck/remove-pmg-parloop
branch
from
July 29, 2026 23:29
3d81cdf to
33be7ba
Compare
pbrubeck
changed the base branch from
pbrubeck/fix/dual-enriched
to
pbrubeck/hdivcurl-delta
July 29, 2026 23:33
An element whose functionals do not all evaluate on the same points is a direct sum, and has a dual basis only on each of its sub-elements, not one weight tensor on one point set. Reconstructing it as a runtime Quadrature space only ever wanted the points, so ask for those directly. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Assembling a two-form Interpolate matrix-free passed the same bcs as both the row and the column bcs of the ImplicitMatrixContext, and left on_diag at its default of True. Neither holds for interpolation between two different spaces: applying the target space's bcs to the source side raised "Cofunction defined on incompatible FunctionSpace", and on_diag made multTranspose try to write the row values into the column vector. Split the bcs by the space they are defined on, as the assembled path already does, and set on_diag from whether the two spaces coincide. A bc on a component of a mixed space is defined on an IndexedProxyFunctionSpace rather than on the space itself, so compare against the top-level parent, which BCBase.function_space now returns on request. Coarsen the p-multigrid nullspace with a locally built interpolation matrix, rather than through getNestSubMatrix, which only the removed MixedInterpolationMatrix provided. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
pbrubeck
force-pushed
the
pbrubeck/remove-pmg-parloop
branch
from
August 18, 2026 22:22
2cdcc16 to
59e617b
Compare
pbrubeck
commented
Aug 18, 2026
Co-authored-by: Pablo Brubeck <brubeck@protonmail.com>
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.
Removes ~1050 lines of hand-written interpolation machinery from
firedrake/preconditioners/pmg.py—StandaloneInterpolationMatrix,MixedInterpolationMatrix,kronmxv,get_permutation_to_nodal_elements,evaluate_dualand friends — and replaces the p-multigrid transfer operators withthe generic
assemble(interpolate(TrialFunction(cV), fV)). The helpers that are stillneeded move to
firedrake/preconditioners/fdm.py.Stacked on #5295, which fixes the matrix-free adjoint interpolation this now relies on.
Also needs firedrakeproject/fiat#268 — see the
DROP BEFORE MERGEcommit, whichapplies to both PRs in the stack.
🤖 Generated with Claude Code