Skip to content

Commit 1564f41

Browse files
author
Your Name
committed
OOP NonlinearSolveAlg jac closure: skip convert for StaticWOperator
1 parent 58d8fc2 commit 1564f41

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
@@ -507,8 +507,14 @@ function build_nlsolver(
507507
(tmp, γ, α, tstep, invγdt, DIRK, p, dt, f)
508508
end
509509
prob = if use_w_reuse
510-
nlf_jac = let W = W
511-
(z, p) -> convert(AbstractMatrix, W)
510+
nlf_jac = if W isa StaticWOperator
511+
let Ws = W
512+
(z, p) -> Ws.W
513+
end
514+
else
515+
let Ww = W
516+
(z, p) -> convert(AbstractMatrix, Ww)
517+
end
512518
end
513519
NonlinearProblem(
514520
NonlinearFunction{false, SciMLBase.FullSpecialize}(nlf; jac = nlf_jac),

0 commit comments

Comments
 (0)