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

Added Feagin Package #2267

Merged
merged 63 commits into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
31f3a4b
Feagin
ParamThakkar123 Jun 27, 2024
824423e
Feagin
ParamThakkar123 Jun 27, 2024
fc92fc7
Added SSPRK methods
ParamThakkar123 Jun 27, 2024
b75f89f
Updates
ParamThakkar123 Jun 27, 2024
dde2145
Updates
ParamThakkar123 Jun 27, 2024
8138da5
Updates
ParamThakkar123 Jun 27, 2024
fab066f
Made changes
ParamThakkar123 Jun 27, 2024
8e73f3c
Changes
ParamThakkar123 Jun 27, 2024
c9ab296
Update lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl
ParamThakkar123 Jun 27, 2024
4c7cae7
Update lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl
ParamThakkar123 Jun 27, 2024
ba31d3c
Update lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl
ParamThakkar123 Jun 27, 2024
8c33b11
Update lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl
ParamThakkar123 Jun 27, 2024
647b185
Update lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl
ParamThakkar123 Jun 27, 2024
941e3f5
Feagin
ParamThakkar123 Jun 27, 2024
4d6f82f
Feagin
ParamThakkar123 Jun 27, 2024
ac76041
Changes
ParamThakkar123 Jun 27, 2024
5d8f382
Changes
ParamThakkar123 Jun 27, 2024
26f0457
Changes
ParamThakkar123 Jun 27, 2024
0adbd99
Added SSPRK methods
ParamThakkar123 Jun 27, 2024
cef4a17
Updates
ParamThakkar123 Jun 27, 2024
c3d2c1f
Updates
ParamThakkar123 Jun 27, 2024
ba3dd0e
Updates
ParamThakkar123 Jun 27, 2024
3e2f53b
Made changes
ParamThakkar123 Jun 27, 2024
45eff97
Changes
ParamThakkar123 Jun 27, 2024
0f4428b
Update lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl
ParamThakkar123 Jun 27, 2024
540bddc
Update lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl
ParamThakkar123 Jun 27, 2024
1c0499f
Update lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl
ParamThakkar123 Jun 27, 2024
41d6523
Update lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl
ParamThakkar123 Jun 27, 2024
6521156
Update lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl
ParamThakkar123 Jun 27, 2024
ee12ea4
Feagin
ParamThakkar123 Jun 27, 2024
6858b50
Feagin
ParamThakkar123 Jun 27, 2024
ba69b75
Changes
ParamThakkar123 Jun 27, 2024
aed26c0
Rebased
ParamThakkar123 Jun 28, 2024
732c4c0
Updates
ParamThakkar123 Jun 27, 2024
251fb79
Rebased
ParamThakkar123 Jun 28, 2024
4590c7c
Updates
ParamThakkar123 Jun 27, 2024
510ecc0
Updates
ParamThakkar123 Jun 27, 2024
b22f546
Made changes
ParamThakkar123 Jun 27, 2024
d1edd7b
Changes
ParamThakkar123 Jun 27, 2024
bd3f755
Rebased
ParamThakkar123 Jun 28, 2024
47ed382
SSPRK22 fix
ParamThakkar123 Jun 28, 2024
d072089
Feagin
ParamThakkar123 Jun 27, 2024
8d70433
Feagin
ParamThakkar123 Jun 27, 2024
0506f33
Changes
ParamThakkar123 Jun 27, 2024
83a8836
Rebased
ParamThakkar123 Jun 28, 2024
526a52a
Rebased
ParamThakkar123 Jun 28, 2024
a380562
Updates
ParamThakkar123 Jun 27, 2024
a9b4b6c
Changes
ParamThakkar123 Jun 27, 2024
318603f
Feagin
ParamThakkar123 Jun 27, 2024
b39d14d
Feagin
ParamThakkar123 Jun 27, 2024
8e88987
Changes
ParamThakkar123 Jun 27, 2024
1407339
Feagin
ParamThakkar123 Jun 27, 2024
2afd4b3
Feagin
ParamThakkar123 Jun 27, 2024
b8ab7bf
Changes
ParamThakkar123 Jun 27, 2024
e6d77ff
Feagin
ParamThakkar123 Jun 30, 2024
df443e4
Feagin10
ParamThakkar123 Jun 30, 2024
d2ab832
OrdinaryDiffEqAdaptiveAlgorithm
ParamThakkar123 Jun 30, 2024
1cde4b3
Feagin10ConstantCache
ParamThakkar123 Jun 30, 2024
13fd931
CompiledFloats
ParamThakkar123 Jun 30, 2024
ed65a02
@tight_loop_macros
ParamThakkar123 Jun 30, 2024
0482816
Fixed mistakes
ParamThakkar123 Jun 30, 2024
a26fd75
Final
ParamThakkar123 Jun 30, 2024
4a4350f
Changes
ParamThakkar123 Jun 30, 2024
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
19 changes: 19 additions & 0 deletions lib/OrdinaryDiffEqFeagin/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name = "OrdinaryDiffEqFeagin"
uuid = "101fe9f7-ebb6-4678-b671-3a81e7194747"
authors = ["ParamThakkar123 <[email protected]>"]
version = "1.0.0"

