Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
trixi-framework
GitHub Repository: trixi-framework/Trixi.jl
Path: blob/main/test/test_tree_1d_mhdmulti.jl
5582 views
1
module TestExamples1DMHD
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 "MHD Multicomponent" begin
11
#! format: noindent
12
13
@trixi_testset "elixir_mhdmulti_ec.jl" begin
14
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhdmulti_ec.jl"),
15
l2=[0.08166807325620999, 0.054659228513541616,
16
0.054659228513541616, 0.15578125987042812,
17
4.130462730494e-17, 0.054652588871500665,
18
0.054652588871500665, 0.008307405499637766,
19
0.01661481099927553, 0.03322962199855106],
20
linf=[0.19019207422649645, 0.10059813883022888,
21
0.10059813883022888, 0.4407925743107146,
22
1.1102230246251565e-16, 0.10528911365809623,
23
0.10528911365809623, 0.01737901809766182,
24
0.03475803619532364, 0.06951607239064728])
25
# Ensure that we do not have excessive memory allocations
26
# (e.g., from type instabilities)
27
@test_allocations(Trixi.rhs!, semi, sol, 1000)
28
end
29
30
@trixi_testset "elixir_mhdmulti_ec.jl with flux_derigs_etal" begin
31
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhdmulti_ec.jl"),
32
l2=[0.08151404166186461, 0.054640238302693274,
33
0.054640238302693274, 0.15536125426328573,
34
4.130462730494e-17, 0.054665489963920275,
35
0.054665489963920275, 0.008308349501359825,
36
0.01661669900271965, 0.0332333980054393],
37
linf=[0.1824424257860952, 0.09734687137001484,
38
0.09734687137001484, 0.4243089502087325,
39
1.1102230246251565e-16, 0.09558639591092555,
40
0.09558639591092555, 0.017364773041550624,
41
0.03472954608310125, 0.0694590921662025],
42
volume_flux=flux_derigs_etal)
43
# Ensure that we do not have excessive memory allocations
44
# (e.g., from type instabilities)
45
@test_allocations(Trixi.rhs!, semi, sol, 1000)
46
end
47
48
@trixi_testset "elixir_mhdmulti_es.jl" begin
49
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhdmulti_es.jl"),
50
l2=[0.07994082660130175, 0.053940174914031976,
51
0.053940174914031976, 0.15165513559250643,
52
4.130462730494e-17, 0.05363207135290325,
53
0.05363207135290325, 0.008258265884659555,
54
0.01651653176931911, 0.03303306353863822],
55
linf=[0.14101014428198477, 0.07762441749521025,
56
0.07762441749521025, 0.3381334453289866,
57
1.1102230246251565e-16, 0.07003646400675223,
58
0.07003646400675223, 0.014962483760600165,
59
0.02992496752120033, 0.05984993504240066])
60
# Ensure that we do not have excessive memory allocations
61
# (e.g., from type instabilities)
62
@test_allocations(Trixi.rhs!, semi, sol, 1000)
63
end
64
65
@trixi_testset "elixir_mhdmulti_convergence.jl" begin
66
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhdmulti_convergence.jl"),
67
l2=[1.7337265267786785e-5, 0.00032976971029271364,
68
0.0003297697102926479, 6.194071694759044e-5,
69
4.130462730494001e-17, 0.00032596825025664136,
70
0.0003259682502567132, 2.5467510126885455e-5,
71
5.093502025377091e-5, 0.00010187004050754182],
72
linf=[3.877554303711845e-5, 0.0012437848638874956,
73
0.0012437848638876898, 0.00016431262020277781,
74
1.1102230246251565e-16, 0.0012443734922607112,
75
0.001244373492260704, 5.691007974162332e-5,
76
0.00011382015948324664, 0.00022764031896649328])
77
# Ensure that we do not have excessive memory allocations
78
# (e.g., from type instabilities)
79
@test_allocations(Trixi.rhs!, semi, sol, 1000)
80
end
81
82
@trixi_testset "elixir_mhdmulti_briowu_shock_tube.jl" begin
83
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhdmulti_briowu_shock_tube.jl"),
84
l2=[0.1877830835572639, 0.3455841730726793, 0.0,
85
0.35413123388836687,
86
8.745556626531982e-16, 0.3629920109231055, 0.0,
87
0.05329005553971236,
88
0.10658011107942472],
89
linf=[0.4288187627971754, 1.0386547815614993, 0.0,
90
0.9541678878162702,
91
5.773159728050814e-15, 1.4595119339458051, 0.0,
92
0.18201910908829552,
93
0.36403821817659104])
94
# Ensure that we do not have excessive memory allocations
95
# (e.g., from type instabilities)
96
@test_allocations(Trixi.rhs!, semi, sol, 1000)
97
end
98
end
99
100
end # module
101
102