Skip to content

Commit 59459bf

Browse files
committed
fix
1 parent 525f0fe commit 59459bf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ function Base.convert(::Type{AbstractMatrix}, W::WOperator{IIP}) where {IIP}
335335
else
336336
# Non-allocating already updated
337337
#_W = W._concrete_form
338-
#jacobian2W!(_W, W.mass_matrix, W.gamma, W.J, W.transform)
338+
#jacobian2W!(_W, W.mass_matrix, W.gamma, convert(AbstractMatrix, W.J), W.transform)
339339
end
340340
return W._concrete_form
341341
end
@@ -455,7 +455,11 @@ function do_newJW(integrator, alg, nlsolver, repeat_step)::NTuple{2, Bool}
455455
integrator.iter <= 1 && return true, true # at least one JW eval at the start
456456
repeat_step && return false, false
457457
islin, _ = islinearfunction(integrator)
458-
islin && return false, false # no further JW eval when it's linear
458+
if islin
459+
# no further J eval when it's linear
460+
# W eval needed if not adaptive
461+
return false, !integrator.opts.adaptive
462+
end
459463
!integrator.opts.adaptive && return true, true # Not adaptive will always refactorize
460464
errorfail = integrator.EEst > one(integrator.EEst)
461465
if alg isa DAEAlgorithm

0 commit comments

Comments
 (0)