[deps]
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"

[extras]
DiffEqDevTools = "f3b72e0c-5b89-59e1-b016-84e28bfd966d"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
julia = "1.10"

[targets]
test = ["DiffEqDevTools", "Random", "SafeTestsets", "Test"]
28 changes: 28 additions & 0 deletions lib/OrdinaryDiffEqFeagin/src/OrdinaryDiffEqFeagin.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module OrdinaryDiffEqFeagin

import OrdinaryDiffEq: alg_order, calculate_residuals!,
initialize!, perform_step!, @unpack, unwrap_alg,
calculate_residuals, ssp_coefficient,
ParamThakkar123 marked this conversation as resolved.
Show resolved Hide resolved
OrdinaryDiffEqAlgorithm,
OrdinaryDiffEqMutableCache, OrdinaryDiffEqConstantCache,
OrdinaryDiffEqNewtonAdaptiveAlgorithm,
ParamThakkar123 marked this conversation as resolved.
Show resolved Hide resolved
OrdinaryDiffEqRosenbrockAdaptiveAlgorithm,
ParamThakkar123 marked this conversation as resolved.
Show resolved Hide resolved
OrdinaryDiffEqAdaptiveAlgorithm, CompiledFloats, uses_uprev,
alg_cache, _vec, _reshape, @cache, isfsal, full_cache,
constvalue, _unwrap_val, du_alias_or_new,
explicit_rk_docstring, trivial_limiter!,
_ode_interpolant, _ode_interpolant!,
ParamThakkar123 marked this conversation as resolved.
Show resolved Hide resolved
_ode_addsteps!
using DiffEqBase, FastBroadcast, Polyester, MuladdMacro, RecursiveArrayTools
using DiffEqBase: @def, @tight_loop_macros
using Static: False

include("algorithms.jl")
include("alg_utils.jl")
include("feagin_tableaus.jl")
include("feagin_caches.jl")
include("feagin_rk_perform_step.jl")

export Feagin10, Feagin12, Feagin14

end
6 changes: 6 additions & 0 deletions lib/OrdinaryDiffEqFeagin/src/alg_utils.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
alg_order(alg::Feagin10) = 10
alg_order(alg::Feagin12) = 12
alg_order(alg::Feagin14) = 14

alg_adaptive_order(alg::Feagin10) = 8
alg_adaptive_order(alg::Feagin14) = 12
41 changes: 41 additions & 0 deletions lib/OrdinaryDiffEqFeagin/src/algorithms.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"""
@article{feagin2012high,
title={High-order explicit Runge-Kutta methods using m-symmetry},
author={Feagin, Terry},
year={2012},
publisher={Neural, Parallel \\& Scientific Computations}
}

Feagin10: Explicit Runge-Kutta Method
Feagin's 10th-order Runge-Kutta method.
"""
Base.@kwdef struct Feagin10{StepLimiter} <: OrdinaryDiffEqAdaptiveAlgorithm
step_limiter!::StepLimiter = trivial_limiter!
end

"""
@article{feagin2012high,
title={High-order explicit Runge-Kutta methods using m-symmetry},
author={Feagin, Terry},
year={2012},
publisher={Neural, Parallel \\& Scientific Computations}
}

Feagin12: Explicit Runge-Kutta Method
Feagin's 12th-order Runge-Kutta method.
"""
Base.@kwdef struct Feagin12{StepLimiter} <: OrdinaryDiffEqAdaptiveAlgorithm
step_limiter!::StepLimiter = trivial_limiter!
end

"""
Feagin, T., “An Explicit Runge-Kutta Method of Order Fourteen,” Numerical
Algorithms, 2009

Feagin14: Explicit Runge-Kutta Method
Feagin's 14th-order Runge-Kutta method.
"""
Base.@kwdef struct Feagin14{StepLimiter} <: OrdinaryDiffEqAdaptiveAlgorithm
step_limiter!::StepLimiter = trivial_limiter!
end

