Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add progress_id to delaydiffeq #270

Merged
merged 3 commits into from
Oct 6, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)

ChrisRackauckas marked this conversation as resolved.
Show resolved Hide resolved

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