OrdinaryDiffEq.jl icon indicating copy to clipboard operation
OrdinaryDiffEq.jl copied to clipboard

reset_fsal! doesn't account for implicit models

Open jd-lara opened this issue 4 years ago • 1 comments

When an implicit model requires a call to fsal! it fails to recognize that the form of f! is f!(out, du, u, p, t) and throws an error.

This is in integrator utils line 376

function reset_fsal!(integrator)
  # Under these condtions, these algorithms are not FSAL anymore
  integrator.destats.nf += 1
  if typeof(integrator.cache) <: OrdinaryDiffEqMutableCache ||
     (typeof(integrator.cache) <: CompositeCache &&
      typeof(integrator.cache.caches[1]) <: OrdinaryDiffEqMutableCache)
    integrator.f(integrator.fsalfirst,integrator.u,integrator.p,integrator.t)
  else
    integrator.fsalfirst = integrator.f(integrator.u,integrator.p,integrator.t)
  end
  # Do not set false here so it can be checked in the algorithm
  # integrator.reeval_fsal = false
end

jd-lara avatar Jul 09 '21 18:07 jd-lara

I think this is partially fixed here: https://github.com/SciML/OrdinaryDiffEq.jl/pull/1105

jd-lara avatar Jul 09 '21 19:07 jd-lara