Rebind writer and linear solver when the grid or matrix object is replaced - #7295
Open
hnil wants to merge 4 commits into
Open
Rebind writer and linear solver when the grid or matrix object is replaced#7295hnil wants to merge 4 commits into
hnil wants to merge 4 commits into
Conversation
New gridViewChanged(gridView) updates the stored view and forwards to gridChanged(), for writers whose grid is rebuilt during the run (e.g. a growing fracture grid). Requires the stored view to be non-const. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
eraseMatrix() now resets the stored matrix pointer, and initPrepare() detects that a different matrix object arrived (grid/system regenerated) and forces solver recreation on the next shouldCreateSolver() query (kept const; the one-shot trigger is mutable). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
akva2
reviewed
Aug 7, 2026
Name the opm-flowgeomechanics use sites - the growing fracture grid for gridViewChanged(), and the connection rebuild for eraseMatrix() - so the two hooks do not read as unused API. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
matrix_ is initialised to nullptr in both constructors, so matrix_ == nullptr implies &M != matrix_ and the separate firstcall flag added nothing. The else branch went with it: it only ran when &M == matrix_, so its 'pointers should not change' throw could not fire. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Member
Author
|
Right — That also made the |
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.
Two small robustness fixes for runs that rebuild the grid or the linear system mid-run (opm-flowgeomechanics does this for a growing fracture grid):
vtkmultiwriter:gridViewChanged(gridView)updates the stored view and forwards togridChanged().ISTLSolver:eraseMatrix()resets the stored matrix pointer, andinitPrepare()notices when a different matrix object arrives and forces solver recreation.Inert unless something actually replaces the grid or matrix; SPE1 unchanged.