Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added SSPRK methods #2264

Merged
merged 56 commits into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
ab0d13f
Added SSPRK methods
ParamThakkar123 Jun 27, 2024
04c11cf
Updates
ParamThakkar123 Jun 27, 2024
0610d65
Updates
ParamThakkar123 Jun 27, 2024
c9128bd
Updates
ParamThakkar123 Jun 27, 2024
3cb123d
Made changes
ParamThakkar123 Jun 27, 2024
337aade
Update lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl
ParamThakkar123 Jun 27, 2024
d8673e9
Update lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl
ParamThakkar123 Jun 27, 2024
4e2f8f0
Update lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl
ParamThakkar123 Jun 27, 2024
063dd28
Update lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl
ParamThakkar123 Jun 27, 2024
0e7c6a5
Update lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl
ParamThakkar123 Jun 27, 2024
bdcf2db
Changes
ParamThakkar123 Jun 27, 2024
030c455
Merge branch 'master' of https://github.com/ParamThakkar123/OrdinaryD…
ParamThakkar123 Jun 27, 2024
2f1f172
Update Project.toml
ChrisRackauckas Jun 27, 2024
1e9011b
Added SSPRK methods
ParamThakkar123 Jun 27, 2024
34a6d2c
Updates
ParamThakkar123 Jun 27, 2024
dabdd1b
Updates
ParamThakkar123 Jun 27, 2024
563e6a3
Updates
ParamThakkar123 Jun 27, 2024
7faa727
Made changes
ParamThakkar123 Jun 27, 2024
a93f3aa
Changes
ParamThakkar123 Jun 27, 2024
edbe42c
Update lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl
ParamThakkar123 Jun 27, 2024
858323e
Update lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl
ParamThakkar123 Jun 27, 2024
36d85cd
Update lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl
ParamThakkar123 Jun 27, 2024
0794cfa
Update lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl
ParamThakkar123 Jun 27, 2024
4778b76
Update lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl
ParamThakkar123 Jun 27, 2024
33d2139
Merge branch 'master' of https://github.com/ParamThakkar123/OrdinaryD…
ParamThakkar123 Jun 27, 2024
b27ad8e
SSPRK22
ParamThakkar123 Jun 27, 2024
e555aba
SSPRK22
ParamThakkar123 Jun 27, 2024
bc23804
SSPRK22 fix
ParamThakkar123 Jun 28, 2024
c91b65a
SSPRK22 fix
ParamThakkar123 Jun 28, 2024
b56c4c0
SSPRK fix
ParamThakkar123 Jun 28, 2024
8adc9ab
SSPRK22 fix
ParamThakkar123 Jun 28, 2024
5b8f9e6
Functions moved
ParamThakkar123 Jun 28, 2024
2e59595
Changes
ParamThakkar123 Jun 28, 2024
4422396
Changes
ParamThakkar123 Jun 28, 2024
344e73a
moved SSPRK caches
ParamThakkar123 Jun 28, 2024
9a60cb3
moved SSPRK caches
ParamThakkar123 Jun 28, 2024
b5d47dd
Fixes
ParamThakkar123 Jun 28, 2024
a79058a
Fixes
ParamThakkar123 Jun 28, 2024
9ff225b
Fixes
ParamThakkar123 Jun 28, 2024
406d44e
Fixes
ParamThakkar123 Jun 28, 2024
a26ece8
Fixes
ParamThakkar123 Jun 28, 2024
f2db85d
Fixes
ParamThakkar123 Jun 28, 2024
0407172
fixes
ParamThakkar123 Jun 28, 2024
66022f9
Fixes
ParamThakkar123 Jun 28, 2024
7db2827
Fixes
ParamThakkar123 Jun 28, 2024
f9598b5
Fixes
ParamThakkar123 Jun 28, 2024
905fa9a
Fixes
ParamThakkar123 Jun 28, 2024
34da85a
SSPRK Algos
ParamThakkar123 Jun 28, 2024
799cf91
SSPRK Algos
ParamThakkar123 Jun 28, 2024
d1a778b
Fixes
ParamThakkar123 Jun 28, 2024
21b4da6
trivial limiter fix
ParamThakkar123 Jun 28, 2024
d352c52
Fixes
ParamThakkar123 Jun 28, 2024
9d70c93
False Fix
ParamThakkar123 Jun 28, 2024
881deab
Changes
ParamThakkar123 Jun 29, 2024
00f2fd5
Update OrdinaryDiffEqSSPRK.jl
ChrisRackauckas Jun 29, 2024
90aac04
imports
ChrisRackauckas Jun 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/OrdinaryDiffEqLowStorageRK/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
using SafeTestsets

