Skip to content

Commit

Permalink
Setup for now FSAL type
Browse files Browse the repository at this point in the history
And has backwards compatability to smooth the update.
  • Loading branch information
ChrisRackauckas committed Aug 19, 2024
1 parent df57955 commit 73943a1
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 74 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DelayDiffEq"
uuid = "bcd4f6db-9728-5f36-b5f7-82caef46ccdb"
authors = ["Chris Rackauckas <[email protected]>"]
version = "5.47.4"
version = "5.48.0"

[deps]
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
Expand Down
71 changes: 0 additions & 71 deletions src/integrators/type.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
72 changes: 70 additions & 2 deletions src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 73943a1

Please sign in to comment.