Skip to content

Commit

Permalink
Added test for Euler 1D Shu Osher with Gauss nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
mleprovost committed May 15, 2024
1 parent 082b6ed commit 0d450c8
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ mesh = DGMultiMesh(dg, cells_per_dimension,
semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition,
dg, boundary_conditions = boundary_conditions)

tspan = (0.0, 2.0)
tspan = (0.0, 1.0)
ode = semidiscretize(semi, tspan)

###############################################################################
Expand All @@ -90,4 +90,4 @@ callbacks = CallbackSet(summary_callback, analysis_callback, stepsize_callback)
# ###############################################################################
# # run the simulation

sol = solve(ode, SSPRK43(), adaptive = true, callback = callbacks, save_everystep = true)
sol = solve(ode, SSPRK43(), adaptive = true, callback = callbacks, save_everystep = false)
49 changes: 37 additions & 12 deletions test/test_dgmulti_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,37 @@ end
l2=[
7.853842541289665e-7,
9.609905503440606e-7,
2.832322219966481e-6,
2.832322219966481e-6
] ./ sqrt(2.0),
linf=[
1.5003758788711963e-6,
1.802998748523521e-6,
4.83599270806323e-6,
4.83599270806323e-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_shu_osher_gauss_shock_capturing.jl " begin
@test_trixi_include(joinpath(EXAMPLES_DIR,
"elixir_euler_shu_osher_gauss_shock_capturing.jl"),
cells_per_dimension=(64,), tspan=(0.0, 1.0),
# division by sqrt(2.0) corresponds to normalization by the square root of the size of the domain
l2=[
1.7177729727131328,
6.191308529732632,
22.281999765458117
],
linf=[
3.228727516356452,
10.989654948503484,
38.65258452259893
])
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
Expand Down Expand Up @@ -93,12 +118,12 @@ end
l2=[
6.437827414849647e-6,
2.1840558851820947e-6,
1.3245669629438228e-5,
1.3245669629438228e-5
],
linf=[
2.0715843751295537e-5,
8.519520630301258e-6,
4.2642194098885255e-5,
4.2642194098885255e-5
])
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
Expand All @@ -122,12 +147,12 @@ end
l2=[
1.8684509287853788e-5,
1.0641411823379635e-5,
5.178010291876143e-5,
5.178010291876143e-5
],
linf=[
6.933493585936645e-5,
3.0277366229292113e-5,
0.0002220020568932668,
0.0002220020568932668
])
show(stdout, semi.solver.basis)
show(stdout, MIME"text/plain"(), semi.solver.basis)
Expand All @@ -145,11 +170,11 @@ end
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_fdsbp_periodic.jl"),
l2=[
9.146929178341782e-7, 1.8997616876521201e-6,
3.991417701005622e-6,
3.991417701005622e-6
],
linf=[
1.7321089882393892e-6, 3.3252888869128583e-6,
6.525278767988141e-6,
6.525278767988141e-6
])
show(stdout, semi.solver.basis)
show(stdout, MIME"text/plain"(), semi.solver.basis)
Expand Down Expand Up @@ -186,13 +211,13 @@ end
3.03001101100507e-6,
1.692177335948727e-5,
3.002634351734614e-16,
1.1636653574178203e-15,
1.1636653574178203e-15
],
linf=[
1.2043401988570679e-5,
5.346847010329059e-5,
9.43689570931383e-16,
2.220446049250313e-15,
2.220446049250313e-15
])
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
Expand All @@ -212,13 +237,13 @@ end
1.633271343738687e-5,
9.575385661756332e-6,
1.2700331443128421e-5,
0.0,
0.0
],
linf=[
7.304984704381567e-5,
5.2365944135601694e-5,
6.469559594934893e-5,
0.0,
0.0
])
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
Expand Down

0 comments on commit 0d450c8

Please sign in to comment.