diff --git a/lib/OrdinaryDiffEqFeagin/Project.toml b/lib/OrdinaryDiffEqFeagin/Project.toml new file mode 100644 index 0000000000..8edbcebf0c --- /dev/null +++ b/lib/OrdinaryDiffEqFeagin/Project.toml @@ -0,0 +1,19 @@ +name = "OrdinaryDiffEqFeagin" +uuid = "101fe9f7-ebb6-4678-b671-3a81e7194747" +authors = ["ParamThakkar123 "] +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"] \ No newline at end of file diff --git a/lib/OrdinaryDiffEqFeagin/src/OrdinaryDiffEqFeagin.jl b/lib/OrdinaryDiffEqFeagin/src/OrdinaryDiffEqFeagin.jl new file mode 100644 index 0000000000..5788444dad --- /dev/null +++ b/lib/OrdinaryDiffEqFeagin/src/OrdinaryDiffEqFeagin.jl @@ -0,0 +1,25 @@ +module OrdinaryDiffEqFeagin + +import OrdinaryDiffEq: alg_order, calculate_residuals!, + initialize!, perform_step!, @unpack, unwrap_alg, + calculate_residuals, + OrdinaryDiffEqAlgorithm, + OrdinaryDiffEqMutableCache, OrdinaryDiffEqConstantCache, + 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_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 diff --git a/lib/OrdinaryDiffEqFeagin/src/alg_utils.jl b/lib/OrdinaryDiffEqFeagin/src/alg_utils.jl new file mode 100644 index 0000000000..ec4f4a10d3 --- /dev/null +++ b/lib/OrdinaryDiffEqFeagin/src/alg_utils.jl @@ -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 \ No newline at end of file diff --git a/lib/OrdinaryDiffEqFeagin/src/algorithms.jl b/lib/OrdinaryDiffEqFeagin/src/algorithms.jl new file mode 100644 index 0000000000..7de1e0284f --- /dev/null +++ b/lib/OrdinaryDiffEqFeagin/src/algorithms.jl @@ -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 + diff --git a/src/caches/feagin_caches.jl b/lib/OrdinaryDiffEqFeagin/src/feagin_caches.jl similarity index 100% rename from src/caches/feagin_caches.jl rename to lib/OrdinaryDiffEqFeagin/src/feagin_caches.jl diff --git a/src/perform_step/feagin_rk_perform_step.jl b/lib/OrdinaryDiffEqFeagin/src/feagin_rk_perform_step.jl similarity index 99% rename from src/perform_step/feagin_rk_perform_step.jl rename to lib/OrdinaryDiffEqFeagin/src/feagin_rk_perform_step.jl index 73dd68e2cf..e21bc4e1ac 100644 --- a/src/perform_step/feagin_rk_perform_step.jl +++ b/lib/OrdinaryDiffEqFeagin/src/feagin_rk_perform_step.jl @@ -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 \ No newline at end of file diff --git a/src/tableaus/feagin_tableaus.jl b/lib/OrdinaryDiffEqFeagin/src/feagin_tableaus.jl similarity index 99% rename from src/tableaus/feagin_tableaus.jl rename to lib/OrdinaryDiffEqFeagin/src/feagin_tableaus.jl index 64a056e0c9..708e98e0a5 100644 --- a/src/tableaus/feagin_tableaus.jl +++ b/lib/OrdinaryDiffEqFeagin/src/feagin_tableaus.jl @@ -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 \ No newline at end of file diff --git a/test/algconvergence/ode_feagin_tests.jl b/lib/OrdinaryDiffEqFeagin/test/ode_feagin_tests.jl similarity index 100% rename from test/algconvergence/ode_feagin_tests.jl rename to lib/OrdinaryDiffEqFeagin/test/ode_feagin_tests.jl diff --git a/lib/OrdinaryDiffEqFeagin/test/runtests.jl b/lib/OrdinaryDiffEqFeagin/test/runtests.jl new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/OrdinaryDiffEq.jl b/src/OrdinaryDiffEq.jl index 3fc9b6b580..a688dacd6a 100644 --- a/src/OrdinaryDiffEq.jl +++ b/src/OrdinaryDiffEq.jl @@ -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") @@ -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") @@ -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") @@ -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 @@ -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 diff --git a/src/alg_utils.jl b/src/alg_utils.jl index 6e53655684..4467a10eb1 100644 --- a/src/alg_utils.jl +++ b/src/alg_utils.jl @@ -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 @@ -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 diff --git a/src/algorithms.jl b/src/algorithms.jl index 7e313b5027..973ebb43d4 100644 --- a/src/algorithms.jl +++ b/src/algorithms.jl @@ -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!, diff --git a/src/algorithms/explicit_rk.jl b/src/algorithms/explicit_rk.jl index 80e6ef44ad..49b9f64784 100644 --- a/src/algorithms/explicit_rk.jl +++ b/src/algorithms/explicit_rk.jl @@ -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. diff --git a/test/runtests.jl b/test/runtests.jl index 7e71b2c45a..14aa5a0703 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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__))) @@ -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 @@ -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 @@ -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