@time @safetestset "Extrapolation Tests" include("ode_low_storage_rk_tests.jl")
@time @safetestset "Low Storage RK Tests" include("ode_low_storage_rk_tests.jl")
23 changes: 23 additions & 0 deletions lib/OrdinaryDiffEqSSPRK/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name = "OrdinaryDiffEqSSPRK"
uuid = "669c94d9-1f4b-4b64-b377-1aa079aa2388"
authors = ["ParamThakkar123 <[email protected]>"]
version = "1.0.0"

[deps]
FastBroadcast = "7034ab61-46d4-4ed7-9d0f-46aef9175898"
MuladdMacro = "46d2c3a1-f734-5fdb-9937-b9b9aeba4221"
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"]
25 changes: 25 additions & 0 deletions lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module OrdinaryDiffEqSSPRK

import OrdinaryDiffEq: alg_order, alg_adaptive_order, calculate_residuals!,
ParamThakkar123 marked this conversation as resolved.
Show resolved Hide resolved
beta2_default, beta1_default, gamma_default,
ParamThakkar123 marked this conversation as resolved.
Show resolved Hide resolved
initialize!, perform_step!, @unpack, unwrap_alg,
calculate_residuals, ssp_coefficient,
OrdinaryDiffEqAlgorithm, ispredictive,
ParamThakkar123 marked this conversation as resolved.
Show resolved Hide resolved
OrdinaryDiffEqMutableCache, OrdinaryDiffEqConstantCache,
OrdinaryDiffEqAdaptiveAlgorithm, uses_uprev,
default_controller, PIDController,
ParamThakkar123 marked this conversation as resolved.
Show resolved Hide resolved
alg_cache, _vec, _reshape, @cache, isfsal, full_cache,
constvalue, _unwrap_val, du_alias_or_new, ArrayFuse
ParamThakkar123 marked this conversation as resolved.
Show resolved Hide resolved
using DiffEqBase, FastBroadcast, Polyester, MuladdMacro, RecursiveArrayTools
import StaticArrays: SArray, MVector, SVector, @SVector, StaticArray, MMatrix, SA

include("alg_utils.jl")
include("algorithms.jl")
include("ssprk_caches.jl")
include("ssprk_perform_step.jl")

export SSPRK53_2N2, SSPRK22, SSPRK53, SSPRK63, SSPRK83, SSPRK43, SSPRK432, SSPRKMSVS32,
SSPRK54, SSPRK53_2N1, SSPRK104, SSPRK932, SSPRKMSVS43, SSPRK73, SSPRK53_H,
SSPRK33, SHLDDRK_2N, KYKSSPRK42, SHLDDRK52

end
52 changes: 52 additions & 0 deletions lib/OrdinaryDiffEqSSPRK/src/alg_utils.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
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

alg_order(alg::KYKSSPRK42) = 2
alg_order(alg::SSPRKMSVS32) = 2
alg_order(alg::SSPRK33) = 3
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::SHLDDRK_2N) = 4
alg_order(alg::SHLDDRK52) = 2

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
ssp_coefficient(alg::KYKSSPRK42) = 2.459
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -1704,4 +1704,4 @@ end
stage_limiter!(u, integrator, p, t + dt)
step_limiter!(u, integrator, p, t + dt)
integrator.stats.nf += 10
end
end
3 changes: 3 additions & 0 deletions lib/OrdinaryDiffEqSSPRK/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using SafeTestsets

