Skip to content

Commit

Permalink
don't specialize integrate on df (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
amilsted authored Oct 17, 2024
1 parent 8fe86a0 commit 1cff06f
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/timeevolution_base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@ function recast! end
Integrate using OrdinaryDiffEq
"""
function integrate(tspan, df::F, x0,
function integrate(tspan, df, x0,
state, dstate, fout;
alg = OrdinaryDiffEq.DP5(),
steady_state = false, tol = 1e-3, save_everystep = false, saveat=tspan,
callback = nothing, kwargs...) where {F}

function df_(dx, x, p, t)
recast!(state,x)
recast!(dstate,dx)
df(t, state, dstate)
recast!(dx,dstate)
return nothing
callback = nothing, kwargs...)

df_ = let df = df
function df_(dx, x, p, t)
recast!(state,x)
recast!(dstate,dx)
df(t, state, dstate)
recast!(dx,dstate)
return nothing
end
end

fout_ = let fout = fout, state = state
Expand Down

0 comments on commit 1cff06f

Please sign in to comment.