Skip to content

Commit

Permalink
use constructorof here
Browse files Browse the repository at this point in the history
  • Loading branch information
jClugstor committed Nov 6, 2024
1 parent f08cf51 commit d8a7649
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ function build_J_W(alg, u, uprev, p, t, dt, f::F, ::Type{uEltypeNoUnits},

_f = islin ? (isode ? f.f : f.f1.f) : f
jacvec = JacVec((du, u, p, t) -> _f(du, u, p, t), copy(u), p, t;
autodiff = alg_autodiff(alg), tag = OrdinaryDiffEqTag())
autodiff = constructorof(alg_autodiff(alg))(), tag = OrdinaryDiffEqTag())
J = jacvec
W = WOperator{IIP}(f.mass_matrix, dt, J, u, jacvec)
elseif alg.linsolve !== nothing && !LinearSolve.needs_concrete_A(alg.linsolve) ||
Expand All @@ -734,7 +734,7 @@ function build_J_W(alg, u, uprev, p, t, dt, f::F, ::Type{uEltypeNoUnits},
(u, p, t) -> _f(u, p, t)
end
jacvec = JacVec(__f, copy(u), p, t;
autodiff = alg_autodiff(alg), tag = OrdinaryDiffEqTag())
autodiff = constructorof(alg_autodiff(alg))(), tag = OrdinaryDiffEqTag())
WOperator{IIP}(f.mass_matrix, dt, J, u, jacvec)
end
else
Expand Down

0 comments on commit d8a7649

Please sign in to comment.