Skip to content

Commit

Permalink
update test to be compatible with save_solution
Browse files Browse the repository at this point in the history
  • Loading branch information
warisa-r committed Jul 9, 2024
1 parent 739b54b commit 995107b
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions test/test_structured_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ end

@trixi_testset "elixir_burgers_perk3.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_burgers_perk3.jl"),
l2=[6.4744366559817754e-6],
linf=[4.357450084224723e-5],
l2=[4.12066275835687e-6],
linf=[2.538190787615413e-5],
atol=1.0e-6)
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
Expand All @@ -73,6 +73,25 @@ end
end
end

# Testing the third-order paired explicit Runge-Kutta (PERK) method without stepsize callback
@trixi_testset "elixir_burgers_perk3.jl(fixed time step)" begin
@test_trixi_include( dt=2.0e-3,
tspan=(0.0, 2.0),
save_solution=SaveSolutionCallback(dt = 0.1 + 1.0e-8),
callbacks=CallbackSet(summary_callback, save_solution,
analysis_callback, alive_callback),
l2=[5.725141913990915e-7],
linf=[3.4298598041715422e-6])
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
let
t = sol.t[end]
u_ode = sol.u[end]
du_ode = similar(u_ode)
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
end
end

@trixi_testset "elixir_euler_sedov.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_sedov.jl"),
l2=[3.67478226e-01, 3.49491179e-01, 8.08910759e-01],
Expand Down

0 comments on commit 995107b

Please sign in to comment.