Skip to content

Commit 350a7e8

Browse files
author
Your Name
committed
OOP NonlinearSolveAlg jac closure: skip convert for StaticWOperator
1 parent af19b48 commit 350a7e8

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

  • lib/OrdinaryDiffEqNonlinearSolve/src

lib/OrdinaryDiffEqNonlinearSolve/src/utils.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,14 @@ function build_nlsolver(
499499
(tmp, γ, α, tstep, invγdt, DIRK, p, dt, f)
500500
end
501501
prob = if use_w_reuse
502-
nlf_jac = let W = W
503-
(z, p) -> convert(AbstractMatrix, W)
502+
nlf_jac = if W isa StaticWOperator
503+
let Ws = W
504+
(z, p) -> Ws.W
505+
end
506+
else
507+
let Ww = W
508+
(z, p) -> convert(AbstractMatrix, Ww)
509+
end
504510
end
505511
NonlinearProblem(
506512
NonlinearFunction{false, SciMLBase.FullSpecialize}(nlf; jac = nlf_jac),

0 commit comments

Comments
 (0)