Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
3 changes: 2 additions & 1 deletion lib/OrdinaryDiffEqBDF/src/OrdinaryDiffEqBDF.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import OrdinaryDiffEqCore: alg_order, calculate_residuals!,
trivial_limiter!,
issplit, qsteady_min_default, qsteady_max_default,
get_current_alg_order, get_current_adaptive_order,
default_controller, stepsize_controller!,
default_controller_v7,
legacy_default_controller, stepsize_controller!,
step_accept_controller!,
step_reject_controller!, post_newton_controller!,
u_modified!, DAEAlgorithm, _unwrap_val, DummyController,
Expand Down
6 changes: 5 additions & 1 deletion lib/OrdinaryDiffEqBDF/src/controllers.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
function default_controller(alg::Union{QNDF, FBDF}, args...)
function legacy_default_controller(alg::Union{QNDF, FBDF}, args...)
DummyController()
end

function default_controller_v7(QT, alg::Union{QNDF, FBDF}, args...)
DummyController()
end

Expand Down
23 changes: 20 additions & 3 deletions lib/OrdinaryDiffEqCore/src/alg_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,26 @@ alg_maximum_order(alg::CompositeAlgorithm) = maximum(alg_order(x) for x in alg.a

alg_adaptive_order(alg::Union{OrdinaryDiffEqAlgorithm, DAEAlgorithm}) = alg_order(alg) - 1

# this is actually incorrect and is purposefully decreased as this tends
# to track the real error much better
# this is actually incorrect and is purposefully decreased as this tends
# to track the real error much better

function default_controller(alg, cache, qoldinit, _beta1 = nothing, _beta2 = nothing)
function default_controller_v7(QT, alg)
if ispredictive(alg)
return NewPredictiveController(QT, alg)
elseif isstandard(alg)
return NewIController(QT, alg)
else
return NewPIController(QT, alg)
end
end

function default_controller_v7(QT, alg::CompositeAlgorithm)
return CompositeController(
map(alg->default_controller_v7(QT, alg), alg.algs)
)
end

function legacy_default_controller(alg, cache, qoldinit, _beta1 = nothing, _beta2 = nothing)
if ispredictive(alg)
return PredictiveController()
elseif isstandard(alg)
Expand All @@ -323,6 +337,9 @@ function default_controller(alg, cache, qoldinit, _beta1 = nothing, _beta2 = not
end
end

# TODO remove this when done
default_controller(args...) = legacy_default_controller(args...)

function _digest_beta1_beta2(alg, cache, ::Val{QT}, _beta1, _beta2) where {QT}
if alg isa OrdinaryDiffEqCompositeAlgorithm
beta2 = _beta2 === nothing ?
Expand Down
Loading
Loading