Original file line number Diff line number Diff line change
Expand Up @@ -1294,4 +1294,4 @@ end
end
f(integrator.fsallast, u, p, t + dt) # For the interpolation, needs k at the updated point
integrator.stats.nf += 1
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -2647,4 +2647,4 @@ function Feagin14ConstantCache(T::Type, T2::Type)
b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17, b18,
b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31,
b32, b33, b34, b35)
end
end
Empty file.
9 changes: 5 additions & 4 deletions src/OrdinaryDiffEq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ include("composite_algs.jl")
include("caches/basic_caches.jl")
include("caches/low_order_rk_caches.jl")
include("caches/high_order_rk_caches.jl")
include("caches/feagin_caches.jl")
include("caches/verner_caches.jl")
include("caches/sdirk_caches.jl")
include("caches/firk_caches.jl")
Expand All @@ -170,7 +169,6 @@ include("tableaus/low_order_rk_tableaus.jl")
include("tableaus/high_order_rk_tableaus.jl")
include("tableaus/symplectic_tableaus.jl")
include("tableaus/verner_tableaus.jl")
include("tableaus/feagin_tableaus.jl")
include("tableaus/rosenbrock_tableaus.jl")
include("tableaus/sdirk_tableaus.jl")
include("tableaus/firk_tableaus.jl")
Expand All @@ -195,7 +193,6 @@ include("perform_step/explicit_rk_perform_step.jl")
include("perform_step/low_order_rk_perform_step.jl")
include("perform_step/high_order_rk_perform_step.jl")
include("perform_step/verner_rk_perform_step.jl")
include("perform_step/feagin_rk_perform_step.jl")
include("perform_step/sdirk_perform_step.jl")
include("perform_step/kencarp_kvaerno_perform_step.jl")
include("perform_step/firk_perform_step.jl")
Expand Down Expand Up @@ -265,6 +262,10 @@ export SSPRK53_2N2, SSPRK22, SSPRK53, SSPRK63, SSPRK83, SSPRK43, SSPRK432, SSPRK
SSPRK54, SSPRK53_2N1, SSPRK104, SSPRK932, SSPRKMSVS43, SSPRK73, SSPRK53_H,
SSPRK33, SHLDDRK_2N, KYKSSPRK42, SHLDDRK52

include("../lib/OrdinaryDiffEqFeagin/src/OrdinaryDiffEqFeagin.jl")
using ..OrdinaryDiffEqFeagin
export Feagin10, Feagin12, Feagin14

import PrecompileTools

PrecompileTools.@compile_workload begin
Expand Down Expand Up @@ -398,7 +399,7 @@ export constructDormandPrince
export FunctionMap, Euler, Heun, Ralston, Midpoint, RK4, ExplicitRK, OwrenZen3, OwrenZen4,
OwrenZen5,
BS3, BS5, DP5, Tsit5, DP8, Vern6, Vern7, Vern8, TanYam7, TsitPap8,
Vern9, Feagin10, Feagin12, Feagin14, CompositeAlgorithm, Anas5, RKO65, FRK65, PFRK87,
Vern9, CompositeAlgorithm, Anas5, RKO65, FRK65, PFRK87,
RKM, MSRK5, MSRK6, Stepanov5, SIR54, QPRK98, PSRK4p7q6, PSRK3p6q5, PSRK3p5q4

export RadauIIA3, RadauIIA5
Expand Down
5 changes: 0 additions & 5 deletions src/alg_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,6 @@ alg_order(alg::SFSDIRK7) = 4
alg_order(alg::SFSDIRK8) = 4
alg_order(alg::Hairer4) = 4
alg_order(alg::Hairer42) = 4
alg_order(alg::Feagin10) = 10
alg_order(alg::Feagin12) = 12
alg_order(alg::Feagin14) = 14
alg_order(alg::PFRK87) = 8

