Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Jul 20, 2024
1 parent 105688a commit 035eec0
Show file tree
Hide file tree
Showing 15 changed files with 537 additions and 509 deletions.
6 changes: 4 additions & 2 deletions lib/OrdinaryDiffEqDefault/src/OrdinaryDiffEqDefault.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
module OrdinaryDiffEqDefault

using OrdinaryDiffEq: Vern7, Vern8, Vern9, Vern6, Tsit5, Rosenbrock23, Rodas5P, FBDF,
alg_stability_size, beta2_default, beta1_default, AutoSwitchCache, ODEIntegrator,
CompositeAlgorithm, OrdinaryDiffEqAlgorithm, OrdinaryDiffEqMutableCache, AutoAlgSwitch
alg_stability_size, beta2_default, beta1_default, AutoSwitchCache,
ODEIntegrator,
CompositeAlgorithm, OrdinaryDiffEqAlgorithm,
OrdinaryDiffEqMutableCache, AutoAlgSwitch
import OrdinaryDiffEq: is_mass_matrix_alg, default_autoswitch
import LinearSolve
using LinearAlgebra: I, isdiag
Expand Down
4 changes: 2 additions & 2 deletions lib/OrdinaryDiffEqDefault/src/default_alg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,6 @@ end

# hack for the default alg
function is_mass_matrix_alg(alg::CompositeAlgorithm{
<:Any, <:Tuple{Tsit5, Vern7, Rosenbrock23, Rodas5P, FBDF, FBDF}})
<:Any, <:Tuple{Tsit5, Vern7, Rosenbrock23, Rodas5P, FBDF, FBDF}})
true
end
end
2 changes: 1 addition & 1 deletion lib/OrdinaryDiffEqVerner/src/alg_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ alg_order(alg::Vern9) = 9
alg_stability_size(alg::Vern6) = 4.8553
alg_stability_size(alg::Vern7) = 4.6400
alg_stability_size(alg::Vern8) = 5.8641
alg_stability_size(alg::Vern9) = 4.4762
alg_stability_size(alg::Vern9) = 4.4762
2 changes: 1 addition & 1 deletion lib/OrdinaryDiffEqVerner/src/algorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ end
AutoVern6(alg; lazy = true, kwargs...) = AutoAlgSwitch(Vern6(lazy = lazy), alg; kwargs...)
AutoVern7(alg; lazy = true, kwargs...) = AutoAlgSwitch(Vern7(lazy = lazy), alg; kwargs...)
AutoVern8(alg; lazy = true, kwargs...) = AutoAlgSwitch(Vern8(lazy = lazy), alg; kwargs...)
AutoVern9(alg; lazy = true, kwargs...) = AutoAlgSwitch(Vern9(lazy = lazy), alg; kwargs...)
AutoVern9(alg; lazy = true, kwargs...) = AutoAlgSwitch(Vern9(lazy = lazy), alg; kwargs...)
2 changes: 1 addition & 1 deletion lib/OrdinaryDiffEqVerner/src/controllers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ end

@inline function accept_step_controller(integrator, controller::PIDController)
return integrator.qold >= controller.accept_safety
end
end
2 changes: 1 addition & 1 deletion lib/OrdinaryDiffEqVerner/src/interp_func.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ function DiffEqBase.interp_summary(::Type{cacheType},
Union{Vern9Cache, Vern9ConstantCache
}}
dense ? "specialized 9th order lazy interpolation" : "1st order linear"
end
end
14 changes: 7 additions & 7 deletions lib/OrdinaryDiffEqVerner/src/interpolants.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ RK_WITH_SPECIAL_INTERPOLATIONS = Union{
}

function _ode_interpolant(Θ, dt, y₀, y₁, k,
cache::RK_WITH_SPECIAL_INTERPOLATIONS,
idxs, T::Type{Val{D}}, differential_vars) where {D}
throw(DerivativeOrderNotPossibleError())
cache::RK_WITH_SPECIAL_INTERPOLATIONS,
idxs, T::Type{Val{D}}, differential_vars) where {D}
throw(DerivativeOrderNotPossibleError())
end

