Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
trixi-framework
GitHub Repository: trixi-framework/Trixi.jl
Path: blob/main/test/test_mpi_t8code_3d.jl
5582 views
1
module TestExamplesMPIT8codeMesh3D
2
3
using Test
4
using Trixi
5
6
include("test_trixi.jl")
7
8
EXAMPLES_DIR = joinpath(examples_dir(), "t8code_3d_dgsem")
9
10
@testset "T8codeMesh MPI 3D" begin
11
#! format: noindent
12
13
# Run basic tests
14
@testset "Examples 3D" begin
15
# Linear scalar advection
16
@trixi_testset "elixir_advection_basic.jl" begin
17
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"),
18
# Expected errors are exactly the same as with TreeMesh!
19
l2=[0.00016263963870641478],
20
linf=[0.0014537194925779984])
21
22
@testset "error-based step size control" begin
23
mpi_isroot() && println("-"^100)
24
mpi_isroot() &&
25
println("elixir_advection_basic.jl with error-based step size control")
26
27
# Use callbacks without stepsize_callback to test error-based step size control
28
callbacks = CallbackSet(summary_callback, analysis_callback, save_restart,
29
save_solution)
30
sol = solve(ode, RDPK3SpFSAL35(); abstol = 1.0e-4, reltol = 1.0e-4,
31
ode_default_options()..., callback = callbacks)
32
summary_callback()
33
errors = analysis_callback(sol)
34
if mpi_isroot()
35
@test errors.l2≈[0.00016800412839949264] rtol=1.0e-4
36
@test errors.linf≈[0.0014548839020096516] rtol=1.0e-4
37
end
38
end
39
40
# Ensure that we do not have excessive memory allocations
41
# (e.g., from type instabilities)
42
@test_allocations(Trixi.rhs!, semi, sol, 1000)
43
end
44
45
@trixi_testset "elixir_advection_amr.jl" begin
46
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_amr.jl"),
47
# Expected errors are exactly the same as with TreeMesh!
48
l2=[1.1302812803902801e-5],
49
linf=[0.0007889950196294793])
50
51
# Ensure that we do not have excessive memory allocations
52
# (e.g., from type instabilities)
53
@test_allocations(Trixi.rhs!, semi, sol, 1000)
54
end
55
56
# There is an issue with the LoopVectorization.jl ecosystem for this setup
57
# (not caused by MPI), see
58
# https://github.com/JuliaSIMD/LoopVectorization.jl/issues/543
59
# Thus, we do not run this test on macOS with ARM processors.
60
@trixi_testset "elixir_advection_amr_unstructured_curved.jl" begin
61
if Sys.isapple() && (Sys.ARCH === :aarch64)
62
# Show a hint in the test summary that there is a broken test
63
@test_skip false
64
else
65
@test_trixi_include(joinpath(EXAMPLES_DIR,
66
"elixir_advection_amr_unstructured_curved.jl"),
67
l2=[2.0535121347526814e-5],
68
linf=[0.0010586603797777504],
69
tspan=(0.0, 1.0))
70
71
# Ensure that we do not have excessive memory allocations
72
# (e.g., from type instabilities)
73
@test_allocations(Trixi.rhs!, semi, sol, 1000)
74
end
75
end
76
77
@trixi_testset "elixir_advection_restart.jl" begin
78
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart.jl"),
79
l2=[0.002590388934758452],
80
linf=[0.01840757696885409])
81
82
# Ensure that we do not have excessive memory allocations
83
# (e.g., from type instabilities)
84
@test_allocations(Trixi.rhs!, semi, sol, 1000)
85
end
86
87
# Compressible Euler
88
@trixi_testset "elixir_euler_source_terms_nonconforming_unstructured_curved.jl" begin
89
@test_trixi_include(joinpath(EXAMPLES_DIR,
90
"elixir_euler_source_terms_nonconforming_unstructured_curved.jl"),
91
l2=[
92
4.070355207909268e-5,
93
4.4993257426833716e-5,
94
5.10588457841744e-5,
95
5.102840924036687e-5,
96
0.00019986264001630542
97
],
98
linf=[
99
0.0016987332417202072,
100
0.003622956808262634,
101
0.002029576258317789,
102
0.0024206977281964193,
103
0.008526972236273522
104
],
105
tspan=(0.0, 0.01))
106
107
# Ensure that we do not have excessive memory allocations
108
# (e.g., from type instabilities)
109
@test_allocations(Trixi.rhs!, semi, sol, 1000)
110
end
111
112
@trixi_testset "elixir_euler_source_terms_nonperiodic.jl" begin
113
@test_trixi_include(joinpath(EXAMPLES_DIR,
114
"elixir_euler_source_terms_nonperiodic.jl"),
115
l2=[
116
0.0015106060984283647,
117
0.0014733349038567685,
118
0.00147333490385685,
119
0.001473334903856929,
120
0.0028149479453087093
121
],
122
linf=[
123
0.008070806335238156,
124
0.009007245083113125,
125
0.009007245083121784,
126
0.009007245083102688,
127
0.01562861968368434
128
],
129
tspan=(0.0, 1.0))
130
131
# Ensure that we do not have excessive memory allocations
132
# (e.g., from type instabilities)
133
@test_allocations(Trixi.rhs!, semi, sol, 1000)
134
end
135
136
@trixi_testset "elixir_euler_ec.jl" begin
137
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_ec.jl"),
138
l2=[
139
0.010380390326164493,
140
0.006192950051354618,
141
0.005970674274073704,
142
0.005965831290564327,
143
0.02628875593094754
144
],
145
linf=[
146
0.3326911600075694,
147
0.2824952141320467,
148
0.41401037398065543,
149
0.45574161423218573,
150
0.8099577682187109
151
],
152
tspan=(0.0, 0.2))
153
154
# Ensure that we do not have excessive memory allocations
155
# (e.g., from type instabilities)
156
@test_allocations(Trixi.rhs!, semi, sol, 1000)
157
end
158
end
159
end # T8codeMesh MPI
160
161
end # module
162
163