Repository navigation
NLNewton OOP: handle AbstractSciMLOperator W instead of erroring - #3796
Merged
ChrisRackauckas merged 4 commits intoJul 6, 2026
Merged
ChrisRackauckas merged 4 commits into
ChrisRackauckas merged 4 commits into
Conversation
| elseif W isa AbstractSciMLOperator | ||
| error("Non-concrete Jacobian not yet supported by out-of-place Newton solve.") | ||
| update_coefficients!(W, ustep, p, tstep; gamma = γW, transform = true) | ||
| W = convert(AbstractMatrix, W) |
Member
There was a problem hiding this comment.
No we shouldn't convert W operators.
Member
There was a problem hiding this comment.
I guess for out of place.
Member
There was a problem hiding this comment.
Ehh probably a bad idea though to \ an operator... better to just give an informative error.
Member
Author
|
fair — reverted the convert, just kept an informative error pointing users at IIP form or jac_prototype |
singhharsh1708
force-pushed
the
fix/oop-nlnewton-sciml-operator
branch
4 times, most recently
from
July 3, 2026 19:27
770010d to
84de2f8
Compare
This was referenced Jul 4, 2026
singhharsh1708
force-pushed
the
fix/oop-nlnewton-sciml-operator
branch
from
July 5, 2026 03:42
84de2f8 to
15387e3
Compare
3 tasks done
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.
The OOP NLNewton
compute_step!hard-errors whenWis anAbstractSciMLOperatorthat isn't aWOperator/StaticWOperator:This case is reachable in practice — e.g. an
ImplicitEuler(nlsolve = NLNewton(...))solve on an OOPODEProblemwhose mass matrix is a state-dependentMatrixOperatorlands here.Fix
Mirror the IIP NLNewton handling of
AbstractSciMLOperatorW (already at line 304):update_coefficients!(W, ustep, p, tstep; gamma = γW, transform = true)refreshes the operator against the current Newton iterate, andconvert(AbstractMatrix, W)materializes the result for the\solve that follows.convert(AbstractMatrix, ::AbstractSciMLOperator)is defined forMatrixOperator,ScaledOperator,AddedOperator,ComposedOperator,IdentityOperator, etc., so this covers the common cases.Scope
This removes the hard error and makes the OOP NLNewton path functional for SciMLOperator W. The pre-existing failing
Dependent Mass Matrix Tests/iip = falseinmass_matrix_tests.jlwas reaching this error path — after this fix it no longer hard-errors, though the test may still surface a separate numerical issue tied to the test RHS mutating the samemm_Ait carries as its mass matrix (the IIP version passes, so the integrator path was OK; only this OOP error was blocking).