-
Notifications
You must be signed in to change notification settings - Fork 176
Fieldsplit: update MatNest Jacobian and support bcs on AssembledMatrix #4708
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
Open
pbrubeck
wants to merge
13
commits into
release
Choose a base branch
from
pbrubeck/fix/nest-fieldsplit
base: release
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+165
−51
Conversation
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
7c9dfcc to
aaabace
Compare
pbrubeck
commented
Nov 5, 2025
firedrake/solving_utils.py
Outdated
Comment on lines
517
to
524
| # Bump petsc matrix state of each split by assembling them. | ||
| # Ensures that if the matrix changed, the preconditioner is | ||
| # updated if necessary. | ||
| for field, splits in ctx._splits.items(): | ||
| for subctx in splits: | ||
| subctx._jac.assemble() | ||
| if subctx.Jp is not None: | ||
| subctx._pjac.assemble() |
Contributor
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stefanozampini I think this should be called elsewhere, maybe in pyop2 or PETSc, but so far this fixes the bug #4687. This is very similar to what we had to do for MatIS
firedrake/firedrake/assemble.py
Lines 1496 to 1498 in 0ce9ad2
| if op2tensor.handle.getType() == "is": | |
| # Flag the entire matrix as assembled before indexing the diagonal block | |
| op2tensor.handle.assemble() |
JHopeCollins
reviewed
Nov 5, 2025
pbrubeck
commented
Nov 5, 2025
abddfda to
4ab9490
Compare
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.
Description
Fixes #4687
Depends on https://gitlab.com/petsc/petsc/-/merge_requests/8860 to trigger preconditioner update for a MatNest with more than one field on a block of the fieldsplit.
Also fixes fieldsplit for
AssembledMatrixwith bcsCleanup
create_subdmindmhooks.py