From ef251c634dbdb89c1458569ed11066667f6bdad6 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Sun, 23 Jun 2024 23:31:51 +0530 Subject: [PATCH 01/54] Added a separate package for Low Storage RK methods --- lib/OrdinaryDiffEqLowStorageRK/Project.toml | 24 + .../src/OrdinaryDiffEqLowStorageRK.jl | 54 ++ .../src/algorithms.jl | 757 +++++++++--------- .../src}/low_storage_rk_caches.jl | 0 .../src}/low_storage_rk_perform_step.jl | 0 .../test}/ode_low_storage_rk_tests.jl | 2 +- src/OrdinaryDiffEq.jl | 23 +- src/algorithms/explicit_rk.jl | 38 - test/runtests.jl | 17 +- 9 files changed, 498 insertions(+), 417 deletions(-) create mode 100644 lib/OrdinaryDiffEqLowStorageRK/Project.toml create mode 100644 lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl rename src/algorithms/explicit_rk_pde.jl => lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl (97%) rename {src/caches => lib/OrdinaryDiffEqLowStorageRK/src}/low_storage_rk_caches.jl (100%) rename {src/perform_step => lib/OrdinaryDiffEqLowStorageRK/src}/low_storage_rk_perform_step.jl (100%) rename {test/algconvergence => lib/OrdinaryDiffEqLowStorageRK/test}/ode_low_storage_rk_tests.jl (99%) diff --git a/lib/OrdinaryDiffEqLowStorageRK/Project.toml b/lib/OrdinaryDiffEqLowStorageRK/Project.toml new file mode 100644 index 0000000000..36c1f5629b --- /dev/null +++ b/lib/OrdinaryDiffEqLowStorageRK/Project.toml @@ -0,0 +1,24 @@ +name = "OrdinaryDiffEqLowStorageRK" +uuid = "b0944070-b475-4768-8dec-fb6eb410534d" +authors = ["ParamThakkar123 "] +version = "1.0.0" + +[deps] +FastBroadcast = "7034ab61-46d4-4ed7-9d0f-46aef9175898" +MuladdMacro = "46d2c3a1-f734-5fdb-9937-b9b9aeba4221" +LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" +OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" +Polyester = "f517fe37-dbe3-4b94-8317-1923a5111588" +RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" + +[compat] +julia = "1.10" + +[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" + +[targets] +test = ["DiffEqDevTools", "Random", "SafeTestsets", "Test"] \ No newline at end of file diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl new file mode 100644 index 0000000000..a576ed666c --- /dev/null +++ b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl @@ -0,0 +1,54 @@ +module OrdinaryDiffEqLowStorageRK + +import OrdinaryDiffEq: alg_order, alg_maximum_order, get_current_adaptive_order, + get_current_alg_order, calculate_residuals!, accept_step_controller, + default_controller, beta2_default, beta1_default, gamma_default, + initialize!, perform_step!, @unpack, unwrap_alg, isthreaded, + step_accept_controller!, calculate_residuals, + OrdinaryDiffEqMutableCache, OrdinaryDiffEqConstantCache, + reset_alg_dependent_opts!, AbstractController, + step_accept_controller!, step_reject_controller!, + OrdinaryDiffEqAdaptiveAlgorithm, OrdinaryDiffEqAdaptiveImplicitAlgorithm, + alg_cache, CompiledFloats, @threaded, stepsize_controller!, DEFAULT_PRECS, + constvalue, PolyesterThreads, Sequential, BaseThreads, + _digest_beta1_beta2, timedepentdtmin, _unwrap_val, + TimeDerivativeWrapper, UDerivativeWrapper, calc_J, _reshape, _vec, + WOperator, TimeGradientWrapper, UJacobianWrapper, build_grad_config, + build_jac_config, calc_J!, jacobian2W!, dolinsolve +using DiffEqBase, FastBroadcast, Polyester, MuladdMacro, RecursiveArrayTools, LinearSolve + +macro cache(expr) + name = expr.args[2].args[1].args[1] + fields = [x for x in expr.args[3].args if typeof(x) != LineNumberNode] + cache_vars = Expr[] + jac_vars = Pair{Symbol, Expr}[] + for x in fields + if x.args[2] == :uType || x.args[2] == :rateType || + x.args[2] == :kType || x.args[2] == :uNoUnitsType + push!(cache_vars, :(c.$(x.args[1]))) + elseif x.args[2] == :DiffCacheType + push!(cache_vars, :(c.$(x.args[1]).du)) + push!(cache_vars, :(c.$(x.args[1]).dual_du)) + end + end + quote + $(esc(expr)) + $(esc(:full_cache))(c::$name) = tuple($(cache_vars...)) + end +end + +include("low_storage_rk_caches.jl") +include("low_storage_rk_perform_step.jl") +include("algorithms.jl") + +export ORK256, SSPRK53_2N1, SSPRK53_2N2, NDBLSRK124, CarpenterKennedy2N54, NDBLSRK134, NDBLSRK144, CFRLDDRK64, + CFRLDDRK64, TSLDDRK74, DGLDDRK73_C, DGLDDRK84_C, DGLDDRK84_F, SHLDDRK64, RK46NL, ParsaniKetchesonDeconinck3S32, + ParsaniKetchesonDeconinck3S82, ParsaniKetchesonDeconinck3S53, ParsaniKetchesonDeconinck3S173, ParsaniKetchesonDeconinck3S94, + ParsaniKetchesonDeconinck3S184, ParsaniKetchesonDeconinck3S105, ParsaniKetchesonDeconinck3S205, CKLLSRK43_2, + CKLLSRK54_3C, CKLLSRK95_4S, CKLLSRK95_4C, CKLLSRK95_4M, CKLLSRK54_3C_3R, CKLLSRK54_3M_3R, CKLLSRK54_3N_3R, + CKLLSRK85_4C_3R, CKLLSRK85_4M_3R, CKLLSRK85_4P_3R, CKLLSRK54_3N_4R, CKLLSRK54_3M_4R, CKLLSRK65_4M_4R, + CKLLSRK85_4FM_4R, CKLLSRK75_4M_5R, RDPK3Sp35, RDPK3SpFSAL35, RDPK3Sp49, RDPK3SpFSAL49, RDPK3Sp510, + RDPK3SpFSAL510, SSPRK104, SSPRK54, SSPRK932, SSPRKMSVS32, SSPRKMSVS43, SSPRK432, SSPRK43, SSPRK83, + SSPRK73, SSPRK63, SSPRK53_H, KYKSSPRK42, SSPRK53, SSPRK33, SSPRK22, YK2014DGSSPRK_3S2, NDBLSRK134, + SLDDRK64, SHLDDRK_2N, SHLDDRK52 +end diff --git a/src/algorithms/explicit_rk_pde.jl b/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl similarity index 97% rename from src/algorithms/explicit_rk_pde.jl rename to lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl index 20fbeadeae..8748d26396 100644 --- a/src/algorithms/explicit_rk_pde.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl @@ -1,4 +1,64 @@ -#Low Storage Explicit Runge-Kutta Methods +@doc explicit_rk_docstring( + "A second-order, five-stage explicit Runge-Kutta method for wave propagation +equations. Fixed timestep only.", "ORK256", + references = "Matteo Bernardini, Sergio Pirozzoli. + A General Strategy for the Optimization of Runge-Kutta Schemes for Wave + Propagation Phenomena. + Journal of Computational Physics, 228(11), pp 4182-4199, 2009. + doi: https://doi.org/10.1016/j.jcp.2009.02.032", + extra_keyword_description = """- `williamson_condition`: allows for an optimization that allows fusing broadcast expressions with the function call `f`. However, it only works for `Array` types. + """, + extra_keyword_default = "williamson_condition = true") +Base.@kwdef struct ORK256{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() + williamson_condition::Bool = true +end +# for backwards compatibility +function ORK256(stage_limiter!, + step_limiter! = trivial_limiter!; + williamson_condition = true) + ORK256(stage_limiter!, step_limiter!, False(), williamson_condition) +end + +@doc explicit_rk_docstring( + "A third-order, five-stage explicit strong stability preserving (SSP) low-storage method. +Fixed timestep only.", + "SSPRK53_2N1", + references = "Higueras and T. Roldán. + New third order low-storage SSP explicit Runge–Kutta methods + arXiv:1809.04807v1.") +Base.@kwdef struct SSPRK53_2N1{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SSPRK53_2N1(stage_limiter!, step_limiter! = trivial_limiter!) + SSPRK53_2N1(stage_limiter!, + step_limiter!, + False()) +end + +@doc explicit_rk_docstring( + "A third-order, five-stage explicit strong stability preserving (SSP) low-storage method. +Fixed timestep only.", + "SSPRK53_2N2", + references = "Higueras and T. Roldán. + New third order low-storage SSP explicit Runge–Kutta methods + arXiv:1809.04807v1.") +Base.@kwdef struct SSPRK53_2N2{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SSPRK53_2N2(stage_limiter!, step_limiter! = trivial_limiter!) + SSPRK53_2N2(stage_limiter!, + step_limiter!, + False()) +end @doc explicit_rk_docstring( "A fourth-order, five-stage explicit low-storage method of Carpenter and Kennedy @@ -28,108 +88,91 @@ function CarpenterKennedy2N54(stage_limiter!, end @doc explicit_rk_docstring( - "A fourth-order, six-stage explicit low-storage method. Fixed timestep only.", - "SHLDDRK64", - references = "D. Stanescu, W. G. Habashi. - 2N-Storage Low Dissipation and Dispersion Runge-Kutta Schemes for Computational - Acoustics. - Journal of Computational Physics, 143(2), pp 674-681, 1998. - doi: https://doi.org/10.1006/jcph.1998.5986 - }", + "12-stage, fourth order low-storage method with optimized stability regions for +advection-dominated problems. Fixed timestep only.", + "NDBLSRK124", + references = "Jens Niegemann, Richard Diehl, Kurt Busch. + Efficient Low-Storage Runge–Kutta Schemes with Optimized Stability Regions. + Journal of Computational Physics, 231, pp 364-372, 2012. + doi: https://doi.org/10.1016/j.jcp.2011.09.003", extra_keyword_description = """- `williamson_condition`: allows for an optimization that allows fusing broadcast expressions with the function call `f`. However, it only works for `Array` types. """, extra_keyword_default = "williamson_condition = true") -Base.@kwdef struct SHLDDRK64{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm +Base.@kwdef struct NDBLSRK124{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() williamson_condition::Bool = true end # for backwards compatibility -function SHLDDRK64(stage_limiter!, - step_limiter! = trivial_limiter!; +function NDBLSRK124(stage_limiter!, step_limiter! = trivial_limiter!; williamson_condition = true) - SHLDDRK64(stage_limiter!, step_limiter!, False(), williamson_condition) + NDBLSRK124(stage_limiter!, + step_limiter!, False(), + williamson_condition) end -@doc explicit_rk_docstring("TBD", "SHLDDRK52") -Base.@kwdef struct SHLDDRK52{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm +@doc explicit_rk_docstring( + "14-stage, fourth order low-storage method with optimized stability regions for +advection-dominated problems. Fixed timestep only.", + "NDBLSRK144", + references = "Jens Niegemann, Richard Diehl, Kurt Busch. + Efficient Low-Storage Runge–Kutta Schemes with Optimized Stability Regions. + Journal of Computational Physics, 231, pp 364-372, 2012. + doi: https://doi.org/10.1016/j.jcp.2011.09.003", + extra_keyword_description = """- `williamson_condition`: allows for an optimization that allows fusing broadcast expressions with the function call `f`. However, it only works for `Array` types. + """, + extra_keyword_default = "williamson_condition = true") +Base.@kwdef struct NDBLSRK144{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() + williamson_condition::Bool = true end # for backwards compatibility -function SHLDDRK52(stage_limiter!, step_limiter! = trivial_limiter!) - SHLDDRK52(stage_limiter!, - step_limiter!, - False()) +function NDBLSRK144(stage_limiter!, step_limiter! = trivial_limiter!; + williamson_condition = true) + NDBLSRK144{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, + step_limiter!, False(), + williamson_condition) end -@doc explicit_rk_docstring("TBD", "SHLDDRK_2N") -Base.@kwdef struct SHLDDRK_2N{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm +@doc explicit_rk_docstring("Low-Storage Method +6-stage, fourth order low-storage, low-dissipation, low-dispersion scheme. +Fixed timestep only.", "CFRLDDRK64", + references = "M. Calvo, J. M. Franco, L. Randez. A New Minimum Storage Runge–Kutta Scheme + for Computational Acoustics. Journal of Computational Physics, 201, pp 1-12, 2004. + doi: https://doi.org/10.1016/j.jcp.2004.05.012") +Base.@kwdef struct CFRLDDRK64{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function SHLDDRK_2N(stage_limiter!, step_limiter! = trivial_limiter!) - SHLDDRK_2N(stage_limiter!, +function CFRLDDRK64(stage_limiter!, step_limiter! = trivial_limiter!) + CFRLDDRK64(stage_limiter!, step_limiter!, False()) end -@doc explicit_rk_docstring("Low-Storage Method -6-stage, fourth order low-stage, low-dissipation, low-dispersion scheme. -Fixed timestep only.", "HSLDDRK64", - references = "D. Stanescu, W. G. Habashi. - 2N-Storage Low Dissipation and Dispersion Runge-Kutta Schemes for Computational - Acoustics. - Journal of Computational Physics, 143(2), pp 674-681, 1998. - doi: https://doi.org/10.1006/jcph.1998.5986 - }", - extra_keyword_description = """- `williamson_condition`: allows for an optimization that allows fusing broadcast expressions with the function call `f`. However, it only works for `Array` types. - """, - extra_keyword_default = "williamson_condition = true") -struct HSLDDRK64{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm - stage_limiter!::StageLimiter - step_limiter!::StepLimiter - thread::Thread - williamson_condition::Bool - function HSLDDRK64(stage_limiter! = trivial_limiter!, step_limiter! = trivial_limiter!; - williamson_condition = true) - Base.depwarn("HSLDDRK64 is deprecated, use SHLDDRK64 instead.", :HSLDDRK64) - SHLDDRK64(stage_limiter!, step_limiter!, thread; - williamson_condition = williamson_condition) - end -end - @doc explicit_rk_docstring( - "7-stage, third order low-storage low-dissipation, low-dispersion scheme for -discontinuous Galerkin space discretizations applied to wave propagation problems. -Optimized for PDE discretizations when maximum spatial step is small due to -geometric features of computational domain. Fixed timestep only.", - "DGLDDRK73_C", - references = "T. Toulorge, W. Desmet. - Optimal Runge–Kutta Schemes for Discontinuous Galerkin Space Discretizations - Applied to Wave Propagation Problems. - Journal of Computational Physics, 231(4), pp 2067-2091, 2012. - doi: https://doi.org/10.1016/j.jcp.2011.11.024", - extra_keyword_description = """- `williamson_condition`: allows for an optimization that allows fusing broadcast expressions with the function call `f`. However, it only works for `Array` types. - """, - extra_keyword_default = "williamson_condition = true") -Base.@kwdef struct DGLDDRK73_C{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + "Low-Storage Method +7-stage, fourth order low-storage low-dissipation, low-dispersion scheme with maximal accuracy and stability limit along the imaginary axes. +Fixed timestep only.", + "TSLDDRK74", + references = "Kostas Tselios, T. E. Simos. Optimized Runge–Kutta Methods with Minimal Dispersion and Dissipation + for Problems arising from Computational Acoustics. Physics Letters A, 393(1-2), pp 38-47, 2007. + doi: https://doi.org/10.1016/j.physleta.2006.10.072") +Base.@kwdef struct TSLDDRK74{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() - williamson_condition::Bool = true end # for backwards compatibility -function DGLDDRK73_C(stage_limiter!, step_limiter! = trivial_limiter!; - williamson_condition = true) - DGLDDRK73_C(stage_limiter!, +function TSLDDRK74(stage_limiter!, step_limiter! = trivial_limiter!) + TSLDDRK74(stage_limiter!, step_limiter!, - False(), - williamson_condition) + False()) end @doc explicit_rk_docstring( @@ -191,233 +234,233 @@ function DGLDDRK84_F(stage_limiter!, step_limiter! = trivial_limiter!; end @doc explicit_rk_docstring( - "12-stage, fourth order low-storage method with optimized stability regions for -advection-dominated problems. Fixed timestep only.", - "NDBLSRK124", - references = "Jens Niegemann, Richard Diehl, Kurt Busch. - Efficient Low-Storage Runge–Kutta Schemes with Optimized Stability Regions. - Journal of Computational Physics, 231, pp 364-372, 2012. - doi: https://doi.org/10.1016/j.jcp.2011.09.003", + "A fourth-order, six-stage explicit low-storage method. Fixed timestep only.", + "SHLDDRK64", + references = "D. Stanescu, W. G. Habashi. + 2N-Storage Low Dissipation and Dispersion Runge-Kutta Schemes for Computational + Acoustics. + Journal of Computational Physics, 143(2), pp 674-681, 1998. + doi: https://doi.org/10.1006/jcph.1998.5986 + }", extra_keyword_description = """- `williamson_condition`: allows for an optimization that allows fusing broadcast expressions with the function call `f`. However, it only works for `Array` types. """, extra_keyword_default = "williamson_condition = true") -Base.@kwdef struct NDBLSRK124{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm +Base.@kwdef struct SHLDDRK64{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() williamson_condition::Bool = true end # for backwards compatibility -function NDBLSRK124(stage_limiter!, step_limiter! = trivial_limiter!; +function SHLDDRK64(stage_limiter!, + step_limiter! = trivial_limiter!; williamson_condition = true) - NDBLSRK124(stage_limiter!, - step_limiter!, False(), - williamson_condition) + SHLDDRK64(stage_limiter!, step_limiter!, False(), williamson_condition) end @doc explicit_rk_docstring( - "13-stage, fourth order low-storage method with optimized stability regions for -advection-dominated problems. Fixed timestep only.", - "NDBLSRK134", - references = "Jens Niegemann, Richard Diehl, Kurt Busch. - Efficient Low-Storage Runge–Kutta Schemes with Optimized Stability Regions. - Journal of Computational Physics, 231, pp 364-372, 2012. - doi: https://doi.org/10.1016/j.jcp.2011.09.003", - extra_keyword_description = """- `williamson_condition`: allows for an optimization that allows fusing broadcast expressions with the function call `f`. However, it only works for `Array` types. - """, - extra_keyword_default = "williamson_condition = true") -Base.@kwdef struct NDBLSRK134{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + "6-stage, fourth order low-stage, low-dissipation, low-dispersion scheme. +Fixed timestep only.", "RK46NL", + references = "Julien Berland, Christophe Bogey, Christophe Bailly. Low-Dissipation and Low-Dispersion Fourth-Order Runge-Kutta Algorithm. Computers & Fluids, 35(10), pp 1459-1463, 2006. doi: https://doi.org/10.1016/j.compfluid.2005.04.003") +Base.@kwdef struct RK46NL{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() - williamson_condition::Bool = true end # for backwards compatibility -function NDBLSRK134(stage_limiter!, step_limiter! = trivial_limiter!; - williamson_condition = true) - NDBLSRK134(stage_limiter!, - step_limiter!, False(), - williamson_condition) +function RK46NL(stage_limiter!, step_limiter! = trivial_limiter!) + RK46NL(stage_limiter!, step_limiter!, False()) end @doc explicit_rk_docstring( - "14-stage, fourth order low-storage method with optimized stability regions for -advection-dominated problems. Fixed timestep only.", - "NDBLSRK144", - references = "Jens Niegemann, Richard Diehl, Kurt Busch. - Efficient Low-Storage Runge–Kutta Schemes with Optimized Stability Regions. - Journal of Computational Physics, 231, pp 364-372, 2012. - doi: https://doi.org/10.1016/j.jcp.2011.09.003", - extra_keyword_description = """- `williamson_condition`: allows for an optimization that allows fusing broadcast expressions with the function call `f`. However, it only works for `Array` types. - """, - extra_keyword_default = "williamson_condition = true") -Base.@kwdef struct NDBLSRK144{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() - williamson_condition::Bool = true -end -# for backwards compatibility -function NDBLSRK144(stage_limiter!, step_limiter! = trivial_limiter!; - williamson_condition = true) - NDBLSRK144{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, - step_limiter!, False(), - williamson_condition) -end - -@doc explicit_rk_docstring("Low-Storage Method -6-stage, fourth order low-storage, low-dissipation, low-dispersion scheme. -Fixed timestep only.", "CFRLDDRK64", - references = "M. Calvo, J. M. Franco, L. Randez. A New Minimum Storage Runge–Kutta Scheme - for Computational Acoustics. Journal of Computational Physics, 201, pp 1-12, 2004. - doi: https://doi.org/10.1016/j.jcp.2004.05.012") -Base.@kwdef struct CFRLDDRK64{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + "Low-Storage Method +3-stage, second order (3S) low-storage scheme, optimized the spectral difference method applied to wave propagation problems.", + "ParsaniKetchesonDeconinck3S32", + references = "Parsani, Matteo, David I. Ketcheson, and W. Deconinck. + Optimized explicit Runge--Kutta schemes for the spectral difference method applied to wave propagation problems. + SIAM Journal on Scientific Computing 35.2 (2013): A957-A986. + doi: https://doi.org/10.1137/120885899") +Base.@kwdef struct ParsaniKetchesonDeconinck3S32{StageLimiter, StepLimiter, Thread} <: + OrdinaryDiffEqAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function CFRLDDRK64(stage_limiter!, step_limiter! = trivial_limiter!) - CFRLDDRK64(stage_limiter!, +function ParsaniKetchesonDeconinck3S32(stage_limiter!, step_limiter! = trivial_limiter!) + ParsaniKetchesonDeconinck3S32{typeof(stage_limiter!), typeof(step_limiter!), False}( + stage_limiter!, step_limiter!, False()) end @doc explicit_rk_docstring( "Low-Storage Method -7-stage, fourth order low-storage low-dissipation, low-dispersion scheme with maximal accuracy and stability limit along the imaginary axes. -Fixed timestep only.", - "TSLDDRK74", - references = "Kostas Tselios, T. E. Simos. Optimized Runge–Kutta Methods with Minimal Dispersion and Dissipation - for Problems arising from Computational Acoustics. Physics Letters A, 393(1-2), pp 38-47, 2007. - doi: https://doi.org/10.1016/j.physleta.2006.10.072") -Base.@kwdef struct TSLDDRK74{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm +8-stage, second order (3S) low-storage scheme, optimized for the spectral difference method applied to wave propagation problems.", + "ParsaniKetchesonDeconinck3S82", + references = "Parsani, Matteo, David I. Ketcheson, and W. Deconinck. + Optimized explicit Runge--Kutta schemes for the spectral difference method applied to wave propagation problems. + SIAM Journal on Scientific Computing 35.2 (2013): A957-A986. + doi: https://doi.org/10.1137/120885899") +Base.@kwdef struct ParsaniKetchesonDeconinck3S82{StageLimiter, StepLimiter, Thread} <: + OrdinaryDiffEqAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function TSLDDRK74(stage_limiter!, step_limiter! = trivial_limiter!) - TSLDDRK74(stage_limiter!, +function ParsaniKetchesonDeconinck3S82(stage_limiter!, step_limiter! = trivial_limiter!) + ParsaniKetchesonDeconinck3S82{typeof(stage_limiter!), typeof(step_limiter!), False}( + stage_limiter!, step_limiter!, False()) end @doc explicit_rk_docstring( "Low-Storage Method -4-stage, third order low-storage scheme, optimized for compressible Navier–Stokes equations. -", "CKLLSRK43_2") -Base.@kwdef struct CKLLSRK43_2{StageLimiter, StepLimiter, Thread} <: - OrdinaryDiffEqAdaptiveAlgorithm +5-stage, third order (3S) low-storage scheme, optimized for the spectral difference method applied to wave propagation problems.", + "ParsaniKetchesonDeconinck3S53", + references = "Parsani, Matteo, David I. Ketcheson, and W. Deconinck. + Optimized explicit Runge--Kutta schemes for the spectral difference method applied to wave propagation problems. + SIAM Journal on Scientific Computing 35.2 (2013): A957-A986. + doi: https://doi.org/10.1137/120885899") +Base.@kwdef struct ParsaniKetchesonDeconinck3S53{StageLimiter, StepLimiter, Thread} <: + OrdinaryDiffEqAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function CKLLSRK43_2(stage_limiter!, step_limiter! = trivial_limiter!) - CKLLSRK43_2{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, +function ParsaniKetchesonDeconinck3S53(stage_limiter!, step_limiter! = trivial_limiter!) + ParsaniKetchesonDeconinck3S53{typeof(stage_limiter!), typeof(step_limiter!), False}( + stage_limiter!, step_limiter!, False()) end @doc explicit_rk_docstring( "Low-Storage Method -5-stage, fourth order low-storage scheme, optimized for compressible Navier–Stokes equations. -", "CKLLSRK54_3C") -Base.@kwdef struct CKLLSRK54_3C{StageLimiter, StepLimiter, Thread} <: - OrdinaryDiffEqAdaptiveAlgorithm +17-stage, third order (3S) low-storage scheme, optimized for the spectral difference method applied to wave propagation problems.", + "ParsaniKetchesonDeconinck3S173", + references = "Parsani, Matteo, David I. Ketcheson, and W. Deconinck. + Optimized explicit Runge--Kutta schemes for the spectral difference method applied to wave propagation problems. + SIAM Journal on Scientific Computing 35.2 (2013): A957-A986. + doi: https://doi.org/10.1137/120885899") +Base.@kwdef struct ParsaniKetchesonDeconinck3S173{StageLimiter, StepLimiter, Thread} <: + OrdinaryDiffEqAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function CKLLSRK54_3C(stage_limiter!, step_limiter! = trivial_limiter!) - CKLLSRK54_3C{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, +function ParsaniKetchesonDeconinck3S173(stage_limiter!, step_limiter! = trivial_limiter!) + ParsaniKetchesonDeconinck3S173{typeof(stage_limiter!), typeof(step_limiter!), False}( + stage_limiter!, step_limiter!, False()) end @doc explicit_rk_docstring( "Low-Storage Method -9-stage, fifth order low-storage scheme, optimized for compressible Navier–Stokes equations. -", "CKLLSRK95_4S") -Base.@kwdef struct CKLLSRK95_4S{StageLimiter, StepLimiter, Thread} <: - OrdinaryDiffEqAdaptiveAlgorithm +9-stage, fourth order (3S) low-storage scheme, optimized for the spectral difference method applied to wave propagation problems.", + "ParsaniKetchesonDeconinck3S94", + references = "Parsani, Matteo, David I. Ketcheson, and W. Deconinck. + Optimized explicit Runge--Kutta schemes for the spectral difference method applied to wave propagation problems. + SIAM Journal on Scientific Computing 35.2 (2013): A957-A986. + doi: https://doi.org/10.1137/120885899") +Base.@kwdef struct ParsaniKetchesonDeconinck3S94{StageLimiter, StepLimiter, Thread} <: + OrdinaryDiffEqAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function CKLLSRK95_4S(stage_limiter!, step_limiter! = trivial_limiter!) - CKLLSRK95_4S{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, +function ParsaniKetchesonDeconinck3S94(stage_limiter!, step_limiter! = trivial_limiter!) + ParsaniKetchesonDeconinck3S94{typeof(stage_limiter!), typeof(step_limiter!), False}( + stage_limiter!, step_limiter!, False()) end @doc explicit_rk_docstring( "Low-Storage Method -9-stage, fifth order low-storage scheme, optimized for compressible Navier–Stokes equations. -", "CKLLSRK95_4C") -Base.@kwdef struct CKLLSRK95_4C{StageLimiter, StepLimiter, Thread} <: - OrdinaryDiffEqAdaptiveAlgorithm +18-stage, fourth order (3S) low-storage scheme, optimized for the spectral difference method applied to wave propagation problems.", + "ParsaniKetchesonDeconinck3S184", + references = "Parsani, Matteo, David I. Ketcheson, and W. Deconinck. + Optimized explicit Runge--Kutta schemes for the spectral difference method applied to wave propagation problems. + SIAM Journal on Scientific Computing 35.2 (2013): A957-A986. + doi: https://doi.org/10.1137/120885899") +Base.@kwdef struct ParsaniKetchesonDeconinck3S184{StageLimiter, StepLimiter, Thread} <: + OrdinaryDiffEqAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function CKLLSRK95_4C(stage_limiter!, step_limiter! = trivial_limiter!) - CKLLSRK95_4C{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, +function ParsaniKetchesonDeconinck3S184(stage_limiter!, step_limiter! = trivial_limiter!) + ParsaniKetchesonDeconinck3S184{typeof(stage_limiter!), typeof(step_limiter!), False}( + stage_limiter!, step_limiter!, False()) end @doc explicit_rk_docstring( "Low-Storage Method -9-stage, fifth order low-storage scheme, optimized for compressible Navier–Stokes equations. -", "CKLLSRK95_4M") -Base.@kwdef struct CKLLSRK95_4M{StageLimiter, StepLimiter, Thread} <: - OrdinaryDiffEqAdaptiveAlgorithm +10-stage, fifth order (3S) low-storage scheme, optimized for the spectral difference method applied to wave propagation problems.", + "ParsaniKetchesonDeconinck3S105", + references = "Parsani, Matteo, David I. Ketcheson, and W. Deconinck. + Optimized explicit Runge--Kutta schemes for the spectral difference method applied to wave propagation problems. + SIAM Journal on Scientific Computing 35.2 (2013): A957-A986. + doi: https://doi.org/10.1137/120885899") +Base.@kwdef struct ParsaniKetchesonDeconinck3S105{StageLimiter, StepLimiter, Thread} <: + OrdinaryDiffEqAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function CKLLSRK95_4M(stage_limiter!, step_limiter! = trivial_limiter!) - CKLLSRK95_4M{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, +function ParsaniKetchesonDeconinck3S105(stage_limiter!, step_limiter! = trivial_limiter!) + ParsaniKetchesonDeconinck3S105{typeof(stage_limiter!), typeof(step_limiter!), False}( + stage_limiter!, step_limiter!, False()) end @doc explicit_rk_docstring( "Low-Storage Method -5-stage, fourth order low-storage scheme, optimized for compressible Navier–Stokes equations. -", "CKLLSRK54_3C_3R") -Base.@kwdef struct CKLLSRK54_3C_3R{StageLimiter, StepLimiter, Thread} <: - OrdinaryDiffEqAdaptiveAlgorithm +20-stage, fifth order (3S) low-storage scheme, optimized for the spectral difference method applied to wave propagation problems.", + "ParsaniKetchesonDeconinck3S205", + references = "Parsani, Matteo, David I. Ketcheson, and W. Deconinck. + Optimized explicit Runge--Kutta schemes for the spectral difference method applied to wave propagation problems. + SIAM Journal on Scientific Computing 35.2 (2013): A957-A986. + doi: https://doi.org/10.1137/120885899") +Base.@kwdef struct ParsaniKetchesonDeconinck3S205{StageLimiter, StepLimiter, Thread} <: + OrdinaryDiffEqAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function CKLLSRK54_3C_3R(stage_limiter!, step_limiter! = trivial_limiter!) - CKLLSRK54_3C_3R{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, +function ParsaniKetchesonDeconinck3S205(stage_limiter!, step_limiter! = trivial_limiter!) + ParsaniKetchesonDeconinck3S205{typeof(stage_limiter!), typeof(step_limiter!), False}( + stage_limiter!, step_limiter!, False()) end @doc explicit_rk_docstring( "Low-Storage Method -5-stage, fourth order low-storage scheme, optimized for compressible Navier–Stokes equations. -", "CKLLSRK54_3M_3R") -Base.@kwdef struct CKLLSRK54_3M_3R{StageLimiter, StepLimiter, Thread} <: +4-stage, third order low-storage scheme, optimized for compressible Navier–Stokes equations. +", "CKLLSRK43_2") +Base.@kwdef struct CKLLSRK43_2{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAdaptiveAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function CKLLSRK54_3M_3R(stage_limiter!, step_limiter! = trivial_limiter!) - CKLLSRK54_3M_3R{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, +function CKLLSRK43_2(stage_limiter!, step_limiter! = trivial_limiter!) + CKLLSRK43_2{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, step_limiter!, False()) end @@ -425,67 +468,67 @@ end @doc explicit_rk_docstring( "Low-Storage Method 5-stage, fourth order low-storage scheme, optimized for compressible Navier–Stokes equations. -", "CKLLSRK54_3N_3R") -Base.@kwdef struct CKLLSRK54_3N_3R{StageLimiter, StepLimiter, Thread} <: +", "CKLLSRK54_3C") +Base.@kwdef struct CKLLSRK54_3C{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAdaptiveAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function CKLLSRK54_3N_3R(stage_limiter!, step_limiter! = trivial_limiter!) - CKLLSRK54_3N_3R{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, +function CKLLSRK54_3C(stage_limiter!, step_limiter! = trivial_limiter!) + CKLLSRK54_3C{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, step_limiter!, False()) end @doc explicit_rk_docstring( "Low-Storage Method -8-stage, fifth order low-storage scheme, optimized for compressible Navier–Stokes equations. -", "CKLLSRK85_4C_3R") -Base.@kwdef struct CKLLSRK85_4C_3R{StageLimiter, StepLimiter, Thread} <: +9-stage, fifth order low-storage scheme, optimized for compressible Navier–Stokes equations. +", "CKLLSRK95_4S") +Base.@kwdef struct CKLLSRK95_4S{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAdaptiveAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function CKLLSRK85_4C_3R(stage_limiter!, step_limiter! = trivial_limiter!) - CKLLSRK85_4C_3R{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, +function CKLLSRK95_4S(stage_limiter!, step_limiter! = trivial_limiter!) + CKLLSRK95_4S{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, step_limiter!, False()) end @doc explicit_rk_docstring( "Low-Storage Method -8-stage, fifth order low-storage scheme, optimized for compressible Navier–Stokes equations. -", "CKLLSRK85_4M_3R") -Base.@kwdef struct CKLLSRK85_4M_3R{StageLimiter, StepLimiter, Thread} <: +9-stage, fifth order low-storage scheme, optimized for compressible Navier–Stokes equations. +", "CKLLSRK95_4C") +Base.@kwdef struct CKLLSRK95_4C{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAdaptiveAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function CKLLSRK85_4M_3R(stage_limiter!, step_limiter! = trivial_limiter!) - CKLLSRK85_4M_3R{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, +function CKLLSRK95_4C(stage_limiter!, step_limiter! = trivial_limiter!) + CKLLSRK95_4C{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, step_limiter!, False()) end @doc explicit_rk_docstring( "Low-Storage Method -8-stage, fifth order low-storage scheme, optimized for compressible Navier–Stokes equations. -", "CKLLSRK85_4P_3R") -Base.@kwdef struct CKLLSRK85_4P_3R{StageLimiter, StepLimiter, Thread} <: +9-stage, fifth order low-storage scheme, optimized for compressible Navier–Stokes equations. +", "CKLLSRK95_4M") +Base.@kwdef struct CKLLSRK95_4M{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAdaptiveAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function CKLLSRK85_4P_3R(stage_limiter!, step_limiter! = trivial_limiter!) - CKLLSRK85_4P_3R{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, +function CKLLSRK95_4M(stage_limiter!, step_limiter! = trivial_limiter!) + CKLLSRK95_4M{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, step_limiter!, False()) end @@ -493,16 +536,16 @@ end @doc explicit_rk_docstring( "Low-Storage Method 5-stage, fourth order low-storage scheme, optimized for compressible Navier–Stokes equations. -", "CKLLSRK54_3N_4R") -Base.@kwdef struct CKLLSRK54_3N_4R{StageLimiter, StepLimiter, Thread} <: +", "CKLLSRK54_3C_3R") +Base.@kwdef struct CKLLSRK54_3C_3R{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAdaptiveAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function CKLLSRK54_3N_4R(stage_limiter!, step_limiter! = trivial_limiter!) - CKLLSRK54_3N_4R{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, +function CKLLSRK54_3C_3R(stage_limiter!, step_limiter! = trivial_limiter!) + CKLLSRK54_3C_3R{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, step_limiter!, False()) end @@ -510,242 +553,168 @@ end @doc explicit_rk_docstring( "Low-Storage Method 5-stage, fourth order low-storage scheme, optimized for compressible Navier–Stokes equations. -", "CKLLSRK54_3M_4R") -Base.@kwdef struct CKLLSRK54_3M_4R{StageLimiter, StepLimiter, Thread} <: - OrdinaryDiffEqAdaptiveAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function CKLLSRK54_3M_4R(stage_limiter!, step_limiter! = trivial_limiter!) - CKLLSRK54_3M_4R{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, - step_limiter!, - False()) -end - -@doc explicit_rk_docstring( - "6-stage, fifth order low-storage scheme, optimized for compressible Navier–Stokes equations.", - "CKLLSRK65_4M_4R") -Base.@kwdef struct CKLLSRK65_4M_4R{StageLimiter, StepLimiter, Thread} <: +", "CKLLSRK54_3M_3R") +Base.@kwdef struct CKLLSRK54_3M_3R{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAdaptiveAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function CKLLSRK65_4M_4R(stage_limiter!, step_limiter! = trivial_limiter!) - CKLLSRK65_4M_4R(stage_limiter!, +function CKLLSRK54_3M_3R(stage_limiter!, step_limiter! = trivial_limiter!) + CKLLSRK54_3M_3R{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, step_limiter!, False()) end @doc explicit_rk_docstring( "Low-Storage Method -8-stage, fifth order low-storage scheme, optimized for compressible Navier–Stokes equations.", - "CKLLSRK85_4FM_4R") -Base.@kwdef struct CKLLSRK85_4FM_4R{StageLimiter, StepLimiter, Thread} <: - OrdinaryDiffEqAdaptiveAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function CKLLSRK85_4FM_4R(stage_limiter!, step_limiter! = trivial_limiter!) - CKLLSRK85_4FM_4R(stage_limiter!, - step_limiter!, - False()) -end - -@doc explicit_rk_docstring( - "CKLLSRK75_4M_5R: Low-Storage Method -7-stage, fifth order low-storage scheme, optimized for compressible Navier–Stokes equations.", - "CKLLSRK75_4M_5R") -Base.@kwdef struct CKLLSRK75_4M_5R{StageLimiter, StepLimiter, Thread} <: +5-stage, fourth order low-storage scheme, optimized for compressible Navier–Stokes equations. +", "CKLLSRK54_3N_3R") +Base.@kwdef struct CKLLSRK54_3N_3R{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAdaptiveAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function CKLLSRK75_4M_5R(stage_limiter!, step_limiter! = trivial_limiter!) - CKLLSRK75_4M_5R{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, +function CKLLSRK54_3N_3R(stage_limiter!, step_limiter! = trivial_limiter!) + CKLLSRK54_3N_3R{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, step_limiter!, False()) end @doc explicit_rk_docstring( "Low-Storage Method -3-stage, second order (3S) low-storage scheme, optimized the spectral difference method applied to wave propagation problems.", - "ParsaniKetchesonDeconinck3S32", - references = "Parsani, Matteo, David I. Ketcheson, and W. Deconinck. - Optimized explicit Runge--Kutta schemes for the spectral difference method applied to wave propagation problems. - SIAM Journal on Scientific Computing 35.2 (2013): A957-A986. - doi: https://doi.org/10.1137/120885899") -Base.@kwdef struct ParsaniKetchesonDeconinck3S32{StageLimiter, StepLimiter, Thread} <: - OrdinaryDiffEqAlgorithm +8-stage, fifth order low-storage scheme, optimized for compressible Navier–Stokes equations. +", "CKLLSRK85_4C_3R") +Base.@kwdef struct CKLLSRK85_4C_3R{StageLimiter, StepLimiter, Thread} <: + OrdinaryDiffEqAdaptiveAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function ParsaniKetchesonDeconinck3S32(stage_limiter!, step_limiter! = trivial_limiter!) - ParsaniKetchesonDeconinck3S32{typeof(stage_limiter!), typeof(step_limiter!), False}( - stage_limiter!, +function CKLLSRK85_4C_3R(stage_limiter!, step_limiter! = trivial_limiter!) + CKLLSRK85_4C_3R{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, step_limiter!, False()) end @doc explicit_rk_docstring( "Low-Storage Method -8-stage, second order (3S) low-storage scheme, optimized for the spectral difference method applied to wave propagation problems.", - "ParsaniKetchesonDeconinck3S82", - references = "Parsani, Matteo, David I. Ketcheson, and W. Deconinck. - Optimized explicit Runge--Kutta schemes for the spectral difference method applied to wave propagation problems. - SIAM Journal on Scientific Computing 35.2 (2013): A957-A986. - doi: https://doi.org/10.1137/120885899") -Base.@kwdef struct ParsaniKetchesonDeconinck3S82{StageLimiter, StepLimiter, Thread} <: - OrdinaryDiffEqAlgorithm +8-stage, fifth order low-storage scheme, optimized for compressible Navier–Stokes equations. +", "CKLLSRK85_4M_3R") +Base.@kwdef struct CKLLSRK85_4M_3R{StageLimiter, StepLimiter, Thread} <: + OrdinaryDiffEqAdaptiveAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function ParsaniKetchesonDeconinck3S82(stage_limiter!, step_limiter! = trivial_limiter!) - ParsaniKetchesonDeconinck3S82{typeof(stage_limiter!), typeof(step_limiter!), False}( - stage_limiter!, +function CKLLSRK85_4M_3R(stage_limiter!, step_limiter! = trivial_limiter!) + CKLLSRK85_4M_3R{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, step_limiter!, False()) end @doc explicit_rk_docstring( "Low-Storage Method -5-stage, third order (3S) low-storage scheme, optimized for the spectral difference method applied to wave propagation problems.", - "ParsaniKetchesonDeconinck3S53", - references = "Parsani, Matteo, David I. Ketcheson, and W. Deconinck. - Optimized explicit Runge--Kutta schemes for the spectral difference method applied to wave propagation problems. - SIAM Journal on Scientific Computing 35.2 (2013): A957-A986. - doi: https://doi.org/10.1137/120885899") -Base.@kwdef struct ParsaniKetchesonDeconinck3S53{StageLimiter, StepLimiter, Thread} <: - OrdinaryDiffEqAlgorithm +8-stage, fifth order low-storage scheme, optimized for compressible Navier–Stokes equations. +", "CKLLSRK85_4P_3R") +Base.@kwdef struct CKLLSRK85_4P_3R{StageLimiter, StepLimiter, Thread} <: + OrdinaryDiffEqAdaptiveAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function ParsaniKetchesonDeconinck3S53(stage_limiter!, step_limiter! = trivial_limiter!) - ParsaniKetchesonDeconinck3S53{typeof(stage_limiter!), typeof(step_limiter!), False}( - stage_limiter!, +function CKLLSRK85_4P_3R(stage_limiter!, step_limiter! = trivial_limiter!) + CKLLSRK85_4P_3R{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, step_limiter!, False()) end @doc explicit_rk_docstring( "Low-Storage Method -17-stage, third order (3S) low-storage scheme, optimized for the spectral difference method applied to wave propagation problems.", - "ParsaniKetchesonDeconinck3S173", - references = "Parsani, Matteo, David I. Ketcheson, and W. Deconinck. - Optimized explicit Runge--Kutta schemes for the spectral difference method applied to wave propagation problems. - SIAM Journal on Scientific Computing 35.2 (2013): A957-A986. - doi: https://doi.org/10.1137/120885899") -Base.@kwdef struct ParsaniKetchesonDeconinck3S173{StageLimiter, StepLimiter, Thread} <: - OrdinaryDiffEqAlgorithm +5-stage, fourth order low-storage scheme, optimized for compressible Navier–Stokes equations. +", "CKLLSRK54_3N_4R") +Base.@kwdef struct CKLLSRK54_3N_4R{StageLimiter, StepLimiter, Thread} <: + OrdinaryDiffEqAdaptiveAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function ParsaniKetchesonDeconinck3S173(stage_limiter!, step_limiter! = trivial_limiter!) - ParsaniKetchesonDeconinck3S173{typeof(stage_limiter!), typeof(step_limiter!), False}( - stage_limiter!, +function CKLLSRK54_3N_4R(stage_limiter!, step_limiter! = trivial_limiter!) + CKLLSRK54_3N_4R{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, step_limiter!, False()) end @doc explicit_rk_docstring( "Low-Storage Method -9-stage, fourth order (3S) low-storage scheme, optimized for the spectral difference method applied to wave propagation problems.", - "ParsaniKetchesonDeconinck3S94", - references = "Parsani, Matteo, David I. Ketcheson, and W. Deconinck. - Optimized explicit Runge--Kutta schemes for the spectral difference method applied to wave propagation problems. - SIAM Journal on Scientific Computing 35.2 (2013): A957-A986. - doi: https://doi.org/10.1137/120885899") -Base.@kwdef struct ParsaniKetchesonDeconinck3S94{StageLimiter, StepLimiter, Thread} <: - OrdinaryDiffEqAlgorithm +5-stage, fourth order low-storage scheme, optimized for compressible Navier–Stokes equations. +", "CKLLSRK54_3M_4R") +Base.@kwdef struct CKLLSRK54_3M_4R{StageLimiter, StepLimiter, Thread} <: + OrdinaryDiffEqAdaptiveAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function ParsaniKetchesonDeconinck3S94(stage_limiter!, step_limiter! = trivial_limiter!) - ParsaniKetchesonDeconinck3S94{typeof(stage_limiter!), typeof(step_limiter!), False}( - stage_limiter!, +function CKLLSRK54_3M_4R(stage_limiter!, step_limiter! = trivial_limiter!) + CKLLSRK54_3M_4R{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, step_limiter!, False()) end @doc explicit_rk_docstring( - "Low-Storage Method -18-stage, fourth order (3S) low-storage scheme, optimized for the spectral difference method applied to wave propagation problems.", - "ParsaniKetchesonDeconinck3S184", - references = "Parsani, Matteo, David I. Ketcheson, and W. Deconinck. - Optimized explicit Runge--Kutta schemes for the spectral difference method applied to wave propagation problems. - SIAM Journal on Scientific Computing 35.2 (2013): A957-A986. - doi: https://doi.org/10.1137/120885899") -Base.@kwdef struct ParsaniKetchesonDeconinck3S184{StageLimiter, StepLimiter, Thread} <: - OrdinaryDiffEqAlgorithm + "6-stage, fifth order low-storage scheme, optimized for compressible Navier–Stokes equations.", + "CKLLSRK65_4M_4R") +Base.@kwdef struct CKLLSRK65_4M_4R{StageLimiter, StepLimiter, Thread} <: + OrdinaryDiffEqAdaptiveAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function ParsaniKetchesonDeconinck3S184(stage_limiter!, step_limiter! = trivial_limiter!) - ParsaniKetchesonDeconinck3S184{typeof(stage_limiter!), typeof(step_limiter!), False}( - stage_limiter!, +function CKLLSRK65_4M_4R(stage_limiter!, step_limiter! = trivial_limiter!) + CKLLSRK65_4M_4R(stage_limiter!, step_limiter!, False()) end @doc explicit_rk_docstring( "Low-Storage Method -10-stage, fifth order (3S) low-storage scheme, optimized for the spectral difference method applied to wave propagation problems.", - "ParsaniKetchesonDeconinck3S105", - references = "Parsani, Matteo, David I. Ketcheson, and W. Deconinck. - Optimized explicit Runge--Kutta schemes for the spectral difference method applied to wave propagation problems. - SIAM Journal on Scientific Computing 35.2 (2013): A957-A986. - doi: https://doi.org/10.1137/120885899") -Base.@kwdef struct ParsaniKetchesonDeconinck3S105{StageLimiter, StepLimiter, Thread} <: - OrdinaryDiffEqAlgorithm +8-stage, fifth order low-storage scheme, optimized for compressible Navier–Stokes equations.", + "CKLLSRK85_4FM_4R") +Base.@kwdef struct CKLLSRK85_4FM_4R{StageLimiter, StepLimiter, Thread} <: + OrdinaryDiffEqAdaptiveAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function ParsaniKetchesonDeconinck3S105(stage_limiter!, step_limiter! = trivial_limiter!) - ParsaniKetchesonDeconinck3S105{typeof(stage_limiter!), typeof(step_limiter!), False}( - stage_limiter!, +function CKLLSRK85_4FM_4R(stage_limiter!, step_limiter! = trivial_limiter!) + CKLLSRK85_4FM_4R(stage_limiter!, step_limiter!, False()) end @doc explicit_rk_docstring( - "Low-Storage Method -20-stage, fifth order (3S) low-storage scheme, optimized for the spectral difference method applied to wave propagation problems.", - "ParsaniKetchesonDeconinck3S205", - references = "Parsani, Matteo, David I. Ketcheson, and W. Deconinck. - Optimized explicit Runge--Kutta schemes for the spectral difference method applied to wave propagation problems. - SIAM Journal on Scientific Computing 35.2 (2013): A957-A986. - doi: https://doi.org/10.1137/120885899") -Base.@kwdef struct ParsaniKetchesonDeconinck3S205{StageLimiter, StepLimiter, Thread} <: - OrdinaryDiffEqAlgorithm + "CKLLSRK75_4M_5R: Low-Storage Method +7-stage, fifth order low-storage scheme, optimized for compressible Navier–Stokes equations.", + "CKLLSRK75_4M_5R") +Base.@kwdef struct CKLLSRK75_4M_5R{StageLimiter, StepLimiter, Thread} <: + OrdinaryDiffEqAdaptiveAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! thread::Thread = False() end # for backwards compatibility -function ParsaniKetchesonDeconinck3S205(stage_limiter!, step_limiter! = trivial_limiter!) - ParsaniKetchesonDeconinck3S205{typeof(stage_limiter!), typeof(step_limiter!), False}( - stage_limiter!, +function CKLLSRK75_4M_5R(stage_limiter!, step_limiter! = trivial_limiter!) + CKLLSRK75_4M_5R{typeof(stage_limiter!), typeof(step_limiter!), False}(stage_limiter!, step_limiter!, False()) end @@ -876,6 +845,84 @@ function RDPK3SpFSAL510(stage_limiter!, step_limiter! = trivial_limiter!) False()) end +#Low Storage Explicit Runge-Kutta Methods + +@doc explicit_rk_docstring("TBD", "SHLDDRK52") +Base.@kwdef struct SHLDDRK52{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SHLDDRK52(stage_limiter!, step_limiter! = trivial_limiter!) + SHLDDRK52(stage_limiter!, + step_limiter!, + False()) +end + +@doc explicit_rk_docstring("TBD", "SHLDDRK_2N") +Base.@kwdef struct SHLDDRK_2N{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SHLDDRK_2N(stage_limiter!, step_limiter! = trivial_limiter!) + SHLDDRK_2N(stage_limiter!, + step_limiter!, + False()) +end + +@doc explicit_rk_docstring("Low-Storage Method +6-stage, fourth order low-stage, low-dissipation, low-dispersion scheme. +Fixed timestep only.", "HSLDDRK64", + references = "D. Stanescu, W. G. Habashi. + 2N-Storage Low Dissipation and Dispersion Runge-Kutta Schemes for Computational + Acoustics. + Journal of Computational Physics, 143(2), pp 674-681, 1998. + doi: https://doi.org/10.1006/jcph.1998.5986 + }", + extra_keyword_description = """- `williamson_condition`: allows for an optimization that allows fusing broadcast expressions with the function call `f`. However, it only works for `Array` types. + """, + extra_keyword_default = "williamson_condition = true") +struct HSLDDRK64{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter + step_limiter!::StepLimiter + thread::Thread + williamson_condition::Bool + function HSLDDRK64(stage_limiter! = trivial_limiter!, step_limiter! = trivial_limiter!; + williamson_condition = true) + Base.depwarn("HSLDDRK64 is deprecated, use SHLDDRK64 instead.", :HSLDDRK64) + SHLDDRK64(stage_limiter!, step_limiter!, thread; + williamson_condition = williamson_condition) + end +end + +@doc explicit_rk_docstring( + "13-stage, fourth order low-storage method with optimized stability regions for +advection-dominated problems. Fixed timestep only.", + "NDBLSRK134", + references = "Jens Niegemann, Richard Diehl, Kurt Busch. + Efficient Low-Storage Runge–Kutta Schemes with Optimized Stability Regions. + Journal of Computational Physics, 231, pp 364-372, 2012. + doi: https://doi.org/10.1016/j.jcp.2011.09.003", + extra_keyword_description = """- `williamson_condition`: allows for an optimization that allows fusing broadcast expressions with the function call `f`. However, it only works for `Array` types. + """, + extra_keyword_default = "williamson_condition = true") +Base.@kwdef struct NDBLSRK134{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() + williamson_condition::Bool = true +end +# for backwards compatibility +function NDBLSRK134(stage_limiter!, step_limiter! = trivial_limiter!; + williamson_condition = true) + NDBLSRK134(stage_limiter!, + step_limiter!, False(), + williamson_condition) +end + #SSP Optimized Runge-Kutta Methods @doc explicit_rk_docstring("TBD", @@ -963,44 +1010,6 @@ function KYKSSPRK42(stage_limiter!, step_limiter! = trivial_limiter!) False()) end -@doc explicit_rk_docstring( - "A third-order, five-stage explicit strong stability preserving (SSP) low-storage method. -Fixed timestep only.", - "SSPRK53_2N1", - references = "Higueras and T. Roldán. - New third order low-storage SSP explicit Runge–Kutta methods - arXiv:1809.04807v1.") -Base.@kwdef struct SSPRK53_2N1{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function SSPRK53_2N1(stage_limiter!, step_limiter! = trivial_limiter!) - SSPRK53_2N1(stage_limiter!, - step_limiter!, - False()) -end - -@doc explicit_rk_docstring( - "A third-order, five-stage explicit strong stability preserving (SSP) low-storage method. -Fixed timestep only.", - "SSPRK53_2N2", - references = "Higueras and T. Roldán. - New third order low-storage SSP explicit Runge–Kutta methods - arXiv:1809.04807v1.") -Base.@kwdef struct SSPRK53_2N2{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function SSPRK53_2N2(stage_limiter!, step_limiter! = trivial_limiter!) - SSPRK53_2N2(stage_limiter!, - step_limiter!, - False()) -end - @doc explicit_rk_docstring( "A third-order, five-stage explicit strong stability preserving (SSP) low-storage method. Fixed timestep only.", @@ -1227,4 +1236,4 @@ end function SSPRK104(stage_limiter!, step_limiter! = trivial_limiter!) SSPRK104(stage_limiter!, step_limiter!, False()) -end +end \ No newline at end of file diff --git a/src/caches/low_storage_rk_caches.jl b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl similarity index 100% rename from src/caches/low_storage_rk_caches.jl rename to lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl diff --git a/src/perform_step/low_storage_rk_perform_step.jl b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_perform_step.jl similarity index 100% rename from src/perform_step/low_storage_rk_perform_step.jl rename to lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_perform_step.jl diff --git a/test/algconvergence/ode_low_storage_rk_tests.jl b/lib/OrdinaryDiffEqLowStorageRK/test/ode_low_storage_rk_tests.jl similarity index 99% rename from test/algconvergence/ode_low_storage_rk_tests.jl rename to lib/OrdinaryDiffEqLowStorageRK/test/ode_low_storage_rk_tests.jl index 7d28903ac9..931b7624aa 100644 --- a/test/algconvergence/ode_low_storage_rk_tests.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/test/ode_low_storage_rk_tests.jl @@ -1564,4 +1564,4 @@ end new_prob_ode_nonlinear_inplace, alg, dt = 1.e-4, save_everystep = false, save_start = false, alias_u0 = true) @test sol_old[end] ≈ sol_new[end] -end +end \ No newline at end of file diff --git a/src/OrdinaryDiffEq.jl b/src/OrdinaryDiffEq.jl index 181d6d952d..2c55c6c678 100644 --- a/src/OrdinaryDiffEq.jl +++ b/src/OrdinaryDiffEq.jl @@ -133,7 +133,6 @@ include("misc_utils.jl") include("algorithms.jl") include("algorithms/explicit_rk.jl") -include("algorithms/explicit_rk_pde.jl") include("alg_utils.jl") @@ -149,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/low_storage_rk_caches.jl") include("caches/ssprk_caches.jl") include("caches/feagin_caches.jl") include("caches/verner_caches.jl") @@ -201,7 +199,6 @@ 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/low_storage_rk_perform_step.jl") include("perform_step/ssprk_perform_step.jl") include("perform_step/sdirk_perform_step.jl") include("perform_step/kencarp_kvaerno_perform_step.jl") @@ -244,6 +241,26 @@ export AitkenNeville, ExtrapolationMidpointDeuflhard, ExtrapolationMidpointHaire ImplicitDeuflhardExtrapolation, ImplicitHairerWannerExtrapolation, ImplicitEulerBarycentricExtrapolation +<<<<<<< HEAD +======= +include("../lib/OrdinaryDiffEqStabilizedRK/src/OrdinaryDiffEqStabilizedRK.jl") +using ..OrdinaryDiffEqStabilizedRK +export ROCK2, ROCK4, RKC, ESERK4, ESERK5, SERK2, IRKC + +include("../lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl") +using ..OrdinaryDiffEqLowStorageRK +export ORK256, SSPRK53_2N1, SSPRK53_2N2, NDBLSRK124, CarpenterKennedy2N54, NDBLSRK134, NDBLSRK144, CFRLDDRK64, + CFRLDDRK64, TSLDDRK74, DGLDDRK73_C, DGLDDRK84_C, DGLDDRK84_F, SHLDDRK64, RK46NL, ParsaniKetchesonDeconinck3S32, + ParsaniKetchesonDeconinck3S82, ParsaniKetchesonDeconinck3S53, ParsaniKetchesonDeconinck3S173, ParsaniKetchesonDeconinck3S94, + ParsaniKetchesonDeconinck3S184, ParsaniKetchesonDeconinck3S105, ParsaniKetchesonDeconinck3S205, CKLLSRK43_2, + CKLLSRK54_3C, CKLLSRK95_4S, CKLLSRK95_4C, CKLLSRK95_4M, CKLLSRK54_3C_3R, CKLLSRK54_3M_3R, CKLLSRK54_3N_3R, + CKLLSRK85_4C_3R, CKLLSRK85_4M_3R, CKLLSRK85_4P_3R, CKLLSRK54_3N_4R, CKLLSRK54_3M_4R, CKLLSRK65_4M_4R, + CKLLSRK85_4FM_4R, CKLLSRK75_4M_5R, RDPK3Sp35, RDPK3SpFSAL35, RDPK3Sp49, RDPK3SpFSAL49, RDPK3Sp510, + RDPK3SpFSAL510, SSPRK104, SSPRK54, SSPRK932, SSPRKMSVS32, SSPRKMSVS43, SSPRK432, SSPRK43, SSPRK83, + SSPRK73, SSPRK63, SSPRK53_H, KYKSSPRK42, SSPRK53, SSPRK33, SSPRK22, YK2014DGSSPRK_3S2, NDBLSRK134, + SLDDRK64, SHLDDRK_2N, SHLDDRK52 + +>>>>>>> 5134aff1 (Added a separate package for Low Storage RK methods) import PrecompileTools PrecompileTools.@compile_workload begin diff --git a/src/algorithms/explicit_rk.jl b/src/algorithms/explicit_rk.jl index f18da8a86e..80e6ef44ad 100644 --- a/src/algorithms/explicit_rk.jl +++ b/src/algorithms/explicit_rk.jl @@ -629,44 +629,6 @@ Euler - The canonical forward Euler method. Fixed timestep only. """ struct Euler <: OrdinaryDiffEqAlgorithm end -@doc explicit_rk_docstring( - "6-stage, fourth order low-stage, low-dissipation, low-dispersion scheme. -Fixed timestep only.", "RK46NL", - references = "Julien Berland, Christophe Bogey, Christophe Bailly. Low-Dissipation and Low-Dispersion Fourth-Order Runge-Kutta Algorithm. Computers & Fluids, 35(10), pp 1459-1463, 2006. doi: https://doi.org/10.1016/j.compfluid.2005.04.003") -Base.@kwdef struct RK46NL{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function RK46NL(stage_limiter!, step_limiter! = trivial_limiter!) - RK46NL(stage_limiter!, step_limiter!, False()) -end - -@doc explicit_rk_docstring( - "A second-order, five-stage explicit Runge-Kutta method for wave propagation -equations. Fixed timestep only.", "ORK256", - references = "Matteo Bernardini, Sergio Pirozzoli. - A General Strategy for the Optimization of Runge-Kutta Schemes for Wave - Propagation Phenomena. - Journal of Computational Physics, 228(11), pp 4182-4199, 2009. - doi: https://doi.org/10.1016/j.jcp.2009.02.032", - extra_keyword_description = """- `williamson_condition`: allows for an optimization that allows fusing broadcast expressions with the function call `f`. However, it only works for `Array` types. - """, - extra_keyword_default = "williamson_condition = true") -Base.@kwdef struct ORK256{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() - williamson_condition::Bool = true -end -# for backwards compatibility -function ORK256(stage_limiter!, - step_limiter! = trivial_limiter!; - williamson_condition = true) - ORK256(stage_limiter!, step_limiter!, False(), williamson_condition) -end - """ KuttaPRK2p5: Parallel Explicit Runge-Kutta Method A 5 parallel, 2 processor explicit Runge-Kutta method of 5th order. diff --git a/test/runtests.jl b/test/runtests.jl index 5ec1677daa..efeb255a06 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -29,6 +29,21 @@ function activate_extrapolation_env() Pkg.instantiate() end +<<<<<<< HEAD +======= +function activate_stabilized_rk() + Pkg.activate("../lib/OrdinaryDiffEqStabilizedRK") + Pkg.develop(PackageSpec(path = dirname(@__DIR__))) + Pkg.instantiate() +end + +function activate_low_storage_rk() + Pkg.activate("../lib/OrdinaryDiffEqLowStorageRK") + Pkg.develop(PackageSpec(path = dirname(@__DIR__))) + Pkg.instantiate() +end + +>>>>>>> 5134aff1 (Added a separate package for Low Storage RK methods) #Start Test Script @time begin @@ -153,7 +168,7 @@ end if !is_APPVEYOR && GROUP == "AlgConvergence_II" @time @safetestset "SSPRK Tests" include("algconvergence/ode_ssprk_tests.jl") - @time @safetestset "Low Storage RK Tests" include("algconvergence/ode_low_storage_rk_tests.jl") + @time @safetestset "Low Storage RK Tests" include("../lib/OrdinaryDiffEqLowStorageRK/test/ode_low_storage_rk_tests.jl") @time @safetestset "OwrenZen Tests" include("algconvergence/owrenzen_tests.jl") @time @safetestset "Runge-Kutta-Chebyshev Tests" include("algconvergence/rkc_tests.jl") end From e8d6af42bf386f775fc460630a36d18ca0c287ae Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 00:28:26 +0530 Subject: [PATCH 02/54] Some changes --- .../src/OrdinaryDiffEqLowStorageRK.jl | 5 +- .../src/alg_utils.jl | 151 ++++++++++++++++++ src/alg_utils.jl | 149 ----------------- 3 files changed, 154 insertions(+), 151 deletions(-) create mode 100644 lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl index a576ed666c..b2046be4e9 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl @@ -40,8 +40,9 @@ end include("low_storage_rk_caches.jl") include("low_storage_rk_perform_step.jl") include("algorithms.jl") +include("alg_utils.jl") -export ORK256, SSPRK53_2N1, SSPRK53_2N2, NDBLSRK124, CarpenterKennedy2N54, NDBLSRK134, NDBLSRK144, CFRLDDRK64, +export ORK256, SSPRK53_2N1, SSPRK53_2N2, NDBLSRK124, CarpenterKennedy2N54, NDBLSRK134, NDBLSRK144, CFRLDDRK64, TSLDDRK74, DGLDDRK73_C, DGLDDRK84_C, DGLDDRK84_F, SHLDDRK64, RK46NL, ParsaniKetchesonDeconinck3S32, ParsaniKetchesonDeconinck3S82, ParsaniKetchesonDeconinck3S53, ParsaniKetchesonDeconinck3S173, ParsaniKetchesonDeconinck3S94, ParsaniKetchesonDeconinck3S184, ParsaniKetchesonDeconinck3S105, ParsaniKetchesonDeconinck3S205, CKLLSRK43_2, @@ -49,6 +50,6 @@ export ORK256, SSPRK53_2N1, SSPRK53_2N2, NDBLSRK124, CarpenterKennedy2N54, NDBLS CKLLSRK85_4C_3R, CKLLSRK85_4M_3R, CKLLSRK85_4P_3R, CKLLSRK54_3N_4R, CKLLSRK54_3M_4R, CKLLSRK65_4M_4R, CKLLSRK85_4FM_4R, CKLLSRK75_4M_5R, RDPK3Sp35, RDPK3SpFSAL35, RDPK3Sp49, RDPK3SpFSAL49, RDPK3Sp510, RDPK3SpFSAL510, SSPRK104, SSPRK54, SSPRK932, SSPRKMSVS32, SSPRKMSVS43, SSPRK432, SSPRK43, SSPRK83, - SSPRK73, SSPRK63, SSPRK53_H, KYKSSPRK42, SSPRK53, SSPRK33, SSPRK22, YK2014DGSSPRK_3S2, NDBLSRK134, + SSPRK73, SSPRK63, SSPRK53_H, KYKSSPRK42, SSPRK53, SSPRK33, SSPRK22, KYK2014DGSSPRK_3S2, NDBLSRK134, SLDDRK64, SHLDDRK_2N, SHLDDRK52 end diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl b/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl new file mode 100644 index 0000000000..0eeff83ad4 --- /dev/null +++ b/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl @@ -0,0 +1,151 @@ +alg_order(alg::KYK2014DGSSPRK_3S2) = 2 +alg_order(alg::ORK256) = 2 +alg_order(alg::CarpenterKennedy2N54) = 4 +alg_order(alg::SSPRK53_2N1) = 3 +alg_order(alg::SSPRK53_2N2) = 3 +alg_order(alg::NDBLSRK124) = 4 +alg_order(alg::NDBLSRK134) = 4 +alg_order(alg::NDBLSRK144) = 4 +alg_order(alg::CFRLDDRK64) = 4 +alg_order(alg::DGLDDRK73_C) = 3 +alg_order(alg::TSLDDRK74) = 4 +alg_order(alg::DGLDDRK84_C) = 4 +alg_order(alg::DGLDDRK84_F) = 4 +alg_order(alg::SHLDDRK64) = 4 +alg_order(alg::RK46NL) = 4 +alg_order(alg::ParsaniKetchesonDeconinck3S32) = 2 +alg_order(alg::ParsaniKetchesonDeconinck3S82) = 2 +alg_order(alg::ParsaniKetchesonDeconinck3S53) = 3 +alg_order(alg::ParsaniKetchesonDeconinck3S173) = 3 +alg_order(alg::ParsaniKetchesonDeconinck3S94) = 4 +alg_order(alg::ParsaniKetchesonDeconinck3S184) = 4 +alg_order(alg::ParsaniKetchesonDeconinck3S105) = 5 +alg_order(alg::ParsaniKetchesonDeconinck3S205) = 5 +alg_order(alg::CKLLSRK43_2) = 3 +alg_order(alg::CKLLSRK54_3C) = 4 +alg_order(alg::CKLLSRK95_4S) = 5 +alg_order(alg::CKLLSRK95_4C) = 5 +alg_order(alg::CKLLSRK95_4M) = 5 +alg_order(alg::CKLLSRK54_3C_3R) = 4 +alg_order(alg::CKLLSRK54_3M_3R) = 4 +alg_order(alg::CKLLSRK54_3N_3R) = 4 +alg_order(alg::CKLLSRK85_4C_3R) = 5 +alg_order(alg::CKLLSRK85_4M_3R) = 5 +alg_order(alg::RDPK3Sp35) = 3 +alg_order(alg::RDPK3SpFSAL35) = 3 +alg_order(alg::RDPK3Sp49) = 4 +alg_order(alg::RDPK3SpFSAL49) = 4 +alg_order(alg::RDPK3Sp510) = 5 +alg_order(alg::RDPK3SpFSAL510) = 5 +alg_order(alg::CKLLSRK85_4P_3R) = 5 +alg_order(alg::CKLLSRK85_4FM_4R) = 5 +alg_order(alg::CKLLSRK54_3N_4R) = 4 +alg_order(alg::CKLLSRK75_4M_5R) = 5 +alg_order(alg::CKLLSRK54_3M_4R) = 4 +alg_order(alg::CKLLSRK65_4M_4R) = 5 + +alg_order(alg::SSPRK22) = 2 +alg_order(alg::SSPRKMSVS32) = 2 +alg_order(alg::SSPRK33) = 3 +alg_order(alg::KYKSSPRK42) = 2 +alg_order(alg::SSPRK53) = 3 +alg_order(alg::SSPRK53_H) = 3 +alg_order(alg::SSPRK63) = 3 +alg_order(alg::SSPRK73) = 3 +alg_order(alg::SSPRK83) = 3 +alg_order(alg::SSPRK43) = 3 +alg_order(alg::SSPRK432) = 3 +alg_order(alg::SSPRKMSVS43) = 3 +alg_order(alg::SSPRK932) = 3 +alg_order(alg::SSPRK54) = 4 +alg_order(alg::SSPRK104) = 4 +alg_order(alg::SHLDDRK52) = 2 +alg_order(alg::SHLDDRK_2N) = 4 + +isfsal(alg::ORK256) = false +isfsal(alg::CarpenterKennedy2N54) = false +isfsal(alg::SSPRK53_2N1) = false +isfsal(alg::SSPRK53_2N2) = false +isfsal(alg::DGLDDRK84_F) = false +isfsal(alg::DGLDDRK73_C) = false +isfsal(alg::DGLDDRK84_C) = false +isfsal(alg::RDPK3Sp35) = false +isfsal(alg::RDPK3Sp49) = false +isfsal(alg::RDPK3Sp510) = false +isfsal(alg::SHLDDRK64) = false +isfsal(alg::NDBLSRK134) = false +isfsal(alg::NDBLSRK124) = false +isfsal(alg::NDBLSRK144) = false + +isfsal(alg::SSPRK22) = false +isfsal(alg::SSPRK33) = false +isfsal(alg::SSPRK53) = false +isfsal(alg::SSPRK53_H) = false +isfsal(alg::SSPRK63) = false +isfsal(alg::SSPRK73) = false +isfsal(alg::SSPRK83) = false +isfsal(alg::SSPRK43) = false +isfsal(alg::SSPRK432) = false +isfsal(alg::SSPRK932) = false +isfsal(alg::SSPRK54) = false +isfsal(alg::SSPRK104) = false + +uses_uprev(alg::ORK256, adaptive::Bool) = false +uses_uprev(alg::SHLDDRK64, adaptive::Bool) = false +uses_uprev(alg::CarpenterKennedy2N54, adaptive::Bool) = false +uses_uprev(alg::NDBLSRK124, adaptive::Bool) = false +uses_uprev(alg::NDBLSRK134, adaptive::Bool) = false +uses_uprev(alg::DGLDDRK84_F, adaptive::Bool) = false +uses_uprev(alg::NDBLSRK144, adaptive::Bool) = false +uses_uprev(alg::DGLDDRK84_C, adaptive::Bool) = false +uses_uprev(alg::TSLDDRK74, adaptive::Bool) = false +uses_uprev(alg::CFRLDDRK64, adaptive::Bool) = false +uses_uprev(alg::DGLDDRK73_C, adaptive::Bool) = false +uses_uprev(alg::CKLLSRK43_2, adaptive::Bool) = adaptive +uses_uprev(alg::CKLLSRK54_3C, adaptive::Bool) = adaptive +uses_uprev(alg::CKLLSRK95_4S, adaptive::Bool) = adaptive +uses_uprev(alg::CKLLSRK95_4C, adaptive::Bool) = adaptive +uses_uprev(alg::CKLLSRK95_4M, adaptive::Bool) = adaptive +uses_uprev(alg::CKLLSRK54_3C_3R, adaptive::Bool) = adaptive +uses_uprev(alg::CKLLSRK54_3M_3R, adaptive::Bool) = adaptive +uses_uprev(alg::CKLLSRK54_3N_3R, adaptive::Bool) = adaptive +uses_uprev(alg::CKLLSRK85_4C_3R, adaptive::Bool) = adaptive +uses_uprev(alg::CKLLSRK85_4M_3R, adaptive::Bool) = adaptive +uses_uprev(alg::CKLLSRK85_4P_3R, adaptive::Bool) = adaptive +uses_uprev(alg::CKLLSRK54_3N_4R, adaptive::Bool) = adaptive +uses_uprev(alg::CKLLSRK54_3M_4R, adaptive::Bool) = adaptive +uses_uprev(alg::CKLLSRK65_4M_4R, adaptive::Bool) = adaptive +uses_uprev(alg::CKLLSRK85_4FM_4R, adaptive::Bool) = adaptive +uses_uprev(alg::CKLLSRK75_4M_5R, adaptive::Bool) = adaptive + +""" + ssp_coefficient(alg) + +Return the SSP coefficient of the ODE algorithm `alg`. If one time step of size +`dt` with `alg` can be written as a convex combination of explicit Euler steps +with step sizes `cᵢ * dt`, the SSP coefficient is the minimal value of `1/cᵢ`. + +# Examples + +```julia-repl +julia> ssp_coefficient(SSPRK104()) +6 +``` +""" + +ssp_coefficient(alg::SSPRK53_2N1) = 2.18 +ssp_coefficient(alg::SSPRK53_2N2) = 2.148 +ssp_coefficient(alg::SSPRK53) = 2.65 +ssp_coefficient(alg::SSPRK53_H) = 2.65 +ssp_coefficient(alg::SSPRK63) = 3.518 +ssp_coefficient(alg::SSPRK73) = 4.2879 +ssp_coefficient(alg::SSPRK83) = 5.107 +ssp_coefficient(alg::SSPRK43) = 2 +ssp_coefficient(alg::SSPRK432) = 2 +ssp_coefficient(alg::KYKSSPRK42) = 2.459 +ssp_coefficient(alg::SSPRK932) = 6 +ssp_coefficient(alg::SSPRK54) = 1.508 +ssp_coefficient(alg::SSPRK104) = 6 +ssp_coefficient(alg::KYK2014DGSSPRK_3S2) = 0.8417 +ssp_coefficient(alg::SSPRK33) = 1 +ssp_coefficient(alg::SSPRK22) = 1 \ No newline at end of file diff --git a/src/alg_utils.jl b/src/alg_utils.jl index e2f83e791a..c6875b9f51 100644 --- a/src/alg_utils.jl +++ b/src/alg_utils.jl @@ -44,40 +44,12 @@ isfsal(alg::Vern7) = false isfsal(alg::Vern8) = false isfsal(alg::Vern9) = false # Pseudo Non-FSAL -isfsal(alg::ORK256) = false -isfsal(alg::CarpenterKennedy2N54) = false -isfsal(alg::SHLDDRK64) = false -isfsal(alg::DGLDDRK73_C) = false -isfsal(alg::DGLDDRK84_C) = false -isfsal(alg::DGLDDRK84_F) = false -isfsal(alg::NDBLSRK124) = false -isfsal(alg::NDBLSRK134) = false -isfsal(alg::NDBLSRK144) = false isfsal(alg::PDIRK44) = false isfsal(alg::DImplicitEuler) = false isfsal(alg::RKO65) = false isfsal(alg::FRK65) = true #isfsal(alg::RKM) = false -isfsal(alg::RDPK3Sp35) = false -isfsal(alg::RDPK3Sp49) = false -isfsal(alg::RDPK3Sp510) = false - -isfsal(alg::SSPRK22) = false -isfsal(alg::SSPRK33) = false -isfsal(alg::SSPRK53) = false -isfsal(alg::SSPRK53_2N1) = false -isfsal(alg::SSPRK53_2N2) = false -isfsal(alg::SSPRK53_H) = false -isfsal(alg::SSPRK63) = false -isfsal(alg::SSPRK73) = false -isfsal(alg::SSPRK83) = false -isfsal(alg::SSPRK43) = false -isfsal(alg::SSPRK432) = false -isfsal(alg::SSPRK932) = false -isfsal(alg::SSPRK54) = false -isfsal(alg::SSPRK104) = false - isfsal(alg::PSRK3p5q4) = false isfsal(alg::PSRK3p6q5) = false isfsal(alg::PSRK4p7q6) = false @@ -442,7 +414,6 @@ alg_order(alg::ETD2) = 2 alg_order(alg::Exprb32) = 3 alg_order(alg::Exprb43) = 4 alg_order(alg::Anas5) = 5 -alg_order(alg::RK46NL) = 4 alg_order(alg::KuttaPRK2p5) = 5 alg_order(alg::RKO65) = 5 alg_order(alg::FRK65) = 6 @@ -485,69 +456,6 @@ alg_order(alg::RKN4) = 4 alg_order(alg::Midpoint) = 2 -alg_order(alg::ORK256) = 2 -alg_order(alg::CarpenterKennedy2N54) = 4 -alg_order(alg::SHLDDRK52) = 2 -alg_order(alg::SHLDDRK_2N) = 4 -alg_order(alg::SHLDDRK64) = 4 -alg_order(alg::DGLDDRK73_C) = 3 -alg_order(alg::DGLDDRK84_C) = 4 -alg_order(alg::DGLDDRK84_F) = 4 -alg_order(alg::NDBLSRK124) = 4 -alg_order(alg::NDBLSRK134) = 4 -alg_order(alg::NDBLSRK144) = 4 -alg_order(alg::CFRLDDRK64) = 4 -alg_order(alg::TSLDDRK74) = 4 -alg_order(alg::CKLLSRK43_2) = 3 -alg_order(alg::CKLLSRK54_3C) = 4 -alg_order(alg::CKLLSRK95_4S) = 5 -alg_order(alg::CKLLSRK95_4C) = 5 -alg_order(alg::CKLLSRK95_4M) = 5 -alg_order(alg::CKLLSRK54_3C_3R) = 4 -alg_order(alg::CKLLSRK54_3M_3R) = 4 -alg_order(alg::CKLLSRK54_3N_3R) = 4 -alg_order(alg::CKLLSRK85_4C_3R) = 5 -alg_order(alg::CKLLSRK85_4M_3R) = 5 -alg_order(alg::CKLLSRK85_4P_3R) = 5 -alg_order(alg::CKLLSRK54_3N_4R) = 4 -alg_order(alg::CKLLSRK54_3M_4R) = 4 -alg_order(alg::CKLLSRK65_4M_4R) = 5 -alg_order(alg::CKLLSRK85_4FM_4R) = 5 -alg_order(alg::CKLLSRK75_4M_5R) = 5 -alg_order(alg::ParsaniKetchesonDeconinck3S32) = 2 -alg_order(alg::ParsaniKetchesonDeconinck3S82) = 2 -alg_order(alg::ParsaniKetchesonDeconinck3S53) = 3 -alg_order(alg::ParsaniKetchesonDeconinck3S173) = 3 -alg_order(alg::ParsaniKetchesonDeconinck3S94) = 4 -alg_order(alg::ParsaniKetchesonDeconinck3S184) = 4 -alg_order(alg::ParsaniKetchesonDeconinck3S105) = 5 -alg_order(alg::ParsaniKetchesonDeconinck3S205) = 5 -alg_order(alg::RDPK3Sp35) = 3 -alg_order(alg::RDPK3SpFSAL35) = 3 -alg_order(alg::RDPK3Sp49) = 4 -alg_order(alg::RDPK3SpFSAL49) = 4 -alg_order(alg::RDPK3Sp510) = 5 -alg_order(alg::RDPK3SpFSAL510) = 5 -alg_order(alg::KYK2014DGSSPRK_3S2) = 2 - -alg_order(alg::SSPRK22) = 2 -alg_order(alg::SSPRKMSVS32) = 2 -alg_order(alg::SSPRK33) = 3 -alg_order(alg::KYKSSPRK42) = 2 -alg_order(alg::SSPRK53) = 3 -alg_order(alg::SSPRK53_2N1) = 3 -alg_order(alg::SSPRK53_2N2) = 3 -alg_order(alg::SSPRK53_H) = 3 -alg_order(alg::SSPRK63) = 3 -alg_order(alg::SSPRK73) = 3 -alg_order(alg::SSPRK83) = 3 -alg_order(alg::SSPRK43) = 3 -alg_order(alg::SSPRK432) = 3 -alg_order(alg::SSPRKMSVS43) = 3 -alg_order(alg::SSPRK932) = 3 -alg_order(alg::SSPRK54) = 4 -alg_order(alg::SSPRK104) = 4 - alg_order(alg::RK4) = 4 alg_order(alg::RKM) = 4 alg_order(alg::ExplicitRK) = alg.tableau.order @@ -844,40 +752,10 @@ function FunctionMap_scale_by_time(alg::FunctionMap{scale_by_time}) where {scale end # SSP coefficients -""" - ssp_coefficient(alg) - -Return the SSP coefficient of the ODE algorithm `alg`. If one time step of size -`dt` with `alg` can be written as a convex combination of explicit Euler steps -with step sizes `cᵢ * dt`, the SSP coefficient is the minimal value of `1/cᵢ`. - -# Examples - -```julia-repl -julia> ssp_coefficient(SSPRK104()) -6 -``` -""" ssp_coefficient(alg) = error("$alg is not a strong stability preserving method.") ssp_coefficient(alg::Euler) = 1 -ssp_coefficient(alg::SSPRK22) = 1 -ssp_coefficient(alg::SSPRK33) = 1 -ssp_coefficient(alg::KYKSSPRK42) = 2.459 -ssp_coefficient(alg::SSPRK53) = 2.65 -ssp_coefficient(alg::SSPRK53_2N1) = 2.18 -ssp_coefficient(alg::SSPRK53_2N2) = 2.148 -ssp_coefficient(alg::SSPRK53_H) = 2.65 -ssp_coefficient(alg::SSPRK63) = 3.518 -ssp_coefficient(alg::SSPRK73) = 4.2879 -ssp_coefficient(alg::SSPRK83) = 5.107 -ssp_coefficient(alg::SSPRK43) = 2 -ssp_coefficient(alg::SSPRK432) = 2 ssp_coefficient(alg::SSPRKMSVS32) = 0.5 ssp_coefficient(alg::SSPRKMSVS43) = 0.33 -ssp_coefficient(alg::SSPRK932) = 6 -ssp_coefficient(alg::SSPRK54) = 1.508 -ssp_coefficient(alg::SSPRK104) = 6 -ssp_coefficient(alg::KYK2014DGSSPRK_3S2) = 0.8417 # We shouldn't do this probably. #ssp_coefficient(alg::ImplicitEuler) = Inf @@ -946,34 +824,7 @@ end # Whether `uprev` is used in the algorithm directly. uses_uprev(alg::Union{OrdinaryDiffEqAlgorithm, DAEAlgorithm}, adaptive::Bool) = true -uses_uprev(alg::ORK256, adaptive::Bool) = false -uses_uprev(alg::CarpenterKennedy2N54, adaptive::Bool) = false -uses_uprev(alg::SHLDDRK64, adaptive::Bool) = false -uses_uprev(alg::DGLDDRK73_C, adaptive::Bool) = false -uses_uprev(alg::DGLDDRK84_C, adaptive::Bool) = false -uses_uprev(alg::DGLDDRK84_F, adaptive::Bool) = false -uses_uprev(alg::NDBLSRK124, adaptive::Bool) = false -uses_uprev(alg::NDBLSRK134, adaptive::Bool) = false -uses_uprev(alg::NDBLSRK144, adaptive::Bool) = false -uses_uprev(alg::CFRLDDRK64, adaptive::Bool) = false -uses_uprev(alg::TSLDDRK74, adaptive::Bool) = false uses_uprev(alg::OrdinaryDiffEqAdaptiveAlgorithm, adaptive::Bool) = true -uses_uprev(alg::CKLLSRK43_2, adaptive::Bool) = adaptive -uses_uprev(alg::CKLLSRK54_3C, adaptive::Bool) = adaptive -uses_uprev(alg::CKLLSRK95_4S, adaptive::Bool) = adaptive -uses_uprev(alg::CKLLSRK95_4C, adaptive::Bool) = adaptive -uses_uprev(alg::CKLLSRK95_4M, adaptive::Bool) = adaptive -uses_uprev(alg::CKLLSRK54_3C_3R, adaptive::Bool) = adaptive -uses_uprev(alg::CKLLSRK54_3M_3R, adaptive::Bool) = adaptive -uses_uprev(alg::CKLLSRK54_3N_3R, adaptive::Bool) = adaptive -uses_uprev(alg::CKLLSRK85_4C_3R, adaptive::Bool) = adaptive -uses_uprev(alg::CKLLSRK85_4M_3R, adaptive::Bool) = adaptive -uses_uprev(alg::CKLLSRK85_4P_3R, adaptive::Bool) = adaptive -uses_uprev(alg::CKLLSRK54_3N_4R, adaptive::Bool) = adaptive -uses_uprev(alg::CKLLSRK54_3M_4R, adaptive::Bool) = adaptive -uses_uprev(alg::CKLLSRK65_4M_4R, adaptive::Bool) = adaptive -uses_uprev(alg::CKLLSRK85_4FM_4R, adaptive::Bool) = adaptive -uses_uprev(alg::CKLLSRK75_4M_5R, adaptive::Bool) = adaptive ispredictive(alg::Union{OrdinaryDiffEqAlgorithm, DAEAlgorithm}) = false ispredictive(alg::Union{RKC}) = true From 7d048f7752128ad657dacbec586c3fc43d3c7322 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 00:44:58 +0530 Subject: [PATCH 03/54] Fixes --- test/runtests.jl | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index efeb255a06..bc66c6eea9 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -29,8 +29,6 @@ function activate_extrapolation_env() Pkg.instantiate() end -<<<<<<< HEAD -======= function activate_stabilized_rk() Pkg.activate("../lib/OrdinaryDiffEqStabilizedRK") Pkg.develop(PackageSpec(path = dirname(@__DIR__))) @@ -43,7 +41,6 @@ function activate_low_storage_rk() Pkg.instantiate() end ->>>>>>> 5134aff1 (Added a separate package for Low Storage RK methods) #Start Test Script @time begin From 347801b5e07d341ff1a01eb44136ed7ba2097dea Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 00:51:03 +0530 Subject: [PATCH 04/54] fixes --- src/OrdinaryDiffEq.jl | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/OrdinaryDiffEq.jl b/src/OrdinaryDiffEq.jl index 2c55c6c678..966bfc8c63 100644 --- a/src/OrdinaryDiffEq.jl +++ b/src/OrdinaryDiffEq.jl @@ -241,8 +241,6 @@ export AitkenNeville, ExtrapolationMidpointDeuflhard, ExtrapolationMidpointHaire ImplicitDeuflhardExtrapolation, ImplicitHairerWannerExtrapolation, ImplicitEulerBarycentricExtrapolation -<<<<<<< HEAD -======= include("../lib/OrdinaryDiffEqStabilizedRK/src/OrdinaryDiffEqStabilizedRK.jl") using ..OrdinaryDiffEqStabilizedRK export ROCK2, ROCK4, RKC, ESERK4, ESERK5, SERK2, IRKC @@ -260,7 +258,6 @@ export ORK256, SSPRK53_2N1, SSPRK53_2N2, NDBLSRK124, CarpenterKennedy2N54, NDBLS SSPRK73, SSPRK63, SSPRK53_H, KYKSSPRK42, SSPRK53, SSPRK33, SSPRK22, YK2014DGSSPRK_3S2, NDBLSRK134, SLDDRK64, SHLDDRK_2N, SHLDDRK52 ->>>>>>> 5134aff1 (Added a separate package for Low Storage RK methods) import PrecompileTools PrecompileTools.@compile_workload begin From 56c4ed0fb0ce2e0e26d7920aea220783e716d8a1 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 00:59:43 +0530 Subject: [PATCH 05/54] Update --- lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl b/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl index 0eeff83ad4..6aaf4172bc 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl @@ -1,3 +1,14 @@ +using OrdinaryDiffEq: ORK256, SSPRK53_2N1, SSPRK53_2N2, NDBLSRK124, CarpenterKennedy2N54, NDBLSRK134, NDBLSRK144, + CFRLDDRK64, TSLDDRK74, DGLDDRK73_C, DGLDDRK84_C, DGLDDRK84_F, SHLDDRK64, RK46NL, ParsaniKetchesonDeconinck3S32, + ParsaniKetchesonDeconinck3S82, ParsaniKetchesonDeconinck3S53, ParsaniKetchesonDeconinck3S173, ParsaniKetchesonDeconinck3S94, + ParsaniKetchesonDeconinck3S184, ParsaniKetchesonDeconinck3S105, ParsaniKetchesonDeconinck3S205, CKLLSRK43_2, + CKLLSRK54_3C, CKLLSRK95_4S, CKLLSRK95_4C, CKLLSRK95_4M, CKLLSRK54_3C_3R, CKLLSRK54_3M_3R, CKLLSRK54_3N_3R, + CKLLSRK85_4C_3R, CKLLSRK85_4M_3R, CKLLSRK85_4P_3R, CKLLSRK54_3N_4R, CKLLSRK54_3M_4R, CKLLSRK65_4M_4R, + CKLLSRK85_4FM_4R, CKLLSRK75_4M_5R, RDPK3Sp35, RDPK3SpFSAL35, RDPK3Sp49, RDPK3SpFSAL49, RDPK3Sp510, + RDPK3SpFSAL510, SSPRK104, SSPRK54, SSPRK932, SSPRKMSVS32, SSPRKMSVS43, SSPRK432, SSPRK43, SSPRK83, + SSPRK73, SSPRK63, SSPRK53_H, KYKSSPRK42, SSPRK53, SSPRK33, SSPRK22, KYK2014DGSSPRK_3S2, NDBLSRK134, + SLDDRK64, SHLDDRK_2N, SHLDDRK52 + alg_order(alg::KYK2014DGSSPRK_3S2) = 2 alg_order(alg::ORK256) = 2 alg_order(alg::CarpenterKennedy2N54) = 4 From 06b194605c9e28255c9f5bb2ba038b57250006ca Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 01:06:16 +0530 Subject: [PATCH 06/54] Update --- src/OrdinaryDiffEq.jl | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/src/OrdinaryDiffEq.jl b/src/OrdinaryDiffEq.jl index 966bfc8c63..d1fb6912e0 100644 --- a/src/OrdinaryDiffEq.jl +++ b/src/OrdinaryDiffEq.jl @@ -177,7 +177,6 @@ include("tableaus/rosenbrock_tableaus.jl") include("tableaus/sdirk_tableaus.jl") include("tableaus/firk_tableaus.jl") include("tableaus/rkn_tableaus.jl") -include("tableaus/rkc_tableaus.jl") include("tableaus/qprk_tableaus.jl") include("integrators/type.jl") @@ -247,16 +246,17 @@ export ROCK2, ROCK4, RKC, ESERK4, ESERK5, SERK2, IRKC include("../lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl") using ..OrdinaryDiffEqLowStorageRK -export ORK256, SSPRK53_2N1, SSPRK53_2N2, NDBLSRK124, CarpenterKennedy2N54, NDBLSRK134, NDBLSRK144, CFRLDDRK64, - CFRLDDRK64, TSLDDRK74, DGLDDRK73_C, DGLDDRK84_C, DGLDDRK84_F, SHLDDRK64, RK46NL, ParsaniKetchesonDeconinck3S32, - ParsaniKetchesonDeconinck3S82, ParsaniKetchesonDeconinck3S53, ParsaniKetchesonDeconinck3S173, ParsaniKetchesonDeconinck3S94, - ParsaniKetchesonDeconinck3S184, ParsaniKetchesonDeconinck3S105, ParsaniKetchesonDeconinck3S205, CKLLSRK43_2, - CKLLSRK54_3C, CKLLSRK95_4S, CKLLSRK95_4C, CKLLSRK95_4M, CKLLSRK54_3C_3R, CKLLSRK54_3M_3R, CKLLSRK54_3N_3R, - CKLLSRK85_4C_3R, CKLLSRK85_4M_3R, CKLLSRK85_4P_3R, CKLLSRK54_3N_4R, CKLLSRK54_3M_4R, CKLLSRK65_4M_4R, - CKLLSRK85_4FM_4R, CKLLSRK75_4M_5R, RDPK3Sp35, RDPK3SpFSAL35, RDPK3Sp49, RDPK3SpFSAL49, RDPK3Sp510, - RDPK3SpFSAL510, SSPRK104, SSPRK54, SSPRK932, SSPRKMSVS32, SSPRKMSVS43, SSPRK432, SSPRK43, SSPRK83, - SSPRK73, SSPRK63, SSPRK53_H, KYKSSPRK42, SSPRK53, SSPRK33, SSPRK22, YK2014DGSSPRK_3S2, NDBLSRK134, - SLDDRK64, SHLDDRK_2N, SHLDDRK52 +export ORK256, CarpenterKennedy2N54, SHLDDRK64, HSLDDRK64, DGLDDRK73_C, DGLDDRK84_C, + DGLDDRK84_F, NDBLSRK124, NDBLSRK134, NDBLSRK144, + CFRLDDRK64, TSLDDRK74, SHLDDRK52, SHLDDRK_2N, CKLLSRK43_2, CKLLSRK54_3C, CKLLSRK95_4S, CKLLSRK95_4C, CKLLSRK95_4M, + CKLLSRK54_3C_3R, CKLLSRK54_3M_3R, CKLLSRK54_3N_3R, CKLLSRK85_4C_3R, CKLLSRK85_4M_3R, CKLLSRK85_4P_3R, + CKLLSRK54_3N_4R, CKLLSRK54_3M_4R, CKLLSRK65_4M_4R, CKLLSRK85_4FM_4R, CKLLSRK75_4M_5R, + ParsaniKetchesonDeconinck3S32, ParsaniKetchesonDeconinck3S82, + ParsaniKetchesonDeconinck3S53, ParsaniKetchesonDeconinck3S173, + ParsaniKetchesonDeconinck3S94, ParsaniKetchesonDeconinck3S184, + ParsaniKetchesonDeconinck3S105, ParsaniKetchesonDeconinck3S205, + RDPK3Sp35, RDPK3SpFSAL35, RDPK3Sp49, RDPK3SpFSAL49, RDPK3Sp510, RDPK3SpFSAL510, + KYK2014DGSSPRK_3S2 import PrecompileTools @@ -400,20 +400,6 @@ export SSPRK22, SSPRK33, KYKSSPRK42, SSPRK53, SSPRK53_2N1, SSPRK53_2N2, SSPRK53_ SSPRK73, SSPRK83, SSPRK43, SSPRK432, SSPRKMSVS32, SSPRKMSVS43, SSPRK932, SSPRK54, SSPRK104 -export ORK256, CarpenterKennedy2N54, SHLDDRK64, HSLDDRK64, DGLDDRK73_C, DGLDDRK84_C, - DGLDDRK84_F, NDBLSRK124, NDBLSRK134, NDBLSRK144, - CFRLDDRK64, TSLDDRK74, SHLDDRK52, SHLDDRK_2N, - CKLLSRK43_2, CKLLSRK54_3C, CKLLSRK95_4S, CKLLSRK95_4C, CKLLSRK95_4M, - CKLLSRK54_3C_3R, CKLLSRK54_3M_3R, CKLLSRK54_3N_3R, CKLLSRK85_4C_3R, CKLLSRK85_4M_3R, - CKLLSRK85_4P_3R, - CKLLSRK54_3N_4R, CKLLSRK54_3M_4R, CKLLSRK65_4M_4R, CKLLSRK85_4FM_4R, CKLLSRK75_4M_5R, - ParsaniKetchesonDeconinck3S32, ParsaniKetchesonDeconinck3S82, - ParsaniKetchesonDeconinck3S53, ParsaniKetchesonDeconinck3S173, - ParsaniKetchesonDeconinck3S94, ParsaniKetchesonDeconinck3S184, - ParsaniKetchesonDeconinck3S105, ParsaniKetchesonDeconinck3S205, - RDPK3Sp35, RDPK3SpFSAL35, RDPK3Sp49, RDPK3SpFSAL49, RDPK3Sp510, RDPK3SpFSAL510, - KYK2014DGSSPRK_3S2 - export RadauIIA3, RadauIIA5 export ImplicitEuler, ImplicitMidpoint, Trapezoid, TRBDF2, SDIRK2, SDIRK22, From 1482b4e3546a006f731b73c3762932332040cea2 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 01:16:43 +0530 Subject: [PATCH 07/54] alg_utils.jl --- .../src/alg_utils.jl | 32 ++++++++++++++++++- src/OrdinaryDiffEq.jl | 1 + src/alg_utils.jl | 30 ----------------- 3 files changed, 32 insertions(+), 31 deletions(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl b/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl index 6aaf4172bc..f518056a15 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl @@ -159,4 +159,34 @@ ssp_coefficient(alg::SSPRK54) = 1.508 ssp_coefficient(alg::SSPRK104) = 6 ssp_coefficient(alg::KYK2014DGSSPRK_3S2) = 0.8417 ssp_coefficient(alg::SSPRK33) = 1 -ssp_coefficient(alg::SSPRK22) = 1 \ No newline at end of file +ssp_coefficient(alg::SSPRK22) = 1 + +function default_controller(alg::RDPK3Sp35, cache, qoldinit, args...) + QT = typeof(qoldinit) + return PIDController(map(Base.Fix1(convert, QT), (0.64, -0.31, 0.04))...) +end + +function default_controller(alg::RDPK3SpFSAL35, cache, qoldinit, args...) + QT = typeof(qoldinit) + return PIDController(map(Base.Fix1(convert, QT), (0.70, -0.23, 0.00))...) +end + +function default_controller(alg::RDPK3Sp49, cache, qoldinit, args...) + QT = typeof(qoldinit) + return PIDController(map(Base.Fix1(convert, QT), (0.25, -0.12, 0.00))...) +end + +function default_controller(alg::RDPK3SpFSAL49, cache, qoldinit, args...) + QT = typeof(qoldinit) + return PIDController(map(Base.Fix1(convert, QT), (0.38, -0.18, 0.01))...) +end + +function default_controller(alg::RDPK3Sp510, cache, qoldinit, args...) + QT = typeof(qoldinit) + return PIDController(map(Base.Fix1(convert, QT), (0.47, -0.20, 0.06))...) +end + +function default_controller(alg::RDPK3SpFSAL510, cache, qoldinit, args...) + QT = typeof(qoldinit) + return PIDController(map(Base.Fix1(convert, QT), (0.45, -0.13, 0.00))...) +end \ No newline at end of file diff --git a/src/OrdinaryDiffEq.jl b/src/OrdinaryDiffEq.jl index d1fb6912e0..3031100de1 100644 --- a/src/OrdinaryDiffEq.jl +++ b/src/OrdinaryDiffEq.jl @@ -177,6 +177,7 @@ include("tableaus/rosenbrock_tableaus.jl") include("tableaus/sdirk_tableaus.jl") include("tableaus/firk_tableaus.jl") include("tableaus/rkn_tableaus.jl") +include("tableaus/rkc_tableaus.jl") include("tableaus/qprk_tableaus.jl") include("integrators/type.jl") diff --git a/src/alg_utils.jl b/src/alg_utils.jl index c6875b9f51..f3eae57f1f 100644 --- a/src/alg_utils.jl +++ b/src/alg_utils.jl @@ -675,36 +675,6 @@ function _digest_beta1_beta2(alg, cache, ::Val{QT}, _beta1, _beta2) where {QT} return convert(QT, beta1)::QT, convert(QT, beta2)::QT end -function default_controller(alg::RDPK3Sp35, cache, qoldinit, args...) - QT = typeof(qoldinit) - return PIDController(map(Base.Fix1(convert, QT), (0.64, -0.31, 0.04))...) -end - -function default_controller(alg::RDPK3SpFSAL35, cache, qoldinit, args...) - QT = typeof(qoldinit) - return PIDController(map(Base.Fix1(convert, QT), (0.70, -0.23, 0.00))...) -end - -function default_controller(alg::RDPK3Sp49, cache, qoldinit, args...) - QT = typeof(qoldinit) - return PIDController(map(Base.Fix1(convert, QT), (0.25, -0.12, 0.00))...) -end - -function default_controller(alg::RDPK3SpFSAL49, cache, qoldinit, args...) - QT = typeof(qoldinit) - return PIDController(map(Base.Fix1(convert, QT), (0.38, -0.18, 0.01))...) -end - -function default_controller(alg::RDPK3Sp510, cache, qoldinit, args...) - QT = typeof(qoldinit) - return PIDController(map(Base.Fix1(convert, QT), (0.47, -0.20, 0.06))...) -end - -function default_controller(alg::RDPK3SpFSAL510, cache, qoldinit, args...) - QT = typeof(qoldinit) - return PIDController(map(Base.Fix1(convert, QT), (0.45, -0.13, 0.00))...) -end - # other special cases in controllers.jl function default_controller(alg::Union{JVODE, QNDF, FBDF}, args...) DummyController() From e5aca196979e33094891d7d41dd7503d2f6a7848 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 01:24:34 +0530 Subject: [PATCH 08/54] Undef Error solve --- lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl | 2 ++ src/alg_utils.jl | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl b/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl index f518056a15..caf5936976 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl @@ -153,7 +153,9 @@ ssp_coefficient(alg::SSPRK73) = 4.2879 ssp_coefficient(alg::SSPRK83) = 5.107 ssp_coefficient(alg::SSPRK43) = 2 ssp_coefficient(alg::SSPRK432) = 2 +ssp_coefficient(alg::SSPRKMSVS32) = 0.5 ssp_coefficient(alg::KYKSSPRK42) = 2.459 +ssp_coefficient(alg::SSPRKMSVS43) = 0.33 ssp_coefficient(alg::SSPRK932) = 6 ssp_coefficient(alg::SSPRK54) = 1.508 ssp_coefficient(alg::SSPRK104) = 6 diff --git a/src/alg_utils.jl b/src/alg_utils.jl index f3eae57f1f..ed6637e1ed 100644 --- a/src/alg_utils.jl +++ b/src/alg_utils.jl @@ -724,8 +724,6 @@ end # SSP coefficients ssp_coefficient(alg) = error("$alg is not a strong stability preserving method.") ssp_coefficient(alg::Euler) = 1 -ssp_coefficient(alg::SSPRKMSVS32) = 0.5 -ssp_coefficient(alg::SSPRKMSVS43) = 0.33 # We shouldn't do this probably. #ssp_coefficient(alg::ImplicitEuler) = Inf From 9e2db241c6b8536da9eca391c8b5facf61665f7f Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 08:17:52 +0530 Subject: [PATCH 09/54] Rebased commits --- .../src/low_storage_rk_caches.jl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl index a903e155ad..608e0386dc 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl @@ -1,5 +1,16 @@ # 2N low storage methods introduced by Williamson +using OrdinaryDiffEq: ORK256, SSPRK53_2N1, SSPRK53_2N2, NDBLSRK124, CarpenterKennedy2N54, NDBLSRK134, NDBLSRK144, + CFRLDDRK64, TSLDDRK74, DGLDDRK73_C, DGLDDRK84_C, DGLDDRK84_F, SHLDDRK64, RK46NL, ParsaniKetchesonDeconinck3S32, + ParsaniKetchesonDeconinck3S82, ParsaniKetchesonDeconinck3S53, ParsaniKetchesonDeconinck3S173, ParsaniKetchesonDeconinck3S94, + ParsaniKetchesonDeconinck3S184, ParsaniKetchesonDeconinck3S105, ParsaniKetchesonDeconinck3S205, CKLLSRK43_2, + CKLLSRK54_3C, CKLLSRK95_4S, CKLLSRK95_4C, CKLLSRK95_4M, CKLLSRK54_3C_3R, CKLLSRK54_3M_3R, CKLLSRK54_3N_3R, + CKLLSRK85_4C_3R, CKLLSRK85_4M_3R, CKLLSRK85_4P_3R, CKLLSRK54_3N_4R, CKLLSRK54_3M_4R, CKLLSRK65_4M_4R, + CKLLSRK85_4FM_4R, CKLLSRK75_4M_5R, RDPK3Sp35, RDPK3SpFSAL35, RDPK3Sp49, RDPK3SpFSAL49, RDPK3Sp510, + RDPK3SpFSAL510, SSPRK104, SSPRK54, SSPRK932, SSPRKMSVS32, SSPRKMSVS43, SSPRK432, SSPRK43, SSPRK83, + SSPRK73, SSPRK63, SSPRK53_H, KYKSSPRK42, SSPRK53, SSPRK33, SSPRK22, KYK2014DGSSPRK_3S2, NDBLSRK134, + SLDDRK64, SHLDDRK_2N, SHLDDRK52 + @cache struct LowStorageRK2NCache{uType, rateType, TabType, StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqMutableCache u::uType From cbadbd175bbd111f3e489a9bf077e41e34000566 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 09:01:55 +0530 Subject: [PATCH 10/54] RK46NL --- src/OrdinaryDiffEq.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OrdinaryDiffEq.jl b/src/OrdinaryDiffEq.jl index b38a83dec4..cc6da6eec9 100644 --- a/src/OrdinaryDiffEq.jl +++ b/src/OrdinaryDiffEq.jl @@ -253,7 +253,7 @@ export ORK256, CarpenterKennedy2N54, SHLDDRK64, HSLDDRK64, DGLDDRK73_C, DGLDDRK8 ParsaniKetchesonDeconinck3S94, ParsaniKetchesonDeconinck3S184, ParsaniKetchesonDeconinck3S105, ParsaniKetchesonDeconinck3S205, RDPK3Sp35, RDPK3SpFSAL35, RDPK3Sp49, RDPK3SpFSAL49, RDPK3Sp510, RDPK3SpFSAL510, - KYK2014DGSSPRK_3S2 + KYK2014DGSSPRK_3S2, RK46NL import PrecompileTools From 7886c4546682726d23faba3ea67f4bcf7320b3a8 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 09:04:49 +0530 Subject: [PATCH 11/54] Fix RK46NL --- src/OrdinaryDiffEq.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OrdinaryDiffEq.jl b/src/OrdinaryDiffEq.jl index cc6da6eec9..0f5e37f295 100644 --- a/src/OrdinaryDiffEq.jl +++ b/src/OrdinaryDiffEq.jl @@ -387,7 +387,7 @@ export constructDormandPrince export FunctionMap, Euler, Heun, Ralston, Midpoint, RK4, ExplicitRK, OwrenZen3, OwrenZen4, OwrenZen5, - BS3, BS5, RK46NL, DP5, Tsit5, DP8, Vern6, Vern7, Vern8, TanYam7, TsitPap8, + BS3, BS5, DP5, Tsit5, DP8, Vern6, Vern7, Vern8, TanYam7, TsitPap8, Vern9, Feagin10, Feagin12, Feagin14, CompositeAlgorithm, Anas5, RKO65, FRK65, PFRK87, RKM, MSRK5, MSRK6, Stepanov5, SIR54, QPRK98, PSRK4p7q6, PSRK3p6q5, PSRK3p5q4 From ef59fa242acb0ea12a7f366fa9c2423cdb493679 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 09:08:39 +0530 Subject: [PATCH 12/54] RK46NL --- .../src/low_storage_rk_caches.jl | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl index 608e0386dc..5041907f23 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl @@ -1,15 +1,6 @@ # 2N low storage methods introduced by Williamson -using OrdinaryDiffEq: ORK256, SSPRK53_2N1, SSPRK53_2N2, NDBLSRK124, CarpenterKennedy2N54, NDBLSRK134, NDBLSRK144, - CFRLDDRK64, TSLDDRK74, DGLDDRK73_C, DGLDDRK84_C, DGLDDRK84_F, SHLDDRK64, RK46NL, ParsaniKetchesonDeconinck3S32, - ParsaniKetchesonDeconinck3S82, ParsaniKetchesonDeconinck3S53, ParsaniKetchesonDeconinck3S173, ParsaniKetchesonDeconinck3S94, - ParsaniKetchesonDeconinck3S184, ParsaniKetchesonDeconinck3S105, ParsaniKetchesonDeconinck3S205, CKLLSRK43_2, - CKLLSRK54_3C, CKLLSRK95_4S, CKLLSRK95_4C, CKLLSRK95_4M, CKLLSRK54_3C_3R, CKLLSRK54_3M_3R, CKLLSRK54_3N_3R, - CKLLSRK85_4C_3R, CKLLSRK85_4M_3R, CKLLSRK85_4P_3R, CKLLSRK54_3N_4R, CKLLSRK54_3M_4R, CKLLSRK65_4M_4R, - CKLLSRK85_4FM_4R, CKLLSRK75_4M_5R, RDPK3Sp35, RDPK3SpFSAL35, RDPK3Sp49, RDPK3SpFSAL49, RDPK3Sp510, - RDPK3SpFSAL510, SSPRK104, SSPRK54, SSPRK932, SSPRKMSVS32, SSPRKMSVS43, SSPRK432, SSPRK43, SSPRK83, - SSPRK73, SSPRK63, SSPRK53_H, KYKSSPRK42, SSPRK53, SSPRK33, SSPRK22, KYK2014DGSSPRK_3S2, NDBLSRK134, - SLDDRK64, SHLDDRK_2N, SHLDDRK52 +include("algorithms.jl") @cache struct LowStorageRK2NCache{uType, rateType, TabType, StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqMutableCache From 3d727cbda84c71a008fea62694242363e5c1e602 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 09:15:32 +0530 Subject: [PATCH 13/54] RK46NL --- .../src/low_storage_rk_caches.jl | 72 ++++++++++++++++++- src/caches/low_order_rk_caches.jl | 71 ------------------ 2 files changed, 71 insertions(+), 72 deletions(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl index 5041907f23..b70c78f37d 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl @@ -1,6 +1,5 @@ # 2N low storage methods introduced by Williamson -include("algorithms.jl") @cache struct LowStorageRK2NCache{uType, rateType, TabType, StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqMutableCache @@ -73,6 +72,77 @@ function alg_cache(alg::ORK256, u, rate_prototype, ::Type{uEltypeNoUnits}, ORK256ConstantCache(constvalue(uBottomEltypeNoUnits), constvalue(tTypeNoUnits)) end +function alg_cache(alg::RK46NL, u, rate_prototype, ::Type{uEltypeNoUnits}, + ::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t, + dt, reltol, p, calck, + ::Val{false}) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits} +RK46NLConstantCache(constvalue(uBottomEltypeNoUnits), constvalue(tTypeNoUnits)) +end + +struct RK46NLConstantCache{T, T2} <: OrdinaryDiffEqConstantCache + α2::T + α3::T + α4::T + α5::T + α6::T + β1::T + β2::T + β3::T + β4::T + β5::T + β6::T + c2::T2 + c3::T2 + c4::T2 + c5::T2 + c6::T2 + + function RK46NLConstantCache(T, T2) + α2 = T(-0.737101392796) + α3 = T(-1.634740794343) + α4 = T(-0.744739003780) + α5 = T(-1.469897351522) + α6 = T(-2.813971388035) + β1 = T(0.032918605146) + β2 = T(0.823256998200) + β3 = T(0.381530948900) + β4 = T(0.200092213184) + β5 = T(1.718581042715) + β6 = T(0.27) + c2 = T2(0.032918605146) + c3 = T2(0.249351723343) + c4 = T2(0.466911705055) + c5 = T2(0.582030414044) + c6 = T2(0.847252983783) + new{T, T2}(α2, α3, α4, α5, α6, β1, β2, β3, β4, β5, β6, c2, c3, c4, c5, c6) + end +end + +function alg_cache(alg::RK46NL, u, rate_prototype, ::Type{uEltypeNoUnits}, + ::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t, + dt, reltol, p, calck, + ::Val{true}) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits} +tmp = zero(u) +k = zero(rate_prototype) +fsalfirst = zero(rate_prototype) +tab = RK46NLConstantCache(constvalue(uBottomEltypeNoUnits), constvalue(tTypeNoUnits)) +RK46NLCache(u, uprev, k, tmp, fsalfirst, tab, alg.stage_limiter!, alg.step_limiter!, + alg.thread) +end + +@cache struct RK46NLCache{uType, rateType, TabType, StageLimiter, StepLimiter, Thread} <: + OrdinaryDiffEqMutableCache +u::uType +uprev::uType +k::rateType +tmp::uType +fsalfirst::rateType +tab::TabType +stage_limiter!::StageLimiter +step_limiter!::StepLimiter +thread::Thread +end + function CarpenterKennedy2N54ConstantCache(T, T2) A2 = convert(T, -567301805773 // 1357537059087) A3 = convert(T, -2404267990393 // 2016746695238) diff --git a/src/caches/low_order_rk_caches.jl b/src/caches/low_order_rk_caches.jl index 54b67ea5b3..f22fcc287c 100644 --- a/src/caches/low_order_rk_caches.jl +++ b/src/caches/low_order_rk_caches.jl @@ -448,77 +448,6 @@ if isdefined(Base, :Experimental) && isdefined(Base.Experimental, :silence!) Base.Experimental.silence!(Tsit5Cache) end -@cache struct RK46NLCache{uType, rateType, TabType, StageLimiter, StepLimiter, Thread} <: - OrdinaryDiffEqMutableCache - u::uType - uprev::uType - k::rateType - tmp::uType - fsalfirst::rateType - tab::TabType - stage_limiter!::StageLimiter - step_limiter!::StepLimiter - thread::Thread -end - -struct RK46NLConstantCache{T, T2} <: OrdinaryDiffEqConstantCache - α2::T - α3::T - α4::T - α5::T - α6::T - β1::T - β2::T - β3::T - β4::T - β5::T - β6::T - c2::T2 - c3::T2 - c4::T2 - c5::T2 - c6::T2 - - function RK46NLConstantCache(T, T2) - α2 = T(-0.737101392796) - α3 = T(-1.634740794343) - α4 = T(-0.744739003780) - α5 = T(-1.469897351522) - α6 = T(-2.813971388035) - β1 = T(0.032918605146) - β2 = T(0.823256998200) - β3 = T(0.381530948900) - β4 = T(0.200092213184) - β5 = T(1.718581042715) - β6 = T(0.27) - c2 = T2(0.032918605146) - c3 = T2(0.249351723343) - c4 = T2(0.466911705055) - c5 = T2(0.582030414044) - c6 = T2(0.847252983783) - new{T, T2}(α2, α3, α4, α5, α6, β1, β2, β3, β4, β5, β6, c2, c3, c4, c5, c6) - end -end - -function alg_cache(alg::RK46NL, u, rate_prototype, ::Type{uEltypeNoUnits}, - ::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t, - dt, reltol, p, calck, - ::Val{true}) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits} - tmp = zero(u) - k = zero(rate_prototype) - fsalfirst = zero(rate_prototype) - tab = RK46NLConstantCache(constvalue(uBottomEltypeNoUnits), constvalue(tTypeNoUnits)) - RK46NLCache(u, uprev, k, tmp, fsalfirst, tab, alg.stage_limiter!, alg.step_limiter!, - alg.thread) -end - -function alg_cache(alg::RK46NL, u, rate_prototype, ::Type{uEltypeNoUnits}, - ::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t, - dt, reltol, p, calck, - ::Val{false}) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits} - RK46NLConstantCache(constvalue(uBottomEltypeNoUnits), constvalue(tTypeNoUnits)) -end - function alg_cache(alg::Tsit5, u, rate_prototype, ::Type{uEltypeNoUnits}, ::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t, dt, reltol, p, calck, From b636cb4d3a4be5e81fbf47962744013c758cb10c Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 09:20:01 +0530 Subject: [PATCH 14/54] RK46NL --- .../src/low_storage_rk_caches.jl | 77 +++++++++++++++++++ src/caches/low_order_rk_caches.jl | 77 ------------------- 2 files changed, 77 insertions(+), 77 deletions(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl index b70c78f37d..9e5960a840 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl @@ -118,6 +118,83 @@ struct RK46NLConstantCache{T, T2} <: OrdinaryDiffEqConstantCache end end +@cache struct KYK2014DGSSPRK_3S2_Cache{uType, rateType, TabType, StageLimiter, StepLimiter, + Thread} <: + OrdinaryDiffEqMutableCache + u::uType + uprev::uType + k::rateType + fsalfirst::rateType + tab::TabType + #temporary values for Shu-Osher + u_1::uType + u_2::uType + kk_1::rateType + kk_2::rateType + stage_limiter!::StageLimiter + step_limiter!::StepLimiter + thread::Thread +end + +struct KYK2014DGSSPRK_3S2_ConstantCache{T, T2} <: OrdinaryDiffEqConstantCache + #These are not α and β for RK but for Shu-Osher + #see top of page 317 in + #Optimal Strong-Stability-Preserving Runge–Kutta Time Discretizations for + #Discontinuous Garlekin Methods, Kubatko, Yaeger, Ketcheson 2014 + α_10::T + α_20::T + α_21::T + α_30::T + α_32::T + β_10::T + β_21::T + β_30::T + β_32::T + #Shu-Osher is normally stated for autonomous systems, the times + #are calculated by hand for this scheme + c_1::T + c_2::T + + function KYK2014DGSSPRK_3S2_ConstantCache(T, T2) + α_10 = T(1.0) + α_20 = T(0.087353119859156) + α_21 = T(0.912646880140844) + α_30 = T(0.344956917166841) + α_32 = T(0.655043082833159) + β_10 = T(0.528005024856522) + β_21 = T(0.481882138633993) + β_30 = T(0.022826837460491) + β_32 = T(0.345866039233415) + c_1 = β_10 + c_2 = α_21 * β_10 + β_21 # ==0.96376427726 + new{T, T2}(α_10, α_20, α_21, α_30, α_32, β_10, β_21, β_30, β_32, c_1, c_2) + end +end + +function alg_cache(alg::KYK2014DGSSPRK_3S2, u, rate_prototype, ::Type{uEltypeNoUnits}, + ::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t, + dt, reltol, p, calck, + ::Val{true}) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits} +u_1 = zero(u) +u_2 = zero(u) +kk_1 = zero(rate_prototype) +kk_2 = zero(rate_prototype) +k = zero(rate_prototype) +fsalfirst = zero(rate_prototype) +tab = KYK2014DGSSPRK_3S2_ConstantCache(constvalue(uBottomEltypeNoUnits), + constvalue(tTypeNoUnits)) +KYK2014DGSSPRK_3S2_Cache(u, uprev, k, fsalfirst, tab, u_1, u_2, kk_1, kk_2, + alg.stage_limiter!, alg.step_limiter!, alg.thread) +end + +function alg_cache(alg::KYK2014DGSSPRK_3S2, u, rate_prototype, ::Type{uEltypeNoUnits}, + ::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t, + dt, reltol, p, calck, + ::Val{false}) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits} +KYK2014DGSSPRK_3S2_ConstantCache(constvalue(uBottomEltypeNoUnits), + constvalue(tTypeNoUnits)) +end + function alg_cache(alg::RK46NL, u, rate_prototype, ::Type{uEltypeNoUnits}, ::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t, dt, reltol, p, calck, diff --git a/src/caches/low_order_rk_caches.jl b/src/caches/low_order_rk_caches.jl index f22fcc287c..0da22a8f41 100644 --- a/src/caches/low_order_rk_caches.jl +++ b/src/caches/low_order_rk_caches.jl @@ -608,83 +608,6 @@ function alg_cache(alg::Anas5, u, rate_prototype, ::Type{uEltypeNoUnits}, Anas5ConstantCache(constvalue(uBottomEltypeNoUnits), constvalue(tTypeNoUnits)) end -@cache struct KYK2014DGSSPRK_3S2_Cache{uType, rateType, TabType, StageLimiter, StepLimiter, - Thread} <: - OrdinaryDiffEqMutableCache - u::uType - uprev::uType - k::rateType - fsalfirst::rateType - tab::TabType - #temporary values for Shu-Osher - u_1::uType - u_2::uType - kk_1::rateType - kk_2::rateType - stage_limiter!::StageLimiter - step_limiter!::StepLimiter - thread::Thread -end - -struct KYK2014DGSSPRK_3S2_ConstantCache{T, T2} <: OrdinaryDiffEqConstantCache - #These are not α and β for RK but for Shu-Osher - #see top of page 317 in - #Optimal Strong-Stability-Preserving Runge–Kutta Time Discretizations for - #Discontinuous Garlekin Methods, Kubatko, Yaeger, Ketcheson 2014 - α_10::T - α_20::T - α_21::T - α_30::T - α_32::T - β_10::T - β_21::T - β_30::T - β_32::T - #Shu-Osher is normally stated for autonomous systems, the times - #are calculated by hand for this scheme - c_1::T - c_2::T - - function KYK2014DGSSPRK_3S2_ConstantCache(T, T2) - α_10 = T(1.0) - α_20 = T(0.087353119859156) - α_21 = T(0.912646880140844) - α_30 = T(0.344956917166841) - α_32 = T(0.655043082833159) - β_10 = T(0.528005024856522) - β_21 = T(0.481882138633993) - β_30 = T(0.022826837460491) - β_32 = T(0.345866039233415) - c_1 = β_10 - c_2 = α_21 * β_10 + β_21 # ==0.96376427726 - new{T, T2}(α_10, α_20, α_21, α_30, α_32, β_10, β_21, β_30, β_32, c_1, c_2) - end -end - -function alg_cache(alg::KYK2014DGSSPRK_3S2, u, rate_prototype, ::Type{uEltypeNoUnits}, - ::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t, - dt, reltol, p, calck, - ::Val{true}) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits} - u_1 = zero(u) - u_2 = zero(u) - kk_1 = zero(rate_prototype) - kk_2 = zero(rate_prototype) - k = zero(rate_prototype) - fsalfirst = zero(rate_prototype) - tab = KYK2014DGSSPRK_3S2_ConstantCache(constvalue(uBottomEltypeNoUnits), - constvalue(tTypeNoUnits)) - KYK2014DGSSPRK_3S2_Cache(u, uprev, k, fsalfirst, tab, u_1, u_2, kk_1, kk_2, - alg.stage_limiter!, alg.step_limiter!, alg.thread) -end - -function alg_cache(alg::KYK2014DGSSPRK_3S2, u, rate_prototype, ::Type{uEltypeNoUnits}, - ::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t, - dt, reltol, p, calck, - ::Val{false}) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits} - KYK2014DGSSPRK_3S2_ConstantCache(constvalue(uBottomEltypeNoUnits), - constvalue(tTypeNoUnits)) -end - @cache struct RKO65Cache{uType, rateType, TabType, StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqMutableCache u::uType From 9e4257363f98138a0debf181a442ac29dd42f49e Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 09:34:40 +0530 Subject: [PATCH 15/54] SSPRK --- .../src/OrdinaryDiffEqLowStorageRK.jl | 22 ++++---- .../src/alg_utils.jl | 52 +------------------ src/alg_utils.jl | 46 ++++++++++++++++ src/algorithms/explicit_rk_pde.jl | 0 4 files changed, 60 insertions(+), 60 deletions(-) create mode 100644 src/algorithms/explicit_rk_pde.jl diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl index b2046be4e9..cf8bb9f88f 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl @@ -42,14 +42,16 @@ include("low_storage_rk_perform_step.jl") include("algorithms.jl") include("alg_utils.jl") -export ORK256, SSPRK53_2N1, SSPRK53_2N2, NDBLSRK124, CarpenterKennedy2N54, NDBLSRK134, NDBLSRK144, - CFRLDDRK64, TSLDDRK74, DGLDDRK73_C, DGLDDRK84_C, DGLDDRK84_F, SHLDDRK64, RK46NL, ParsaniKetchesonDeconinck3S32, - ParsaniKetchesonDeconinck3S82, ParsaniKetchesonDeconinck3S53, ParsaniKetchesonDeconinck3S173, ParsaniKetchesonDeconinck3S94, - ParsaniKetchesonDeconinck3S184, ParsaniKetchesonDeconinck3S105, ParsaniKetchesonDeconinck3S205, CKLLSRK43_2, - CKLLSRK54_3C, CKLLSRK95_4S, CKLLSRK95_4C, CKLLSRK95_4M, CKLLSRK54_3C_3R, CKLLSRK54_3M_3R, CKLLSRK54_3N_3R, - CKLLSRK85_4C_3R, CKLLSRK85_4M_3R, CKLLSRK85_4P_3R, CKLLSRK54_3N_4R, CKLLSRK54_3M_4R, CKLLSRK65_4M_4R, - CKLLSRK85_4FM_4R, CKLLSRK75_4M_5R, RDPK3Sp35, RDPK3SpFSAL35, RDPK3Sp49, RDPK3SpFSAL49, RDPK3Sp510, - RDPK3SpFSAL510, SSPRK104, SSPRK54, SSPRK932, SSPRKMSVS32, SSPRKMSVS43, SSPRK432, SSPRK43, SSPRK83, - SSPRK73, SSPRK63, SSPRK53_H, KYKSSPRK42, SSPRK53, SSPRK33, SSPRK22, KYK2014DGSSPRK_3S2, NDBLSRK134, - SLDDRK64, SHLDDRK_2N, SHLDDRK52 +export ORK256, CarpenterKennedy2N54, SHLDDRK64, HSLDDRK64, DGLDDRK73_C, DGLDDRK84_C, + DGLDDRK84_F, NDBLSRK124, NDBLSRK134, NDBLSRK144, + CFRLDDRK64, TSLDDRK74, SHLDDRK52, SHLDDRK_2N, CKLLSRK43_2, CKLLSRK54_3C, + CKLLSRK95_4S, CKLLSRK95_4C, CKLLSRK95_4M, + CKLLSRK54_3C_3R, CKLLSRK54_3M_3R, CKLLSRK54_3N_3R, CKLLSRK85_4C_3R, CKLLSRK85_4M_3R, CKLLSRK85_4P_3R, + CKLLSRK54_3N_4R, CKLLSRK54_3M_4R, CKLLSRK65_4M_4R, CKLLSRK85_4FM_4R, CKLLSRK75_4M_5R, + ParsaniKetchesonDeconinck3S32, ParsaniKetchesonDeconinck3S82, + ParsaniKetchesonDeconinck3S53, ParsaniKetchesonDeconinck3S173, + ParsaniKetchesonDeconinck3S94, ParsaniKetchesonDeconinck3S184, + ParsaniKetchesonDeconinck3S105, ParsaniKetchesonDeconinck3S205, + RDPK3Sp35, RDPK3SpFSAL35, RDPK3Sp49, RDPK3SpFSAL49, RDPK3Sp510, RDPK3SpFSAL510, + KYK2014DGSSPRK_3S2, RK46NL end diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl b/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl index caf5936976..8242bd523f 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl @@ -1,19 +1,16 @@ -using OrdinaryDiffEq: ORK256, SSPRK53_2N1, SSPRK53_2N2, NDBLSRK124, CarpenterKennedy2N54, NDBLSRK134, NDBLSRK144, +using OrdinaryDiffEq: ORK256, NDBLSRK124, CarpenterKennedy2N54, NDBLSRK134, NDBLSRK144, CFRLDDRK64, TSLDDRK74, DGLDDRK73_C, DGLDDRK84_C, DGLDDRK84_F, SHLDDRK64, RK46NL, ParsaniKetchesonDeconinck3S32, ParsaniKetchesonDeconinck3S82, ParsaniKetchesonDeconinck3S53, ParsaniKetchesonDeconinck3S173, ParsaniKetchesonDeconinck3S94, ParsaniKetchesonDeconinck3S184, ParsaniKetchesonDeconinck3S105, ParsaniKetchesonDeconinck3S205, CKLLSRK43_2, CKLLSRK54_3C, CKLLSRK95_4S, CKLLSRK95_4C, CKLLSRK95_4M, CKLLSRK54_3C_3R, CKLLSRK54_3M_3R, CKLLSRK54_3N_3R, CKLLSRK85_4C_3R, CKLLSRK85_4M_3R, CKLLSRK85_4P_3R, CKLLSRK54_3N_4R, CKLLSRK54_3M_4R, CKLLSRK65_4M_4R, CKLLSRK85_4FM_4R, CKLLSRK75_4M_5R, RDPK3Sp35, RDPK3SpFSAL35, RDPK3Sp49, RDPK3SpFSAL49, RDPK3Sp510, - RDPK3SpFSAL510, SSPRK104, SSPRK54, SSPRK932, SSPRKMSVS32, SSPRKMSVS43, SSPRK432, SSPRK43, SSPRK83, - SSPRK73, SSPRK63, SSPRK53_H, KYKSSPRK42, SSPRK53, SSPRK33, SSPRK22, KYK2014DGSSPRK_3S2, NDBLSRK134, + RDPK3SpFSAL510, KYKSSPRK42, KYK2014DGSSPRK_3S2, NDBLSRK134, SLDDRK64, SHLDDRK_2N, SHLDDRK52 alg_order(alg::KYK2014DGSSPRK_3S2) = 2 alg_order(alg::ORK256) = 2 alg_order(alg::CarpenterKennedy2N54) = 4 -alg_order(alg::SSPRK53_2N1) = 3 -alg_order(alg::SSPRK53_2N2) = 3 alg_order(alg::NDBLSRK124) = 4 alg_order(alg::NDBLSRK134) = 4 alg_order(alg::NDBLSRK144) = 4 @@ -55,28 +52,12 @@ alg_order(alg::CKLLSRK75_4M_5R) = 5 alg_order(alg::CKLLSRK54_3M_4R) = 4 alg_order(alg::CKLLSRK65_4M_4R) = 5 -alg_order(alg::SSPRK22) = 2 -alg_order(alg::SSPRKMSVS32) = 2 -alg_order(alg::SSPRK33) = 3 alg_order(alg::KYKSSPRK42) = 2 -alg_order(alg::SSPRK53) = 3 -alg_order(alg::SSPRK53_H) = 3 -alg_order(alg::SSPRK63) = 3 -alg_order(alg::SSPRK73) = 3 -alg_order(alg::SSPRK83) = 3 -alg_order(alg::SSPRK43) = 3 -alg_order(alg::SSPRK432) = 3 -alg_order(alg::SSPRKMSVS43) = 3 -alg_order(alg::SSPRK932) = 3 -alg_order(alg::SSPRK54) = 4 -alg_order(alg::SSPRK104) = 4 alg_order(alg::SHLDDRK52) = 2 alg_order(alg::SHLDDRK_2N) = 4 isfsal(alg::ORK256) = false isfsal(alg::CarpenterKennedy2N54) = false -isfsal(alg::SSPRK53_2N1) = false -isfsal(alg::SSPRK53_2N2) = false isfsal(alg::DGLDDRK84_F) = false isfsal(alg::DGLDDRK73_C) = false isfsal(alg::DGLDDRK84_C) = false @@ -88,19 +69,6 @@ isfsal(alg::NDBLSRK134) = false isfsal(alg::NDBLSRK124) = false isfsal(alg::NDBLSRK144) = false -isfsal(alg::SSPRK22) = false -isfsal(alg::SSPRK33) = false -isfsal(alg::SSPRK53) = false -isfsal(alg::SSPRK53_H) = false -isfsal(alg::SSPRK63) = false -isfsal(alg::SSPRK73) = false -isfsal(alg::SSPRK83) = false -isfsal(alg::SSPRK43) = false -isfsal(alg::SSPRK432) = false -isfsal(alg::SSPRK932) = false -isfsal(alg::SSPRK54) = false -isfsal(alg::SSPRK104) = false - uses_uprev(alg::ORK256, adaptive::Bool) = false uses_uprev(alg::SHLDDRK64, adaptive::Bool) = false uses_uprev(alg::CarpenterKennedy2N54, adaptive::Bool) = false @@ -144,24 +112,8 @@ julia> ssp_coefficient(SSPRK104()) ``` """ -ssp_coefficient(alg::SSPRK53_2N1) = 2.18 -ssp_coefficient(alg::SSPRK53_2N2) = 2.148 -ssp_coefficient(alg::SSPRK53) = 2.65 -ssp_coefficient(alg::SSPRK53_H) = 2.65 -ssp_coefficient(alg::SSPRK63) = 3.518 -ssp_coefficient(alg::SSPRK73) = 4.2879 -ssp_coefficient(alg::SSPRK83) = 5.107 -ssp_coefficient(alg::SSPRK43) = 2 -ssp_coefficient(alg::SSPRK432) = 2 -ssp_coefficient(alg::SSPRKMSVS32) = 0.5 ssp_coefficient(alg::KYKSSPRK42) = 2.459 -ssp_coefficient(alg::SSPRKMSVS43) = 0.33 -ssp_coefficient(alg::SSPRK932) = 6 -ssp_coefficient(alg::SSPRK54) = 1.508 -ssp_coefficient(alg::SSPRK104) = 6 ssp_coefficient(alg::KYK2014DGSSPRK_3S2) = 0.8417 -ssp_coefficient(alg::SSPRK33) = 1 -ssp_coefficient(alg::SSPRK22) = 1 function default_controller(alg::RDPK3Sp35, cache, qoldinit, args...) QT = typeof(qoldinit) diff --git a/src/alg_utils.jl b/src/alg_utils.jl index 6c419b0a35..171e558d55 100644 --- a/src/alg_utils.jl +++ b/src/alg_utils.jl @@ -33,6 +33,20 @@ isfsal(alg::FunctionMap) = false isfsal(alg::Rodas3P) = false isfsal(alg::Rodas23W) = false isfsal(alg::Rodas5) = false +isfsal(alg::SSPRK53_2N1) = false +isfsal(alg::SSPRK53_2N2) = false +isfsal(alg::SSPRK22) = false +isfsal(alg::SSPRK33) = false +isfsal(alg::SSPRK53) = false +isfsal(alg::SSPRK53_H) = false +isfsal(alg::SSPRK63) = false +isfsal(alg::SSPRK73) = false +isfsal(alg::SSPRK83) = false +isfsal(alg::SSPRK43) = false +isfsal(alg::SSPRK432) = false +isfsal(alg::SSPRK932) = false +isfsal(alg::SSPRK54) = false +isfsal(alg::SSPRK104) = false isfsal(alg::Rodas5P) = false isfsal(alg::Rodas5Pr) = false isfsal(alg::Rodas5Pe) = false @@ -397,6 +411,8 @@ alg_order(alg::Ralston) = 2 alg_order(alg::LawsonEuler) = 1 alg_order(alg::NorsettEuler) = 1 alg_order(alg::LieEuler) = 1 +alg_order(alg::SSPRKMSVS32) = 2 +alg_order(alg::SSPRK33) = 3 alg_order(alg::CayleyEuler) = 2 alg_order(alg::ETDRK2) = 2 alg_order(alg::ETDRK3) = 3 @@ -529,6 +545,20 @@ alg_order(alg::SFSDIRK8) = 4 alg_order(alg::Hairer4) = 4 alg_order(alg::Hairer42) = 4 alg_order(alg::Feagin10) = 10 +alg_order(alg::SSPRK53_2N1) = 3 +alg_order(alg::SSPRK53_2N2) = 3 +alg_order(alg::SSPRK22) = 2 +alg_order(alg::SSPRK53) = 3 +alg_order(alg::SSPRK53_H) = 3 +alg_order(alg::SSPRK63) = 3 +alg_order(alg::SSPRK73) = 3 +alg_order(alg::SSPRK83) = 3 +alg_order(alg::SSPRK43) = 3 +alg_order(alg::SSPRK432) = 3 +alg_order(alg::SSPRKMSVS43) = 3 +alg_order(alg::SSPRK932) = 3 +alg_order(alg::SSPRK54) = 4 +alg_order(alg::SSPRK104) = 4 alg_order(alg::Feagin12) = 12 alg_order(alg::Feagin14) = 14 alg_order(alg::PFRK87) = 8 @@ -710,6 +740,22 @@ end # SSP coefficients ssp_coefficient(alg) = error("$alg is not a strong stability preserving method.") ssp_coefficient(alg::Euler) = 1 +ssp_coefficient(alg::SSPRK53_2N1) = 2.18 +ssp_coefficient(alg::SSPRK53_2N2) = 2.148 +ssp_coefficient(alg::SSPRK53) = 2.65 +ssp_coefficient(alg::SSPRK53_H) = 2.65 +ssp_coefficient(alg::SSPRK63) = 3.518 +ssp_coefficient(alg::SSPRK73) = 4.2879 +ssp_coefficient(alg::SSPRK83) = 5.107 +ssp_coefficient(alg::SSPRK43) = 2 +ssp_coefficient(alg::SSPRK432) = 2 +ssp_coefficient(alg::SSPRK932) = 6 +ssp_coefficient(alg::SSPRK54) = 1.508 +ssp_coefficient(alg::SSPRK104) = 6 +ssp_coefficient(alg::SSPRK33) = 1 +ssp_coefficient(alg::SSPRK22) = 1 +ssp_coefficient(alg::SSPRKMSVS32) = 0.5 +ssp_coefficient(alg::SSPRKMSVS43) = 0.33 # We shouldn't do this probably. #ssp_coefficient(alg::ImplicitEuler) = Inf diff --git a/src/algorithms/explicit_rk_pde.jl b/src/algorithms/explicit_rk_pde.jl new file mode 100644 index 0000000000..e69de29bb2 From a656bbeb025192d2b227bb1635e8ec8956d6893c Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 09:42:53 +0530 Subject: [PATCH 16/54] SSPRK fixes --- .../src/algorithms.jl | 322 ------------------ src/algorithms/explicit_rk_pde.jl | 321 +++++++++++++++++ 2 files changed, 321 insertions(+), 322 deletions(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl b/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl index 8748d26396..ed343a1477 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl @@ -22,44 +22,6 @@ function ORK256(stage_limiter!, ORK256(stage_limiter!, step_limiter!, False(), williamson_condition) end -@doc explicit_rk_docstring( - "A third-order, five-stage explicit strong stability preserving (SSP) low-storage method. -Fixed timestep only.", - "SSPRK53_2N1", - references = "Higueras and T. Roldán. - New third order low-storage SSP explicit Runge–Kutta methods - arXiv:1809.04807v1.") -Base.@kwdef struct SSPRK53_2N1{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function SSPRK53_2N1(stage_limiter!, step_limiter! = trivial_limiter!) - SSPRK53_2N1(stage_limiter!, - step_limiter!, - False()) -end - -@doc explicit_rk_docstring( - "A third-order, five-stage explicit strong stability preserving (SSP) low-storage method. -Fixed timestep only.", - "SSPRK53_2N2", - references = "Higueras and T. Roldán. - New third order low-storage SSP explicit Runge–Kutta methods - arXiv:1809.04807v1.") -Base.@kwdef struct SSPRK53_2N2{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function SSPRK53_2N2(stage_limiter!, step_limiter! = trivial_limiter!) - SSPRK53_2N2(stage_limiter!, - step_limiter!, - False()) -end - @doc explicit_rk_docstring( "A fourth-order, five-stage explicit low-storage method of Carpenter and Kennedy (free 3rd order Hermite interpolant). Fixed timestep only. Designed for @@ -940,62 +902,6 @@ function KYK2014DGSSPRK_3S2(stage_limiter!, step_limiter! = trivial_limiter!) False()) end -@doc explicit_rk_docstring( - "A second-order, two-stage explicit strong stability preserving (SSP) method. -Fixed timestep only.", - "SSPRK22", - references = "Shu, Chi-Wang, and Stanley Osher. - Efficient implementation of essentially non-oscillatory shock-capturing schemes. - Journal of Computational Physics 77.2 (1988): 439-471. - https://doi.org/10.1016/0021-9991(88)90177-5") -Base.@kwdef struct SSPRK22{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function SSPRK22(stage_limiter!, step_limiter! = trivial_limiter!) - SSPRK22(stage_limiter!, - step_limiter!, False()) -end - -@doc explicit_rk_docstring( - "A third-order, three-stage explicit strong stability preserving (SSP) method. -Fixed timestep only.", - "SSPRK33", - references = "Shu, Chi-Wang, and Stanley Osher. - Efficient implementation of essentially non-oscillatory shock-capturing schemes. - Journal of Computational Physics 77.2 (1988): 439-471. - https://doi.org/10.1016/0021-9991(88)90177-5") -Base.@kwdef struct SSPRK33{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function SSPRK33(stage_limiter!, step_limiter! = trivial_limiter!) - SSPRK33(stage_limiter!, - step_limiter!, False()) -end - -@doc explicit_rk_docstring( - "A third-order, five-stage explicit strong stability preserving (SSP) method. -Fixed timestep only.", - "SSPRK53", - references = "Ruuth, Steven. - Global optimization of explicit strong-stability-preserving Runge-Kutta methods. - Mathematics of Computation 75.253 (2006): 183-207") -Base.@kwdef struct SSPRK53{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function SSPRK53(stage_limiter!, step_limiter! = trivial_limiter!) - SSPRK53(stage_limiter!, - step_limiter!, False()) -end - @doc explicit_rk_docstring("TBD", "KYKSSPRK42") Base.@kwdef struct KYKSSPRK42{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm @@ -1008,232 +914,4 @@ function KYKSSPRK42(stage_limiter!, step_limiter! = trivial_limiter!) KYKSSPRK42(stage_limiter!, step_limiter!, False()) -end - -@doc explicit_rk_docstring( - "A third-order, five-stage explicit strong stability preserving (SSP) low-storage method. -Fixed timestep only.", - "SSPRK53_H", - references = "Higueras and T. Roldán. - New third order low-storage SSP explicit Runge–Kutta methods - arXiv:1809.04807v1.") -Base.@kwdef struct SSPRK53_H{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function SSPRK53_H(stage_limiter!, step_limiter! = trivial_limiter!) - SSPRK53_H(stage_limiter!, - step_limiter!, False()) -end - -@doc explicit_rk_docstring( - "A third-order, six-stage explicit strong stability preserving (SSP) method. -Fixed timestep only.", - "SSPRK63", - references = "Ruuth, Steven. - Global optimization of explicit strong-stability-preserving Runge-Kutta methods. - Mathematics of Computation 75.253 (2006): 183-207") -Base.@kwdef struct SSPRK63{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function SSPRK63(stage_limiter!, step_limiter! = trivial_limiter!) - SSPRK63(stage_limiter!, - step_limiter!, False()) -end - -@doc explicit_rk_docstring( - "A third-order, seven-stage explicit strong stability preserving (SSP) method. -Fixed timestep only.", - "SSPRK73", - references = "Ruuth, Steven. - Global optimization of explicit strong-stability-preserving Runge-Kutta methods. - Mathematics of Computation 75.253 (2006): 183-207") -Base.@kwdef struct SSPRK73{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function SSPRK73(stage_limiter!, step_limiter! = trivial_limiter!) - SSPRK73(stage_limiter!, - step_limiter!, False()) -end - -@doc explicit_rk_docstring( - "A third-order, eight-stage explicit strong stability preserving (SSP) method. -Fixed timestep only.", - "SSPRK83", - references = "Ruuth, Steven. - Global optimization of explicit strong-stability-preserving Runge-Kutta methods. - Mathematics of Computation 75.253 (2006): 183-207") -Base.@kwdef struct SSPRK83{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function SSPRK83(stage_limiter!, step_limiter! = trivial_limiter!) - SSPRK83(stage_limiter!, - step_limiter!, False()) -end - -@doc explicit_rk_docstring( - "A third-order, four-stage explicit strong stability preserving (SSP) method.", - "SSPRK43", - references = """Optimal third-order explicit SSP method with four stages discovered by - - - J. F. B. M. Kraaijevanger. - "Contractivity of Runge-Kutta methods." - In: BIT Numerical Mathematics 31.3 (1991), pp. 482–528. - [DOI: 10.1007/BF01933264](https://doi.org/10.1007/BF01933264). - - Embedded method constructed by - - - Sidafa Conde, Imre Fekete, John N. Shadid. - "Embedded error estimation and adaptive step-size control for - optimal explicit strong stability preserving Runge–Kutta methods." - [arXiv: 1806.08693](https://arXiv.org/abs/1806.08693) - - Efficient implementation (and optimized controller) developed by - - - Hendrik Ranocha, Lisandro Dalcin, Matteo Parsani, David I. Ketcheson (2021) - Optimized Runge-Kutta Methods with Automatic Step Size Control for - Compressible Computational Fluid Dynamics - [arXiv:2104.06836](https://arxiv.org/abs/2104.06836)""") -Base.@kwdef struct SSPRK43{StageLimiter, StepLimiter, Thread} <: - OrdinaryDiffEqAdaptiveAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function SSPRK43(stage_limiter!, step_limiter! = trivial_limiter!) - SSPRK43(stage_limiter!, - step_limiter!, False()) -end - -@doc explicit_rk_docstring( - "A third-order, four-stage explicit strong stability preserving (SSP) method.", - "SSPRK432", - references = "Gottlieb, Sigal, David I. Ketcheson, and Chi-Wang Shu. - Strong stability preserving Runge-Kutta and multistep time discretizations. - World Scientific, 2011. - Example 6.1") -Base.@kwdef struct SSPRK432{StageLimiter, StepLimiter, Thread} <: - OrdinaryDiffEqAdaptiveAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function SSPRK432(stage_limiter!, step_limiter! = trivial_limiter!) - SSPRK432(stage_limiter!, - step_limiter!, False()) -end - -@doc explicit_rk_docstring( - "A third-order, four-step explicit strong stability preserving (SSP) linear multistep method. -This method does not come with an error estimator and requires a fixed time step -size.", - "SSPRKMSVS43", - references = "Shu, Chi-Wang. - Total-variation-diminishing time discretizations. - SIAM Journal on Scientific and Statistical Computing 9, no. 6 (1988): 1073-1084. - [DOI: 10.1137/0909073](https://doi.org/10.1137/0909073)") -Base.@kwdef struct SSPRKMSVS43{StageLimiter, StepLimiter, Thread} <: - OrdinaryDiffEqAdaptiveAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function SSPRKMSVS43(stage_limiter!, step_limiter! = trivial_limiter!) - SSPRKMSVS43(stage_limiter!, - step_limiter!, - False()) -end - -@doc explicit_rk_docstring( - "A second-order, three-step explicit strong stability preserving (SSP) linear multistep method. -This method does not come with an error estimator and requires a fixed time step -size.", - "SSPRKMSVS32", - references = "Shu, Chi-Wang. - Total-variation-diminishing time discretizations. - SIAM Journal on Scientific and Statistical Computing 9, no. 6 (1988): 1073-1084. - [DOI: 10.1137/0909073](https://doi.org/10.1137/0909073)") -Base.@kwdef struct SSPRKMSVS32{StageLimiter, StepLimiter, Thread} <: - OrdinaryDiffEqAdaptiveAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function SSPRKMSVS32(stage_limiter!, step_limiter! = trivial_limiter!) - SSPRKMSVS32(stage_limiter!, - step_limiter!, - False()) -end - -@doc explicit_rk_docstring( - "A third-order, nine-stage explicit strong stability preserving (SSP) method. - -Consider using `SSPRK43` instead, which uses the same main method and an -improved embedded method.", - "SSPRK932", - references = "Gottlieb, Sigal, David I. Ketcheson, and Chi-Wang Shu. - Strong stability preserving Runge-Kutta and multistep time discretizations. - World Scientific, 2011.") -Base.@kwdef struct SSPRK932{StageLimiter, StepLimiter, Thread} <: - OrdinaryDiffEqAdaptiveAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function SSPRK932(stage_limiter!, step_limiter! = trivial_limiter!) - SSPRK932(stage_limiter!, - step_limiter!, False()) -end - -@doc explicit_rk_docstring( - "A fourth-order, five-stage explicit strong stability preserving (SSP) method. -Fixed timestep only.", - "SSPRK54", - references = "Ruuth, Steven. - Global optimization of explicit strong-stability-preserving Runge-Kutta methods. - Mathematics of Computation 75.253 (2006): 183-207.") -Base.@kwdef struct SSPRK54{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function SSPRK54(stage_limiter!, step_limiter! = trivial_limiter!) - SSPRK54(stage_limiter!, - step_limiter!, False()) -end - -@doc explicit_rk_docstring( - "A fourth-order, ten-stage explicit strong stability preserving (SSP) method. -Fixed timestep only.", - "SSPRK104", - references = "Ketcheson, David I. - Highly efficient strong stability-preserving Runge–Kutta methods with - low-storage implementations. - SIAM Journal on Scientific Computing 30.4 (2008): 2113-2136.") -Base.@kwdef struct SSPRK104{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function SSPRK104(stage_limiter!, step_limiter! = trivial_limiter!) - SSPRK104(stage_limiter!, - step_limiter!, False()) end \ No newline at end of file diff --git a/src/algorithms/explicit_rk_pde.jl b/src/algorithms/explicit_rk_pde.jl index e69de29bb2..b221499320 100644 --- a/src/algorithms/explicit_rk_pde.jl +++ b/src/algorithms/explicit_rk_pde.jl @@ -0,0 +1,321 @@ +@doc explicit_rk_docstring( + "A third-order, five-stage explicit strong stability preserving (SSP) low-storage method. +Fixed timestep only.", + "SSPRK53_2N2", + references = "Higueras and T. Roldán. + New third order low-storage SSP explicit Runge–Kutta methods + arXiv:1809.04807v1.") +Base.@kwdef struct SSPRK53_2N2{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SSPRK53_2N2(stage_limiter!, step_limiter! = trivial_limiter!) + SSPRK53_2N2(stage_limiter!, + step_limiter!, + False()) +end + +@doc explicit_rk_docstring( + "A second-order, two-stage explicit strong stability preserving (SSP) method. +Fixed timestep only.", + "SSPRK22", + references = "Shu, Chi-Wang, and Stanley Osher. + Efficient implementation of essentially non-oscillatory shock-capturing schemes. + Journal of Computational Physics 77.2 (1988): 439-471. + https://doi.org/10.1016/0021-9991(88)90177-5") +Base.@kwdef struct SSPRK22{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SSPRK22(stage_limiter!, step_limiter! = trivial_limiter!) + SSPRK22(stage_limiter!, + step_limiter!, False()) +end + +@doc explicit_rk_docstring( + "A third-order, five-stage explicit strong stability preserving (SSP) method. +Fixed timestep only.", + "SSPRK53", + references = "Ruuth, Steven. + Global optimization of explicit strong-stability-preserving Runge-Kutta methods. + Mathematics of Computation 75.253 (2006): 183-207") +Base.@kwdef struct SSPRK53{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SSPRK53(stage_limiter!, step_limiter! = trivial_limiter!) + SSPRK53(stage_limiter!, + step_limiter!, False()) +end + +@doc explicit_rk_docstring( + "A third-order, six-stage explicit strong stability preserving (SSP) method. +Fixed timestep only.", + "SSPRK63", + references = "Ruuth, Steven. + Global optimization of explicit strong-stability-preserving Runge-Kutta methods. + Mathematics of Computation 75.253 (2006): 183-207") +Base.@kwdef struct SSPRK63{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SSPRK63(stage_limiter!, step_limiter! = trivial_limiter!) + SSPRK63(stage_limiter!, + step_limiter!, False()) +end + +@doc explicit_rk_docstring( + "A third-order, eight-stage explicit strong stability preserving (SSP) method. +Fixed timestep only.", + "SSPRK83", + references = "Ruuth, Steven. + Global optimization of explicit strong-stability-preserving Runge-Kutta methods. + Mathematics of Computation 75.253 (2006): 183-207") +Base.@kwdef struct SSPRK83{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SSPRK83(stage_limiter!, step_limiter! = trivial_limiter!) + SSPRK83(stage_limiter!, + step_limiter!, False()) +end + +@doc explicit_rk_docstring( + "A third-order, four-stage explicit strong stability preserving (SSP) method.", + "SSPRK43", + references = """Optimal third-order explicit SSP method with four stages discovered by + + - J. F. B. M. Kraaijevanger. + "Contractivity of Runge-Kutta methods." + In: BIT Numerical Mathematics 31.3 (1991), pp. 482–528. + [DOI: 10.1007/BF01933264](https://doi.org/10.1007/BF01933264). + + Embedded method constructed by + + - Sidafa Conde, Imre Fekete, John N. Shadid. + "Embedded error estimation and adaptive step-size control for + optimal explicit strong stability preserving Runge–Kutta methods." + [arXiv: 1806.08693](https://arXiv.org/abs/1806.08693) + + Efficient implementation (and optimized controller) developed by + + - Hendrik Ranocha, Lisandro Dalcin, Matteo Parsani, David I. Ketcheson (2021) + Optimized Runge-Kutta Methods with Automatic Step Size Control for + Compressible Computational Fluid Dynamics + [arXiv:2104.06836](https://arxiv.org/abs/2104.06836)""") +Base.@kwdef struct SSPRK43{StageLimiter, StepLimiter, Thread} <: + OrdinaryDiffEqAdaptiveAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SSPRK43(stage_limiter!, step_limiter! = trivial_limiter!) + SSPRK43(stage_limiter!, + step_limiter!, False()) +end + +@doc explicit_rk_docstring( + "A third-order, four-stage explicit strong stability preserving (SSP) method.", + "SSPRK432", + references = "Gottlieb, Sigal, David I. Ketcheson, and Chi-Wang Shu. + Strong stability preserving Runge-Kutta and multistep time discretizations. + World Scientific, 2011. + Example 6.1") +Base.@kwdef struct SSPRK432{StageLimiter, StepLimiter, Thread} <: + OrdinaryDiffEqAdaptiveAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SSPRK432(stage_limiter!, step_limiter! = trivial_limiter!) + SSPRK432(stage_limiter!, + step_limiter!, False()) +end + +@doc explicit_rk_docstring( + "A second-order, three-step explicit strong stability preserving (SSP) linear multistep method. +This method does not come with an error estimator and requires a fixed time step +size.", + "SSPRKMSVS32", + references = "Shu, Chi-Wang. + Total-variation-diminishing time discretizations. + SIAM Journal on Scientific and Statistical Computing 9, no. 6 (1988): 1073-1084. + [DOI: 10.1137/0909073](https://doi.org/10.1137/0909073)") +Base.@kwdef struct SSPRKMSVS32{StageLimiter, StepLimiter, Thread} <: + OrdinaryDiffEqAdaptiveAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SSPRKMSVS32(stage_limiter!, step_limiter! = trivial_limiter!) + SSPRKMSVS32(stage_limiter!, + step_limiter!, + False()) +end + +@doc explicit_rk_docstring( + "A fourth-order, five-stage explicit strong stability preserving (SSP) method. +Fixed timestep only.", + "SSPRK54", + references = "Ruuth, Steven. + Global optimization of explicit strong-stability-preserving Runge-Kutta methods. + Mathematics of Computation 75.253 (2006): 183-207.") +Base.@kwdef struct SSPRK54{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SSPRK54(stage_limiter!, step_limiter! = trivial_limiter!) + SSPRK54(stage_limiter!, + step_limiter!, False()) +end + +@doc explicit_rk_docstring( + "A third-order, five-stage explicit strong stability preserving (SSP) low-storage method. +Fixed timestep only.", + "SSPRK53_2N1", + references = "Higueras and T. Roldán. + New third order low-storage SSP explicit Runge–Kutta methods + arXiv:1809.04807v1.") +Base.@kwdef struct SSPRK53_2N1{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SSPRK53_2N1(stage_limiter!, step_limiter! = trivial_limiter!) + SSPRK53_2N1(stage_limiter!, + step_limiter!, + False()) +end + +@doc explicit_rk_docstring( + "A fourth-order, ten-stage explicit strong stability preserving (SSP) method. +Fixed timestep only.", + "SSPRK104", + references = "Ketcheson, David I. + Highly efficient strong stability-preserving Runge–Kutta methods with + low-storage implementations. + SIAM Journal on Scientific Computing 30.4 (2008): 2113-2136.") +Base.@kwdef struct SSPRK104{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SSPRK104(stage_limiter!, step_limiter! = trivial_limiter!) + SSPRK104(stage_limiter!, + step_limiter!, False()) +end + +@doc explicit_rk_docstring( + "A third-order, nine-stage explicit strong stability preserving (SSP) method. + +Consider using `SSPRK43` instead, which uses the same main method and an +improved embedded method.", + "SSPRK932", + references = "Gottlieb, Sigal, David I. Ketcheson, and Chi-Wang Shu. + Strong stability preserving Runge-Kutta and multistep time discretizations. + World Scientific, 2011.") +Base.@kwdef struct SSPRK932{StageLimiter, StepLimiter, Thread} <: + OrdinaryDiffEqAdaptiveAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SSPRK932(stage_limiter!, step_limiter! = trivial_limiter!) + SSPRK932(stage_limiter!, + step_limiter!, False()) +end + +@doc explicit_rk_docstring( + "A third-order, four-step explicit strong stability preserving (SSP) linear multistep method. +This method does not come with an error estimator and requires a fixed time step +size.", + "SSPRKMSVS43", + references = "Shu, Chi-Wang. + Total-variation-diminishing time discretizations. + SIAM Journal on Scientific and Statistical Computing 9, no. 6 (1988): 1073-1084. + [DOI: 10.1137/0909073](https://doi.org/10.1137/0909073)") +Base.@kwdef struct SSPRKMSVS43{StageLimiter, StepLimiter, Thread} <: + OrdinaryDiffEqAdaptiveAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SSPRKMSVS43(stage_limiter!, step_limiter! = trivial_limiter!) + SSPRKMSVS43(stage_limiter!, + step_limiter!, + False()) +end + +@doc explicit_rk_docstring( + "A third-order, seven-stage explicit strong stability preserving (SSP) method. +Fixed timestep only.", + "SSPRK73", + references = "Ruuth, Steven. + Global optimization of explicit strong-stability-preserving Runge-Kutta methods. + Mathematics of Computation 75.253 (2006): 183-207") +Base.@kwdef struct SSPRK73{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SSPRK73(stage_limiter!, step_limiter! = trivial_limiter!) + SSPRK73(stage_limiter!, + step_limiter!, False()) +end + +@doc explicit_rk_docstring( + "A third-order, five-stage explicit strong stability preserving (SSP) low-storage method. +Fixed timestep only.", + "SSPRK53_H", + references = "Higueras and T. Roldán. + New third order low-storage SSP explicit Runge–Kutta methods + arXiv:1809.04807v1.") +Base.@kwdef struct SSPRK53_H{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SSPRK53_H(stage_limiter!, step_limiter! = trivial_limiter!) + SSPRK53_H(stage_limiter!, + step_limiter!, False()) +end + +@doc explicit_rk_docstring( + "A third-order, three-stage explicit strong stability preserving (SSP) method. +Fixed timestep only.", + "SSPRK33", + references = "Shu, Chi-Wang, and Stanley Osher. + Efficient implementation of essentially non-oscillatory shock-capturing schemes. + Journal of Computational Physics 77.2 (1988): 439-471. + https://doi.org/10.1016/0021-9991(88)90177-5") +Base.@kwdef struct SSPRK33{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SSPRK33(stage_limiter!, step_limiter! = trivial_limiter!) + SSPRK33(stage_limiter!, + step_limiter!, False()) +end \ No newline at end of file From 1037febd8b93f84774f74b9d9f274d20b8287dec Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 10:35:15 +0530 Subject: [PATCH 17/54] SSPRK53_2N1 --- src/OrdinaryDiffEq.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/OrdinaryDiffEq.jl b/src/OrdinaryDiffEq.jl index 0f5e37f295..05fe6b8a93 100644 --- a/src/OrdinaryDiffEq.jl +++ b/src/OrdinaryDiffEq.jl @@ -133,6 +133,7 @@ include("misc_utils.jl") include("algorithms.jl") include("algorithms/explicit_rk.jl") +include("algorithms/explicit_rk_pde.jl") include("alg_utils.jl") From 85f1766ba77513103bba30bcc77bd1a567f6f1a5 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 10:40:07 +0530 Subject: [PATCH 18/54] KYKSSPRK42 fixes --- lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl | 4 +--- lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl | 14 -------------- src/alg_utils.jl | 2 ++ src/algorithms/explicit_rk_pde.jl | 14 ++++++++++++++ 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl b/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl index 8242bd523f..cca58e3c87 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl @@ -5,7 +5,7 @@ using OrdinaryDiffEq: ORK256, NDBLSRK124, CarpenterKennedy2N54, NDBLSRK134, NDBL CKLLSRK54_3C, CKLLSRK95_4S, CKLLSRK95_4C, CKLLSRK95_4M, CKLLSRK54_3C_3R, CKLLSRK54_3M_3R, CKLLSRK54_3N_3R, CKLLSRK85_4C_3R, CKLLSRK85_4M_3R, CKLLSRK85_4P_3R, CKLLSRK54_3N_4R, CKLLSRK54_3M_4R, CKLLSRK65_4M_4R, CKLLSRK85_4FM_4R, CKLLSRK75_4M_5R, RDPK3Sp35, RDPK3SpFSAL35, RDPK3Sp49, RDPK3SpFSAL49, RDPK3Sp510, - RDPK3SpFSAL510, KYKSSPRK42, KYK2014DGSSPRK_3S2, NDBLSRK134, + RDPK3SpFSAL510, KYK2014DGSSPRK_3S2, NDBLSRK134, SLDDRK64, SHLDDRK_2N, SHLDDRK52 alg_order(alg::KYK2014DGSSPRK_3S2) = 2 @@ -52,7 +52,6 @@ alg_order(alg::CKLLSRK75_4M_5R) = 5 alg_order(alg::CKLLSRK54_3M_4R) = 4 alg_order(alg::CKLLSRK65_4M_4R) = 5 -alg_order(alg::KYKSSPRK42) = 2 alg_order(alg::SHLDDRK52) = 2 alg_order(alg::SHLDDRK_2N) = 4 @@ -112,7 +111,6 @@ julia> ssp_coefficient(SSPRK104()) ``` """ -ssp_coefficient(alg::KYKSSPRK42) = 2.459 ssp_coefficient(alg::KYK2014DGSSPRK_3S2) = 0.8417 function default_controller(alg::RDPK3Sp35, cache, qoldinit, args...) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl b/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl index ed343a1477..306e67fb85 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl @@ -900,18 +900,4 @@ function KYK2014DGSSPRK_3S2(stage_limiter!, step_limiter! = trivial_limiter!) KYK2014DGSSPRK_3S2(stage_limiter!, step_limiter!, False()) -end - -@doc explicit_rk_docstring("TBD", - "KYKSSPRK42") -Base.@kwdef struct KYKSSPRK42{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function KYKSSPRK42(stage_limiter!, step_limiter! = trivial_limiter!) - KYKSSPRK42(stage_limiter!, - step_limiter!, - False()) end \ No newline at end of file diff --git a/src/alg_utils.jl b/src/alg_utils.jl index 171e558d55..1cd5aa02d4 100644 --- a/src/alg_utils.jl +++ b/src/alg_utils.jl @@ -411,6 +411,7 @@ alg_order(alg::Ralston) = 2 alg_order(alg::LawsonEuler) = 1 alg_order(alg::NorsettEuler) = 1 alg_order(alg::LieEuler) = 1 +alg_order(alg::KYKSSPRK42) = 2 alg_order(alg::SSPRKMSVS32) = 2 alg_order(alg::SSPRK33) = 3 alg_order(alg::CayleyEuler) = 2 @@ -756,6 +757,7 @@ ssp_coefficient(alg::SSPRK33) = 1 ssp_coefficient(alg::SSPRK22) = 1 ssp_coefficient(alg::SSPRKMSVS32) = 0.5 ssp_coefficient(alg::SSPRKMSVS43) = 0.33 +ssp_coefficient(alg::KYKSSPRK42) = 2.459 # We shouldn't do this probably. #ssp_coefficient(alg::ImplicitEuler) = Inf diff --git a/src/algorithms/explicit_rk_pde.jl b/src/algorithms/explicit_rk_pde.jl index b221499320..821e630af0 100644 --- a/src/algorithms/explicit_rk_pde.jl +++ b/src/algorithms/explicit_rk_pde.jl @@ -318,4 +318,18 @@ end function SSPRK33(stage_limiter!, step_limiter! = trivial_limiter!) SSPRK33(stage_limiter!, step_limiter!, False()) +end + +@doc explicit_rk_docstring("TBD", + "KYKSSPRK42") +Base.@kwdef struct KYKSSPRK42{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function KYKSSPRK42(stage_limiter!, step_limiter! = trivial_limiter!) + KYKSSPRK42(stage_limiter!, + step_limiter!, + False()) end \ No newline at end of file From 9e6a75fabebc37a13fb03ae98ddbe14adeeccdf9 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 10:47:11 +0530 Subject: [PATCH 19/54] SHLDDRK_2N --- .../src/OrdinaryDiffEqLowStorageRK.jl | 2 +- .../src/alg_utils.jl | 3 +-- .../src/algorithms.jl | 26 ------------------- src/OrdinaryDiffEq.jl | 4 ++- src/alg_utils.jl | 1 + src/algorithms/explicit_rk_pde.jl | 26 +++++++++++++++++++ 6 files changed, 32 insertions(+), 30 deletions(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl index cf8bb9f88f..3fa96a563d 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl @@ -44,7 +44,7 @@ include("alg_utils.jl") export ORK256, CarpenterKennedy2N54, SHLDDRK64, HSLDDRK64, DGLDDRK73_C, DGLDDRK84_C, DGLDDRK84_F, NDBLSRK124, NDBLSRK134, NDBLSRK144, - CFRLDDRK64, TSLDDRK74, SHLDDRK52, SHLDDRK_2N, CKLLSRK43_2, CKLLSRK54_3C, + CFRLDDRK64, TSLDDRK74, CKLLSRK43_2, CKLLSRK54_3C, CKLLSRK95_4S, CKLLSRK95_4C, CKLLSRK95_4M, CKLLSRK54_3C_3R, CKLLSRK54_3M_3R, CKLLSRK54_3N_3R, CKLLSRK85_4C_3R, CKLLSRK85_4M_3R, CKLLSRK85_4P_3R, CKLLSRK54_3N_4R, CKLLSRK54_3M_4R, CKLLSRK65_4M_4R, CKLLSRK85_4FM_4R, CKLLSRK75_4M_5R, diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl b/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl index cca58e3c87..6d5a91b5e4 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl @@ -6,7 +6,7 @@ using OrdinaryDiffEq: ORK256, NDBLSRK124, CarpenterKennedy2N54, NDBLSRK134, NDBL CKLLSRK85_4C_3R, CKLLSRK85_4M_3R, CKLLSRK85_4P_3R, CKLLSRK54_3N_4R, CKLLSRK54_3M_4R, CKLLSRK65_4M_4R, CKLLSRK85_4FM_4R, CKLLSRK75_4M_5R, RDPK3Sp35, RDPK3SpFSAL35, RDPK3Sp49, RDPK3SpFSAL49, RDPK3Sp510, RDPK3SpFSAL510, KYK2014DGSSPRK_3S2, NDBLSRK134, - SLDDRK64, SHLDDRK_2N, SHLDDRK52 + SLDDRK64, SHLDDRK_2N alg_order(alg::KYK2014DGSSPRK_3S2) = 2 alg_order(alg::ORK256) = 2 @@ -52,7 +52,6 @@ alg_order(alg::CKLLSRK75_4M_5R) = 5 alg_order(alg::CKLLSRK54_3M_4R) = 4 alg_order(alg::CKLLSRK65_4M_4R) = 5 -alg_order(alg::SHLDDRK52) = 2 alg_order(alg::SHLDDRK_2N) = 4 isfsal(alg::ORK256) = false diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl b/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl index 306e67fb85..4031643fb7 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl @@ -809,32 +809,6 @@ end #Low Storage Explicit Runge-Kutta Methods -@doc explicit_rk_docstring("TBD", "SHLDDRK52") -Base.@kwdef struct SHLDDRK52{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function SHLDDRK52(stage_limiter!, step_limiter! = trivial_limiter!) - SHLDDRK52(stage_limiter!, - step_limiter!, - False()) -end - -@doc explicit_rk_docstring("TBD", "SHLDDRK_2N") -Base.@kwdef struct SHLDDRK_2N{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function SHLDDRK_2N(stage_limiter!, step_limiter! = trivial_limiter!) - SHLDDRK_2N(stage_limiter!, - step_limiter!, - False()) -end - @doc explicit_rk_docstring("Low-Storage Method 6-stage, fourth order low-stage, low-dissipation, low-dispersion scheme. Fixed timestep only.", "HSLDDRK64", diff --git a/src/OrdinaryDiffEq.jl b/src/OrdinaryDiffEq.jl index 05fe6b8a93..1d88094ec8 100644 --- a/src/OrdinaryDiffEq.jl +++ b/src/OrdinaryDiffEq.jl @@ -242,11 +242,13 @@ include("../lib/OrdinaryDiffEqStabilizedRK/src/OrdinaryDiffEqStabilizedRK.jl") using ..OrdinaryDiffEqStabilizedRK export ROCK2, ROCK4, RKC, ESERK4, ESERK5, SERK2, IRKC +# SHLDDRK52 SHLDDRK_2N + include("../lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl") using ..OrdinaryDiffEqLowStorageRK export ORK256, CarpenterKennedy2N54, SHLDDRK64, HSLDDRK64, DGLDDRK73_C, DGLDDRK84_C, DGLDDRK84_F, NDBLSRK124, NDBLSRK134, NDBLSRK144, - CFRLDDRK64, TSLDDRK74, SHLDDRK52, SHLDDRK_2N, CKLLSRK43_2, CKLLSRK54_3C, CKLLSRK95_4S, CKLLSRK95_4C, CKLLSRK95_4M, + CFRLDDRK64, TSLDDRK74, CKLLSRK43_2, CKLLSRK54_3C, CKLLSRK95_4S, CKLLSRK95_4C, CKLLSRK95_4M, CKLLSRK54_3C_3R, CKLLSRK54_3M_3R, CKLLSRK54_3N_3R, CKLLSRK85_4C_3R, CKLLSRK85_4M_3R, CKLLSRK85_4P_3R, CKLLSRK54_3N_4R, CKLLSRK54_3M_4R, CKLLSRK65_4M_4R, CKLLSRK85_4FM_4R, CKLLSRK75_4M_5R, ParsaniKetchesonDeconinck3S32, ParsaniKetchesonDeconinck3S82, diff --git a/src/alg_utils.jl b/src/alg_utils.jl index 1cd5aa02d4..c7f24c2a24 100644 --- a/src/alg_utils.jl +++ b/src/alg_utils.jl @@ -598,6 +598,7 @@ alg_order(alg::Rodas5) = 5 alg_order(alg::Rodas5P) = 5 alg_order(alg::Rodas5Pr) = 5 alg_order(alg::Rodas5Pe) = 5 +alg_order(alg::SHLDDRK52) = 2 alg_order(alg::AB3) = 3 alg_order(alg::AB4) = 4 diff --git a/src/algorithms/explicit_rk_pde.jl b/src/algorithms/explicit_rk_pde.jl index 821e630af0..842c402ef1 100644 --- a/src/algorithms/explicit_rk_pde.jl +++ b/src/algorithms/explicit_rk_pde.jl @@ -320,6 +320,19 @@ function SSPRK33(stage_limiter!, step_limiter! = trivial_limiter!) step_limiter!, False()) end +@doc explicit_rk_docstring("TBD", "SHLDDRK_2N") +Base.@kwdef struct SHLDDRK_2N{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SHLDDRK_2N(stage_limiter!, step_limiter! = trivial_limiter!) + SHLDDRK_2N(stage_limiter!, + step_limiter!, + False()) +end + @doc explicit_rk_docstring("TBD", "KYKSSPRK42") Base.@kwdef struct KYKSSPRK42{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm @@ -332,4 +345,17 @@ function KYKSSPRK42(stage_limiter!, step_limiter! = trivial_limiter!) KYKSSPRK42(stage_limiter!, step_limiter!, False()) +end + +@doc explicit_rk_docstring("TBD", "SHLDDRK52") +Base.@kwdef struct SHLDDRK52{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SHLDDRK52(stage_limiter!, step_limiter! = trivial_limiter!) + SHLDDRK52(stage_limiter!, + step_limiter!, + False()) end \ No newline at end of file From e1c46f7fbbf2b6deb009b1ec6f59a581b1bf49cc Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 11:03:53 +0530 Subject: [PATCH 20/54] RK46NLCache --- .../src/low_storage_rk_perform_step.jl | 51 +++++++++++++++++++ .../fixed_timestep_perform_step.jl | 51 ------------------- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_perform_step.jl b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_perform_step.jl index d9e42aea82..bb0ccd5d0c 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_perform_step.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_perform_step.jl @@ -848,3 +848,54 @@ end f(k, u, p, t + dt) integrator.stats.nf += 1 end + +function initialize!(integrator, cache::RK46NLCache) + @unpack k, fsalfirst = cache + integrator.fsalfirst = fsalfirst + integrator.fsallast = k + integrator.kshortsize = 1 + resize!(integrator.k, integrator.kshortsize) + integrator.k[1] = integrator.fsalfirst + integrator.f(integrator.fsalfirst, integrator.uprev, integrator.p, integrator.t) # FSAL for interpolation + integrator.stats.nf += 1 +end + +@muladd function perform_step!(integrator, cache::RK46NLCache, repeat_step = false) + @unpack t, dt, uprev, u, f, p = integrator + @unpack k, fsalfirst, tmp, stage_limiter!, step_limiter!, thread = cache + @unpack α2, α3, α4, α5, α6, β1, β2, β3, β4, β5, β6, c2, c3, c4, c5, c6 = cache.tab + + # u1 + @.. broadcast=false thread=thread tmp=dt * fsalfirst + @.. broadcast=false thread=thread u=uprev + β1 * tmp + stage_limiter!(u, integrator, p, t + c2 * dt) + # u2 + f(k, u, p, t + c2 * dt) + @.. broadcast=false thread=thread tmp=α2 * tmp + dt * k + @.. broadcast=false thread=thread u=u + β2 * tmp + stage_limiter!(u, integrator, p, t + c3 * dt) + # u3 + f(k, u, p, t + c3 * dt) + @.. broadcast=false thread=thread tmp=α3 * tmp + dt * k + @.. broadcast=false thread=thread u=u + β3 * tmp + stage_limiter!(u, integrator, p, t + c4 * dt) + # u4 + f(k, u, p, t + c4 * dt) + @.. broadcast=false thread=thread tmp=α4 * tmp + dt * k + @.. broadcast=false thread=thread u=u + β4 * tmp + stage_limiter!(u, integrator, p, t + c5 * dt) + # u5 = u + f(k, u, p, t + c5 * dt) + @.. broadcast=false thread=thread tmp=α5 * tmp + dt * k + @.. broadcast=false thread=thread u=u + β5 * tmp + stage_limiter!(u, integrator, p, t + c6 * dt) + + f(k, u, p, t + c6 * dt) + @.. broadcast=false thread=thread tmp=α6 * tmp + dt * k + @.. broadcast=false thread=thread u=u + β6 * tmp + stage_limiter!(u, integrator, p, t + dt) + step_limiter!(u, integrator, p, t + dt) + + f(k, u, p, t + dt) + integrator.stats.nf += 6 +end diff --git a/src/perform_step/fixed_timestep_perform_step.jl b/src/perform_step/fixed_timestep_perform_step.jl index 0fda5ff7d1..b2983aa1d9 100644 --- a/src/perform_step/fixed_timestep_perform_step.jl +++ b/src/perform_step/fixed_timestep_perform_step.jl @@ -450,57 +450,6 @@ end integrator.u = u end -function initialize!(integrator, cache::RK46NLCache) - @unpack k, fsalfirst = cache - integrator.fsalfirst = fsalfirst - integrator.fsallast = k - integrator.kshortsize = 1 - resize!(integrator.k, integrator.kshortsize) - integrator.k[1] = integrator.fsalfirst - integrator.f(integrator.fsalfirst, integrator.uprev, integrator.p, integrator.t) # FSAL for interpolation - integrator.stats.nf += 1 -end - -@muladd function perform_step!(integrator, cache::RK46NLCache, repeat_step = false) - @unpack t, dt, uprev, u, f, p = integrator - @unpack k, fsalfirst, tmp, stage_limiter!, step_limiter!, thread = cache - @unpack α2, α3, α4, α5, α6, β1, β2, β3, β4, β5, β6, c2, c3, c4, c5, c6 = cache.tab - - # u1 - @.. broadcast=false thread=thread tmp=dt * fsalfirst - @.. broadcast=false thread=thread u=uprev + β1 * tmp - stage_limiter!(u, integrator, p, t + c2 * dt) - # u2 - f(k, u, p, t + c2 * dt) - @.. broadcast=false thread=thread tmp=α2 * tmp + dt * k - @.. broadcast=false thread=thread u=u + β2 * tmp - stage_limiter!(u, integrator, p, t + c3 * dt) - # u3 - f(k, u, p, t + c3 * dt) - @.. broadcast=false thread=thread tmp=α3 * tmp + dt * k - @.. broadcast=false thread=thread u=u + β3 * tmp - stage_limiter!(u, integrator, p, t + c4 * dt) - # u4 - f(k, u, p, t + c4 * dt) - @.. broadcast=false thread=thread tmp=α4 * tmp + dt * k - @.. broadcast=false thread=thread u=u + β4 * tmp - stage_limiter!(u, integrator, p, t + c5 * dt) - # u5 = u - f(k, u, p, t + c5 * dt) - @.. broadcast=false thread=thread tmp=α5 * tmp + dt * k - @.. broadcast=false thread=thread u=u + β5 * tmp - stage_limiter!(u, integrator, p, t + c6 * dt) - - f(k, u, p, t + c6 * dt) - @.. broadcast=false thread=thread tmp=α6 * tmp + dt * k - @.. broadcast=false thread=thread u=u + β6 * tmp - stage_limiter!(u, integrator, p, t + dt) - step_limiter!(u, integrator, p, t + dt) - - f(k, u, p, t + dt) - integrator.stats.nf += 6 -end - function initialize!(integrator, cache::Anas5ConstantCache) integrator.kshortsize = 7 integrator.k = typeof(integrator.k)(undef, integrator.kshortsize) From 67f2b1f93cbf81e0877865685a33306b82426901 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 11:06:21 +0530 Subject: [PATCH 21/54] RK46NLConstantCache --- .../src/low_storage_rk_perform_step.jl | 40 +++++++++++++++++++ .../fixed_timestep_perform_step.jl | 40 ------------------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_perform_step.jl b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_perform_step.jl index bb0ccd5d0c..b5f5e79413 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_perform_step.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_perform_step.jl @@ -899,3 +899,43 @@ end f(k, u, p, t + dt) integrator.stats.nf += 6 end + +function initialize!(integrator, cache::RK46NLConstantCache) + integrator.fsalfirst = integrator.f(integrator.uprev, integrator.p, integrator.t) # Pre-start fsal + integrator.stats.nf += 1 + integrator.kshortsize = 1 + integrator.k = typeof(integrator.k)(undef, integrator.kshortsize) + + # Avoid undefined entries if k is an array of arrays + integrator.fsallast = zero(integrator.fsalfirst) + integrator.k[1] = integrator.fsalfirst +end + +@muladd function perform_step!(integrator, cache::RK46NLConstantCache, repeat_step = false) + @unpack t, dt, uprev, u, f, p = integrator + @unpack α2, α3, α4, α5, α6, β1, β2, β3, β4, β5, β6, c2, c3, c4, c5, c6 = cache + + # u1 + tmp = dt * integrator.fsalfirst + u = uprev + β1 * tmp + # u2 + tmp = α2 * tmp + dt * f(u, p, t + c2 * dt) + u = u + β2 * tmp + # u3 + tmp = α3 * tmp + dt * f(u, p, t + c3 * dt) + u = u + β3 * tmp + # u4 + tmp = α4 * tmp + dt * f(u, p, t + c4 * dt) + u = u + β4 * tmp + # u5 = u + tmp = α5 * tmp + dt * f(u, p, t + c5 * dt) + u = u + β5 * tmp + # u6 + tmp = α6 * tmp + dt * f(u, p, t + c6 * dt) + u = u + β6 * tmp + + integrator.fsallast = f(u, p, t + dt) # For interpolation, then FSAL'd + integrator.stats.nf += 6 + integrator.k[1] = integrator.fsalfirst + integrator.u = u +end \ No newline at end of file diff --git a/src/perform_step/fixed_timestep_perform_step.jl b/src/perform_step/fixed_timestep_perform_step.jl index b2983aa1d9..643ce748f8 100644 --- a/src/perform_step/fixed_timestep_perform_step.jl +++ b/src/perform_step/fixed_timestep_perform_step.jl @@ -410,46 +410,6 @@ end end end -function initialize!(integrator, cache::RK46NLConstantCache) - integrator.fsalfirst = integrator.f(integrator.uprev, integrator.p, integrator.t) # Pre-start fsal - integrator.stats.nf += 1 - integrator.kshortsize = 1 - integrator.k = typeof(integrator.k)(undef, integrator.kshortsize) - - # Avoid undefined entries if k is an array of arrays - integrator.fsallast = zero(integrator.fsalfirst) - integrator.k[1] = integrator.fsalfirst -end - -@muladd function perform_step!(integrator, cache::RK46NLConstantCache, repeat_step = false) - @unpack t, dt, uprev, u, f, p = integrator - @unpack α2, α3, α4, α5, α6, β1, β2, β3, β4, β5, β6, c2, c3, c4, c5, c6 = cache - - # u1 - tmp = dt * integrator.fsalfirst - u = uprev + β1 * tmp - # u2 - tmp = α2 * tmp + dt * f(u, p, t + c2 * dt) - u = u + β2 * tmp - # u3 - tmp = α3 * tmp + dt * f(u, p, t + c3 * dt) - u = u + β3 * tmp - # u4 - tmp = α4 * tmp + dt * f(u, p, t + c4 * dt) - u = u + β4 * tmp - # u5 = u - tmp = α5 * tmp + dt * f(u, p, t + c5 * dt) - u = u + β5 * tmp - # u6 - tmp = α6 * tmp + dt * f(u, p, t + c6 * dt) - u = u + β6 * tmp - - integrator.fsallast = f(u, p, t + dt) # For interpolation, then FSAL'd - integrator.stats.nf += 6 - integrator.k[1] = integrator.fsalfirst - integrator.u = u -end - function initialize!(integrator, cache::Anas5ConstantCache) integrator.kshortsize = 7 integrator.k = typeof(integrator.k)(undef, integrator.kshortsize) From 8bee104eadaa39245b06e039fcdbc0859c950066 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 11:09:09 +0530 Subject: [PATCH 22/54] KYK2014DGSSPRK_3S2_Cache --- .../src/low_storage_rk_perform_step.jl | 63 +++++++++++++++++++ src/perform_step/low_order_rk_perform_step.jl | 63 ------------------- 2 files changed, 63 insertions(+), 63 deletions(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_perform_step.jl b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_perform_step.jl index b5f5e79413..ff01941054 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_perform_step.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_perform_step.jl @@ -938,4 +938,67 @@ end integrator.stats.nf += 6 integrator.k[1] = integrator.fsalfirst integrator.u = u +end + +function initialize!(integrator, cache::KYK2014DGSSPRK_3S2_ConstantCache) + integrator.fsalfirst = integrator.f(integrator.uprev, integrator.p, integrator.t) # Pre-start fsal + integrator.stats.nf += 1 + integrator.kshortsize = 2 + integrator.k = typeof(integrator.k)(undef, integrator.kshortsize) + + # Avoid undefined entries if k is an array of arrays + integrator.fsallast = zero(integrator.fsalfirst) + return nothing +end + +@muladd function perform_step!(integrator, cache::KYK2014DGSSPRK_3S2_ConstantCache, + repeat_step = false) + @unpack t, dt, uprev, u, f, p = integrator + @unpack α_10, α_20, α_21, α_30, α_32, β_10, β_21, β_30, β_32, c_1, c_2 = cache + u_1 = α_10 * uprev + dt * β_10 * integrator.fsalfirst + u_2 = (α_20 * uprev + + α_21 * u_1 + dt * β_21 * f(u_1, p, t + c_1 * dt)) + integrator.u = (α_30 * uprev + dt * β_30 * integrator.fsalfirst + + α_32 * u_2 + dt * β_32 * f(u_2, p, t + c_2 * dt)) + integrator.k[1] = integrator.fsalfirst + integrator.k[2] = f(integrator.u, p, t + dt) # For interpolation, then FSAL'd + integrator.stats.nf += 3 + integrator.fsallast = integrator.k[2] + return nothing +end + +function initialize!(integrator, cache::KYK2014DGSSPRK_3S2_Cache) + @unpack k, fsalfirst = cache + integrator.fsalfirst = fsalfirst + integrator.fsallast = k + integrator.kshortsize = 2 + resize!(integrator.k, integrator.kshortsize) + integrator.k[1] = integrator.fsalfirst + integrator.k[2] = integrator.fsallast + integrator.f(integrator.fsalfirst, integrator.uprev, integrator.p, integrator.t) # FSAL for interpolation + integrator.stats.nf += 1 + return nothing +end + +@muladd function perform_step!(integrator, cache::KYK2014DGSSPRK_3S2_Cache, + repeat_step = false) + @unpack t, dt, uprev, u, f, p = integrator + @unpack k, fsalfirst, u_1, u_2, kk_1, kk_2, stage_limiter!, step_limiter!, thread = cache + @unpack α_10, α_20, α_21, α_30, α_32, β_10, β_21, β_30, β_32, c_1, c_2 = cache.tab + + @.. broadcast=false thread=thread u_1=α_10 * uprev + dt * β_10 * integrator.fsalfirst + stage_limiter!(u_1, integrator, p, t + c_1 * dt) + f(kk_1, u_1, p, t + c_1 * dt) + @.. broadcast=false thread=thread u_2=(α_20 * uprev + + α_21 * u_1 + dt * β_21 * kk_1) + stage_limiter!(u_2, integrator, p, t + c_2 * dt) + f(kk_2, u_2, p, t + c_2 * dt) + @.. broadcast=false thread=thread u=(α_30 * uprev + + dt * β_30 * integrator.fsalfirst + + α_32 * u_2 + dt * β_32 * kk_2) + stage_limiter!(u, integrator, p, t + dt) + step_limiter!(u, integrator, p, t + dt) + f(integrator.k[2], u, p, t + dt) # For interpolation, then FSAL'd + integrator.stats.nf += 3 + return nothing end \ No newline at end of file diff --git a/src/perform_step/low_order_rk_perform_step.jl b/src/perform_step/low_order_rk_perform_step.jl index 4ad5f6f106..5ac5d34976 100644 --- a/src/perform_step/low_order_rk_perform_step.jl +++ b/src/perform_step/low_order_rk_perform_step.jl @@ -981,69 +981,6 @@ end return nothing end -function initialize!(integrator, cache::KYK2014DGSSPRK_3S2_ConstantCache) - integrator.fsalfirst = integrator.f(integrator.uprev, integrator.p, integrator.t) # Pre-start fsal - integrator.stats.nf += 1 - integrator.kshortsize = 2 - integrator.k = typeof(integrator.k)(undef, integrator.kshortsize) - - # Avoid undefined entries if k is an array of arrays - integrator.fsallast = zero(integrator.fsalfirst) - return nothing -end - -@muladd function perform_step!(integrator, cache::KYK2014DGSSPRK_3S2_ConstantCache, - repeat_step = false) - @unpack t, dt, uprev, u, f, p = integrator - @unpack α_10, α_20, α_21, α_30, α_32, β_10, β_21, β_30, β_32, c_1, c_2 = cache - u_1 = α_10 * uprev + dt * β_10 * integrator.fsalfirst - u_2 = (α_20 * uprev + - α_21 * u_1 + dt * β_21 * f(u_1, p, t + c_1 * dt)) - integrator.u = (α_30 * uprev + dt * β_30 * integrator.fsalfirst + - α_32 * u_2 + dt * β_32 * f(u_2, p, t + c_2 * dt)) - integrator.k[1] = integrator.fsalfirst - integrator.k[2] = f(integrator.u, p, t + dt) # For interpolation, then FSAL'd - integrator.stats.nf += 3 - integrator.fsallast = integrator.k[2] - return nothing -end - -function initialize!(integrator, cache::KYK2014DGSSPRK_3S2_Cache) - @unpack k, fsalfirst = cache - integrator.fsalfirst = fsalfirst - integrator.fsallast = k - integrator.kshortsize = 2 - resize!(integrator.k, integrator.kshortsize) - integrator.k[1] = integrator.fsalfirst - integrator.k[2] = integrator.fsallast - integrator.f(integrator.fsalfirst, integrator.uprev, integrator.p, integrator.t) # FSAL for interpolation - integrator.stats.nf += 1 - return nothing -end - -@muladd function perform_step!(integrator, cache::KYK2014DGSSPRK_3S2_Cache, - repeat_step = false) - @unpack t, dt, uprev, u, f, p = integrator - @unpack k, fsalfirst, u_1, u_2, kk_1, kk_2, stage_limiter!, step_limiter!, thread = cache - @unpack α_10, α_20, α_21, α_30, α_32, β_10, β_21, β_30, β_32, c_1, c_2 = cache.tab - - @.. broadcast=false thread=thread u_1=α_10 * uprev + dt * β_10 * integrator.fsalfirst - stage_limiter!(u_1, integrator, p, t + c_1 * dt) - f(kk_1, u_1, p, t + c_1 * dt) - @.. broadcast=false thread=thread u_2=(α_20 * uprev + - α_21 * u_1 + dt * β_21 * kk_1) - stage_limiter!(u_2, integrator, p, t + c_2 * dt) - f(kk_2, u_2, p, t + c_2 * dt) - @.. broadcast=false thread=thread u=(α_30 * uprev + - dt * β_30 * integrator.fsalfirst + - α_32 * u_2 + dt * β_32 * kk_2) - stage_limiter!(u, integrator, p, t + dt) - step_limiter!(u, integrator, p, t + dt) - f(integrator.k[2], u, p, t + dt) # For interpolation, then FSAL'd - integrator.stats.nf += 3 - return nothing -end - function initialize!(integrator, cache::RKO65ConstantCache) integrator.kshortsize = 6 integrator.k = typeof(integrator.k)(undef, integrator.kshortsize) From 10e2f0b1262dd24de63f646b3993a27faa3f8b8b Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 11:11:30 +0530 Subject: [PATCH 23/54] SVector --- lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl index 3fa96a563d..a9532d0a58 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl @@ -16,6 +16,7 @@ import OrdinaryDiffEq: alg_order, alg_maximum_order, get_current_adaptive_order, WOperator, TimeGradientWrapper, UJacobianWrapper, build_grad_config, build_jac_config, calc_J!, jacobian2W!, dolinsolve using DiffEqBase, FastBroadcast, Polyester, MuladdMacro, RecursiveArrayTools, LinearSolve +import StaticArrays: SArray, MVector, SVector, @SVector, StaticArray, MMatrix, SA macro cache(expr) name = expr.args[2].args[1].args[1] From 1ac3caaa7410a5e9059a232ac75ab199a04d8f4d Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 13:18:55 +0530 Subject: [PATCH 24/54] ORK256 fix --- lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl index 9e5960a840..c5e601b432 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl @@ -1,6 +1,6 @@ # 2N low storage methods introduced by Williamson - +include("algorithms.jl") @cache struct LowStorageRK2NCache{uType, rateType, TabType, StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqMutableCache u::uType From 6d05af6f159c29bfe44056245e5d2034d7fb7a9b Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 13:28:28 +0530 Subject: [PATCH 25/54] ORK256 fix --- lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl index c5e601b432..fe7af211c8 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl @@ -1,6 +1,6 @@ # 2N low storage methods introduced by Williamson -include("algorithms.jl") +using OrdinaryDiffEq @cache struct LowStorageRK2NCache{uType, rateType, TabType, StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqMutableCache u::uType From 5116903b3948663a0486476be6200cbc5a1bc19e Mon Sep 17 00:00:00 2001 From: Param Thakkar <128291516+ParamThakkar123@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:10:47 +0530 Subject: [PATCH 26/54] Update lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl Co-authored-by: Christopher Rackauckas --- .../src/OrdinaryDiffEqLowStorageRK.jl | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl index a9532d0a58..6427c8711a 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl @@ -1,20 +1,14 @@ module OrdinaryDiffEqLowStorageRK -import OrdinaryDiffEq: alg_order, alg_maximum_order, get_current_adaptive_order, - get_current_alg_order, calculate_residuals!, accept_step_controller, - default_controller, beta2_default, beta1_default, gamma_default, - initialize!, perform_step!, @unpack, unwrap_alg, isthreaded, - step_accept_controller!, calculate_residuals, +import OrdinaryDiffEq: alg_order, alg_adaptive_order, calculate_residuals!, + beta2_default, beta1_default, gamma_default, + initialize!, perform_step!, @unpack, unwrap_alg, + calculate_residuals, + OrdinaryDiffEqAlgorithm, ispredictive, OrdinaryDiffEqMutableCache, OrdinaryDiffEqConstantCache, - reset_alg_dependent_opts!, AbstractController, - step_accept_controller!, step_reject_controller!, - OrdinaryDiffEqAdaptiveAlgorithm, OrdinaryDiffEqAdaptiveImplicitAlgorithm, - alg_cache, CompiledFloats, @threaded, stepsize_controller!, DEFAULT_PRECS, - constvalue, PolyesterThreads, Sequential, BaseThreads, - _digest_beta1_beta2, timedepentdtmin, _unwrap_val, - TimeDerivativeWrapper, UDerivativeWrapper, calc_J, _reshape, _vec, - WOperator, TimeGradientWrapper, UJacobianWrapper, build_grad_config, - build_jac_config, calc_J!, jacobian2W!, dolinsolve + OrdinaryDiffEqAdaptiveAlgorithm, + alg_cache, _vec, _reshape, @cache, + constvalue, _unwrap_val, du_alias_or_new using DiffEqBase, FastBroadcast, Polyester, MuladdMacro, RecursiveArrayTools, LinearSolve import StaticArrays: SArray, MVector, SVector, @SVector, StaticArray, MMatrix, SA From 86dd0652100d5b608a9d8ff06f4ba8742345c412 Mon Sep 17 00:00:00 2001 From: Param Thakkar <128291516+ParamThakkar123@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:11:34 +0530 Subject: [PATCH 27/54] Update lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl Co-authored-by: Christopher Rackauckas --- .../src/OrdinaryDiffEqLowStorageRK.jl | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl index 6427c8711a..38e43f93dd 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl @@ -12,25 +12,6 @@ import OrdinaryDiffEq: alg_order, alg_adaptive_order, calculate_residuals!, using DiffEqBase, FastBroadcast, Polyester, MuladdMacro, RecursiveArrayTools, LinearSolve import StaticArrays: SArray, MVector, SVector, @SVector, StaticArray, MMatrix, SA -macro cache(expr) - name = expr.args[2].args[1].args[1] - fields = [x for x in expr.args[3].args if typeof(x) != LineNumberNode] - cache_vars = Expr[] - jac_vars = Pair{Symbol, Expr}[] - for x in fields - if x.args[2] == :uType || x.args[2] == :rateType || - x.args[2] == :kType || x.args[2] == :uNoUnitsType - push!(cache_vars, :(c.$(x.args[1]))) - elseif x.args[2] == :DiffCacheType - push!(cache_vars, :(c.$(x.args[1]).du)) - push!(cache_vars, :(c.$(x.args[1]).dual_du)) - end - end - quote - $(esc(expr)) - $(esc(:full_cache))(c::$name) = tuple($(cache_vars...)) - end -end include("low_storage_rk_caches.jl") include("low_storage_rk_perform_step.jl") From bc8f1fae9aa15b336b2352b64e6d620fa54bd0be Mon Sep 17 00:00:00 2001 From: Param Thakkar <128291516+ParamThakkar123@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:11:46 +0530 Subject: [PATCH 28/54] Update lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl Co-authored-by: Christopher Rackauckas --- .../src/OrdinaryDiffEqLowStorageRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl index 38e43f93dd..d2d44e840d 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl @@ -9,7 +9,7 @@ import OrdinaryDiffEq: alg_order, alg_adaptive_order, calculate_residuals!, OrdinaryDiffEqAdaptiveAlgorithm, alg_cache, _vec, _reshape, @cache, constvalue, _unwrap_val, du_alias_or_new -using DiffEqBase, FastBroadcast, Polyester, MuladdMacro, RecursiveArrayTools, LinearSolve +using DiffEqBase, FastBroadcast, Polyester, MuladdMacro, RecursiveArrayTools import StaticArrays: SArray, MVector, SVector, @SVector, StaticArray, MMatrix, SA From b2e1e25e6ab56d1d42b1599ec133d5638dd9d3b0 Mon Sep 17 00:00:00 2001 From: Param Thakkar <128291516+ParamThakkar123@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:11:55 +0530 Subject: [PATCH 29/54] Update lib/OrdinaryDiffEqLowStorageRK/Project.toml Co-authored-by: Christopher Rackauckas --- lib/OrdinaryDiffEqLowStorageRK/Project.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/Project.toml b/lib/OrdinaryDiffEqLowStorageRK/Project.toml index 36c1f5629b..547e3c2a1c 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/Project.toml +++ b/lib/OrdinaryDiffEqLowStorageRK/Project.toml @@ -6,7 +6,6 @@ version = "1.0.0" [deps] FastBroadcast = "7034ab61-46d4-4ed7-9d0f-46aef9175898" MuladdMacro = "46d2c3a1-f734-5fdb-9937-b9b9aeba4221" -LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" Polyester = "f517fe37-dbe3-4b94-8317-1923a5111588" RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" From 50bf6c3bc4f264bbe034c60520abc60fc9142806 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 16:23:21 +0530 Subject: [PATCH 30/54] Added tests --- lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl | 10 ---------- lib/OrdinaryDiffEqLowStorageRK/test/runtests.jl | 3 +++ 2 files changed, 3 insertions(+), 10 deletions(-) create mode 100644 lib/OrdinaryDiffEqLowStorageRK/test/runtests.jl diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl b/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl index 6d5a91b5e4..69b77377d7 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl @@ -1,13 +1,3 @@ -using OrdinaryDiffEq: ORK256, NDBLSRK124, CarpenterKennedy2N54, NDBLSRK134, NDBLSRK144, - CFRLDDRK64, TSLDDRK74, DGLDDRK73_C, DGLDDRK84_C, DGLDDRK84_F, SHLDDRK64, RK46NL, ParsaniKetchesonDeconinck3S32, - ParsaniKetchesonDeconinck3S82, ParsaniKetchesonDeconinck3S53, ParsaniKetchesonDeconinck3S173, ParsaniKetchesonDeconinck3S94, - ParsaniKetchesonDeconinck3S184, ParsaniKetchesonDeconinck3S105, ParsaniKetchesonDeconinck3S205, CKLLSRK43_2, - CKLLSRK54_3C, CKLLSRK95_4S, CKLLSRK95_4C, CKLLSRK95_4M, CKLLSRK54_3C_3R, CKLLSRK54_3M_3R, CKLLSRK54_3N_3R, - CKLLSRK85_4C_3R, CKLLSRK85_4M_3R, CKLLSRK85_4P_3R, CKLLSRK54_3N_4R, CKLLSRK54_3M_4R, CKLLSRK65_4M_4R, - CKLLSRK85_4FM_4R, CKLLSRK75_4M_5R, RDPK3Sp35, RDPK3SpFSAL35, RDPK3Sp49, RDPK3SpFSAL49, RDPK3Sp510, - RDPK3SpFSAL510, KYK2014DGSSPRK_3S2, NDBLSRK134, - SLDDRK64, SHLDDRK_2N - alg_order(alg::KYK2014DGSSPRK_3S2) = 2 alg_order(alg::ORK256) = 2 alg_order(alg::CarpenterKennedy2N54) = 4 diff --git a/lib/OrdinaryDiffEqLowStorageRK/test/runtests.jl b/lib/OrdinaryDiffEqLowStorageRK/test/runtests.jl new file mode 100644 index 0000000000..8a095b23c4 --- /dev/null +++ b/lib/OrdinaryDiffEqLowStorageRK/test/runtests.jl @@ -0,0 +1,3 @@ +using SafeTestsets + +@time @safetestset "Extrapolation Tests" include("ode_low_storage_rk_tests.jl") \ No newline at end of file From 2fa058eedd082a426d99e3d0bbaf16235c90ccc1 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Mon, 24 Jun 2024 14:27:58 +0200 Subject: [PATCH 31/54] Update lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl --- .../src/OrdinaryDiffEqLowStorageRK.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl index d2d44e840d..2e7481c511 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl @@ -13,10 +13,10 @@ using DiffEqBase, FastBroadcast, Polyester, MuladdMacro, RecursiveArrayTools import StaticArrays: SArray, MVector, SVector, @SVector, StaticArray, MMatrix, SA -include("low_storage_rk_caches.jl") -include("low_storage_rk_perform_step.jl") include("algorithms.jl") include("alg_utils.jl") +include("low_storage_rk_caches.jl") +include("low_storage_rk_perform_step.jl") export ORK256, CarpenterKennedy2N54, SHLDDRK64, HSLDDRK64, DGLDDRK73_C, DGLDDRK84_C, DGLDDRK84_F, NDBLSRK124, NDBLSRK134, NDBLSRK144, From ab0c0a730d306550b7160a0089a80cd403351ebb Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 18:31:20 +0530 Subject: [PATCH 32/54] explicit_rk_docstring --- .../src/OrdinaryDiffEqLowStorageRK.jl | 1 + .../src/algorithms.jl | 2 +- .../src/doc_utils.jl | 20 ++++++++ .../src/low_storage_rk_caches.jl | 51 +++++++++---------- src/doc_utils.jl | 21 -------- 5 files changed, 47 insertions(+), 48 deletions(-) create mode 100644 lib/OrdinaryDiffEqLowStorageRK/src/doc_utils.jl diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl index 2e7481c511..c09585481b 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl @@ -15,6 +15,7 @@ import StaticArrays: SArray, MVector, SVector, @SVector, StaticArray, MMatrix, S include("algorithms.jl") include("alg_utils.jl") +include("doc_utils.jl") include("low_storage_rk_caches.jl") include("low_storage_rk_perform_step.jl") diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl b/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl index 4031643fb7..b0767e0a5d 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl @@ -35,7 +35,7 @@ hyperbolic PDEs (stability properties).", extra_keyword_description = """- `williamson_condition`: allows for an optimization that allows fusing broadcast expressions with the function call `f`. However, it only works for `Array` types. """, extra_keyword_default = "williamson_condition = true") -Base.@kwdef struct CarpenterKennedy2N54{StageLimiter, StepLimiter, Thread} <: + Base.@kwdef struct CarpenterKennedy2N54{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm stage_limiter!::StageLimiter = trivial_limiter! step_limiter!::StepLimiter = trivial_limiter! diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/doc_utils.jl b/lib/OrdinaryDiffEqLowStorageRK/src/doc_utils.jl new file mode 100644 index 0000000000..0a32d8decf --- /dev/null +++ b/lib/OrdinaryDiffEqLowStorageRK/src/doc_utils.jl @@ -0,0 +1,20 @@ +function explicit_rk_docstring(description::String, + name::String; + references::String = "", + extra_keyword_description::String = "", + extra_keyword_default::String = "") +keyword_default = """ +stage_limiter! = OrdinaryDiffEq.trivial_limiter!, +step_limiter! = OrdinaryDiffEq.trivial_limiter!, +""" * extra_keyword_default + +keyword_default_description = """ +- `stage_limiter!`: function of the form `limiter!(u, integrator, p, t)` +- `step_limiter!`: function of the form `limiter!(u, integrator, p, t)` +""" * extra_keyword_description + +generic_solver_docstring( + description, name, "Explicit Runge-Kutta Method. ", references, + keyword_default_description, keyword_default +) +end \ No newline at end of file diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl index fe7af211c8..ff2ae9cf0a 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_caches.jl @@ -1,6 +1,5 @@ # 2N low storage methods introduced by Williamson -using OrdinaryDiffEq @cache struct LowStorageRK2NCache{uType, rateType, TabType, StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqMutableCache u::uType @@ -69,14 +68,14 @@ function alg_cache(alg::ORK256, u, rate_prototype, ::Type{uEltypeNoUnits}, ::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t, dt, reltol, p, calck, ::Val{false}) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits} - ORK256ConstantCache(constvalue(uBottomEltypeNoUnits), constvalue(tTypeNoUnits)) + ORK256ConstantCache(constvalue(uBottomEltypeNoUnits), constvalue(tTypeNoUnits)) end function alg_cache(alg::RK46NL, u, rate_prototype, ::Type{uEltypeNoUnits}, ::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t, dt, reltol, p, calck, ::Val{false}) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits} -RK46NLConstantCache(constvalue(uBottomEltypeNoUnits), constvalue(tTypeNoUnits)) + RK46NLConstantCache(constvalue(uBottomEltypeNoUnits), constvalue(tTypeNoUnits)) end struct RK46NLConstantCache{T, T2} <: OrdinaryDiffEqConstantCache @@ -175,15 +174,15 @@ function alg_cache(alg::KYK2014DGSSPRK_3S2, u, rate_prototype, ::Type{uEltypeNoU ::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t, dt, reltol, p, calck, ::Val{true}) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits} -u_1 = zero(u) -u_2 = zero(u) -kk_1 = zero(rate_prototype) -kk_2 = zero(rate_prototype) -k = zero(rate_prototype) -fsalfirst = zero(rate_prototype) -tab = KYK2014DGSSPRK_3S2_ConstantCache(constvalue(uBottomEltypeNoUnits), + u_1 = zero(u) + u_2 = zero(u) + kk_1 = zero(rate_prototype) + kk_2 = zero(rate_prototype) + k = zero(rate_prototype) + fsalfirst = zero(rate_prototype) + tab = KYK2014DGSSPRK_3S2_ConstantCache(constvalue(uBottomEltypeNoUnits), constvalue(tTypeNoUnits)) -KYK2014DGSSPRK_3S2_Cache(u, uprev, k, fsalfirst, tab, u_1, u_2, kk_1, kk_2, + KYK2014DGSSPRK_3S2_Cache(u, uprev, k, fsalfirst, tab, u_1, u_2, kk_1, kk_2, alg.stage_limiter!, alg.step_limiter!, alg.thread) end @@ -191,7 +190,7 @@ function alg_cache(alg::KYK2014DGSSPRK_3S2, u, rate_prototype, ::Type{uEltypeNoU ::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t, dt, reltol, p, calck, ::Val{false}) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits} -KYK2014DGSSPRK_3S2_ConstantCache(constvalue(uBottomEltypeNoUnits), + KYK2014DGSSPRK_3S2_ConstantCache(constvalue(uBottomEltypeNoUnits), constvalue(tTypeNoUnits)) end @@ -199,25 +198,25 @@ function alg_cache(alg::RK46NL, u, rate_prototype, ::Type{uEltypeNoUnits}, ::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t, dt, reltol, p, calck, ::Val{true}) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits} -tmp = zero(u) -k = zero(rate_prototype) -fsalfirst = zero(rate_prototype) -tab = RK46NLConstantCache(constvalue(uBottomEltypeNoUnits), constvalue(tTypeNoUnits)) -RK46NLCache(u, uprev, k, tmp, fsalfirst, tab, alg.stage_limiter!, alg.step_limiter!, + tmp = zero(u) + k = zero(rate_prototype) + fsalfirst = zero(rate_prototype) + tab = RK46NLConstantCache(constvalue(uBottomEltypeNoUnits), constvalue(tTypeNoUnits)) + RK46NLCache(u, uprev, k, tmp, fsalfirst, tab, alg.stage_limiter!, alg.step_limiter!, alg.thread) end @cache struct RK46NLCache{uType, rateType, TabType, StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqMutableCache -u::uType -uprev::uType -k::rateType -tmp::uType -fsalfirst::rateType -tab::TabType -stage_limiter!::StageLimiter -step_limiter!::StepLimiter -thread::Thread + u::uType + uprev::uType + k::rateType + tmp::uType + fsalfirst::rateType + tab::TabType + stage_limiter!::StageLimiter + step_limiter!::StepLimiter + thread::Thread end function CarpenterKennedy2N54ConstantCache(T, T2) diff --git a/src/doc_utils.jl b/src/doc_utils.jl index 3ded215c3a..ebfe447474 100644 --- a/src/doc_utils.jl +++ b/src/doc_utils.jl @@ -54,27 +54,6 @@ function generic_solver_docstring(description::String, "## References\n" * references end -function explicit_rk_docstring(description::String, - name::String; - references::String = "", - extra_keyword_description::String = "", - extra_keyword_default::String = "") - keyword_default = """ - stage_limiter! = OrdinaryDiffEq.trivial_limiter!, - step_limiter! = OrdinaryDiffEq.trivial_limiter!, - """ * extra_keyword_default - - keyword_default_description = """ - - `stage_limiter!`: function of the form `limiter!(u, integrator, p, t)` - - `step_limiter!`: function of the form `limiter!(u, integrator, p, t)` - """ * extra_keyword_description - - generic_solver_docstring( - description, name, "Explicit Runge-Kutta Method. ", references, - keyword_default_description, keyword_default - ) -end - function rosenbrock_docstring(description::String, name::String; references::String = "", From 7a54a84c7b82b982373c1ce37c791b7bb7317062 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 18:36:17 +0530 Subject: [PATCH 33/54] Fixes --- src/doc_utils.jl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/doc_utils.jl b/src/doc_utils.jl index ebfe447474..7d8b317a46 100644 --- a/src/doc_utils.jl +++ b/src/doc_utils.jl @@ -85,6 +85,27 @@ function rosenbrock_docstring(description::String, ) end +function explicit_rk_docstring(description::String, + name::String; + references::String = "", + extra_keyword_description::String = "", + extra_keyword_default::String = "") +keyword_default = """ +stage_limiter! = OrdinaryDiffEq.trivial_limiter!, +step_limiter! = OrdinaryDiffEq.trivial_limiter!, +""" * extra_keyword_default + +keyword_default_description = """ +- `stage_limiter!`: function of the form `limiter!(u, integrator, p, t)` +- `step_limiter!`: function of the form `limiter!(u, integrator, p, t)` +""" * extra_keyword_description + +generic_solver_docstring( + description, name, "Explicit Runge-Kutta Method. ", references, + keyword_default_description, keyword_default +) +end + function rosenbrock_wanner_docstring(description::String, name::String; references::String = "", From 513fcffb2d25d80c6d7a6aad0b44e3ddd9bf83f0 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 20:05:29 +0530 Subject: [PATCH 34/54] Docstring --- .../src/OrdinaryDiffEqLowStorageRK.jl | 1 - .../src/algorithms.jl | 2 ++ .../src/doc_utils.jl | 20 ------------------- 3 files changed, 2 insertions(+), 21 deletions(-) delete mode 100644 lib/OrdinaryDiffEqLowStorageRK/src/doc_utils.jl diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl index c09585481b..2e7481c511 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl @@ -15,7 +15,6 @@ import StaticArrays: SArray, MVector, SVector, @SVector, StaticArray, MMatrix, S include("algorithms.jl") include("alg_utils.jl") -include("doc_utils.jl") include("low_storage_rk_caches.jl") include("low_storage_rk_perform_step.jl") diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl b/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl index b0767e0a5d..fb8fba37b2 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl @@ -1,3 +1,5 @@ +using OrdinaryDiffEq: explicit_rk_docstring + @doc explicit_rk_docstring( "A second-order, five-stage explicit Runge-Kutta method for wave propagation equations. Fixed timestep only.", "ORK256", diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/doc_utils.jl b/lib/OrdinaryDiffEqLowStorageRK/src/doc_utils.jl deleted file mode 100644 index 0a32d8decf..0000000000 --- a/lib/OrdinaryDiffEqLowStorageRK/src/doc_utils.jl +++ /dev/null @@ -1,20 +0,0 @@ -function explicit_rk_docstring(description::String, - name::String; - references::String = "", - extra_keyword_description::String = "", - extra_keyword_default::String = "") -keyword_default = """ -stage_limiter! = OrdinaryDiffEq.trivial_limiter!, -step_limiter! = OrdinaryDiffEq.trivial_limiter!, -""" * extra_keyword_default - -keyword_default_description = """ -- `stage_limiter!`: function of the form `limiter!(u, integrator, p, t)` -- `step_limiter!`: function of the form `limiter!(u, integrator, p, t)` -""" * extra_keyword_description - -generic_solver_docstring( - description, name, "Explicit Runge-Kutta Method. ", references, - keyword_default_description, keyword_default -) -end \ No newline at end of file From 6cde74794412badeacd6d1ee64755b47841b2143 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 20:15:21 +0530 Subject: [PATCH 35/54] DGLDDRK73_C --- .../src/algorithms.jl | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl b/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl index fb8fba37b2..866d5ab640 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl @@ -24,6 +24,35 @@ function ORK256(stage_limiter!, ORK256(stage_limiter!, step_limiter!, False(), williamson_condition) end +@doc explicit_rk_docstring( + "7-stage, third order low-storage low-dissipation, low-dispersion scheme for +discontinuous Galerkin space discretizations applied to wave propagation problems. +Optimized for PDE discretizations when maximum spatial step is small due to +geometric features of computational domain. Fixed timestep only.", + "DGLDDRK73_C", + references = "T. Toulorge, W. Desmet. + Optimal Runge–Kutta Schemes for Discontinuous Galerkin Space Discretizations + Applied to Wave Propagation Problems. + Journal of Computational Physics, 231(4), pp 2067-2091, 2012. + doi: https://doi.org/10.1016/j.jcp.2011.11.024", + extra_keyword_description = """- `williamson_condition`: allows for an optimization that allows fusing broadcast expressions with the function call `f`. However, it only works for `Array` types. + """, + extra_keyword_default = "williamson_condition = true") +Base.@kwdef struct DGLDDRK73_C{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() + williamson_condition::Bool = true +end +# for backwards compatibility +function DGLDDRK73_C(stage_limiter!, step_limiter! = trivial_limiter!; + williamson_condition = true) + DGLDDRK73_C(stage_limiter!, + step_limiter!, + False(), + williamson_condition) +end + @doc explicit_rk_docstring( "A fourth-order, five-stage explicit low-storage method of Carpenter and Kennedy (free 3rd order Hermite interpolant). Fixed timestep only. Designed for From 4a92167d89d2cf089b50a3a387bfd4334838d152 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 20:17:56 +0530 Subject: [PATCH 36/54] SHLDDRK_2N --- lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl | 13 +++++++++++++ src/algorithms/explicit_rk_pde.jl | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl b/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl index 866d5ab640..4a940d9b6b 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl @@ -24,6 +24,19 @@ function ORK256(stage_limiter!, ORK256(stage_limiter!, step_limiter!, False(), williamson_condition) end +@doc explicit_rk_docstring("TBD", "SHLDDRK_2N") +Base.@kwdef struct SHLDDRK_2N{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SHLDDRK_2N(stage_limiter!, step_limiter! = trivial_limiter!) + SHLDDRK_2N(stage_limiter!, + step_limiter!, + False()) +end + @doc explicit_rk_docstring( "7-stage, third order low-storage low-dissipation, low-dispersion scheme for discontinuous Galerkin space discretizations applied to wave propagation problems. diff --git a/src/algorithms/explicit_rk_pde.jl b/src/algorithms/explicit_rk_pde.jl index 842c402ef1..9cae9794d9 100644 --- a/src/algorithms/explicit_rk_pde.jl +++ b/src/algorithms/explicit_rk_pde.jl @@ -320,19 +320,6 @@ function SSPRK33(stage_limiter!, step_limiter! = trivial_limiter!) step_limiter!, False()) end -@doc explicit_rk_docstring("TBD", "SHLDDRK_2N") -Base.@kwdef struct SHLDDRK_2N{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function SHLDDRK_2N(stage_limiter!, step_limiter! = trivial_limiter!) - SHLDDRK_2N(stage_limiter!, - step_limiter!, - False()) -end - @doc explicit_rk_docstring("TBD", "KYKSSPRK42") Base.@kwdef struct KYKSSPRK42{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm From c0a0dd2f80f8a2253f3fcdabc8a57b2f5b0c0813 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 20:35:07 +0530 Subject: [PATCH 37/54] SHLDDRK_2N --- lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl | 13 ------------- src/OrdinaryDiffEq.jl | 4 ++-- src/algorithms/explicit_rk_pde.jl | 13 +++++++++++++ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl b/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl index 4a940d9b6b..866d5ab640 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl @@ -24,19 +24,6 @@ function ORK256(stage_limiter!, ORK256(stage_limiter!, step_limiter!, False(), williamson_condition) end -@doc explicit_rk_docstring("TBD", "SHLDDRK_2N") -Base.@kwdef struct SHLDDRK_2N{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm - stage_limiter!::StageLimiter = trivial_limiter! - step_limiter!::StepLimiter = trivial_limiter! - thread::Thread = False() -end -# for backwards compatibility -function SHLDDRK_2N(stage_limiter!, step_limiter! = trivial_limiter!) - SHLDDRK_2N(stage_limiter!, - step_limiter!, - False()) -end - @doc explicit_rk_docstring( "7-stage, third order low-storage low-dissipation, low-dispersion scheme for discontinuous Galerkin space discretizations applied to wave propagation problems. diff --git a/src/OrdinaryDiffEq.jl b/src/OrdinaryDiffEq.jl index 1d88094ec8..2171f24575 100644 --- a/src/OrdinaryDiffEq.jl +++ b/src/OrdinaryDiffEq.jl @@ -242,8 +242,6 @@ include("../lib/OrdinaryDiffEqStabilizedRK/src/OrdinaryDiffEqStabilizedRK.jl") using ..OrdinaryDiffEqStabilizedRK export ROCK2, ROCK4, RKC, ESERK4, ESERK5, SERK2, IRKC -# SHLDDRK52 SHLDDRK_2N - include("../lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl") using ..OrdinaryDiffEqLowStorageRK export ORK256, CarpenterKennedy2N54, SHLDDRK64, HSLDDRK64, DGLDDRK73_C, DGLDDRK84_C, @@ -426,6 +424,8 @@ export SymplecticEuler, VelocityVerlet, VerletLeapfrog, PseudoVerletLeapfrog, McAte2, Ruth3, McAte3, CandyRoz4, McAte4, McAte42, McAte5, CalvoSanz4, Yoshida6, KahanLi6, McAte8, KahanLi8, SofSpa10 +export SHLDDRK52 SHLDDRK_2N + export SplitEuler export Nystrom4, FineRKN4, FineRKN5, Nystrom4VelocityIndependent, diff --git a/src/algorithms/explicit_rk_pde.jl b/src/algorithms/explicit_rk_pde.jl index 9cae9794d9..842c402ef1 100644 --- a/src/algorithms/explicit_rk_pde.jl +++ b/src/algorithms/explicit_rk_pde.jl @@ -320,6 +320,19 @@ function SSPRK33(stage_limiter!, step_limiter! = trivial_limiter!) step_limiter!, False()) end +@doc explicit_rk_docstring("TBD", "SHLDDRK_2N") +Base.@kwdef struct SHLDDRK_2N{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm + stage_limiter!::StageLimiter = trivial_limiter! + step_limiter!::StepLimiter = trivial_limiter! + thread::Thread = False() +end +# for backwards compatibility +function SHLDDRK_2N(stage_limiter!, step_limiter! = trivial_limiter!) + SHLDDRK_2N(stage_limiter!, + step_limiter!, + False()) +end + @doc explicit_rk_docstring("TBD", "KYKSSPRK42") Base.@kwdef struct KYKSSPRK42{StageLimiter, StepLimiter, Thread} <: OrdinaryDiffEqAlgorithm From d6e72dec1844ea4d25ca65445459a25510288e44 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 20:37:01 +0530 Subject: [PATCH 38/54] fixes --- src/OrdinaryDiffEq.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/OrdinaryDiffEq.jl b/src/OrdinaryDiffEq.jl index 2171f24575..67f6549d5d 100644 --- a/src/OrdinaryDiffEq.jl +++ b/src/OrdinaryDiffEq.jl @@ -394,7 +394,7 @@ export FunctionMap, Euler, Heun, Ralston, Midpoint, RK4, ExplicitRK, OwrenZen3, export SSPRK22, SSPRK33, KYKSSPRK42, SSPRK53, SSPRK53_2N1, SSPRK53_2N2, SSPRK53_H, SSPRK63, SSPRK73, SSPRK83, SSPRK43, SSPRK432, - SSPRKMSVS32, SSPRKMSVS43, SSPRK932, SSPRK54, SSPRK104 + SSPRKMSVS32, SSPRKMSVS43, SSPRK932, SSPRK54, SSPRK104, SHLDDRK52, SHLDDRK_2N export RadauIIA3, RadauIIA5 @@ -424,7 +424,6 @@ export SymplecticEuler, VelocityVerlet, VerletLeapfrog, PseudoVerletLeapfrog, McAte2, Ruth3, McAte3, CandyRoz4, McAte4, McAte42, McAte5, CalvoSanz4, Yoshida6, KahanLi6, McAte8, KahanLi8, SofSpa10 -export SHLDDRK52 SHLDDRK_2N export SplitEuler From 9674f3d7fbadc6b64f4911fe815a11ef38a32fd6 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 21:12:35 +0530 Subject: [PATCH 39/54] SHLDDRK_2N --- lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl | 2 -- src/OrdinaryDiffEq.jl | 3 ++- src/alg_utils.jl | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl b/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl index 69b77377d7..3bf95a8d65 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl @@ -42,8 +42,6 @@ alg_order(alg::CKLLSRK75_4M_5R) = 5 alg_order(alg::CKLLSRK54_3M_4R) = 4 alg_order(alg::CKLLSRK65_4M_4R) = 5 -alg_order(alg::SHLDDRK_2N) = 4 - isfsal(alg::ORK256) = false isfsal(alg::CarpenterKennedy2N54) = false isfsal(alg::DGLDDRK84_F) = false diff --git a/src/OrdinaryDiffEq.jl b/src/OrdinaryDiffEq.jl index 67f6549d5d..994e10072f 100644 --- a/src/OrdinaryDiffEq.jl +++ b/src/OrdinaryDiffEq.jl @@ -394,7 +394,7 @@ export FunctionMap, Euler, Heun, Ralston, Midpoint, RK4, ExplicitRK, OwrenZen3, export SSPRK22, SSPRK33, KYKSSPRK42, SSPRK53, SSPRK53_2N1, SSPRK53_2N2, SSPRK53_H, SSPRK63, SSPRK73, SSPRK83, SSPRK43, SSPRK432, - SSPRKMSVS32, SSPRKMSVS43, SSPRK932, SSPRK54, SSPRK104, SHLDDRK52, SHLDDRK_2N + SSPRKMSVS32, SSPRKMSVS43, SSPRK932, SSPRK54, SSPRK104 export RadauIIA3, RadauIIA5 @@ -424,6 +424,7 @@ export SymplecticEuler, VelocityVerlet, VerletLeapfrog, PseudoVerletLeapfrog, McAte2, Ruth3, McAte3, CandyRoz4, McAte4, McAte42, McAte5, CalvoSanz4, Yoshida6, KahanLi6, McAte8, KahanLi8, SofSpa10 +export SHLDDRK52, SHLDDRK_2N export SplitEuler diff --git a/src/alg_utils.jl b/src/alg_utils.jl index c7f24c2a24..4dac513354 100644 --- a/src/alg_utils.jl +++ b/src/alg_utils.jl @@ -430,6 +430,7 @@ alg_order(alg::SplitEuler) = 1 alg_order(alg::ETD2) = 2 alg_order(alg::Exprb32) = 3 alg_order(alg::Exprb43) = 4 +alg_order(alg::SHLDDRK_2N) = 4 alg_order(alg::Anas5) = 5 alg_order(alg::KuttaPRK2p5) = 5 alg_order(alg::RKO65) = 5 From 9be59e76333771f5583fe545429bcdc037272048 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 21:16:20 +0530 Subject: [PATCH 40/54] trivial_limiter! --- lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl b/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl index 866d5ab640..d5cf617e4e 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl @@ -1,5 +1,7 @@ using OrdinaryDiffEq: explicit_rk_docstring +@inline trivial_limiter!(u, integrator, p, t) = nothing + @doc explicit_rk_docstring( "A second-order, five-stage explicit Runge-Kutta method for wave propagation equations. Fixed timestep only.", "ORK256", From 46b6f00c6c907f083b7f51c5818f74efbe30fb2d Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 23:03:04 +0530 Subject: [PATCH 41/54] Static added as a dep --- Project.toml | 1 + lib/OrdinaryDiffEqLowStorageRK/Project.toml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 1c15474628..fe5528f7b1 100644 --- a/Project.toml +++ b/Project.toml @@ -40,6 +40,7 @@ SimpleNonlinearSolve = "727e6d20-b764-4bd8-a329-72de5adea6c7" SimpleUnPack = "ce78b400-467f-4804-87d8-8f486da07d0a" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" SparseDiffTools = "47a9eef4-7e08-11e9-0b38-333d64bd3804" +Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" StaticArrayInterface = "0d7ed370-da01-4f52-bd93-41d350b8b718" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" TruncatedStacktraces = "781d530d-4396-4725-bb49-402e4bee1e77" diff --git a/lib/OrdinaryDiffEqLowStorageRK/Project.toml b/lib/OrdinaryDiffEqLowStorageRK/Project.toml index 547e3c2a1c..e418603292 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/Project.toml +++ b/lib/OrdinaryDiffEqLowStorageRK/Project.toml @@ -9,6 +9,7 @@ MuladdMacro = "46d2c3a1-f734-5fdb-9937-b9b9aeba4221" OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" Polyester = "f517fe37-dbe3-4b94-8317-1923a5111588" RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" +Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" [compat] julia = "1.10" @@ -20,4 +21,4 @@ SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["DiffEqDevTools", "Random", "SafeTestsets", "Test"] \ No newline at end of file +test = ["DiffEqDevTools", "Random", "SafeTestsets", "Test"] From 751474f28c9949feb4ed64b3bb816f2031529979 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 23:10:12 +0530 Subject: [PATCH 42/54] Static fix --- lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl b/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl index d5cf617e4e..5fd69f8d08 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/algorithms.jl @@ -1,4 +1,5 @@ using OrdinaryDiffEq: explicit_rk_docstring +using Static: False @inline trivial_limiter!(u, integrator, p, t) = nothing From 13faaa6a539923648c634a84575738a7607505e0 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 24 Jun 2024 23:21:41 +0530 Subject: [PATCH 43/54] ArrayFuse --- .../src/low_storage_rk_perform_step.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_perform_step.jl b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_perform_step.jl index ff01941054..4019f6bc86 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_perform_step.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_perform_step.jl @@ -1,5 +1,7 @@ # 2N low storage methods +using OrdinaryDiffEq: ArrayFuse + function initialize!(integrator, cache::LowStorageRK2NConstantCache) integrator.fsalfirst = integrator.f(integrator.uprev, integrator.p, integrator.t) # Pre-start fsal integrator.stats.nf += 1 From 56cb6ae5fb792d10a1759f03c352b3143297b895 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Tue, 25 Jun 2024 08:07:58 +0530 Subject: [PATCH 44/54] IRKC --- src/OrdinaryDiffEq.jl | 6 +++++- src/integrators/controllers.jl | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/OrdinaryDiffEq.jl b/src/OrdinaryDiffEq.jl index 994e10072f..4fe33f2109 100644 --- a/src/OrdinaryDiffEq.jl +++ b/src/OrdinaryDiffEq.jl @@ -240,7 +240,11 @@ export AitkenNeville, ExtrapolationMidpointDeuflhard, ExtrapolationMidpointHaire include("../lib/OrdinaryDiffEqStabilizedRK/src/OrdinaryDiffEqStabilizedRK.jl") using ..OrdinaryDiffEqStabilizedRK -export ROCK2, ROCK4, RKC, ESERK4, ESERK5, SERK2, IRKC +export ROCK2, ROCK4, RKC, ESERK4, ESERK5, SERK2 + +include("..lib/OrdinaryDiffEqStabilizedIRK/src/OrdinaryDiffEqStabilizedIRK.jl") +using ..OrdinaryDiffEqStabilizedIRK +export IRKC include("../lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl") using ..OrdinaryDiffEqLowStorageRK diff --git a/src/integrators/controllers.jl b/src/integrators/controllers.jl index 1c7eeedc2d..e8949d82bd 100644 --- a/src/integrators/controllers.jl +++ b/src/integrators/controllers.jl @@ -1,3 +1,4 @@ +using OrdinaryDiffEq: IRKC, RKC, SERK2 abstract type AbstractController end From 192be8fa98364f77dae03dce370a2673476114d6 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Tue, 25 Jun 2024 08:14:53 +0530 Subject: [PATCH 45/54] IRKC fix --- src/OrdinaryDiffEq.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OrdinaryDiffEq.jl b/src/OrdinaryDiffEq.jl index 4fe33f2109..f242d274a6 100644 --- a/src/OrdinaryDiffEq.jl +++ b/src/OrdinaryDiffEq.jl @@ -242,7 +242,7 @@ include("../lib/OrdinaryDiffEqStabilizedRK/src/OrdinaryDiffEqStabilizedRK.jl") using ..OrdinaryDiffEqStabilizedRK export ROCK2, ROCK4, RKC, ESERK4, ESERK5, SERK2 -include("..lib/OrdinaryDiffEqStabilizedIRK/src/OrdinaryDiffEqStabilizedIRK.jl") +include("../lib/OrdinaryDiffEqStabilizedIRK/src/OrdinaryDiffEqStabilizedIRK.jl") using ..OrdinaryDiffEqStabilizedIRK export IRKC From c5810ec7639c62ac419415e9abbfb7994173eb20 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Tue, 25 Jun 2024 08:41:53 +0530 Subject: [PATCH 46/54] IRKC fix --- src/integrators/controllers.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/integrators/controllers.jl b/src/integrators/controllers.jl index e8949d82bd..ae694f31e9 100644 --- a/src/integrators/controllers.jl +++ b/src/integrators/controllers.jl @@ -1,6 +1,5 @@ -using OrdinaryDiffEq: IRKC, RKC, SERK2 - abstract type AbstractController end +using OrdinaryDiffEq: IRKC @inline function stepsize_controller!(integrator, alg) stepsize_controller!(integrator, integrator.opts.controller, alg) From bee45cd8bf20bdfcfcf1c78464ca3474247c9a0f Mon Sep 17 00:00:00 2001 From: Param Thakkar <128291516+ParamThakkar123@users.noreply.github.com> Date: Tue, 25 Jun 2024 09:59:27 +0530 Subject: [PATCH 47/54] Update lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl Co-authored-by: Hendrik Ranocha --- lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl b/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl index 3bf95a8d65..bfafdb28df 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl @@ -97,7 +97,6 @@ julia> ssp_coefficient(SSPRK104()) 6 ``` """ - ssp_coefficient(alg::KYK2014DGSSPRK_3S2) = 0.8417 function default_controller(alg::RDPK3Sp35, cache, qoldinit, args...) From f22f2e60e4b403bb36738b6b52163599867f7525 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Tue, 25 Jun 2024 15:57:48 +0530 Subject: [PATCH 48/54] IRKC --- src/integrators/controllers.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/integrators/controllers.jl b/src/integrators/controllers.jl index ae694f31e9..b951759da0 100644 --- a/src/integrators/controllers.jl +++ b/src/integrators/controllers.jl @@ -1,5 +1,5 @@ abstract type AbstractController end -using OrdinaryDiffEq: IRKC +using OrdinaryDiffEq @inline function stepsize_controller!(integrator, alg) stepsize_controller!(integrator, integrator.opts.controller, alg) From a7c45910193d3c391c75b97ffb6d003e05c7e284 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Wed, 26 Jun 2024 10:40:08 +0800 Subject: [PATCH 49/54] Update lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl --- .../src/OrdinaryDiffEqLowStorageRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl index 2e7481c511..83c0cb8f24 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl @@ -3,7 +3,7 @@ module OrdinaryDiffEqLowStorageRK import OrdinaryDiffEq: alg_order, alg_adaptive_order, calculate_residuals!, beta2_default, beta1_default, gamma_default, initialize!, perform_step!, @unpack, unwrap_alg, - calculate_residuals, + calculate_residuals, ssp_coefficient, OrdinaryDiffEqAlgorithm, ispredictive, OrdinaryDiffEqMutableCache, OrdinaryDiffEqConstantCache, OrdinaryDiffEqAdaptiveAlgorithm, From d8004b43f368d4e81e0c7cca695d6702cb578a58 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Wed, 26 Jun 2024 12:50:38 +0800 Subject: [PATCH 50/54] Update OrdinaryDiffEqLowStorageRK.jl --- .../src/OrdinaryDiffEqLowStorageRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl index 83c0cb8f24..71f8ab7521 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl @@ -6,7 +6,7 @@ import OrdinaryDiffEq: alg_order, alg_adaptive_order, calculate_residuals!, calculate_residuals, ssp_coefficient, OrdinaryDiffEqAlgorithm, ispredictive, OrdinaryDiffEqMutableCache, OrdinaryDiffEqConstantCache, - OrdinaryDiffEqAdaptiveAlgorithm, + OrdinaryDiffEqAdaptiveAlgorithm, uses_uprev, alg_cache, _vec, _reshape, @cache, constvalue, _unwrap_val, du_alias_or_new using DiffEqBase, FastBroadcast, Polyester, MuladdMacro, RecursiveArrayTools From 426669f15ad23242c0601a6d6cff4d6fce69f025 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Thu, 27 Jun 2024 01:52:23 +0800 Subject: [PATCH 51/54] Update OrdinaryDiffEqLowStorageRK.jl --- .../src/OrdinaryDiffEqLowStorageRK.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl index 71f8ab7521..3d9fd4950a 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl @@ -7,7 +7,8 @@ import OrdinaryDiffEq: alg_order, alg_adaptive_order, calculate_residuals!, OrdinaryDiffEqAlgorithm, ispredictive, OrdinaryDiffEqMutableCache, OrdinaryDiffEqConstantCache, OrdinaryDiffEqAdaptiveAlgorithm, uses_uprev, - alg_cache, _vec, _reshape, @cache, + default_controller, + alg_cache, _vec, _reshape, @cache, isfsal, constvalue, _unwrap_val, du_alias_or_new using DiffEqBase, FastBroadcast, Polyester, MuladdMacro, RecursiveArrayTools import StaticArrays: SArray, MVector, SVector, @SVector, StaticArray, MMatrix, SA From 86c78d9fdba765378633b95de3208669e70db508 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Wed, 26 Jun 2024 23:42:22 +0530 Subject: [PATCH 52/54] Moved --- .../src/OrdinaryDiffEqLowStorageRK.jl | 2 +- .../src/low_storage_rk_perform_step.jl | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl index 3d9fd4950a..6f0f921b32 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl @@ -9,7 +9,7 @@ import OrdinaryDiffEq: alg_order, alg_adaptive_order, calculate_residuals!, OrdinaryDiffEqAdaptiveAlgorithm, uses_uprev, default_controller, alg_cache, _vec, _reshape, @cache, isfsal, - constvalue, _unwrap_val, du_alias_or_new + constvalue, _unwrap_val, du_alias_or_new, ArrayFuse using DiffEqBase, FastBroadcast, Polyester, MuladdMacro, RecursiveArrayTools import StaticArrays: SArray, MVector, SVector, @SVector, StaticArray, MMatrix, SA diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_perform_step.jl b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_perform_step.jl index 4019f6bc86..018401ff3b 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_perform_step.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/low_storage_rk_perform_step.jl @@ -1,7 +1,4 @@ - # 2N low storage methods -using OrdinaryDiffEq: ArrayFuse - function initialize!(integrator, cache::LowStorageRK2NConstantCache) integrator.fsalfirst = integrator.f(integrator.uprev, integrator.p, integrator.t) # Pre-start fsal integrator.stats.nf += 1 From ed0d4a4f347f0d406f7578327c4a00ab679e3a45 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Thu, 27 Jun 2024 05:40:15 +0800 Subject: [PATCH 53/54] Update lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl --- .../src/OrdinaryDiffEqLowStorageRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl index 6f0f921b32..e26838a4b7 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl @@ -7,7 +7,7 @@ import OrdinaryDiffEq: alg_order, alg_adaptive_order, calculate_residuals!, OrdinaryDiffEqAlgorithm, ispredictive, OrdinaryDiffEqMutableCache, OrdinaryDiffEqConstantCache, OrdinaryDiffEqAdaptiveAlgorithm, uses_uprev, - default_controller, + default_controller, PIDController, alg_cache, _vec, _reshape, @cache, isfsal, constvalue, _unwrap_val, du_alias_or_new, ArrayFuse using DiffEqBase, FastBroadcast, Polyester, MuladdMacro, RecursiveArrayTools From c24a65e47936ff2a0db485ca88c88be0cb25f9c4 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Thu, 27 Jun 2024 06:13:32 +0800 Subject: [PATCH 54/54] Update OrdinaryDiffEqLowStorageRK.jl --- .../src/OrdinaryDiffEqLowStorageRK.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl index e26838a4b7..d50fa8c3d1 100644 --- a/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl +++ b/lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl @@ -8,12 +8,11 @@ import OrdinaryDiffEq: alg_order, alg_adaptive_order, calculate_residuals!, OrdinaryDiffEqMutableCache, OrdinaryDiffEqConstantCache, OrdinaryDiffEqAdaptiveAlgorithm, uses_uprev, default_controller, PIDController, - alg_cache, _vec, _reshape, @cache, isfsal, + alg_cache, _vec, _reshape, @cache, isfsal, full_cache, constvalue, _unwrap_val, du_alias_or_new, ArrayFuse using DiffEqBase, FastBroadcast, Polyester, MuladdMacro, RecursiveArrayTools import StaticArrays: SArray, MVector, SVector, @SVector, StaticArray, MMatrix, SA - include("algorithms.jl") include("alg_utils.jl") include("low_storage_rk_caches.jl")