Skip to content

Commit 873d81a

Browse files
Merge #164
164: Add background info for ODE solvers r=dennisYatunin a=dennisYatunin Co-authored-by: Dennis Yatunin <[email protected]>
2 parents d87d6dc + fe92581 commit 873d81a

File tree

9 files changed

+321
-17
lines changed

9 files changed

+321
-17
lines changed

docs/make.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ bib = CitationBibliography(joinpath(@__DIR__, "refs.bib"))
99
#! format: off
1010
pages = [
1111
"index.md",
12+
"Background Information" => [
13+
"ODE Solvers" => "background/ode_solvers.md",
14+
"Newtons Method" => "background/newtons_method.md",
15+
],
1216
"Algorithm formulations" => [
1317
"algo_formulations/lsrk.md",
1418
"algo_formulations/ssprk.md",
1519
"algo_formulations/ark.md",
1620
"algo_formulations/mrrk.md",
1721
],
18-
"Non-linear solvers" => [
19-
"Formulation" => "nl_solvers/formulation.md",
20-
"Newtons method" => "nl_solvers/newtons_method.md",
21-
],
2222
"Test problems" => [
2323
"test_problems/index.md",
2424
],

docs/refs.bib

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,3 +215,20 @@ @article{RobertsSarsharSandu2018arxiv
215215
journal={arXiv preprint arXiv:1812.00808},
216216
year={2019}
217217
}
218+
219+
@article{GTS2014,
220+
title={Optimization-based limiters for the spectral element method},
221+
author={Guba, Oksana and Taylor, Mark and St-Cyr, Amik},
222+
journal={Journal of computational physics},
223+
volume={267},
224+
pages={176--195},
225+
year={2014},
226+
doi={10.1016/j.jcp.2014.02.029},
227+
}
228+
229+
@article{HR2018arxiv,
230+
title={New third order low-storage SSP explicit Runge-Kutta methods},
231+
author={Higueras, Inmaculada and Roldán, Teo},
232+
journal={arXiv preprint arXiv:1809.04807},
233+
year={2018},
234+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Newton's Method
2+
3+
TODO: fill out

docs/src/background/ode_solvers.md

Lines changed: 294 additions & 0 deletions
Large diffs are not rendered by default.

docs/src/nl_solvers/formulation.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/src/nl_solvers/newtons_method.md

Whitespace-only changes.

src/functions.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import DiffEqBase
22
export ClimaODEFunction, ForwardEulerODEFunction
33

4-
Base.@kwdef struct ClimaODEFunction{TL, TE, TI, L, D, S} <: DiffEqBase.AbstractODEFunction{true}
4+
Base.@kwdef struct ClimaODEFunction{TL, TE, TI, L, D} <: DiffEqBase.AbstractODEFunction{true}
55
T_lim!::TL = nothing # nothing or (uₜ, u, p, t) -> ...
66
T_exp!::TE = nothing # nothing or (uₜ, u, p, t) -> ...
77
T_imp!::TI = nothing # nothing or (uₜ, u, p, t) -> ...
88
lim!::L = (u, p, t, u_ref) -> nothing
99
dss!::D = (u, p, t) -> nothing
10-
stage_callback!::S = (u, p, t) -> nothing
1110
end
1211

1312
# Don't wrap a ClimaODEFunction in an ODEFunction (makes ODEProblem work).

src/solvers/imex_ark.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ end
4545
function step_u!(integrator, cache::IMEXARKCache)
4646
(; u, p, t, dt, sol, alg) = integrator
4747
(; f) = sol.prob
48-
(; T_lim!, T_exp!, T_imp!, lim!, dss!, stage_callback!) = f
48+
(; T_lim!, T_exp!, T_imp!, lim!, dss!) = f
4949
(; name, tableau, newtons_method) = alg
5050
(; a_exp, b_exp, a_imp, b_imp, c_exp, c_imp) = tableau
5151
(; U, T_lim, T_exp, T_imp, temp, γ, newtons_method_cache) = cache
@@ -125,8 +125,6 @@ function step_u!(integrator, cache::IMEXARKCache)
125125
end
126126
end
127127

128-
stage_callback!(U[i], p, t_exp)
129-
130128
if !all(iszero, a_exp[:, i]) || !iszero(b_exp[i])
131129
if !isnothing(T_lim!)
132130
T_lim!(T_lim[i], U[i], p, t_exp)

src/solvers/imex_ssp.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ end
5454
function step_u!(integrator, cache::IMEXSSPRKCache)
5555
(; u, p, t, dt, sol, alg) = integrator
5656
(; f) = sol.prob
57-
(; T_lim!, T_exp!, T_imp!, lim!, dss!, stage_callback!) = f
57+
(; T_lim!, T_exp!, T_imp!, lim!, dss!) = f
5858
(; name, tableau, newtons_method) = alg
5959
(; a_imp, b_imp, c_exp, c_imp) = tableau
6060
(; U, U_lim, U_exp, T_lim, T_exp, T_imp, temp, β, γ, newtons_method_cache) = cache
@@ -134,8 +134,6 @@ function step_u!(integrator, cache::IMEXSSPRKCache)
134134
end
135135
end
136136

137-
stage_callback!(U, p, t_exp)
138-
139137
if !iszero(β[i])
140138
if !isnothing(T_lim!)
141139
T_lim!(T_lim, U, p, t_exp)

0 commit comments

Comments
 (0)