Skip to content

Commit 035eec0

Browse files
format
1 parent 105688a commit 035eec0

File tree

15 files changed

+537
-509
lines changed

15 files changed

+537
-509
lines changed

lib/OrdinaryDiffEqDefault/src/OrdinaryDiffEqDefault.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
module OrdinaryDiffEqDefault
22

33
using OrdinaryDiffEq: Vern7, Vern8, Vern9, Vern6, Tsit5, Rosenbrock23, Rodas5P, FBDF,
4-
alg_stability_size, beta2_default, beta1_default, AutoSwitchCache, ODEIntegrator,
5-
CompositeAlgorithm, OrdinaryDiffEqAlgorithm, OrdinaryDiffEqMutableCache, AutoAlgSwitch
4+
alg_stability_size, beta2_default, beta1_default, AutoSwitchCache,
5+
ODEIntegrator,
6+
CompositeAlgorithm, OrdinaryDiffEqAlgorithm,
7+
OrdinaryDiffEqMutableCache, AutoAlgSwitch
68
import OrdinaryDiffEq: is_mass_matrix_alg, default_autoswitch
79
import LinearSolve
810
using LinearAlgebra: I, isdiag

lib/OrdinaryDiffEqDefault/src/default_alg.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,6 @@ end
116116

117117
# hack for the default alg
118118
function is_mass_matrix_alg(alg::CompositeAlgorithm{
119-
<:Any, <:Tuple{Tsit5, Vern7, Rosenbrock23, Rodas5P, FBDF, FBDF}})
119+
<:Any, <:Tuple{Tsit5, Vern7, Rosenbrock23, Rodas5P, FBDF, FBDF}})
120120
true
121-
end
121+
end

lib/OrdinaryDiffEqVerner/src/alg_utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ alg_order(alg::Vern9) = 9
1010
alg_stability_size(alg::Vern6) = 4.8553
1111
alg_stability_size(alg::Vern7) = 4.6400
1212
alg_stability_size(alg::Vern8) = 5.8641
13-
alg_stability_size(alg::Vern9) = 4.4762
13+
alg_stability_size(alg::Vern9) = 4.4762

lib/OrdinaryDiffEqVerner/src/algorithms.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,4 @@ end
116116
AutoVern6(alg; lazy = true, kwargs...) = AutoAlgSwitch(Vern6(lazy = lazy), alg; kwargs...)
117117
AutoVern7(alg; lazy = true, kwargs...) = AutoAlgSwitch(Vern7(lazy = lazy), alg; kwargs...)
118118
AutoVern8(alg; lazy = true, kwargs...) = AutoAlgSwitch(Vern8(lazy = lazy), alg; kwargs...)
119-
AutoVern9(alg; lazy = true, kwargs...) = AutoAlgSwitch(Vern9(lazy = lazy), alg; kwargs...)
119+
AutoVern9(alg; lazy = true, kwargs...) = AutoAlgSwitch(Vern9(lazy = lazy), alg; kwargs...)

lib/OrdinaryDiffEqVerner/src/controllers.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ end
55

66
@inline function accept_step_controller(integrator, controller::PIDController)
77
return integrator.qold >= controller.accept_safety
8-
end
8+
end

lib/OrdinaryDiffEqVerner/src/interp_func.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ function DiffEqBase.interp_summary(::Type{cacheType},
2828
Union{Vern9Cache, Vern9ConstantCache
2929
}}
3030
dense ? "specialized 9th order lazy interpolation" : "1st order linear"
31-
end
31+
end

lib/OrdinaryDiffEqVerner/src/interpolants.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ RK_WITH_SPECIAL_INTERPOLATIONS = Union{
66
}
77

88
function _ode_interpolant(Θ, dt, y₀, y₁, k,
9-
cache::RK_WITH_SPECIAL_INTERPOLATIONS,
10-
idxs, T::Type{Val{D}}, differential_vars) where {D}
11-
throw(DerivativeOrderNotPossibleError())
9+
cache::RK_WITH_SPECIAL_INTERPOLATIONS,
10+
idxs, T::Type{Val{D}}, differential_vars) where {D}
11+
throw(DerivativeOrderNotPossibleError())
1212
end
1313

1414
function _ode_interpolant!(out, Θ, dt, y₀, y₁, k,
15-
cache::RK_WITH_SPECIAL_INTERPOLATIONS,
16-
idxs, T::Type{Val{D}}, differential_vars) where {D}
17-
throw(DerivativeOrderNotPossibleError())
15+
cache::RK_WITH_SPECIAL_INTERPOLATIONS,
16+
idxs, T::Type{Val{D}}, differential_vars) where {D}
17+
throw(DerivativeOrderNotPossibleError())
1818
end
1919

