Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
trixi-framework
GitHub Repository: trixi-framework/Trixi.jl
Path: blob/main/test/test_tree_1d_burgers.jl
5582 views
1
module TestExamples1DBurgers
2
3
using Test
4
using Trixi
5
6
include("test_trixi.jl")
7
8
EXAMPLES_DIR = joinpath(examples_dir(), "tree_1d_dgsem")
9
10
@testset "Inviscid Burgers" begin
11
#! format: noindent
12
13
@trixi_testset "elixir_burgers_basic.jl" begin
14
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_burgers_basic.jl"),
15
l2=[2.967470209082194e-5],
16
linf=[0.00016152468882624227])
17
# Ensure that we do not have excessive memory allocations
18
# (e.g., from type instabilities)
19
@test_allocations(Trixi.rhs!, semi, sol, 1000)
20
end
21
22
@trixi_testset "elixir_burgers_linear_stability.jl" begin
23
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_burgers_linear_stability.jl"),
24
l2=[0.5660569881106876],
25
linf=[1.9352238038313998])
26
# Ensure that we do not have excessive memory allocations
27
# (e.g., from type instabilities)
28
@test_allocations(Trixi.rhs!, semi, sol, 1000)
29
end
30
31
@trixi_testset "elixir_burgers_shock.jl" begin
32
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_burgers_shock.jl"),
33
l2=[0.4429871964104191],
34
linf=[1.007778754747701])
35
# Ensure that we do not have excessive memory allocations
36
# (e.g., from type instabilities)
37
@test_allocations(Trixi.rhs!, semi, sol, 1000)
38
end
39
40
@trixi_testset "elixir_burgers_rarefaction.jl" begin
41
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_burgers_rarefaction.jl"),
42
l2=[0.4038224690923722],
43
linf=[1.0049201454652736])
44
# Ensure that we do not have excessive memory allocations
45
# (e.g., from type instabilities)
46
@test_allocations(Trixi.rhs!, semi, sol, 1000)
47
end
48
end
49
50
end # module
51
52