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 Low Storage RK methods #2256

Merged
merged 56 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
ef251c6
Added a separate package for Low Storage RK methods
ParamThakkar123 Jun 23, 2024
e8d6af4
Some changes
ParamThakkar123 Jun 23, 2024
7d048f7
Fixes
ParamThakkar123 Jun 23, 2024
347801b
fixes
ParamThakkar123 Jun 23, 2024
56c4ed0
Update
ParamThakkar123 Jun 23, 2024
06b1946
Update
ParamThakkar123 Jun 23, 2024
1482b4e
alg_utils.jl
ParamThakkar123 Jun 23, 2024
e5aca19
Undef Error solve
ParamThakkar123 Jun 23, 2024
9e2db24
Rebased commits
ParamThakkar123 Jun 24, 2024
167cf6e
Merge branch 'master' into master
ParamThakkar123 Jun 24, 2024
cbadbd1
RK46NL
ParamThakkar123 Jun 24, 2024
7886c45
Fix RK46NL
ParamThakkar123 Jun 24, 2024
ef59fa2
RK46NL
ParamThakkar123 Jun 24, 2024
3d727cb
RK46NL
ParamThakkar123 Jun 24, 2024
b636cb4
RK46NL
ParamThakkar123 Jun 24, 2024
9e42573
SSPRK
ParamThakkar123 Jun 24, 2024
a656bbe
SSPRK fixes
ParamThakkar123 Jun 24, 2024
1037feb
SSPRK53_2N1
ParamThakkar123 Jun 24, 2024
85f1766
KYKSSPRK42 fixes
ParamThakkar123 Jun 24, 2024
9e6a75f
SHLDDRK_2N
ParamThakkar123 Jun 24, 2024
e1c46f7
RK46NLCache
ParamThakkar123 Jun 24, 2024
67f2b1f
RK46NLConstantCache
ParamThakkar123 Jun 24, 2024
8bee104
KYK2014DGSSPRK_3S2_Cache
ParamThakkar123 Jun 24, 2024
10e2f0b
SVector
ParamThakkar123 Jun 24, 2024
1ac3caa
ORK256 fix
ParamThakkar123 Jun 24, 2024
6d05af6
ORK256 fix
ParamThakkar123 Jun 24, 2024
5116903
Update lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl
ParamThakkar123 Jun 24, 2024
86dd065
Update lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl
ParamThakkar123 Jun 24, 2024
bc8f1fa
Update lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl
ParamThakkar123 Jun 24, 2024
b2e1e25
Update lib/OrdinaryDiffEqLowStorageRK/Project.toml
ParamThakkar123 Jun 24, 2024
50bf6c3
Added tests
ParamThakkar123 Jun 24, 2024
2fa058e
Update lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl
ChrisRackauckas Jun 24, 2024
ab0c0a7
explicit_rk_docstring
ParamThakkar123 Jun 24, 2024
7a54a84
Fixes
ParamThakkar123 Jun 24, 2024
513fcff
Docstring
ParamThakkar123 Jun 24, 2024
6cde747
DGLDDRK73_C
ParamThakkar123 Jun 24, 2024
4a92167
SHLDDRK_2N
ParamThakkar123 Jun 24, 2024
c0a0dd2
SHLDDRK_2N
ParamThakkar123 Jun 24, 2024
d6e72de
fixes
ParamThakkar123 Jun 24, 2024
9674f3d
SHLDDRK_2N
ParamThakkar123 Jun 24, 2024
9be59e7
trivial_limiter!
ParamThakkar123 Jun 24, 2024
46b6f00
Static added as a dep
ParamThakkar123 Jun 24, 2024
751474f
Static fix
ParamThakkar123 Jun 24, 2024
13faaa6
ArrayFuse
ParamThakkar123 Jun 24, 2024
56cb6ae
IRKC
ParamThakkar123 Jun 25, 2024
192be8f
IRKC fix
ParamThakkar123 Jun 25, 2024
c5810ec
IRKC fix
ParamThakkar123 Jun 25, 2024
bee45cd
Update lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl
ParamThakkar123 Jun 25, 2024
f22f2e6
IRKC
ParamThakkar123 Jun 25, 2024
a7c4591
Update lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl
ChrisRackauckas Jun 26, 2024
d8004b4
Update OrdinaryDiffEqLowStorageRK.jl
ChrisRackauckas Jun 26, 2024
426669f
Update OrdinaryDiffEqLowStorageRK.jl
ChrisRackauckas Jun 26, 2024
68d064c
Merge branch 'master' of https://github.com/SciML/OrdinaryDiffEq.jl
ParamThakkar123 Jun 26, 2024
86c78d9
Moved
ParamThakkar123 Jun 26, 2024
ed0d4a4
Update lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl
ChrisRackauckas Jun 26, 2024
c24a65e
Update OrdinaryDiffEqLowStorageRK.jl
ChrisRackauckas Jun 26, 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
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
24 changes: 24 additions & 0 deletions lib/OrdinaryDiffEqLowStorageRK/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name = "OrdinaryDiffEqLowStorageRK"
uuid = "b0944070-b475-4768-8dec-fb6eb410534d"
ParamThakkar123 marked this conversation as resolved.
Show resolved Hide resolved
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"
Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"

[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"]
33 changes: 33 additions & 0 deletions lib/OrdinaryDiffEqLowStorageRK/src/OrdinaryDiffEqLowStorageRK.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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, ssp_coefficient,
OrdinaryDiffEqAlgorithm, ispredictive,
OrdinaryDiffEqMutableCache, OrdinaryDiffEqConstantCache,
OrdinaryDiffEqAdaptiveAlgorithm, uses_uprev,
default_controller, PIDController,
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")
include("low_storage_rk_perform_step.jl")

export ORK256, CarpenterKennedy2N54, SHLDDRK64, HSLDDRK64, DGLDDRK73_C, DGLDDRK84_C,
DGLDDRK84_F, NDBLSRK124, NDBLSRK134, NDBLSRK144,
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,
ParsaniKetchesonDeconinck3S53, ParsaniKetchesonDeconinck3S173,
ParsaniKetchesonDeconinck3S94, ParsaniKetchesonDeconinck3S184,
ParsaniKetchesonDeconinck3S105, ParsaniKetchesonDeconinck3S205,
RDPK3Sp35, RDPK3SpFSAL35, RDPK3Sp49, RDPK3SpFSAL49, RDPK3Sp510, RDPK3SpFSAL510,
KYK2014DGSSPRK_3S2, RK46NL
end
130 changes: 130 additions & 0 deletions lib/OrdinaryDiffEqLowStorageRK/src/alg_utils.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
alg_order(alg::KYK2014DGSSPRK_3S2) = 2
alg_order(alg::ORK256) = 2
alg_order(alg::CarpenterKennedy2N54) = 4
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

isfsal(alg::ORK256) = false
isfsal(alg::CarpenterKennedy2N54) = 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

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::KYK2014DGSSPRK_3S2) = 0.8417

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
Loading
Loading