From 1cff06fd0ea353327e10dcc150a62ee458cda4ed Mon Sep 17 00:00:00 2001 From: Ashley Milsted Date: Thu, 17 Oct 2024 15:10:39 -0700 Subject: [PATCH] don't specialize `integrate` on `df` (#423) --- src/timeevolution_base.jl | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/timeevolution_base.jl b/src/timeevolution_base.jl index c34bb0d9..27ef603c 100644 --- a/src/timeevolution_base.jl +++ b/src/timeevolution_base.jl @@ -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