Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
trixi-framework
GitHub Repository: trixi-framework/Trixi.jl
Path: blob/main/test/test_dgmulti_2d.jl
5582 views
1
module TestExamplesDGMulti2D
2
3
using Test
4
using Trixi
5
6
include("test_trixi.jl")
7
8
EXAMPLES_DIR = joinpath(examples_dir(), "dgmulti_2d")
9
10
# Start with a clean environment: remove Trixi.jl output directory if it exists
11
outdir = "out"
12
isdir(outdir) && rm(outdir, recursive = true)
13
14
@testset "DGMulti 2D" begin
15
#! format: noindent
16
17
@trixi_testset "elixir_euler_weakform.jl" begin
18
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_weakform.jl"),
19
cells_per_dimension=(4, 4),
20
surface_integral=SurfaceIntegralWeakForm(FluxHLL(min_max_speed_naive)),
21
# division by 2.0 corresponds to normalization by the square root of the size of the domain
22
l2=[
23
0.0013536930300254945,
24
0.0014315603442106193,
25
0.001431560344211359,
26
0.0047393341007602625
27
] ./ 2.0,
28
linf=[
29
0.001514260921466004,
30
0.0020623991944839215,
31
0.002062399194485476,
32
0.004897700392503701
33
])
34
# Ensure that we do not have excessive memory allocations
35
# (e.g., from type instabilities)
36
@test_allocations(Trixi.rhs!, semi, sol, 1000)
37
38
# Load the mesh file for code coverage
39
loaded_mesh = Trixi.load_mesh_serial(joinpath("out", "mesh.h5"),
40
n_cells_max = 0,
41
RealT = Float64)
42
end
43
44
@trixi_testset "elixir_euler_weakform.jl (SBP)" begin
45
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_weakform.jl"),
46
cells_per_dimension=(4, 4),
47
approximation_type=SBP(),
48
surface_integral=SurfaceIntegralWeakForm(FluxHLL(min_max_speed_naive)),
49
# division by 2.0 corresponds to normalization by the square root of the size of the domain
50
l2=[
51
0.0074706882014934735,
52
0.005306220583603261,
53
0.005306220583613591,
54
0.014724842607716771
55
] ./ 2.0,
56
linf=[
57
0.021563604940952885,
58
0.01359397832530762,
59
0.013593978324845324,
60
0.03270995869587523
61
])
62
# Ensure that we do not have excessive memory allocations
63
# (e.g., from type instabilities)
64
@test_allocations(Trixi.rhs!, semi, sol, 1000)
65
end
66
67
@trixi_testset "elixir_euler_weakform.jl (Quadrilateral elements)" begin
68
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_weakform.jl"),
69
cells_per_dimension=(4, 4),
70
element_type=Quad(),
71
surface_integral=SurfaceIntegralWeakForm(FluxHLL(min_max_speed_naive)),
72
# division by 2.0 corresponds to normalization by the square root of the size of the domain
73
l2=[
74
0.00031892254415307093,
75
0.00033637562986771894,
76
0.0003363756298680649,
77
0.0011100259064243145
78
] ./ 2.0,
79
linf=[
80
0.001073298211445639,
81
0.0013568139808282087,
82
0.0013568139808290969,
83
0.0032249020004324613
84
])
85
# Ensure that we do not have excessive memory allocations
86
# (e.g., from type instabilities)
87
@test_allocations(Trixi.rhs!, semi, sol, 1000)
88
end
89
90
@trixi_testset "elixir_euler_weakform.jl (EC) " begin
91
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_weakform.jl"),
92
cells_per_dimension=(4, 4),
93
volume_integral=VolumeIntegralFluxDifferencing(flux_ranocha),
94
surface_integral=SurfaceIntegralWeakForm(flux_ranocha),
95
# division by 2.0 corresponds to normalization by the square root of the size of the domain
96
l2=[
97
0.007801417730672109,
98
0.00708583561714128,
99
0.0070858356171393,
100
0.015217574294198809
101
] ./ 2.0,
102
linf=[
103
0.011572828457858897,
104
0.013965298735070686,
105
0.01396529873508534,
106
0.04227683691807904
107
])
108
# Ensure that we do not have excessive memory allocations
109
# (e.g., from type instabilities)
110
@test_allocations(Trixi.rhs!, semi, sol, 1000)
111
end
112
113
@trixi_testset "elixir_euler_weakform.jl (SBP, EC)" begin
114
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_weakform.jl"),
115
cells_per_dimension=(4, 4),
116
volume_integral=VolumeIntegralFluxDifferencing(flux_ranocha),
117
surface_integral=SurfaceIntegralWeakForm(flux_ranocha),
118
approximation_type=SBP(),
119
# division by 2.0 corresponds to normalization by the square root of the size of the domain
120
l2=[
121
0.01280067571168776,
122
0.010607599608273302,
123
0.010607599608239775,
124
0.026408338014056548
125
] ./ 2.0,
126
linf=[
127
0.037983023185674814,
128
0.05321027922533417,
129
0.05321027922608157,
130
0.13392025411844033
131
])
132
# Ensure that we do not have excessive memory allocations
133
# (e.g., from type instabilities)
134
@test_allocations(Trixi.rhs!, semi, sol, 1000)
135
end
136
137
@trixi_testset "elixir_euler_weakform.jl (Quadrilateral elements, SBP, EC)" begin
138
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_weakform.jl"),
139
cells_per_dimension=(4, 4),
140
element_type=Quad(),
141
volume_integral=VolumeIntegralFluxDifferencing(flux_ranocha),
142
surface_integral=SurfaceIntegralWeakForm(flux_ranocha),
143
approximation_type=SBP(),
144
# division by 2.0 corresponds to normalization by the square root of the size of the domain
145
l2=[
146
0.0029373718090697975,
147
0.0030629360605489465,
148
0.003062936060545615,
149
0.0068486089344859755
150
] ./ 2.0,
151
linf=[
152
0.01360165305316885,
153
0.01267402847925303,
154
0.012674028479251254,
155
0.02210545278615017
156
])
157
# Ensure that we do not have excessive memory allocations
158
# (e.g., from type instabilities)
159
@test_allocations(Trixi.rhs!, semi, sol, 1000)
160
end
161
162
@trixi_testset "elixir_euler_bilinear.jl (Bilinear quadrilateral elements, SBP, flux differencing)" begin
163
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_bilinear.jl"),
164
l2=[
165
1.0267413589968656e-5,
166
9.03069720963081e-6,
167
9.030697209721065e-6,
168
2.7436672091049314e-5
169
],
170
linf=[
171
7.36251369879426e-5,
172
6.874041557969335e-5,
173
6.874041552329402e-5,
174
0.00019123932693609902
175
])
176
# Ensure that we do not have excessive memory allocations
177
# (e.g., from type instabilities)
178
@test_allocations(Trixi.rhs!, semi, sol, 1000)
179
end
180
181
@trixi_testset "elixir_euler_curved.jl (Quadrilateral elements, SBP, flux differencing)" begin
182
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_curved.jl"),
183
l2=[
184
1.7209164346836478e-5,
185
1.5928649356474767e-5,
186
1.5928649356802847e-5,
187
4.8963394546089164e-5
188
],
189
linf=[
190
0.00010525404319428056,
191
0.00010003768703326088,
192
0.00010003768694910598,
193
0.0003642622844113319
194
])
195
# Ensure that we do not have excessive memory allocations
196
# (e.g., from type instabilities)
197
@test_allocations(Trixi.rhs!, semi, sol, 1000)
198
end
199
200
@trixi_testset "elixir_euler_curved.jl (Quadrilateral elements, GaussSBP, flux differencing)" begin
201
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_curved.jl"),
202
approximation_type=GaussSBP(),
203
surface_integral=SurfaceIntegralWeakForm(FluxHLL(min_max_speed_naive)),
204
l2=[
205
3.4664508443541302e-6,
206
3.4389354928807557e-6,
207
3.438935492692069e-6,
208
1.0965259031107001e-5
209
],
210
linf=[
211
1.1326776948594741e-5,
212
1.1343379410666543e-5,
213
1.1343379308081936e-5,
214
3.679395547040443e-5
215
],
216
rtol=2 * sqrt(eps()))
217
# Ensure that we do not have excessive memory allocations
218
# (e.g., from type instabilities)
219
@test_allocations(Trixi.rhs!, semi, sol, 1000)
220
end
221
222
@trixi_testset "elixir_euler_curved.jl (Triangular elements, Polynomial, weak formulation)" begin
223
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_curved.jl"),
224
element_type=Tri(), approximation_type=Polynomial(),
225
volume_integral=VolumeIntegralWeakForm(),
226
surface_integral=SurfaceIntegralWeakForm(FluxHLL(min_max_speed_naive)),
227
l2=[
228
7.906577233358824e-6,
229
8.733496764180975e-6,
230
8.733496764698532e-6,
231
2.911852322169076e-5
232
],
233
linf=[
234
3.298755256198049e-5,
235
4.0322966492922774e-5,
236
4.032296598488472e-5,
237
0.00012013778942154829
238
])
239
# Ensure that we do not have excessive memory allocations
240
# (e.g., from type instabilities)
241
@test_allocations(Trixi.rhs!, semi, sol, 1000)
242
end
243
244
@trixi_testset "elixir_euler_hohqmesh.jl (Quadrilateral elements, SBP, flux differencing)" begin
245
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_hohqmesh.jl"),
246
l2=[
247
0.0008153911341539523,
248
0.0007768159702011952,
249
0.0004790260681142826,
250
0.0015551846076274918
251
],
252
linf=[
253
0.002930113136531798,
254
0.003442705146861069,
255
0.002872156984277563,
256
0.011125365075300486
257
])
258
# Ensure that we do not have excessive memory allocations
259
# (e.g., from type instabilities)
260
@test_allocations(Trixi.rhs!, semi, sol, 1000)
261
end
262
263
@trixi_testset "elixir_euler_weakform.jl (convergence)" begin
264
using Trixi: convergence_test
265
eocs, _ = convergence_test(@__MODULE__,
266
joinpath(EXAMPLES_DIR,
267
"elixir_euler_weakform.jl"), 2)
268
mean_convergence = Trixi.calc_mean_convergence(eocs)
269
@test isapprox(mean_convergence[:l2],
270
[
271
4.243843382379403,
272
4.128314378833922,
273
4.128314378397532,
274
4.081366752807379
275
], rtol = 0.05)
276
# Ensure that we do not have excessive memory allocations
277
# (e.g., from type instabilities)
278
@test_allocations(Trixi.rhs!, semi, sol, 1000)
279
end
280
281
@trixi_testset "elixir_euler_weakform_periodic.jl" begin
282
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_weakform_periodic.jl"),
283
# division by 2.0 corresponds to normalization by the square root of the size of the domain
284
l2=[
285
0.0007492755162295128, 0.0007641875305302599,
286
0.0007641875305306243, 0.0024232389721009447
287
],
288
linf=[
289
0.0015060064614331736, 0.0019371156800773726,
290
0.0019371156800769285, 0.004742431684202408
291
])
292
# Ensure that we do not have excessive memory allocations
293
# (e.g., from type instabilities)
294
@test_allocations(Trixi.rhs!, semi, sol, 1000)
295
end
296
297
@trixi_testset "elixir_euler_triangulate_pkg_mesh.jl" begin
298
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_triangulate_pkg_mesh.jl"),
299
l2=[
300
2.344076909832665e-6, 1.8610002398709756e-6,
301
2.4095132179484066e-6, 6.37330249340445e-6
302
],
303
linf=[
304
2.509979394305084e-5, 2.2683711321080935e-5,
305
2.6180377720841363e-5, 5.575278031910713e-5
306
])
307
# Ensure that we do not have excessive memory allocations
308
# (e.g., from type instabilities)
309
@test_allocations(Trixi.rhs!, semi, sol, 1000)
310
end
311
312
@trixi_testset "elixir_euler_kelvin_helmholtz_instability.jl" begin
313
@test_trixi_include(joinpath(EXAMPLES_DIR,
314
"elixir_euler_kelvin_helmholtz_instability.jl"),
315
cells_per_dimension=(32, 32), tspan=(0.0, 0.2),
316
# division by 2.0 corresponds to normalization by the square root of the size of the domain
317
l2=[
318
0.11140378947116614,
319
0.06598161188703612,
320
0.10448953167839563,
321
0.16023209181809595
322
] ./ 2.0,
323
linf=[
324
0.24033843177853664,
325
0.1659992245272325,
326
0.1235468309508845,
327
0.26911424973147735
328
])
329
# Ensure that we do not have excessive memory allocations
330
# (e.g., from type instabilities)
331
@test_allocations(Trixi.rhs!, semi, sol, 1000)
332
end
333
334
@trixi_testset "elixir_euler_kelvin_helmholtz_instability.jl (Quadrilateral elements, GaussSBP)" begin
335
@test_trixi_include(joinpath(EXAMPLES_DIR,
336
"elixir_euler_kelvin_helmholtz_instability.jl"),
337
cells_per_dimension=(32, 32), element_type=Quad(),
338
approximation_type=GaussSBP(), tspan=(0.0, 0.2),
339
# division by 2.0 corresponds to normalization by the square root of the size of the domain
340
l2=[
341
0.11141270656347146,
342
0.06598888014584121,
343
0.1044902203749932,
344
0.16023037364774995
345
] ./ 2.0,
346
linf=[
347
0.2414760062126462,
348
0.1662111846065654,
349
0.12344140473946856,
350
0.26978428189564774
351
])
352
# Ensure that we do not have excessive memory allocations
353
# (e.g., from type instabilities)
354
@test_allocations(Trixi.rhs!, semi, sol, 1000)
355
end
356
357
@trixi_testset "elixir_euler_kelvin_helmholtz_instability_adaptive_vol_int.jl" begin
358
@test_trixi_include(joinpath(EXAMPLES_DIR,
359
"elixir_euler_kelvin_helmholtz_instability_adaptive_vol_int.jl"),
360
maximum_entropy_increase=0.0,
361
tspan=(0.0, 0.2),
362
l2=[
363
0.05570371489805444,
364
0.03299286402646503,
365
0.05224508023471742,
366
0.08011545946002244
367
],
368
linf=[
369
0.24323216643032874,
370
0.1685158282708948,
371
0.12357902305982191,
372
0.26981068435988087
373
])
374
# Ensure that we do not have excessive memory allocations
375
# (e.g., from type instabilities)
376
@test_allocations(Trixi.rhs!, semi, sol, 1000)
377
end
378
379
@trixi_testset "elixir_euler_rayleigh_taylor_instability.jl" begin
380
@test_trixi_include(joinpath(EXAMPLES_DIR,
381
"elixir_euler_rayleigh_taylor_instability.jl"),
382
cells_per_dimension=(8, 8), tspan=(0.0, 0.2),
383
l2=[
384
0.07097806924106471,
385
0.005168545523460976,
386
0.013820905434253445,
387
0.03243358478653133
388
],
389
linf=[
390
0.4783395366569936,
391
0.022446258588973853,
392
0.04023354591166624,
393
0.08515791118082117
394
])
395
# Ensure that we do not have excessive memory allocations
396
# (e.g., from type instabilities)
397
@test_allocations(Trixi.rhs!, semi, sol, 1000)
398
end
399
400
@trixi_testset "elixir_euler_brown_minion_vortex.jl" begin
401
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_brown_minion_vortex.jl"),
402
cells_per_dimension=4, tspan=(0.0, 0.1),
403
l2=[
404
0.006680001611078062,
405
0.02151676347585447,
406
0.010696524235364626,
407
0.15052841129694647
408
],
409
linf=[
410
0.01544756362800248,
411
0.09517304772476806,
412
0.021957154972646383,
413
0.33773439650806303
414
])
415
# Ensure that we do not have excessive memory allocations
416
# (e.g., from type instabilities)
417
@test_allocations(Trixi.rhs!, semi, sol, 1000)
418
end
419
420
@trixi_testset "elixir_euler_shockcapturing.jl" begin
421
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_shockcapturing.jl"),
422
cells_per_dimension=4, tspan=(0.0, 0.1),
423
l2=[
424
0.05685180852320552,
425
0.04308097439005265,
426
0.04308097439005263,
427
0.21098250258804
428
],
429
linf=[
430
0.2360805191601203,
431
0.16684117462697776,
432
0.16684117462697767,
433
0.8573034682049414
434
])
435
# Ensure that we do not have excessive memory allocations
436
# (e.g., from type instabilities)
437
@test_allocations(Trixi.rhs!, semi, sol, 1000)
438
end
439
440
@trixi_testset "elixir_euler_shockcapturing_curved.jl" begin
441
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_shockcapturing_curved.jl"),
442
cells_per_dimension=4, tspan=(0.0, 0.1),
443
l2=[
444
0.055659339125865195,
445
0.042323245380073364,
446
0.042323245380073315,
447
0.20642426004746467
448
],
449
linf=[
450
0.23633597150568753,
451
0.16929779869845438,
452
0.16929779869845438,
453
0.8587814448153765
454
])
455
# Ensure that we do not have excessive memory allocations
456
# (e.g., from type instabilities)
457
@test_allocations(Trixi.rhs!, semi, sol, 1000)
458
end
459
460
@trixi_testset "elixir_euler_weakform.jl (FD SBP)" begin
461
using Trixi: SummationByPartsOperators, derivative_operator
462
global D = derivative_operator(SummationByPartsOperators.MattssonNordström2004(),
463
derivative_order = 1,
464
accuracy_order = 4,
465
xmin = 0.0, xmax = 1.0,
466
N = 12)
467
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_weakform.jl"),
468
cells_per_dimension=(2, 2),
469
element_type=Quad(),
470
cfl=1.0,
471
approximation_type=D,
472
# division by 2.0 corresponds to normalization by the square root of the size of the domain
473
l2=[
474
0.0008966318978421226,
475
0.0011418826379110242,
476
0.001141882637910878,
477
0.0030918374335671393
478
] ./ 2.0,
479
linf=[
480
0.0015281525343109337,
481
0.00162430960401716,
482
0.0016243096040242655,
483
0.004447503691245913
484
])
485
# Ensure that we do not have excessive memory allocations
486
# (e.g., from type instabilities)
487
@test_allocations(Trixi.rhs!, semi, sol, 1000)
488
end
489
490
@trixi_testset "elixir_euler_weakform.jl (FD SBP, EC)" begin
491
using Trixi: SummationByPartsOperators, derivative_operator
492
global D = derivative_operator(SummationByPartsOperators.MattssonNordström2004(),
493
derivative_order = 1,
494
accuracy_order = 4,
495
xmin = 0.0, xmax = 1.0,
496
N = 12)
497
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_weakform.jl"),
498
cells_per_dimension=(2, 2),
499
element_type=Quad(),
500
cfl=1.0,
501
approximation_type=D,
502
volume_integral=VolumeIntegralFluxDifferencing(flux_ranocha),
503
surface_integral=SurfaceIntegralWeakForm(flux_ranocha),
504
# division by 2.0 corresponds to normalization by the square root of the size of the domain
505
l2=[
506
0.0014018725496871129,
507
0.0015887007320868913,
508
0.001588700732086329,
509
0.003870926821031202
510
] ./ 2.0,
511
linf=[
512
0.0029541996523780867,
513
0.0034520465226108854,
514
0.003452046522624652,
515
0.007677153211004928
516
])
517
# Ensure that we do not have excessive memory allocations
518
# (e.g., from type instabilities)
519
@test_allocations(Trixi.rhs!, semi, sol, 1000)
520
end
521
522
@trixi_testset "elixir_euler_fdsbp_periodic.jl" begin
523
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_fdsbp_periodic.jl"),
524
l2=[
525
1.333332033888785e-6, 2.044834627786368e-6,
526
2.0448346278315884e-6, 5.282189803437435e-6
527
],
528
linf=[
529
2.7000151703315822e-6, 3.988595025372632e-6,
530
3.9885950240403645e-6, 8.848583036513702e-6
531
])
532
# Ensure that we do not have excessive memory allocations
533
# (e.g., from type instabilities)
534
@test_allocations(Trixi.rhs!, semi, sol, 1000)
535
end
536
537
@trixi_testset "elixir_euler_cgsbp_periodic.jl" begin
538
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_cgsbp_periodic.jl"),
539
l2=[
540
1.2713306233672395e-4, 1.5304132439425007e-4,
541
1.5304132439424308e-4, 3.192754742776865e-4
542
],
543
linf=[
544
3.6081264672516156e-4, 3.4235010781946684e-4,
545
3.423501078176905e-4, 9.824814197632037e-4
546
])
547
@test_allocations(Trixi.rhs!, semi, sol, 1000)
548
end
549
550
@trixi_testset "elixir_euler_fdsbp_periodic.jl (arbitrary reference domain)" begin
551
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_fdsbp_periodic.jl"),
552
xmin=-200.0, xmax=100.0, #= parameters for reference interval =#
553
surface_flux=FluxHLL(min_max_speed_naive),
554
l2=[
555
1.333332034149886e-6,
556
2.0448346280892024e-6,
557
2.0448346279766305e-6,
558
5.282189803510037e-6
559
],
560
linf=[
561
2.700015170553627e-6,
562
3.988595024262409e-6,
563
3.988595024928543e-6,
564
8.84858303740188e-6
565
])
566
# Ensure that we do not have excessive memory allocations
567
# (e.g., from type instabilities)
568
@test_allocations(Trixi.rhs!, semi, sol, 1000)
569
end
570
571
@trixi_testset "elixir_euler_fdsbp_periodic.jl (arbitrary reference and physical domains)" begin
572
using Trixi: periodic_derivative_operator
573
global D = periodic_derivative_operator(derivative_order = 1,
574
accuracy_order = 4,
575
xmin = -200.0,
576
xmax = 100.0,
577
N = 100)
578
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_fdsbp_periodic.jl"),
579
approximation_type=D,
580
coordinates_min=(-3.0, -4.0), coordinates_max=(0.0, -1.0),
581
surface_flux=FluxHLL(min_max_speed_naive),
582
l2=[
583
0.07318831033918516,
584
0.10039910610067465,
585
0.1003991061006748,
586
0.2642450566234564
587
],
588
linf=[
589
0.36081081739439735,
590
0.5244468027020845,
591
0.5244468027020814,
592
1.2210130256735705
593
])
594
# Ensure that we do not have excessive memory allocations
595
# (e.g., from type instabilities)
596
@test_allocations(Trixi.rhs!, semi, sol, 1000)
597
end
598
599
@trixi_testset "elixir_euler_fdsbp_periodic.jl (CGSEM)" begin
600
using Trixi: SummationByPartsOperators
601
D_local = SummationByPartsOperators.legendre_derivative_operator(xmin = 0.0,
602
xmax = 1.0,
603
N = 4)
604
mesh_local = SummationByPartsOperators.UniformPeriodicMesh1D(xmin = -1.0,
605
xmax = 1.0,
606
Nx = 10)
607
global D = SummationByPartsOperators.couple_continuously(D_local, mesh_local)
608
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_fdsbp_periodic.jl"),
609
approximation_type=D,
610
surface_flux=FluxHLL(min_max_speed_naive),
611
l2=[
612
1.5440402410017893e-5,
613
1.4913189903083485e-5,
614
1.4913189902797073e-5,
615
2.6104615985156992e-5
616
],
617
linf=[
618
4.16334345412217e-5,
619
5.067812788173143e-5,
620
5.067812786885284e-5,
621
9.887976803746312e-5
622
])
623
# Ensure that we do not have excessive memory allocations
624
# (e.g., from type instabilities)
625
@test_allocations(Trixi.rhs!, semi, sol, 1000)
626
end
627
628
@trixi_testset "elixir_mhd_weak_blast_wave.jl (Quad)" begin
629
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_weak_blast_wave.jl"),
630
cells_per_dimension=4,
631
l2=[0.03906769915509508, 0.04923079758984701,
632
0.049230797589847136, 0.02660348840973283,
633
0.18054907061740028, 0.019195256934309846,
634
0.019195256934310016, 0.027856113419468087,
635
0.0016567799774264065],
636
linf=[0.16447597822733662, 0.244157345789029,
637
0.24415734578903472, 0.11982440036793476,
638
0.7450328339751362, 0.06357382685763713, 0.0635738268576378,
639
0.1058830287485999,
640
0.005740591170062146])
641
# Ensure that we do not have excessive memory allocations
642
# (e.g., from type instabilities)
643
@test_allocations(Trixi.rhs!, semi, sol, 1000)
644
end
645
646
@trixi_testset "elixir_mhd_weak_blast_wave.jl (Tri)" begin
647
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_weak_blast_wave.jl"),
648
cells_per_dimension=4, element_type=Tri(),
649
l2=[0.03372468091254386, 0.03971626483409167,
650
0.03971626483409208, 0.021427571421535722,
651
0.15079331840847413, 0.015716300366650286,
652
0.015716300366652128, 0.022365252076279075,
653
0.0009232971979900358],
654
linf=[0.16290247390873458, 0.2256891306641319,
655
0.2256891306641336, 0.09476017042552534,
656
0.6906308908961734, 0.05349939593012487,
657
0.05349939593013042, 0.08830587480616725,
658
0.0029551359803035027])
659
# Ensure that we do not have excessive memory allocations
660
# (e.g., from type instabilities)
661
@test_allocations(Trixi.rhs!, semi, sol, 1000)
662
end
663
664
@trixi_testset "elixir_mhd_weak_blast_wave_SBP.jl (Quad)" begin
665
# These setups do not pass CI reliably, see
666
# https://github.com/trixi-framework/Trixi.jl/pull/880 and
667
# https://github.com/trixi-framework/Trixi.jl/issues/881
668
@test_skip @test_trixi_include(joinpath(EXAMPLES_DIR,
669
"elixir_mhd_weak_blast_wave_SBP.jl"),
670
cells_per_dimension=4,
671
# division by 2.0 corresponds to normalization by the square root of the size of the domain
672
l2=[0.15825983698241494, 0.19897219694837923,
673
0.19784182473275247, 0.10482833997417325,
674
0.7310752391255246, 0.07374056714564853,
675
0.07371172293240634, 0.10782032253431281,
676
0.004921676235111545] ./ 2.0,
677
linf=[0.1765644464978685, 0.2627803272865769,
678
0.26358136695848144, 0.12347681727447984,
679
0.7733289736898254, 0.06695360844467957,
680
0.06650382120802623, 0.10885097000919097,
681
0.007212567638078835])
682
end
683
684
@trixi_testset "elixir_mhd_weak_blast_wave_SBP.jl (Tri)" begin
685
# These setups do not pass CI reliably, see
686
# https://github.com/trixi-framework/Trixi.jl/pull/880 and
687
# https://github.com/trixi-framework/Trixi.jl/issues/881
688
@test_skip @test_trixi_include(joinpath(EXAMPLES_DIR,
689
"elixir_mhd_weak_blast_wave_SBP.jl"),
690
cells_per_dimension=4, element_type=Tri(),
691
tspan=(0.0, 0.2),
692
# division by 2.0 corresponds to normalization by the square root of the size of the domain
693
l2=[0.13825044764021147, 0.15472815448314997,
694
0.1549093274293255, 0.053103596213755405,
695
0.7246162776815603, 0.07730777596615901,
696
0.07733438386480523, 0.109893463921706,
697
0.00617678167062838] ./ 2.0,
698
linf=[0.22701306227317952, 0.2905255794821543,
699
0.2912409425436937, 0.08051361477962096,
700
1.0842974228656006, 0.07866000368926784,
701
0.0786646354518149, 0.1614896380292925,
702
0.010358210347485542])
703
end
704
705
@trixi_testset "elixir_mhd_reflective_wall.jl (Quad)" begin
706
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_reflective_wall.jl"),
707
cells_per_dimension=4,
708
l2=[
709
0.0036019562526881602,
710
0.0017340971255535853,
711
0.00837522167692243,
712
0.0,
713
0.028596802654003512,
714
0.0018573697892233679,
715
0.0020807798940528956,
716
0.0,
717
5.301259762428258e-5
718
],
719
linf=[
720
0.016925983823703028,
721
0.009369659529710701,
722
0.04145170727840005,
723
0.0,
724
0.1156990108418654,
725
0.009849648257876749,
726
0.011417088537145403,
727
0.0,
728
0.0002992621756946904
729
])
730
# Ensure that we do not have excessive memory allocations
731
# (e.g., from type instabilities)
732
@test_allocations(Trixi.rhs!, semi, sol, 1000)
733
end
734
end
735
# Clean up afterwards: delete Trixi.jl output directory
736
@test_nowarn isdir(outdir) && rm(outdir, recursive = true)
737
738
end # module
739
740