Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
trixi-framework
GitHub Repository: trixi-framework/Trixi.jl
Path: blob/main/test/test_tree_1d_linearizedeuler.jl
2055 views
1
2
using Test
3
using Trixi
4
5
include("test_trixi.jl")
6
7
EXAMPLES_DIR = joinpath(examples_dir(), "tree_1d_dgsem")
8
9
@testset "Linearized Euler Equations 1D" begin
10
#! format: noindent
11
12
@trixi_testset "elixir_linearizedeuler_convergence.jl" begin
13
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_linearizedeuler_convergence.jl"),
14
l2=[
15
0.00010894927270421941,
16
0.00014295255695912358,
17
0.00010894927270421941
18
],
19
linf=[
20
0.0005154647164193893,
21
0.00048457837684242266,
22
0.0005154647164193893
23
])
24
# Ensure that we do not have excessive memory allocations
25
# (e.g., from type instabilities)
26
let
27
t = sol.t[end]
28
u_ode = sol.u[end]
29
du_ode = similar(u_ode)
30
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
31
end
32
end
33
34
@trixi_testset "elixir_linearizedeuler_gauss_wall.jl" begin
35
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_linearizedeuler_gauss_wall.jl"),
36
l2=[0.650082087850354, 0.2913911415488769, 0.650082087850354],
37
linf=[
38
1.9999505145390108,
39
0.9999720404625275,
40
1.9999505145390108
41
])
42
# Ensure that we do not have excessive memory allocations
43
# (e.g., from type instabilities)
44
let
45
t = sol.t[end]
46
u_ode = sol.u[end]
47
du_ode = similar(u_ode)
48
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
49
end
50
end
51
end
52
53