Skip to content

Commit 20dde2b

Browse files
JoshuaLampertgithub-actions[bot]ranocha
authored
Use ode_default_options() consistently (#2286)
* use ode_default_options() consistently in examples * also replace in test * same for docs * same for markdown files in docs * same for benchmark * replace commas by semicolons to separate positional args from kwargs * Update docs/literate/src/files/DGMulti_1.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update examples/dgmulti_1d/elixir_euler_fdsbp_periodic.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update examples/dgmulti_1d/elixir_euler_flux_diff.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update examples/dgmulti_2d/elixir_euler_fdsbp_periodic.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * format * manually fix some semicolons * fix some more semicolons manually * fix semicolon in restart examples * some more manual fixes * another manual fix * manual semicolon fixes * Apply suggestions from code review Co-authored-by: Hendrik Ranocha <[email protected]> * Apply suggestions from code review Co-authored-by: Hendrik Ranocha <[email protected]> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Hendrik Ranocha <[email protected]>
1 parent f47c5ed commit 20dde2b

File tree

366 files changed

+752
-733
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

366 files changed

+752
-733
lines changed

benchmark/elixir_2d_euler_vortex_p4est.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback)
7979
###############################################################################
8080
# run the simulation
8181

82-
sol = solve(ode, BS3(),
83-
save_everystep = false, callback = callbacks);
82+
sol = solve(ode, BS3();
83+
ode_default_options()..., callback = callbacks);
8484
summary_callback() # print the timer summary

benchmark/elixir_2d_euler_vortex_structured.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@ callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback)
7878
###############################################################################
7979
# run the simulation
8080

81-
sol = solve(ode, BS3(),
82-
save_everystep = false, callback = callbacks);
81+
sol = solve(ode, BS3();
82+
ode_default_options()..., callback = callbacks);
8383
summary_callback() # print the timer summary

benchmark/elixir_2d_euler_vortex_tree.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback)
7979
###############################################################################
8080
# run the simulation
8181

82-
sol = solve(ode, BS3(),
83-
save_everystep = false, callback = callbacks);
82+
sol = solve(ode, BS3();
83+
ode_default_options()..., callback = callbacks);
8484
summary_callback() # print the timer summary

benchmark/elixir_2d_euler_vortex_unstructured.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@ callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback)
7878
###############################################################################
7979
# run the simulation
8080

81-
sol = solve(ode, BS3(),
82-
save_everystep = false, callback = callbacks);
81+
sol = solve(ode, BS3();
82+
ode_default_options()..., callback = callbacks);
8383
summary_callback() # print the timer summary

benchmark/elixir_3d_euler_source_terms_structured.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback)
3737
###############################################################################
3838
# run the simulation
3939

40-
sol = solve(ode, BS3(),
41-
save_everystep = false, callback = callbacks);
40+
sol = solve(ode, BS3();
41+
ode_default_options()..., callback = callbacks);
4242
summary_callback() # print the timer summary

benchmark/elixir_3d_euler_source_terms_tree.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback)
3838
###############################################################################
3939
# run the simulation
4040

41-
sol = solve(ode, BS3(),
42-
save_everystep = false, callback = callbacks);
41+
sol = solve(ode, BS3();
42+
ode_default_options()..., callback = callbacks);
4343
summary_callback() # print the timer summary

docs/literate/src/files/DGMulti_1.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ analysis_callback = AnalysisCallback(semi, interval = 100, uEltype = real(dg))
4444
callbacks = CallbackSet(analysis_callback, alive_callback);
4545

4646
# Run the simulation with the same time integration algorithm as before.
47-
sol = solve(ode, RDPK3SpFSAL49(), abstol = 1.0e-6, reltol = 1.0e-6,
48-
callback = callbacks, save_everystep = false);
47+
sol = solve(ode, RDPK3SpFSAL49(), abstol = 1.0e-6, reltol = 1.0e-6;
48+
callback = callbacks, ode_default_options()...);
4949
#-
5050
using Plots
5151
pd = PlotData2D(sol)
@@ -182,8 +182,10 @@ alive_callback = AliveCallback(alive_interval = 20)
182182
analysis_callback = AnalysisCallback(semi, interval = 200, uEltype = real(dg))
183183
callbacks = CallbackSet(alive_callback, analysis_callback);
184184

185-
sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false),
186-
dt = 0.5 * estimate_dt(mesh, dg), save_everystep = false, callback = callbacks);
185+
sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false);
186+
dt = 0.5 * estimate_dt(mesh, dg),
187+
ode_default_options()...,
188+
callback = callbacks);
187189
#-
188190
using Plots
189191
pd = PlotData2D(sol)

docs/literate/src/files/adaptive_mesh_refinement.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,9 @@ stepsize_callback = StepsizeCallback(cfl = 0.9)
148148
callbacks = CallbackSet(amr_callback, stepsize_callback);
149149

150150
# Running the simulation.
151-
sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false),
151+
sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false);
152152
dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback
153-
save_everystep = false, callback = callbacks);
153+
ode_default_options()..., callback = callbacks);
154154

155155
# We plot the solution and add the refined mesh at the end of the simulation.
156156
using Plots

docs/literate/src/files/adding_nonconservative_equation.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ callbacks = CallbackSet(summary_callback, analysis_callback)
131131

132132
## OrdinaryDiffEq's `solve` method evolves the solution in time and executes
133133
## the passed callbacks
134-
sol = solve(ode, Tsit5(), abstol = 1.0e-6, reltol = 1.0e-6,
135-
save_everystep = false, callback = callbacks)
134+
sol = solve(ode, Tsit5(), abstol = 1.0e-6, reltol = 1.0e-6;
135+
ode_default_options()..., callback = callbacks)
136136

137137
## Print the timer summary
138138
summary_callback()
@@ -164,8 +164,8 @@ summary_callback = SummaryCallback()
164164
analysis_callback = AnalysisCallback(semi, interval = 50)
165165
callbacks = CallbackSet(summary_callback, analysis_callback);
166166

167-
sol = solve(ode, Tsit5(), abstol = 1.0e-6, reltol = 1.0e-6,
168-
save_everystep = false, callback = callbacks);
167+
sol = solve(ode, Tsit5(), abstol = 1.0e-6, reltol = 1.0e-6;
168+
ode_default_options()..., callback = callbacks);
169169
summary_callback()
170170

171171
#nb #-
@@ -283,8 +283,8 @@ callbacks = CallbackSet(summary_callback, analysis_callback);
283283

284284
## OrdinaryDiffEq's `solve` method evolves the solution in time and executes
285285
## the passed callbacks
286-
sol = solve(ode, Tsit5(), abstol = 1.0e-6, reltol = 1.0e-6,
287-
save_everystep = false);
286+
sol = solve(ode, Tsit5(), abstol = 1.0e-6, reltol = 1.0e-6;
287+
ode_default_options()...);
288288

289289
## Plot the numerical solution at the final time
290290
using Plots: plot

docs/literate/src/files/behind_the_scenes_simulation_setup.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ ode = semidiscretize(semi, (0.0, 1.0));
214214
# the OrdinaryDiffEq.jl package can be utilized to compute an approximated solution using the
215215
# instructions contained in the `ODEProblem` object.
216216

217-
sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false), dt = 0.01,
218-
save_everystep = false);
217+
sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false), dt = 0.01;
218+
ode_default_options()...);
219219

220220
# Since the `solve` function and the ODE solver have no knowledge
221221
# of a particular spatial discretization, it is necessary to define a

0 commit comments

Comments
 (0)