Repository navigation
Conversation
Contributor
Author
|
Could a maintainer please add the "LLM used" label? I apparently don't have permission to set labels. |
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.
Description
ImplicitMatrixContext.createSubMatrixrebuilds eachDirichletBCwithbc.reconstruct(field=row_inds, ...). For a space that is not a subspace of a mixed space,fs.indexisNone, soBCBase.as_subspacereturnsNoneforfield=[0], and the BC is silently dropped. The submatrix then has ordinary operator rows on the boundary, where the original matrix has identity rows.This happens whenever a general (non-stride) IS covers the whole space; PETSc's identity-stride shortcut in
MatCreateSubMatrixavoids it. For example,SNESVINEWTONRSLSwithmat_type: matfreeand an empty active set does this: CG on the reduced system stagnates or diverges. That is how it showed up, in a FAS multigrid solver for an unconstrained problem.The fix treats a space with no index as field 0 of itself. BCs on whole mixed spaces are already rejected, so this does not change any mixed-space behaviour. A regression test compares matrix-free and AIJ submatrices over a whole-space general IS, for scalar, vector and vector-component BCs.
AI assistance: diagnosis, fix and test were developed with Claude Code (Claude Opus 5.5) and reviewed by the author.