Skip to content

Commit

Permalink
Format & Comment custom integrators (#2218)
Browse files Browse the repository at this point in the history
* Format & Comment custom integrators

* Update src/time_integration/methods_2N.jl

Co-authored-by: Joshua Lampert <[email protected]>

---------

Co-authored-by: Joshua Lampert <[email protected]>
  • Loading branch information
DanielDoehring and JoshuaLampert authored Jan 8, 2025
1 parent a1be62b commit 679e4c7
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 16 deletions.
18 changes: 12 additions & 6 deletions src/semidiscretization/semidiscretization_euler_gravity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -360,15 +360,21 @@ end
function timestep_gravity_carpenter_kennedy_erk54_2N!(cache, u_euler, tau, dtau,
gravity_parameters, semi_gravity)
# Coefficients for Carpenter's 5-stage 4th-order low-storage Runge-Kutta method
a = SVector(0.0, 567301805773.0 / 1357537059087.0,
a = SVector(0.0,
567301805773.0 / 1357537059087.0,
2404267990393.0 / 2016746695238.0,
3550918686646.0 / 2091501179385.0, 1275806237668.0 / 842570457699.0)
b = SVector(1432997174477.0 / 9575080441755.0, 5161836677717.0 / 13612068292357.0,
1720146321549.0 / 2090206949498.0, 3134564353537.0 / 4481467310338.0,
3550918686646.0 / 2091501179385.0,
1275806237668.0 / 842570457699.0)
b = SVector(1432997174477.0 / 9575080441755.0,
5161836677717.0 / 13612068292357.0,
1720146321549.0 / 2090206949498.0,
3134564353537.0 / 4481467310338.0,
2277821191437.0 / 14882151754819.0)
c = SVector(0.0, 1432997174477.0 / 9575080441755.0,
c = SVector(0.0,
1432997174477.0 / 9575080441755.0,
2526269341429.0 / 6820363962896.0,
2006345519317.0 / 3224310063776.0, 2802321613138.0 / 2924317926251.0)
2006345519317.0 / 3224310063776.0,
2802321613138.0 / 2924317926251.0)

timestep_gravity_2N!(cache, u_euler, tau, dtau, gravity_parameters, semi_gravity,
a, b, c)
Expand Down
24 changes: 18 additions & 6 deletions src/time_integration/methods_2N.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ abstract type SimpleAlgorithm2N end
The following structures and methods provide a minimal implementation of
the low-storage explicit Runge-Kutta method of
Carpenter, Kennedy (1994) Fourth order 2N storage RK schemes, Solution 3
- Carpenter, Kennedy (1994)
Fourth-order 2N-storage Runge-Kutta schemes (Solution 3)
URL: https://ntrs.nasa.gov/citations/19940028444
File: https://ntrs.nasa.gov/api/citations/19940028444/downloads/19940028444.pdf
using the same interface as OrdinaryDiffEq.jl.
"""
Expand All @@ -24,15 +27,18 @@ struct CarpenterKennedy2N54 <: SimpleAlgorithm2N
c::SVector{5, Float64}

function CarpenterKennedy2N54()
a = SVector(0.0, 567301805773.0 / 1357537059087.0,
a = SVector(0.0,
567301805773.0 / 1357537059087.0,
2404267990393.0 / 2016746695238.0,
3550918686646.0 / 2091501179385.0, 1275806237668.0 / 842570457699.0)
3550918686646.0 / 2091501179385.0,
1275806237668.0 / 842570457699.0)
b = SVector(1432997174477.0 / 9575080441755.0,
5161836677717.0 / 13612068292357.0,
1720146321549.0 / 2090206949498.0,
3134564353537.0 / 4481467310338.0,
2277821191437.0 / 14882151754819.0)
c = SVector(0.0, 1432997174477.0 / 9575080441755.0,
c = SVector(0.0,
1432997174477.0 / 9575080441755.0,
2526269341429.0 / 6820363962896.0,
2006345519317.0 / 3224310063776.0,
2802321613138.0 / 2924317926251.0)
Expand All @@ -42,9 +48,15 @@ struct CarpenterKennedy2N54 <: SimpleAlgorithm2N
end

"""
CarpenterKennedy2N43()
CarpenterKennedy2N43()
Carpenter, Kennedy (1994) Third order 2N storage RK schemes with error control
The following structures and methods provide a minimal implementation of
the low-storage explicit Runge-Kutta method of
- Carpenter, Kennedy (1994)
Third-order 2N-storage Runge-Kutta schemes with error control
URL: https://ntrs.nasa.gov/citations/19940028444
File: https://ntrs.nasa.gov/api/citations/19940028444/downloads/19940028444.pdf
"""
struct CarpenterKennedy2N43 <: SimpleAlgorithm2N
a::SVector{4, Float64}
Expand Down
8 changes: 4 additions & 4 deletions src/time_integration/methods_3Sstar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ end
"""
ParsaniKetchesonDeconinck3Sstar94()
Parsani, Ketcheson, Deconinck (2013)
- Parsani, Ketcheson, Deconinck (2013)
Optimized explicit RK schemes for the spectral difference method applied to wave propagation problems
[DOI: 10.1137/120885899](https://doi.org/10.1137/120885899)
[DOI: 10.1137/120885899](https://doi.org/10.1137/120885899)
"""
struct ParsaniKetchesonDeconinck3Sstar94 <: SimpleAlgorithm3Sstar
gamma1::SVector{9, Float64}
Expand Down Expand Up @@ -100,9 +100,9 @@ end
"""
ParsaniKetchesonDeconinck3Sstar32()
Parsani, Ketcheson, Deconinck (2013)
- Parsani, Ketcheson, Deconinck (2013)
Optimized explicit RK schemes for the spectral difference method applied to wave propagation problems
[DOI: 10.1137/120885899](https://doi.org/10.1137/120885899)
[DOI: 10.1137/120885899](https://doi.org/10.1137/120885899)
"""
struct ParsaniKetchesonDeconinck3Sstar32 <: SimpleAlgorithm3Sstar
gamma1::SVector{3, Float64}
Expand Down

0 comments on commit 679e4c7

Please sign in to comment.