From 73943a11c228c2b97ccf81a3839039f7c1afa02a Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 18 Aug 2024 21:23:45 -0400 Subject: [PATCH] Setup for now FSAL type And has backwards compatability to smooth the update. --- Project.toml | 2 +- src/integrators/type.jl | 71 ---------------------------------------- src/solve.jl | 72 +++++++++++++++++++++++++++++++++++++++-- 3 files changed, 71 insertions(+), 74 deletions(-) diff --git a/Project.toml b/Project.toml index dd4ec9f..a776b19 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "DelayDiffEq" uuid = "bcd4f6db-9728-5f36-b5f7-82caef46ccdb" authors = ["Chris Rackauckas "] -version = "5.47.4" +version = "5.48.0" [deps] ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" diff --git a/src/integrators/type.jl b/src/integrators/type.jl index eaa1f44..7536ac0 100644 --- a/src/integrators/type.jl +++ b/src/integrators/type.jl @@ -95,77 +95,6 @@ mutable struct DDEIntegrator{algType, IIP, uType, tType, P, eigenType, tTypeNoUn integrator::IType fsalfirst::FSALType fsallast::FSALType - - # incomplete initialization without fsalfirst and fsallast - function DDEIntegrator{algType, IIP, uType, tType, P, eigenType, tTypeNoUnits, - tdirType, ksEltype, SolType, F, CacheType, IType, FP, - O, dAbsType, dRelType, H, tstopsType, discType, - FSALType, EventErrorType, CallbackCacheType, DV}(sol, u, k, t, dt, f, - p, uprev, uprev2, - tprev, prev_idx, - prev2_idx, - fpsolver, - order_discontinuity_t0, - tracked_discontinuities, - discontinuity_interp_points, - discontinuity_abstol, - discontinuity_reltol, - tstops_propagated, - d_discontinuities_propagated, - alg, dtcache, - dtchangeable, - dtpropose, tdir, - eigen_est, EEst, - qold, - q11, erracc, dtacc, - success_iter, iter, - saveiter, - saveiter_dense, - cache, - callback_cache, - kshortsize, - force_stepfail, - last_stepfail, - just_hit_tstop, - do_error_check, - event_last_time, - vector_event_last_time, - last_event_error, - accept_step, isout, - reeval_fsal, - u_modified, isdae, - opts, stats, - history, - differential_vars, - integrator) where - {algType, IIP, uType, tType, P, eigenType, tTypeNoUnits, tdirType, ksEltype, - SolType, F, - CacheType, IType, FP, O, dAbsType, dRelType, H, tstopsType, discType, - FSALType, EventErrorType, CallbackCacheType, DV} - new{algType, IIP, uType, tType, P, eigenType, tTypeNoUnits, tdirType, ksEltype, - SolType, F, - CacheType, IType, FP, O, dAbsType, dRelType, H, tstopsType, discType, FSALType, - EventErrorType, CallbackCacheType, DV}( - sol, u, k, t, dt, f, p, uprev, uprev2, tprev, - prev_idx, prev2_idx, fpsolver, - order_discontinuity_t0, - tracked_discontinuities, - discontinuity_interp_points, - discontinuity_abstol, discontinuity_reltol, - tstops_propagated, - d_discontinuities_propagated, alg, dtcache, - dtchangeable, dtpropose, tdir, - eigen_est, EEst, qold, q11, erracc, dtacc, - success_iter, iter, saveiter, saveiter_dense, - cache, callback_cache, kshortsize, - force_stepfail, last_stepfail, - just_hit_tstop, - do_error_check, event_last_time, - vector_event_last_time, - last_event_error, accept_step, isout, - reeval_fsal, u_modified, isdae, opts, - stats, history, differential_vars, integrator) - end end function (integrator::DDEIntegrator)(t, deriv::Type = Val{0}; idxs = nothing) diff --git a/src/solve.jl b/src/solve.jl index 8e93ad7..30cef58 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -396,7 +396,9 @@ function DiffEqBase.__init(prob::DiffEqBase.AbstractDDEProblem, erracc = QT(1) dtacc = tType(1) - integrator = DDEIntegrator{typeof(alg.alg), isinplace(prob), typeof(u0), tType, + if isdefined(OrdinaryDiffEq, :get_fsalfirstlast) + fsalfirst, fsallast = OrdinaryDiffEq.get_fsalfirstlast(cache,rate_prototype) + integrator = DDEIntegrator{typeof(alg.alg), isinplace(prob), typeof(u0), tType, typeof(p), typeof(eigen_est), QT, typeof(tdir), typeof(k), typeof(sol), typeof(f_with_history), typeof(cache), @@ -459,7 +461,73 @@ function DiffEqBase.__init(prob::DiffEqBase.AbstractDDEProblem, stats, history, differential_vars, - ode_integrator) + ode_integrator, fsalfirst, fsallast) + else + integrator = DDEIntegrator{typeof(alg.alg), isinplace(prob), typeof(u0), tType, + typeof(p), + typeof(eigen_est), QT, typeof(tdir), typeof(k), typeof(sol), + typeof(f_with_history), typeof(cache), + typeof(ode_integrator), typeof(fpsolver), + typeof(opts), typeof(discontinuity_abstol), + typeof(discontinuity_reltol), typeof(history), + typeof(tstops_propagated), + typeof(d_discontinuities_propagated), + OrdinaryDiffEq.fsal_typeof(alg.alg, rate_prototype), + typeof(last_event_error), typeof(callback_cache), + typeof(differential_vars)}(sol, u, k, + t0, + tType(dt), + f_with_history, + p, + uprev, + uprev2, + tprev, + prev_idx, + prev2_idx, + fpsolver, + order_discontinuity_t0, + tracked_discontinuities, + discontinuity_interp_points, + discontinuity_abstol, + discontinuity_reltol, + tstops_propagated, + d_discontinuities_propagated, + alg.alg, + dtcache, + dtchangeable, + dtpropose, + tdir, + eigen_est, + EEst, + QT(qoldinit), + q11, + erracc, + dtacc, + success_iter, + iter, + length(ts), + length(ts), + cache, + callback_cache, + kshortsize, + force_stepfail, + last_stepfail, + just_hit_tstop, + do_error_check, + event_last_time, + vector_event_last_time, + last_event_error, + accept_step, + isout, + reeval_fsal, + u_modified, + isdae, + opts, + stats, + history, + differential_vars, + ode_integrator) + end # initialize DDE integrator if initialize_integrator