@time @safetestset "SSPRK Tests" include("ode_ssprk_tests.jl")
13 changes: 6 additions & 7 deletions src/OrdinaryDiffEq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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/ssprk_caches.jl")
include("caches/feagin_caches.jl")
include("caches/verner_caches.jl")
include("caches/sdirk_caches.jl")
Expand Down Expand Up @@ -198,7 +196,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/ssprk_perform_step.jl")
include("perform_step/sdirk_perform_step.jl")
include("perform_step/kencarp_kvaerno_perform_step.jl")
include("perform_step/firk_perform_step.jl")
Expand Down Expand Up @@ -262,6 +259,12 @@ export ORK256, CarpenterKennedy2N54, SHLDDRK64, HSLDDRK64, DGLDDRK73_C, DGLDDRK8
RDPK3Sp35, RDPK3SpFSAL35, RDPK3Sp49, RDPK3SpFSAL49, RDPK3Sp510, RDPK3SpFSAL510,
KYK2014DGSSPRK_3S2, RK46NL

include("../lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl")
using ..OrdinaryDiffEqSSPRK
export SSPRK53_2N2, SSPRK22, SSPRK53, SSPRK63, SSPRK83, SSPRK43, SSPRK432, SSPRKMSVS32,
SSPRK54, SSPRK53_2N1, SSPRK104, SSPRK932, SSPRKMSVS43, SSPRK73, SSPRK53_H,
SSPRK33, SHLDDRK_2N, KYKSSPRK42, SHLDDRK52

import PrecompileTools

PrecompileTools.@compile_workload begin
Expand Down Expand Up @@ -398,10 +401,6 @@ export FunctionMap, Euler, Heun, Ralston, Midpoint, RK4, ExplicitRK, OwrenZen3,
Vern9, Feagin10, Feagin12, Feagin14, CompositeAlgorithm, Anas5, RKO65, FRK65, PFRK87,
RKM, MSRK5, MSRK6, Stepanov5, SIR54, QPRK98, PSRK4p7q6, PSRK3p6q5, PSRK3p5q4

export SSPRK22, SSPRK33, KYKSSPRK42, SSPRK53, SSPRK53_2N1, SSPRK53_2N2, SSPRK53_H, SSPRK63,
SSPRK73, SSPRK83, SSPRK43, SSPRK432,
SSPRKMSVS32, SSPRKMSVS43, SSPRK932, SSPRK54, SSPRK104

export RadauIIA3, RadauIIA5

export ImplicitEuler, ImplicitMidpoint, Trapezoid, TRBDF2, SDIRK2, SDIRK22,
Expand Down
50 changes: 0 additions & 50 deletions src/alg_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,6 @@ 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
Expand Down Expand Up @@ -414,9 +400,6 @@ 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
alg_order(alg::ETDRK2) = 2
alg_order(alg::ETDRK3) = 3
Expand All @@ -433,7 +416,6 @@ 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
Expand Down Expand Up @@ -550,20 +532,6 @@ 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
Expand Down Expand Up @@ -602,7 +570,6 @@ 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
Expand Down Expand Up @@ -748,23 +715,6 @@ 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
ssp_coefficient(alg::KYKSSPRK42) = 2.459

# We shouldn't do this probably.
#ssp_coefficient(alg::ImplicitEuler) = Inf
Expand Down
23 changes: 21 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,24 @@ function activate_stabilized_rk()
Pkg.instantiate()
end

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

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

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

#Start Test Script

@time begin
Expand Down Expand Up @@ -164,8 +176,6 @@ end
end

if !is_APPVEYOR && GROUP == "AlgConvergence_II"
@time @safetestset "SSPRK Tests" include("algconvergence/ode_ssprk_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("../lib/OrdinaryDiffEqStabilizedRK/test/rkc_tests.jl")
end
Expand Down Expand Up @@ -194,6 +204,15 @@ end
@time @safetestset "StabilizedIRK Tests" include("../lib/OrdinaryDiffEqStabilizedIRK/test/runtests.jl")
end

if !is_APPVEYOR && GROUP == "SSPRK"
@time @safetestset "SSPRK Tests" include("../lib/OrdinaryDiffEqSSPRK/test/ode_ssprk_tests.jl")
end

if !is_APPVEYOR && GROUP == "Low Storage RK"
@time @safetestset "Low Storage RK Tests" include("../lib/OrdinaryDiffEqLowStorageRK/test/ode_low_storage_rk_tests.jl")
end


if !is_APPVEYOR && GROUP == "Downstream"
activate_downstream_env()
@time @safetestset "DelayDiffEq Tests" include("downstream/delaydiffeq.jl")
Expand Down
Loading