Skip to content

Commit 8cf4e3c

Browse files
Docs: Switch integrator to fix wave number example (#2616)
* Docs: Switch integrator to fix wave number example * tv
1 parent 7684beb commit 8cf4e3c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/literate/src/files/differentiable_programming.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ function energy_at_final_time(k) # k is the wave number of the initial condition
230230
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver,
231231
uEltype = typeof(k))
232232
ode = semidiscretize(semi, (0.0, 1.0))
233-
sol = solve(ode, BS3(); ode_default_options()...)
233+
sol = solve(ode, FRK65(), dt = 0.05, adaptive = false, save_everystep = false)
234234
Trixi.integrate(energy_total, sol.u[end], semi)
235235
end
236236

@@ -280,7 +280,7 @@ function energy_at_final_time(k) # k is the wave number of the initial condition
280280
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver,
281281
uEltype = typeof(k))
282282
ode = semidiscretize(semi, (0.0, 1.0))
283-
sol = solve(ode, BS3(); ode_default_options()...)
283+
sol = solve(ode, FRK65(), dt = 0.05, adaptive = false, save_everystep = false)
284284
Trixi.integrate(energy_total, sol.u[end], semi)
285285
end
286286

@@ -330,9 +330,9 @@ semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver,
330330
# does. This is basically the only part where you need to modify your standard Trixi.jl
331331
# code to enable automatic differentiation. From there on, the remaining steps
332332
ode = semidiscretize(semi, (0.0, 1.0))
333-
sol = solve(ode, BS3(); ode_default_options()...)
333+
sol = solve(ode, FRK65(), dt = 0.05, adaptive = false, save_everystep = false)
334334
round(Trixi.integrate(energy_total, sol.u[end], semi), sigdigits = 5)
335-
@test round(Trixi.integrate(energy_total, sol.u[end], semi), sigdigits = 5) == 0.24986 #src
335+
@test round(Trixi.integrate(energy_total, sol.u[end], semi), sigdigits = 5) == 0.25 #src
336336

337337
# do not need any modifications since they are sufficiently generic (and enough effort
338338
# has been spend to allow general types inside these calls).

0 commit comments

Comments
 (0)