Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
trixi-framework
GitHub Repository: trixi-framework/Trixi.jl
Path: blob/main/test/test_p4est_3d.jl
5582 views
1
module TestExamplesP4estMesh3D
2
3
using Test
4
using Trixi
5
6
include("test_trixi.jl")
7
8
EXAMPLES_DIR = joinpath(examples_dir(), "p4est_3d_dgsem")
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 "P4estMesh3D" begin
15
#! format: noindent
16
17
@trixi_testset "elixir_advection_basic.jl" begin
18
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"),
19
# Expected errors are exactly the same as with TreeMesh!
20
l2=[0.00016263963870641478],
21
linf=[0.0014537194925779984])
22
# Ensure that we do not have excessive memory allocations
23
# (e.g., from type instabilities)
24
@test_allocations(Trixi.rhs!, semi, sol, 1000)
25
end
26
27
@trixi_testset "elixir_advection_unstructured_curved.jl" begin
28
@test_trixi_include(joinpath(EXAMPLES_DIR,
29
"elixir_advection_unstructured_curved.jl"),
30
l2=[0.0004750004258546538],
31
linf=[0.026527551737137167])
32
# Ensure that we do not have excessive memory allocations
33
# (e.g., from type instabilities)
34
@test_allocations(Trixi.rhs!, semi, sol, 1000)
35
end
36
37
@trixi_testset "elixir_advection_nonconforming.jl" begin
38
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_nonconforming.jl"),
39
l2=[0.00253595715323843],
40
linf=[0.016486952252155795])
41
# Ensure that we do not have excessive memory allocations
42
# (e.g., from type instabilities)
43
@test_allocations(Trixi.rhs!, semi, sol, 1000)
44
end
45
46
@trixi_testset "elixir_advection_amr.jl" begin
47
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_amr.jl"),
48
# Expected errors are exactly the same as with TreeMesh!
49
l2=[9.773852895157622e-6],
50
linf=[0.0005853874124926162])
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
@trixi_testset "elixir_advection_amr_unstructured_curved.jl" begin
57
@test_trixi_include(joinpath(EXAMPLES_DIR,
58
"elixir_advection_amr_unstructured_curved.jl"),
59
l2=[1.6163120948209677e-5],
60
linf=[0.0010572201890564834],
61
tspan=(0.0, 1.0))
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_advection_cubed_sphere.jl" begin
68
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_cubed_sphere.jl"),
69
l2=[0.002006918015656413],
70
linf=[0.027655117058380085])
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
76
@trixi_testset "elixir_advection_restart.jl" begin
77
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart.jl"),
78
l2=[0.002590388934758452],
79
linf=[0.01840757696885409])
80
# Ensure that we do not have excessive memory allocations
81
# (e.g., from type instabilities)
82
@test_allocations(Trixi.rhs!, semi, sol, 1000)
83
end
84
85
@trixi_testset "elixir_euler_source_terms_nonconforming_unstructured_curved.jl" begin
86
@test_trixi_include(joinpath(EXAMPLES_DIR,
87
"elixir_euler_source_terms_nonconforming_unstructured_curved.jl"),
88
l2=[
89
4.070355207909268e-5,
90
4.4993257426833716e-5,
91
5.10588457841744e-5,
92
5.102840924036687e-5,
93
0.00019986264001630542
94
],
95
linf=[
96
0.0016987332417202072,
97
0.003622956808262634,
98
0.002029576258317789,
99
0.0024206977281964193,
100
0.008526972236273522
101
],
102
tspan=(0.0, 0.01))
103
104
@test_trixi_include(joinpath(EXAMPLES_DIR,
105
"elixir_euler_source_terms_nonconforming_unstructured_curved.jl"),
106
surface_flux=FluxPlusDissipation(flux_ranocha,
107
DissipationMatrixWintersEtal()),
108
l2=[
109
4.068002997087932e-5,
110
4.4742882348806466e-5,
111
5.101817697733163e-5,
112
5.100410876233901e-5,
113
0.000199848133462063
114
],
115
linf=[
116
0.0013080357114820806,
117
0.0028524316301083985,
118
0.0019100643150573582,
119
0.0024800222220195955,
120
0.00830424488849335
121
],
122
tspan=(0.0, 0.01))
123
# Ensure that we do not have excessive memory allocations
124
# (e.g., from type instabilities)
125
@test_allocations(Trixi.rhs!, semi, sol, 1000)
126
end
127
128
@trixi_testset "elixir_euler_source_terms_nonperiodic.jl" begin
129
@test_trixi_include(joinpath(EXAMPLES_DIR,
130
"elixir_euler_source_terms_nonperiodic.jl"),
131
l2=[
132
0.0015106060984283647,
133
0.0014733349038567685,
134
0.00147333490385685,
135
0.001473334903856929,
136
0.0028149479453087093
137
],
138
linf=[
139
0.008070806335238156,
140
0.009007245083113125,
141
0.009007245083121784,
142
0.009007245083102688,
143
0.01562861968368434
144
],
145
tspan=(0.0, 1.0))
146
# Ensure that we do not have excessive memory allocations
147
# (e.g., from type instabilities)
148
@test_allocations(Trixi.rhs!, semi, sol, 1000)
149
end
150
151
@trixi_testset "elixir_euler_free_stream.jl" begin
152
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_free_stream.jl"),
153
l2=[
154
5.162664597942288e-15,
155
1.941857343642486e-14,
156
2.0232366394187278e-14,
157
2.3381518645408552e-14,
158
7.083114561232324e-14
159
],
160
linf=[
161
7.269740365245525e-13,
162
3.289868377720495e-12,
163
4.440087186807773e-12,
164
3.8686831516088205e-12,
165
9.412914891981927e-12
166
],
167
tspan=(0.0, 0.03))
168
# Ensure that we do not have excessive memory allocations
169
# (e.g., from type instabilities)
170
@test_allocations(Trixi.rhs!, semi, sol, 1000)
171
end
172
173
@trixi_testset "elixir_euler_free_stream.jl (VolumeIntegralPureLGLFiniteVolume)" begin
174
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_free_stream.jl"),
175
volume_integral=VolumeIntegralPureLGLFiniteVolume(flux_hllc),
176
cfl=1.0,
177
l2=[
178
1.9974155101075348e-15,
179
1.1961083306610996e-14,
180
1.2872974022570237e-14,
181
1.5462968285712546e-14,
182
2.6094715468434938e-14
183
],
184
linf=[
185
2.828848266744899e-13,
186
1.6810441927361808e-12,
187
2.784633634789202e-12,
188
2.8425040099477883e-12,
189
3.7339020764193265e-12
190
],
191
tspan=(0.0, 0.03))
192
# Ensure that we do not have excessive memory allocations
193
# (e.g., from type instabilities)
194
@test_allocations(Trixi.rhs!, semi, sol, 1000)
195
end
196
197
@trixi_testset "elixir_euler_free_stream_extruded.jl" begin
198
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_free_stream_extruded.jl"),
199
l2=[
200
8.444868392439035e-16,
201
4.889826056731442e-15,
202
2.2921260987087585e-15,
203
4.268460455702414e-15,
204
1.1356712092620279e-14
205
],
206
linf=[
207
7.749356711883593e-14,
208
2.8792246364872653e-13,
209
1.1121659149182506e-13,
210
3.3228975127030935e-13,
211
9.592326932761353e-13
212
],
213
tspan=(0.0, 0.1))
214
# Ensure that we do not have excessive memory allocations
215
# (e.g., from type instabilities)
216
@test_allocations(Trixi.rhs!, semi, sol, 1000)
217
end
218
219
@trixi_testset "elixir_euler_free_stream_extruded_fvO2.jl" begin
220
@test_trixi_include(joinpath(EXAMPLES_DIR,
221
"elixir_euler_free_stream_extruded_fvO2.jl"),
222
l2=[
223
1.5286679406524262e-16,
224
4.950311927136664e-16,
225
4.69913693630953e-16,
226
4.012046698403924e-16,
227
2.0419659904946413e-15
228
],
229
linf=[
230
2.220446049250313e-15,
231
3.3029134982598407e-15,
232
7.716050021144838e-15,
233
1.27675647831893e-14,
234
3.019806626980426e-14
235
],
236
tspan=(0.0, 0.1))
237
# Ensure that we do not have excessive memory allocations
238
# (e.g., from type instabilities)
239
@test_allocations(Trixi.rhs!, semi, sol, 1000)
240
end
241
242
@trixi_testset "elixir_euler_free_stream_boundaries.jl" begin
243
@test_trixi_include(joinpath(EXAMPLES_DIR,
244
"elixir_euler_free_stream_boundaries.jl"),
245
l2=[
246
6.530157034651212e-16, 1.6057829680004379e-15,
247
3.31107455378537e-15, 3.908829498281281e-15,
248
5.048390610424672e-15
249
],
250
linf=[
251
4.884981308350689e-15, 1.1921019726912618e-14,
252
1.5432100042289676e-14, 2.298161660974074e-14,
253
6.039613253960852e-14
254
])
255
# Ensure that we do not have excessive memory allocations
256
# (e.g., from type instabilities)
257
@test_allocations(Trixi.rhs!, semi, sol, 1000)
258
end
259
260
@trixi_testset "elixir_euler_free_stream_boundaries_float32.jl" begin
261
# Expected errors are taken from elixir_euler_free_stream_boundaries.jl
262
@test_trixi_include(joinpath(EXAMPLES_DIR,
263
"elixir_euler_free_stream_boundaries_float32.jl"),
264
l2=[
265
Float32(6.530157034651212e-16),
266
Float32(1.6057829680004379e-15),
267
Float32(3.31107455378537e-15),
268
Float32(3.908829498281281e-15),
269
Float32(5.048390610424672e-15)
270
],
271
linf=[
272
Float32(4.884981308350689e-15),
273
Float32(1.1921019726912618e-14),
274
Float32(1.5432100042289676e-14),
275
Float32(2.298161660974074e-14),
276
Float32(6.039613253960852e-14)
277
],
278
RealT_for_test_tolerances=Float32)
279
# Ensure that we do not have excessive memory allocations
280
# (e.g., from type instabilities)
281
@test_allocations(Trixi.rhs!, semi, sol, 1000)
282
end
283
284
@trixi_testset "elixir_euler_free_stream_extruded.jl with HLLC FLux" begin
285
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_free_stream_extruded.jl"),
286
l2=[
287
8.444868392439035e-16,
288
4.889826056731442e-15,
289
2.2921260987087585e-15,
290
4.268460455702414e-15,
291
1.1356712092620279e-14
292
],
293
linf=[
294
7.749356711883593e-14,
295
4.513472928735496e-13,
296
2.9790059308254513e-13,
297
1.057154364048074e-12,
298
1.6271428648906294e-12
299
],
300
tspan=(0.0, 0.1),
301
surface_flux=flux_hllc)
302
# Ensure that we do not have excessive memory allocations
303
# (e.g., from type instabilities)
304
@test_allocations(Trixi.rhs!, semi, sol, 1000)
305
end
306
307
@trixi_testset "elixir_euler_ec.jl" begin
308
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_ec.jl"),
309
l2=[
310
0.010380390326164493,
311
0.006192950051354618,
312
0.005970674274073704,
313
0.005965831290564327,
314
0.02628875593094754
315
],
316
linf=[
317
0.3326911600075694,
318
0.2824952141320467,
319
0.41401037398065543,
320
0.45574161423218573,
321
0.8099577682187109
322
],
323
tspan=(0.0, 0.2))
324
# Ensure that we do not have excessive memory allocations
325
# (e.g., from type instabilities)
326
@test_allocations(Trixi.rhs!, semi, sol, 1000)
327
end
328
329
@trixi_testset "elixir_euler_ec.jl (flux_chandrashekar)" begin
330
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_ec.jl"),
331
l2=[
332
0.010368548525287055,
333
0.006216054794583285,
334
0.006020401857347216,
335
0.006019175682769779,
336
0.026228080232814154
337
],
338
linf=[
339
0.3169376449662026,
340
0.28950510175646726,
341
0.4402523227566396,
342
0.4869168122387365,
343
0.7999141641954051
344
],
345
tspan=(0.0, 0.2),
346
volume_flux=flux_chandrashekar)
347
# Ensure that we do not have excessive memory allocations
348
# (e.g., from type instabilities)
349
@test_allocations(Trixi.rhs!, semi, sol, 1000)
350
end
351
352
@trixi_testset "elixir_euler_sedov.jl" begin
353
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_sedov.jl"),
354
l2=[
355
7.82070951e-02,
356
4.33260474e-02,
357
4.33260474e-02,
358
4.33260474e-02,
359
3.75260911e-01
360
],
361
linf=[
362
7.45329845e-01,
363
3.21754792e-01,
364
3.21754792e-01,
365
3.21754792e-01,
366
4.76151527e+00
367
],
368
tspan=(0.0, 0.3))
369
# Ensure that we do not have excessive memory allocations
370
# (e.g., from type instabilities)
371
@test_allocations(Trixi.rhs!, semi, sol, 1000)
372
end
373
374
@trixi_testset "elixir_euler_sedov_sc_subcell.jl (positivity bounds)" begin
375
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_sedov_sc_subcell.jl"),
376
l2=[
377
0.19427117014566905,
378
0.07557679851688888,
379
0.07557679851688896,
380
0.07557679851688917,
381
0.3713893373335463
382
],
383
linf=[
384
2.754292081408987,
385
1.888627709320322,
386
1.8886277093203232,
387
1.888627709320322,
388
4.971280431903264
389
],
390
tspan=(0.0, 0.3))
391
# Ensure that we do not have excessive memory allocations
392
# (e.g., from type instabilities)
393
# Larger values for allowed allocations due to usage of custom
394
# integrator which are not *recorded* for the methods from
395
# OrdinaryDiffEq.jl
396
# Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877
397
@test_allocations(Trixi.rhs!, semi, sol, 15_000)
398
end
399
400
@trixi_testset "elixir_euler_sedov_sc_subcell.jl (local bounds)" begin
401
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_sedov_sc_subcell.jl"),
402
local_twosided_variables_cons=["rho"],
403
local_onesided_variables_nonlinear=[(entropy_guermond_etal,
404
min)],
405
max_iterations_newton=30,
406
l2=[
407
0.16504564013491585,
408
0.06461384162458203,
409
0.06461384162461223,
410
0.06461384162461678,
411
0.36193245790622036
412
],
413
linf=[
414
0.9138327077620716,
415
0.5707102472596818,
416
0.5707102472739252,
417
0.5707102472781822,
418
4.777595503303726
419
],
420
tspan=(0.0, 0.3))
421
# Ensure that we do not have excessive memory allocations
422
# (e.g., from type instabilities)
423
# Larger values for allowed allocations due to usage of custom
424
# integrator which are not *recorded* for the methods from
425
# OrdinaryDiffEq.jl
426
# Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877
427
@test_allocations(Trixi.rhs!, semi, sol, 15_000)
428
end
429
430
@trixi_testset "elixir_euler_sedov_sc_subcell.jl (local bounds, nonperiodic)" begin
431
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_sedov_sc_subcell.jl"),
432
local_twosided_variables_cons=["rho"],
433
local_onesided_variables_nonlinear=[(entropy_guermond_etal,
434
min)],
435
max_iterations_newton=50,
436
periodicity=false,
437
boundary_conditions=BoundaryConditionDirichlet(initial_condition),
438
l2=[
439
0.16504564013491585,
440
0.06461384162458203,
441
0.06461384162461223,
442
0.06461384162461678,
443
0.36193245790622036
444
],
445
linf=[
446
0.9138327077620716,
447
0.5707102472596818,
448
0.5707102472739252,
449
0.5707102472781822,
450
4.777595503303726
451
],
452
tspan=(0.0, 0.3))
453
# Ensure that we do not have excessive memory allocations
454
# (e.g., from type instabilities)
455
# Larger values for allowed allocations due to usage of custom
456
# integrator which are not *recorded* for the methods from
457
# OrdinaryDiffEq.jl
458
# Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877
459
@test_allocations(Trixi.rhs!, semi, sol, 15_000)
460
end
461
462
@trixi_testset "elixir_euler_sedov.jl (HLLE)" begin
463
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_sedov.jl"),
464
l2=[
465
0.09946224487902565,
466
0.04863386374672001,
467
0.048633863746720116,
468
0.04863386374672032,
469
0.3751015774232693
470
],
471
linf=[
472
0.789241521871487,
473
0.42046970270100276,
474
0.42046970270100276,
475
0.4204697027010028,
476
4.730877375538398
477
],
478
tspan=(0.0, 0.3),
479
surface_flux=flux_hlle)
480
# Ensure that we do not have excessive memory allocations
481
# (e.g., from type instabilities)
482
@test_allocations(Trixi.rhs!, semi, sol, 1000)
483
end
484
485
@trixi_testset "elixir_euler_source_terms_nonconforming_earth.jl" begin
486
@test_trixi_include(joinpath(EXAMPLES_DIR,
487
"elixir_euler_source_terms_nonconforming_earth.jl"),
488
l2=[
489
6.040180337738628e-6,
490
5.4254175153621895e-6,
491
5.677698851333843e-6,
492
5.8017136892469794e-6,
493
1.3637854615117974e-5
494
],
495
linf=[
496
0.00013996924184311865,
497
0.00013681539559939893,
498
0.00013681539539733834,
499
0.00013681539541021692,
500
0.00016833038543762058
501
],
502
# Decrease tolerance of adaptive time stepping to get similar results across different systems
503
abstol=1.0e-11, reltol=1.0e-11)
504
# Ensure that we do not have excessive memory allocations
505
# (e.g., from type instabilities)
506
@test_allocations(Trixi.rhs!, semi, sol, 1000)
507
end
508
509
@trixi_testset "elixir_euler_circular_wind_nonconforming.jl" begin
510
@test_trixi_include(joinpath(EXAMPLES_DIR,
511
"elixir_euler_circular_wind_nonconforming.jl"),
512
l2=[
513
1.5737711609657832e-7,
514
3.8630261900166194e-5,
515
3.8672287531936816e-5,
516
3.6865116098660796e-5,
517
0.05508620970403884
518
],
519
linf=[
520
2.268845333053271e-6,
521
0.000531462302113539,
522
0.0005314624461298934,
523
0.0005129931254772464,
524
0.7942778058932163
525
],
526
tspan=(0.0, 2e2))
527
# Ensure that we do not have excessive memory allocations
528
# (e.g., from type instabilities)
529
@test_allocations(Trixi.rhs!, semi, sol, 1000)
530
end
531
532
@trixi_testset "elixir_euler_baroclinic_instability.jl" begin
533
@test_trixi_include(joinpath(EXAMPLES_DIR,
534
"elixir_euler_baroclinic_instability.jl"),
535
l2=[
536
6.725093801700048e-7,
537
0.00021710076010951073,
538
0.0004386796338203878,
539
0.00020836270267103122,
540
0.07601887903440395
541
],
542
linf=[
543
1.9107530539574924e-5,
544
0.02980358831035801,
545
0.048476331898047564,
546
0.02200137344113612,
547
4.848310144356219
548
],
549
tspan=(0.0, 1e2),
550
# Decrease tolerance of adaptive time stepping to get similar results across different systems
551
abstol=1.0e-9, reltol=1.0e-9)
552
# Ensure that we do not have excessive memory allocations
553
# (e.g., from type instabilities)
554
@test_allocations(Trixi.rhs!, semi, sol, 1000)
555
end
556
557
@trixi_testset "elixir_euler_source_terms_nonperiodic_hohqmesh.jl" begin
558
@test_trixi_include(joinpath(EXAMPLES_DIR,
559
"elixir_euler_source_terms_nonperiodic_hohqmesh.jl"),
560
l2=[
561
0.0042023406458005464,
562
0.004122532789279737,
563
0.0042448149597303616,
564
0.0036361316700401765,
565
0.007389845952982495
566
],
567
linf=[
568
0.04530610539892499,
569
0.02765695110527666,
570
0.05670295599308606,
571
0.048396544302230504,
572
0.1154589758186293
573
])
574
# Ensure that we do not have excessive memory allocations
575
# (e.g., from type instabilities)
576
@test_allocations(Trixi.rhs!, semi, sol, 1000)
577
end
578
579
@trixi_testset "elixir_euler_tandem_spheres.jl" begin
580
@test_trixi_include(joinpath(EXAMPLES_DIR,
581
"elixir_euler_tandem_spheres.jl"),
582
# Strict tols to avoid issues with different systems (CI vs local machines)
583
tspan=(0.0, 1e-3), tols=1e-8,
584
l2=[
585
1.4563595831943405e-6,
586
1.1433846164578946e-6,
587
6.45964041497078e-7,
588
6.446228703680879e-7,
589
3.648646693902689e-6
590
],
591
linf=[
592
0.08928818652777637,
593
0.09007801634411498,
594
0.04241320785718675,
595
0.04253018852293939,
596
0.22552627764127076
597
])
598
# Ensure that we do not have excessive memory allocations
599
# (e.g., from type instabilities)
600
@test_allocations(Trixi.rhs!, semi, sol, 1000)
601
end
602
603
@trixi_testset "elixir_euler_free_stream_hybrid_mesh.jl" begin
604
@test_trixi_include(joinpath(EXAMPLES_DIR,
605
"elixir_euler_free_stream_hybrid_mesh.jl"),
606
l2=[
607
6.459343647140878e-16,
608
1.6402804603545678e-15,
609
2.0956682982886904e-15,
610
2.3267454534698676e-15,
611
3.802615222445529e-15
612
],
613
linf=[
614
1.1657341758564144e-14,
615
1.6056600493641326e-14,
616
3.5665914666083154e-14,
617
3.68594044175552e-14,
618
6.217248937900877e-14
619
])
620
# Ensure that we do not have excessive memory allocations
621
# (e.g., from type instabilities)
622
@test_allocations(Trixi.rhs!, semi, sol, 1000)
623
end
624
625
@trixi_testset "elixir_mhd_alfven_wave_er.jl" begin
626
@test_trixi_include(joinpath(EXAMPLES_DIR,
627
"elixir_mhd_alfven_wave_er.jl"),
628
l2=[
629
0.0052864046546744065,
630
0.009963357787771665,
631
0.006635699953141596,
632
0.01295540589311982,
633
0.013939326496053958,
634
0.010192741315114568,
635
0.004631666336074305,
636
0.012267586777052244,
637
0.0018063823439272181
638
],
639
linf=[
640
0.021741826900806394,
641
0.0470226920658848,
642
0.025036937229995254,
643
0.05043002191230382,
644
0.06018360063552164,
645
0.04338351710391075,
646
0.023607975939848536,
647
0.050740527490335,
648
0.006909064342577296
649
])
650
# Larger values for allowed allocations due to usage of custom
651
# integrator which are not *recorded* for the methods from
652
# OrdinaryDiffEq.jl
653
# Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877
654
@test_allocations(Trixi.rhs!, semi, sol, 15_000)
655
end
656
657
@trixi_testset "elixir_mhd_alfven_wave_nonconforming.jl" begin
658
@test_trixi_include(joinpath(EXAMPLES_DIR,
659
"elixir_mhd_alfven_wave_nonconforming.jl"),
660
l2=[
661
0.0001788543743594658,
662
0.000624334205581902,
663
0.00022892869974368887,
664
0.0007223464581156573,
665
0.0006651366626523314,
666
0.0006287275014743352,
667
0.000344484339916008,
668
0.0007179788287557142,
669
8.632896980651243e-7
670
],
671
linf=[
672
0.0010730565632763867,
673
0.004596749809344033,
674
0.0013235269262853733,
675
0.00468874234888117,
676
0.004719267084104306,
677
0.004228339352211896,
678
0.0037503625505571625,
679
0.005104176909383168,
680
9.738081186490818e-6
681
],
682
tspan=(0.0, 0.25))
683
# Ensure that we do not have excessive memory allocations
684
# (e.g., from type instabilities)
685
@test_allocations(Trixi.rhs!, semi, sol, 1000)
686
end
687
688
@trixi_testset "elixir_mhd_alfven_wave_nonperiodic.jl" begin
689
@test_trixi_include(joinpath(EXAMPLES_DIR,
690
"elixir_mhd_alfven_wave_nonperiodic.jl"),
691
l2=[
692
0.00017912812934894293,
693
0.000630910737693146,
694
0.0002256138768371346,
695
0.0007301686017397987,
696
0.0006647296256552257,
697
0.0006409790941359089,
698
0.00033986873316986315,
699
0.0007277161123570452,
700
1.3184121257198033e-5
701
],
702
linf=[
703
0.0012248374096375247,
704
0.004857541490859554,
705
0.001813452620706816,
706
0.004803571938364726,
707
0.005271403957646026,
708
0.004571200760744465,
709
0.002618188297242474,
710
0.005010126350015381,
711
6.309149507784953e-5
712
],
713
tspan=(0.0, 0.25))
714
# Ensure that we do not have excessive memory allocations
715
# (e.g., from type instabilities)
716
@test_allocations(Trixi.rhs!, semi, sol, 1000)
717
end
718
719
@trixi_testset "elixir_mhd_shockcapturing_amr.jl" begin
720
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_shockcapturing_amr.jl"),
721
l2=[
722
0.0062973565893792004,
723
0.006436273914579104,
724
0.007112703307027178,
725
0.006529650167358523,
726
0.020607452343745017,
727
0.005560993001492338,
728
0.007576418168749763,
729
0.0055721349394598635,
730
3.8269125984310296e-6
731
],
732
linf=[
733
0.2090718196650192,
734
0.1863884052971854,
735
0.23475479927204168,
736
0.19460789763442982,
737
0.6859816363887359,
738
0.15171474186273914,
739
0.22404690260234983,
740
0.16808957604979002,
741
0.0005083795485317637
742
],
743
tspan=(0.0, 0.04))
744
# Ensure that we do not have excessive memory allocations
745
# (e.g., from type instabilities)
746
@test_allocations(Trixi.rhs!, semi, sol, 1000)
747
end
748
749
@trixi_testset "elixir_mhd_shockcapturing_subcell.jl" begin
750
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_shockcapturing_subcell.jl"),
751
l2=[
752
0.006729931970167595,
753
0.008638393158639436,
754
0.008978257148101689,
755
0.0085466685190268,
756
0.0285664608641833,
757
0.005796806835751598,
758
0.007485378539184046,
759
0.005846216235895686,
760
1.116115482859488e-5
761
],
762
linf=[
763
0.31507940417652525,
764
0.27581230560179737,
765
0.5096527712168957,
766
0.2900021150087706,
767
0.9484970527977867,
768
0.2591599747174065,
769
0.22934145164154485,
770
0.2868673643088755,
771
0.0013663401454538622
772
],
773
tspan=(0.0, 0.04))
774
# Ensure that we do not have excessive memory allocations
775
# (e.g., from type instabilities)
776
# Larger values for allowed allocations due to usage of custom
777
# integrator which are not *recorded* for the methods from
778
# OrdinaryDiffEq.jl
779
# Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877
780
@test_allocations(Trixi.rhs!, semi, sol, 15_000)
781
end
782
783
@trixi_testset "elixir_mhd_amr_entropy_bounded.jl" begin
784
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_amr_entropy_bounded.jl"),
785
l2=[
786
0.005430006338127661,
787
0.006186402899876596,
788
0.012171513410597289,
789
0.006181479343504159,
790
0.035068817354117605,
791
0.004967715666538709,
792
0.006592173316509503,
793
0.0050151140388451105,
794
5.146547644807638e-6
795
],
796
linf=[
797
0.18655204102670386,
798
0.20397573777286138,
799
0.3700839435299759,
800
0.23329319876321034,
801
1.0348619438460904,
802
0.18462694496595722,
803
0.20648634653698617,
804
0.18947822281424997,
805
0.0005083794158781671
806
],
807
tspan=(0.0, 0.04))
808
# Ensure that we do not have excessive memory allocations
809
# (e.g., from type instabilities)
810
@test_allocations(Trixi.rhs!, semi, sol, 1000)
811
end
812
813
@trixi_testset "elixir_linearizedeuler_convergence.jl" begin
814
@test_trixi_include(joinpath(EXAMPLES_DIR,
815
"elixir_linearizedeuler_convergence.jl"),
816
l2=[
817
0.04452389418193219, 0.03688186699434862,
818
0.03688186699434861, 0.03688186699434858,
819
0.044523894181932186
820
],
821
linf=[
822
0.2295447498696467, 0.058369658071546704,
823
0.05836965807154648, 0.05836965807154648, 0.2295447498696468
824
])
825
# Ensure that we do not have excessive memory allocations
826
# (e.g., from type instabilities)
827
@test_allocations(Trixi.rhs!, semi, sol, 1000)
828
end
829
830
@trixi_testset "elixir_euler_weak_blast_wave_amr.jl" begin
831
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_weak_blast_wave_amr.jl"),
832
l2=[
833
0.01374649869395016,
834
0.01993458602992416,
835
0.020403214655756098,
836
0.020408263790073853,
837
0.14975849029503904
838
],
839
linf=[
840
0.4411601724293266,
841
0.668308654218055,
842
0.7351134068050753,
843
0.5955002383710662,
844
3.1811162616598985
845
],
846
tspan=(0.0, 0.025))
847
# Ensure that we do not have excessive memory allocations
848
# (e.g., from type instabilities)
849
@test_allocations(Trixi.rhs!, semi, sol, 1000)
850
# Check for conservation
851
state_integrals = Trixi.integrate(sol.u[2], semi)
852
initial_state_integrals = analysis_callback.affect!.initial_state_integrals
853
854
@test isapprox(state_integrals[1], initial_state_integrals[1], atol = 1e-13)
855
@test isapprox(state_integrals[2], initial_state_integrals[2], atol = 1e-13)
856
@test isapprox(state_integrals[3], initial_state_integrals[3], atol = 1e-13)
857
@test isapprox(state_integrals[4], initial_state_integrals[4], atol = 1e-13)
858
@test isapprox(state_integrals[5], initial_state_integrals[5], atol = 1e-13)
859
end
860
861
@trixi_testset "elixir_euler_ONERA_M6_wing.jl" begin
862
@test_trixi_include(joinpath(EXAMPLES_DIR,
863
"elixir_euler_ONERA_M6_wing.jl"),
864
l2=[
865
1.3302852203314697e-7,
866
7.016342225152883e-8,
867
1.0954098970860626e-7,
868
6.834890433113107e-8,
869
3.796737956937651e-7
870
],
871
linf=[
872
0.08856648749331164,
873
0.07431651477033197,
874
0.08791247483932041,
875
0.012973811024139751,
876
0.25575828277482016
877
],
878
tspan=(0.0, 5e-8))
879
# Ensure that we do not have excessive memory allocations
880
# (e.g., from type instabilities)
881
@test_allocations(Trixi.rhs!, semi, sol, 1000)
882
end
883
884
# Multi-ion MHD tests
885
include("test_p4est_3d_mhdmultiion.jl")
886
end
887
888
# Clean up afterwards: delete Trixi.jl output directory
889
@test_nowarn rm(outdir, recursive = true)
890
891
end # module
892
893