Skip to content

Commit

Permalink
add progress_id to delaydiffeq (#270)
Browse files Browse the repository at this point in the history
* add progress_id to delaydiffeq

* backward compat with DEOptions sans progress_id

* Update src/solve.jl

---------

Co-authored-by: Pepijn de Vos <[email protected]>
Co-authored-by: Christopher Rackauckas <[email protected]>
  • Loading branch information
3 people authored Oct 6, 2023
1 parent 4195928 commit 9b117cd
Showing 1 changed file with 118 additions and 56 deletions.
174 changes: 118 additions & 56 deletions src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ function DiffEqBase.__init(prob::DiffEqBase.AbstractDDEProblem,
progress_steps = 1000,
progress_name = "DDE",
progress_message = DiffEqBase.ODE_DEFAULT_PROG_MESSAGE,
progress_id = gensym("DelayDiffEq"),
userdata = nothing,
allow_extrapolation = OrdinaryDiffEq.alg_extrapolates(alg),
initialize_integrator = true,
Expand Down Expand Up @@ -97,7 +98,7 @@ function DiffEqBase.__init(prob::DiffEqBase.AbstractDDEProblem,
@warn("Dense output is incompatible with saveat. Please use the SavingCallback from the Callback Library to mix the two behaviors.")
end

progress && @logmsg(-1, progress_name, _id=_id = :DelayDiffEq, progress=0)
progress && @logmsg(-1, progress_name, _id=progress_id, progress=0)

isdae = prob.f.mass_matrix !== I && !(prob.f.mass_matrix isa Tuple) &&
ArrayInterface.issingular(prob.f.mass_matrix)
Expand Down Expand Up @@ -241,61 +242,122 @@ function DiffEqBase.__init(prob::DiffEqBase.AbstractDDEProblem,
save_everystep || isempty(saveat) || saveat isa Number ||
prob.tspan[2] in saveat : save_end

opts = OrdinaryDiffEq.DEOptions{typeof(abstol_internal), typeof(reltol_internal),
QT, tType, typeof(controller),
typeof(internalnorm), typeof(internalopnorm),
typeof(save_end_user),
typeof(callback_set),
typeof(isoutofdomain),
typeof(progress_message), typeof(unstable_check),
typeof(tstops_internal),
typeof(d_discontinuities_internal), typeof(userdata),
typeof(save_idxs),
typeof(maxiters), typeof(tstops),
typeof(saveat), typeof(d_discontinuities)}(maxiters,
save_everystep,
adaptive,
abstol_internal,
reltol_internal,
QT(gamma),
QT(qmax),
QT(qmin),
QT(qsteady_max),
QT(qsteady_min),
QT(qoldinit),
QT(failfactor),
tType(dtmax),
tType(dtmin),
controller,
internalnorm,
internalopnorm,
save_idxs,
tstops_internal,
saveat_internal,
d_discontinuities_internal,
tstops,
saveat,
d_discontinuities,
userdata,
progress,
progress_steps,
progress_name,
progress_message,
timeseries_errors,
dense_errors,
dense,
save_on,
save_start,
save_end,
save_end_user,
callback_set,
isoutofdomain,
unstable_check,
verbose,
calck,
force_dtmin,
advance_to_tstop,
stop_at_next_tstop)
# added in OrdinaryDiffEq.jl#2032
if hasfield(OrdinaryDiffEq.DEOptions, :progress_id)
opts = OrdinaryDiffEq.DEOptions{typeof(abstol_internal), typeof(reltol_internal),
QT, tType, typeof(controller),
typeof(internalnorm), typeof(internalopnorm),
typeof(save_end_user),
typeof(callback_set),
typeof(isoutofdomain),
typeof(progress_message), typeof(unstable_check),
typeof(tstops_internal),
typeof(d_discontinuities_internal), typeof(userdata),
typeof(save_idxs),
typeof(maxiters), typeof(tstops),
typeof(saveat), typeof(d_discontinuities)}(maxiters,
save_everystep,
adaptive,
abstol_internal,
reltol_internal,
QT(gamma),
QT(qmax),
QT(qmin),
QT(qsteady_max),
QT(qsteady_min),
QT(qoldinit),
QT(failfactor),
tType(dtmax),
tType(dtmin),
controller,
internalnorm,
internalopnorm,
save_idxs,
tstops_internal,
saveat_internal,
d_discontinuities_internal,
tstops,
saveat,
d_discontinuities,
userdata,
progress,
progress_steps,
progress_name,
progress_message,
progress_id,
timeseries_errors,
dense_errors,
dense,
save_on,
save_start,
save_end,
save_end_user,
callback_set,
isoutofdomain,
unstable_check,
verbose,
calck,
force_dtmin,
advance_to_tstop,
stop_at_next_tstop)
else
opts = OrdinaryDiffEq.DEOptions{typeof(abstol_internal), typeof(reltol_internal),
QT, tType, typeof(controller),
typeof(internalnorm), typeof(internalopnorm),
typeof(save_end_user),
typeof(callback_set),
typeof(isoutofdomain),
typeof(progress_message), typeof(unstable_check),
typeof(tstops_internal),
typeof(d_discontinuities_internal), typeof(userdata),
typeof(save_idxs),
typeof(maxiters), typeof(tstops),
typeof(saveat), typeof(d_discontinuities)}(maxiters,
save_everystep,
adaptive,
abstol_internal,
reltol_internal,
QT(gamma),
QT(qmax),
QT(qmin),
QT(qsteady_max),
QT(qsteady_min),
QT(qoldinit),
QT(failfactor),
tType(dtmax),
tType(dtmin),
controller,
internalnorm,
internalopnorm,
save_idxs,
tstops_internal,
saveat_internal,
d_discontinuities_internal,
tstops,
saveat,
d_discontinuities,
userdata,
progress,
progress_steps,
progress_name,
progress_message,
#progress_id,
timeseries_errors,
dense_errors,
dense,
save_on,
save_start,
save_end,
save_end_user,
callback_set,
isoutofdomain,
unstable_check,
verbose,
calck,
force_dtmin,
advance_to_tstop,
stop_at_next_tstop)
end

# create fixed point solver
fpsolver = build_fpsolver(alg, alg.fpsolve, u, uEltypeNoUnits, uBottomEltypeNoUnits,
Expand Down

0 comments on commit 9b117cd

Please sign in to comment.