function _ode_interpolant!(out, Θ, dt, y₀, y₁, k,
cache::RK_WITH_SPECIAL_INTERPOLATIONS,
idxs, T::Type{Val{D}}, differential_vars) where {D}
throw(DerivativeOrderNotPossibleError())
cache::RK_WITH_SPECIAL_INTERPOLATIONS,
idxs, T::Type{Val{D}}, differential_vars) where {D}
throw(DerivativeOrderNotPossibleError())
end

## Vern6
Expand Down Expand Up @@ -1040,4 +1040,4 @@ end
k[18][idxs] * b24Θdiff + k[19][idxs] * b25Θdiff +
k[20][idxs] * b26Θdiff) * invdt3
out
end
end
43 changes: 21 additions & 22 deletions src/algorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ RadauIIA7: Fully-Implicit Runge-Kutta Method
An A-B-L stable fully implicit Runge-Kutta method with internal tableau complex basis transform for efficiency.
"""
struct RadauIIA7{CS, AD, F, P, FDT, ST, CJ, Tol, C1, C2, StepLimiter} <:
OrdinaryDiffEqNewtonAdaptiveAlgorithm{CS, AD, FDT, ST, CJ}
OrdinaryDiffEqNewtonAdaptiveAlgorithm{CS, AD, FDT, ST, CJ}
linsolve::F
precs::P
smooth_est::Bool
Expand All @@ -1025,30 +1025,29 @@ struct RadauIIA7{CS, AD, F, P, FDT, ST, CJ, Tol, C1, C2, StepLimiter} <:
end

function RadauIIA7(; chunk_size = Val{0}(), autodiff = Val{true}(),
standardtag = Val{true}(), concrete_jac = nothing,
diff_type = Val{:forward},
linsolve = nothing, precs = DEFAULT_PRECS,
extrapolant = :dense, fast_convergence_cutoff = 1 // 5,
new_W_γdt_cutoff = 1 // 5,
controller = :Predictive, κ = nothing, maxiters = 10, smooth_est = true,
step_limiter! = trivial_limiter!)
RadauIIA7{_unwrap_val(chunk_size), _unwrap_val(autodiff), typeof(linsolve),
typeof(precs), diff_type, _unwrap_val(standardtag), _unwrap_val(concrete_jac),
typeof(κ), typeof(fast_convergence_cutoff),
typeof(new_W_γdt_cutoff), typeof(step_limiter!)}(linsolve,
precs,
smooth_est,
extrapolant,
κ,
maxiters,
fast_convergence_cutoff,
new_W_γdt_cutoff,
controller,
step_limiter!)
standardtag = Val{true}(), concrete_jac = nothing,
diff_type = Val{:forward},
linsolve = nothing, precs = DEFAULT_PRECS,
extrapolant = :dense, fast_convergence_cutoff = 1 // 5,
new_W_γdt_cutoff = 1 // 5,
controller = :Predictive, κ = nothing, maxiters = 10, smooth_est = true,
step_limiter! = trivial_limiter!)
RadauIIA7{_unwrap_val(chunk_size), _unwrap_val(autodiff), typeof(linsolve),
typeof(precs), diff_type, _unwrap_val(standardtag), _unwrap_val(concrete_jac),
typeof(κ), typeof(fast_convergence_cutoff),
typeof(new_W_γdt_cutoff), typeof(step_limiter!)}(linsolve,
precs,
smooth_est,
extrapolant,
κ,
maxiters,
fast_convergence_cutoff,
new_W_γdt_cutoff,
controller,
step_limiter!)
end
TruncatedStacktraces.@truncate_stacktrace RadauIIA7


################################################################################

# SDIRK Methods
Expand Down
4 changes: 3 additions & 1 deletion src/cache_utils.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
is_constant_cache(::OrdinaryDiffEqConstantCache) = true
is_constant_cache(::OrdinaryDiffEqCache) = false
is_constant_cache(cache::CompositeCache) = is_constant_cache(cache.caches[1])
is_constant_cache(::DefaultCache{Cache1}) where {Cache1} = Cache1 <: OrdinaryDiffEqConstantCache
function is_constant_cache(::DefaultCache{Cache1}) where {Cache1}
Cache1 <: OrdinaryDiffEqConstantCache
end

function DiffEqBase.unwrap_cache(integrator::ODEIntegrator, is_stiff)
alg = integrator.alg
Expand Down
Loading

0 comments on commit 035eec0

Please sign in to comment.