2020
## Vern6
@@ -1040,4 +1040,4 @@ end
10401040
k[18][idxs] * b24Θdiff + k[19][idxs] * b25Θdiff +
10411041
k[20][idxs] * b26Θdiff) * invdt3
10421042
out
1043-
end
1043+
end

src/algorithms.jl

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ RadauIIA7: Fully-Implicit Runge-Kutta Method
10111011
An A-B-L stable fully implicit Runge-Kutta method with internal tableau complex basis transform for efficiency.
10121012
"""
10131013
struct RadauIIA7{CS, AD, F, P, FDT, ST, CJ, Tol, C1, C2, StepLimiter} <:
1014-
OrdinaryDiffEqNewtonAdaptiveAlgorithm{CS, AD, FDT, ST, CJ}
1014+
OrdinaryDiffEqNewtonAdaptiveAlgorithm{CS, AD, FDT, ST, CJ}
10151015
linsolve::F
10161016
precs::P
10171017
smooth_est::Bool
@@ -1025,30 +1025,29 @@ struct RadauIIA7{CS, AD, F, P, FDT, ST, CJ, Tol, C1, C2, StepLimiter} <:
10251025
end
10261026

10271027
function RadauIIA7(; chunk_size = Val{0}(), autodiff = Val{true}(),
1028-
standardtag = Val{true}(), concrete_jac = nothing,
1029-
diff_type = Val{:forward},
1030-
linsolve = nothing, precs = DEFAULT_PRECS,
1031-
extrapolant = :dense, fast_convergence_cutoff = 1 // 5,
1032-
new_W_γdt_cutoff = 1 // 5,
1033-
controller = :Predictive, κ = nothing, maxiters = 10, smooth_est = true,
1034-
step_limiter! = trivial_limiter!)
1035-
RadauIIA7{_unwrap_val(chunk_size), _unwrap_val(autodiff), typeof(linsolve),
1036-
typeof(precs), diff_type, _unwrap_val(standardtag), _unwrap_val(concrete_jac),
1037-
typeof(κ), typeof(fast_convergence_cutoff),
1038-
typeof(new_W_γdt_cutoff), typeof(step_limiter!)}(linsolve,
1039-
precs,
1040-
smooth_est,
1041-
extrapolant,
1042-
κ,
1043-
maxiters,
1044-
fast_convergence_cutoff,
1045-
new_W_γdt_cutoff,
1046-
controller,
1047-
step_limiter!)
1028+
standardtag = Val{true}(), concrete_jac = nothing,
1029+
diff_type = Val{:forward},
1030+
linsolve = nothing, precs = DEFAULT_PRECS,
1031+
extrapolant = :dense, fast_convergence_cutoff = 1 // 5,
1032+
new_W_γdt_cutoff = 1 // 5,
1033+
controller = :Predictive, κ = nothing, maxiters = 10, smooth_est = true,
1034+
step_limiter! = trivial_limiter!)
1035+
RadauIIA7{_unwrap_val(chunk_size), _unwrap_val(autodiff), typeof(linsolve),
1036+
typeof(precs), diff_type, _unwrap_val(standardtag), _unwrap_val(concrete_jac),
1037+
typeof(κ), typeof(fast_convergence_cutoff),
1038+
typeof(new_W_γdt_cutoff), typeof(step_limiter!)}(linsolve,
1039+
precs,
1040+
smooth_est,
1041+
extrapolant,
1042+
κ,
1043+
maxiters,
1044+
fast_convergence_cutoff,
1045+
new_W_γdt_cutoff,
1046+
controller,
1047+
step_limiter!)
10481048
end
10491049
TruncatedStacktraces.@truncate_stacktrace RadauIIA7
10501050

1051-
10521051
################################################################################
10531052

10541053
# SDIRK Methods

src/cache_utils.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
is_constant_cache(::OrdinaryDiffEqConstantCache) = true
22
is_constant_cache(::OrdinaryDiffEqCache) = false
33
is_constant_cache(cache::CompositeCache) = is_constant_cache(cache.caches[1])
4-
is_constant_cache(::DefaultCache{Cache1}) where {Cache1} = Cache1 <: OrdinaryDiffEqConstantCache
4+
function is_constant_cache(::DefaultCache{Cache1}) where {Cache1}
5+
Cache1 <: OrdinaryDiffEqConstantCache
6+
end
57

68
function DiffEqBase.unwrap_cache(integrator::ODEIntegrator, is_stiff)
79
alg = integrator.alg

0 commit comments

Comments
 (0)