Skip to content

Commit 98bbc94

Browse files
author
Your Name
committed
OOP NonlinearSolveAlg: gate W-reuse on concrete WOperator; skip convert
1 parent b4962b9 commit 98bbc94

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • lib/OrdinaryDiffEqNonlinearSolve/src

lib/OrdinaryDiffEqNonlinearSolve/src/utils.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,10 @@ function build_nlsolver(
498498
γ = tTypeNoUnits(γ)
499499
α = tTypeNoUnits(α)
500500
dt = tTypeNoUnits(dt)
501-
use_w_reuse = !isdae && f.nlstep_data === nothing &&
502-
W isa Union{WOperator, StaticWOperator}
501+
use_w_reuse = !isdae && f.nlstep_data === nothing && (
502+
W isa StaticWOperator ||
503+
(W isa WOperator && W.J !== nothing && !(W.J isa AbstractSciMLOperator))
504+
)
503505
nlf = isdae ? oopdaenlf : oopodenlf
504506
nlp_params = if isdae
505507
(tmp, α, tstep, invγdt, p, dt, uprev, f)
@@ -513,7 +515,7 @@ function build_nlsolver(
513515
end
514516
else
515517
let Ww = W
516-
(z, p) -> convert(AbstractMatrix, Ww)
518+
(z, p) -> Ww._concrete_form
517519
end
518520
end
519521
NonlinearProblem(

0 commit comments

Comments
 (0)