alg_order(alg::ROS2) = 2
Expand Down Expand Up @@ -621,8 +618,6 @@ alg_maximum_order(alg::CompositeAlgorithm) = maximum(alg_order(x) for x in alg.a

alg_adaptive_order(alg::ExplicitRK) = alg.tableau.adaptiveorder
alg_adaptive_order(alg::Union{OrdinaryDiffEqAlgorithm, DAEAlgorithm}) = alg_order(alg) - 1
alg_adaptive_order(alg::Feagin10) = 8
alg_adaptive_order(alg::Feagin14) = 12

alg_adaptive_order(alg::Rosenbrock23) = 3
alg_adaptive_order(alg::Rosenbrock32) = 2
Expand Down
1 change: 0 additions & 1 deletion src/algorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ ExplicitRK(; tableau = ODE_DEFAULT_TABLEAU) = ExplicitRK(tableau)
TruncatedStacktraces.@truncate_stacktrace ExplicitRK

@inline trivial_limiter!(u, integrator, p, t) = nothing

"""
SIR54(; stage_limiter! = OrdinaryDiffEq.trivial_limiter!,
step_limiter! = OrdinaryDiffEq.trivial_limiter!,
Expand Down
41 changes: 0 additions & 41 deletions src/algorithms/explicit_rk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -406,47 +406,6 @@ function TsitPap8(stage_limiter!, step_limiter! = trivial_limiter!)
TsitPap8(stage_limiter!, step_limiter!, False())
end

"""
@article{feagin2012high,
title={High-order explicit Runge-Kutta methods using m-symmetry},
author={Feagin, Terry},
year={2012},
publisher={Neural, Parallel \\& Scientific Computations}
}

Feagin10: Explicit Runge-Kutta Method
Feagin's 10th-order Runge-Kutta method.
"""
Base.@kwdef struct Feagin10{StepLimiter} <: OrdinaryDiffEqAdaptiveAlgorithm
step_limiter!::StepLimiter = trivial_limiter!
end

"""
@article{feagin2012high,
title={High-order explicit Runge-Kutta methods using m-symmetry},
author={Feagin, Terry},
year={2012},
publisher={Neural, Parallel \\& Scientific Computations}
}

Feagin12: Explicit Runge-Kutta Method
Feagin's 12th-order Runge-Kutta method.
"""
Base.@kwdef struct Feagin12{StepLimiter} <: OrdinaryDiffEqAdaptiveAlgorithm
step_limiter!::StepLimiter = trivial_limiter!
end

"""
Feagin, T., “An Explicit Runge-Kutta Method of Order Fourteen,” Numerical
Algorithms, 2009

Feagin14: Explicit Runge-Kutta Method
Feagin's 14th-order Runge-Kutta method.
"""
Base.@kwdef struct Feagin14{StepLimiter} <: OrdinaryDiffEqAdaptiveAlgorithm
step_limiter!::StepLimiter = trivial_limiter!
end

@doc explicit_rk_docstring("Zero Dissipation Runge-Kutta of 6th order.", "FRK65",
extra_keyword_description = """- `omega`: a periodicity phase estimate,
when accurate this method results in zero numerical dissipation.
Expand Down
17 changes: 16 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ function activate_stabilized_irk()
Pkg.instantiate()
end

function activate_low_storage_rk()
Pkg.activate("../lib/OrdinaryDiffEqStabilizedIRK")
Pkg.develop(PackageSpec(path = dirname(@__DIR__)))
Pkg.instantiate()
end

function activate_low_storage_rk()
Pkg.activate("../lib/OrdinaryDiffEqLowStorageRK")
Pkg.develop(PackageSpec(path = dirname(@__DIR__)))
Expand All @@ -53,6 +59,12 @@ function activate_ssprk()
Pkg.instantiate()
end

function activate_feagin()
Pkg.activate("../lib/OrdinaryDiffEqFeagin")
Pkg.develop(PackageSpec(path = dirname(@__DIR__)))
Pkg.instantiate()
end

#Start Test Script

@time begin
Expand Down Expand Up @@ -187,7 +199,6 @@ end
@time @safetestset "FIRK Tests" include("algconvergence/ode_firk_tests.jl")
@time @safetestset "Linear-Nonlinear Methods Tests" include("algconvergence/linear_nonlinear_convergence_tests.jl")
@time @safetestset "Linear-Nonlinear Krylov Methods Tests" include("algconvergence/linear_nonlinear_krylov_tests.jl")
@time @safetestset "Feagin Tests" include("algconvergence/ode_feagin_tests.jl")
@time @safetestset "Symplectic Tests" include("algconvergence/symplectic_tests.jl")
@time @safetestset "Quadruple precision Runge-Kutta Tests" include("algconvergence/ode_quadruple_precision_tests.jl")
end
Expand All @@ -196,6 +207,10 @@ end
@time @safetestset "Extrapolation Tests" include("../lib/OrdinaryDiffEqExtrapolation/test/runtests.jl")
end

if !is_APPVEYOR && GROUP == "Feagin"
@time @safetestset "Feagin Tests" include("../lib/OrdinaryDiffEqFeagin/test/ode_feagin_tests.jl")
end

if !is_APPVEYOR && GROUP == "StabilizedRK"
@time @safetestset "StabilizedRK Tests" include("../lib/OrdinaryDiffEqStabilizedRK/test/runtests.jl")
end
Expand Down
Loading