Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
trixi-framework
GitHub Repository: trixi-framework/Trixi.jl
Path: blob/main/test/test_structured_2d.jl
2055 views
1
module TestExamplesStructuredMesh2D
2
3
using Test
4
using Trixi
5
6
include("test_trixi.jl")
7
8
EXAMPLES_DIR = joinpath(examples_dir(), "structured_2d_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 "StructuredMesh2D" 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=[8.311947673061856e-6],
21
linf=[6.627000273229378e-5])
22
# Ensure that we do not have excessive memory allocations
23
# (e.g., from type instabilities)
24
let
25
t = sol.t[end]
26
u_ode = sol.u[end]
27
du_ode = similar(u_ode)
28
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
29
end
30
end
31
32
@trixi_testset "elixir_advection_float32.jl" begin
33
# Expected errors are taken from elixir_advection_basic.jl
34
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_float32.jl"),
35
# Expected errors are taken from elixir_advection_basic.jl
36
l2=[Float32(8.311947673061856e-6)],
37
linf=[Float32(6.627000273229378e-5)],
38
RealT=Float32)
39
# Ensure that we do not have excessive memory allocations
40
# (e.g., from type instabilities)
41
let
42
t = sol.t[end]
43
u_ode = sol.u[end]
44
du_ode = similar(u_ode)
45
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
46
end
47
end
48
49
@trixi_testset "elixir_advection_coupled.jl" begin
50
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_coupled.jl"),
51
l2=[
52
7.816742843336293e-6,
53
7.816742843340186e-6,
54
7.816742843025513e-6,
55
7.816742843061526e-6
56
],
57
linf=[
58
6.314906965276812e-5,
59
6.314906965187994e-5,
60
6.31490696496595e-5,
61
6.314906965032563e-5
62
])
63
64
@testset "analysis_callback(sol) for AnalysisCallbackCoupled" begin
65
errors = analysis_callback(sol)
66
@test errors.l2≈[
67
7.816742843336293e-6,
68
7.816742843340186e-6,
69
7.816742843025513e-6,
70
7.816742843061526e-6
71
] rtol=1.0e-4
72
@test errors.linf≈[
73
6.314906965276812e-5,
74
6.314906965187994e-5,
75
6.31490696496595e-5,
76
6.314906965032563e-5
77
] rtol=1.0e-4
78
# Ensure that we do not have excessive memory allocations
79
# (e.g., from type instabilities)
80
let
81
t = sol.t[end]
82
u_ode = sol.u[end]
83
du_ode = similar(u_ode)
84
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
85
end
86
end
87
88
# Test plotdata construction for coupled semidiscretization
89
@test_nowarn pd = PlotData2D(sol)
90
end
91
92
@trixi_testset "elixir_advection_meshview.jl" begin
93
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_meshview.jl"),
94
l2=[
95
8.311947673083206e-6,
96
8.311947673068427e-6
97
],
98
linf=[
99
6.627000273318195e-5,
100
6.62700027264096e-5
101
])
102
103
@testset "analysis_callback(sol) for AnalysisCallbackCoupled" begin
104
# Ensure that we do not have excessive memory allocations
105
# (e.g., from type instabilities)
106
let
107
t = sol.t[end]
108
u_ode = sol.u[end]
109
du_ode = similar(u_ode)
110
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
111
end
112
end
113
end
114
115
@trixi_testset "elixir_advection_meshview.jl with time-dependent CFL" begin
116
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_meshview.jl"),
117
l2=[
118
8.311947673083206e-6,
119
8.311947673068427e-6
120
],
121
linf=[
122
6.627000273318195e-5,
123
6.62700027264096e-5
124
],
125
stepsize_callback=StepsizeCallback(cfl = x -> 1.6))
126
127
@testset "analysis_callback(sol) for AnalysisCallbackCoupled" begin
128
# Ensure that we do not have excessive memory allocations
129
# (e.g., from type instabilities)
130
let
131
t = sol.t[end]
132
u_ode = sol.u[end]
133
du_ode = similar(u_ode)
134
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
135
end
136
end
137
end
138
139
@trixi_testset "elixir_advection_extended.jl" begin
140
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_extended.jl"),
141
l2=[4.220397559713772e-6],
142
linf=[3.477948874874848e-5])
143
# Ensure that we do not have excessive memory allocations
144
# (e.g., from type instabilities)
145
let
146
t = sol.t[end]
147
u_ode = sol.u[end]
148
du_ode = similar(u_ode)
149
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
150
end
151
end
152
153
@trixi_testset "elixir_advection_extended.jl with polydeg=4" begin
154
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_extended.jl"),
155
l2=[5.32996976442737e-7],
156
linf=[4.1344662966569246e-6],
157
atol=1e-12, # required to make CI tests pass on macOS
158
cells_per_dimension=(16, 23),
159
polydeg=4,
160
cfl=1.4)
161
# Ensure that we do not have excessive memory allocations
162
# (e.g., from type instabilities)
163
let
164
t = sol.t[end]
165
u_ode = sol.u[end]
166
du_ode = similar(u_ode)
167
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
168
end
169
end
170
171
@testset "elixir_advection_rotated.jl" begin
172
@trixi_testset "elixir_advection_rotated.jl with α = 0.0" begin
173
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_rotated.jl"),
174
# Expected errors are exactly the same as in elixir_advection_basic!
175
l2=[8.311947673061856e-6],
176
linf=[6.627000273229378e-5],
177
alpha=0.0)
178
# Ensure that we do not have excessive memory allocations
179
# (e.g., from type instabilities)
180
let
181
t = sol.t[end]
182
u_ode = sol.u[end]
183
du_ode = similar(u_ode)
184
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
185
end
186
end
187
188
@trixi_testset "elixir_advection_rotated.jl with α = 0.1" begin
189
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_rotated.jl"),
190
# Expected errors differ only slightly from elixir_advection_basic!
191
l2=[8.3122750550501e-6],
192
linf=[6.626802581322089e-5],
193
alpha=0.1)
194
# Ensure that we do not have excessive memory allocations
195
# (e.g., from type instabilities)
196
let
197
t = sol.t[end]
198
u_ode = sol.u[end]
199
du_ode = similar(u_ode)
200
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
201
end
202
end
203
204
@trixi_testset "elixir_advection_rotated.jl with α = 0.5 * pi" begin
205
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_rotated.jl"),
206
# Expected errors are exactly the same as in elixir_advection_basic!
207
l2=[8.311947673061856e-6],
208
linf=[6.627000273229378e-5],
209
alpha=0.5 * pi)
210
# Ensure that we do not have excessive memory allocations
211
# (e.g., from type instabilities)
212
let
213
t = sol.t[end]
214
u_ode = sol.u[end]
215
du_ode = similar(u_ode)
216
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
217
end
218
end
219
end
220
221
@trixi_testset "elixir_advection_parallelogram.jl" begin
222
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_parallelogram.jl"),
223
# Expected errors are exactly the same as in elixir_advection_basic!
224
l2=[8.311947673061856e-6],
225
linf=[6.627000273229378e-5])
226
# Ensure that we do not have excessive memory allocations
227
# (e.g., from type instabilities)
228
let
229
t = sol.t[end]
230
u_ode = sol.u[end]
231
du_ode = similar(u_ode)
232
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
233
end
234
end
235
236
@trixi_testset "elixir_advection_waving_flag.jl" begin
237
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_waving_flag.jl"),
238
l2=[0.00018553859900545866],
239
linf=[0.0016167719118129753])
240
# Ensure that we do not have excessive memory allocations
241
# (e.g., from type instabilities)
242
let
243
t = sol.t[end]
244
u_ode = sol.u[end]
245
du_ode = similar(u_ode)
246
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
247
end
248
end
249
250
@trixi_testset "elixir_advection_free_stream.jl" begin
251
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_free_stream.jl"),
252
l2=[6.8925194184204476e-15],
253
linf=[9.903189379656396e-14])
254
# Ensure that we do not have excessive memory allocations
255
# (e.g., from type instabilities)
256
let
257
t = sol.t[end]
258
u_ode = sol.u[end]
259
du_ode = similar(u_ode)
260
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
261
end
262
end
263
264
@trixi_testset "elixir_advection_nonperiodic.jl" begin
265
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_nonperiodic.jl"),
266
l2=[0.00025552740731641223],
267
linf=[0.007252625722805939])
268
# Ensure that we do not have excessive memory allocations
269
# (e.g., from type instabilities)
270
let
271
t = sol.t[end]
272
u_ode = sol.u[end]
273
du_ode = similar(u_ode)
274
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
275
end
276
end
277
278
@trixi_testset "elixir_advection_restart.jl" begin
279
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart.jl"),
280
l2=[4.219208035582454e-6],
281
linf=[3.438434404412494e-5])
282
# Ensure that we do not have excessive memory allocations
283
# (e.g., from type instabilities)
284
let
285
t = sol.t[end]
286
u_ode = sol.u[end]
287
du_ode = similar(u_ode)
288
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
289
end
290
end
291
292
@trixi_testset "elixir_advection_restart.jl with waving flag mesh" begin
293
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart.jl"),
294
l2=[0.00016265538265929818],
295
linf=[0.0015194252169410394],
296
rtol=5.0e-5, # Higher tolerance to make tests pass in CI (in particular with macOS)
297
elixir_file="elixir_advection_waving_flag.jl",
298
restart_file="restart_000000021.h5",)
299
# Ensure that we do not have excessive memory allocations
300
# (e.g., from type instabilities)
301
let
302
t = sol.t[end]
303
u_ode = sol.u[end]
304
du_ode = similar(u_ode)
305
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
306
end
307
end
308
309
@trixi_testset "elixir_advection_restart.jl with free stream mesh" begin
310
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart.jl"),
311
l2=[7.841217436552029e-15],
312
linf=[1.0857981180834031e-13],
313
elixir_file="elixir_advection_free_stream.jl",
314
restart_file="restart_000000036.h5",)
315
# Ensure that we do not have excessive memory allocations
316
# (e.g., from type instabilities)
317
let
318
t = sol.t[end]
319
u_ode = sol.u[end]
320
du_ode = similar(u_ode)
321
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
322
end
323
end
324
325
@trixi_testset "elixir_euler_convergence_implicit_sparse_jacobian.jl" begin
326
@test_trixi_include(joinpath(EXAMPLES_DIR,
327
"elixir_euler_convergence_implicit_sparse_jacobian.jl"),
328
tspan=(0.0, 1.0),
329
l2=[
330
0.0025545032994393493,
331
0.0025848892135096136,
332
0.002585815262287367,
333
0.0031668773337869584
334
],
335
linf=[
336
0.010367159504626189,
337
0.009326212633131492,
338
0.008372785091578683,
339
0.011242647117379434
340
])
341
# Ensure that we do not have excessive memory allocations
342
# (e.g., from type instabilities)
343
let
344
t = sol.t[end]
345
u_ode = sol.u[end]
346
du_ode = similar(u_ode)
347
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi_float_type, t)) < 1000
348
end
349
end
350
351
@trixi_testset "elixir_eulermulti_convergence_ec.jl" begin
352
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_eulermulti_convergence_ec.jl"),
353
l2=[
354
1.5123651627525257e-5,
355
1.51236516273878e-5,
356
2.4544918394022538e-5,
357
5.904791661362391e-6,
358
1.1809583322724782e-5
359
],
360
linf=[
361
8.393471747591974e-5,
362
8.393471748258108e-5,
363
0.00015028562494778797,
364
3.504466610437795e-5,
365
7.00893322087559e-5
366
])
367
# Ensure that we do not have excessive memory allocations
368
# (e.g., from type instabilities)
369
let
370
t = sol.t[end]
371
u_ode = sol.u[end]
372
du_ode = similar(u_ode)
373
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
374
end
375
end
376
377
@trixi_testset "elixir_euler_source_terms.jl" begin
378
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_source_terms.jl"),
379
# Expected errors are exactly the same as with TreeMesh!
380
l2=[
381
9.321181253186009e-7,
382
1.4181210743438511e-6,
383
1.4181210743487851e-6,
384
4.824553091276693e-6
385
],
386
linf=[
387
9.577246529612893e-6,
388
1.1707525976012434e-5,
389
1.1707525976456523e-5,
390
4.8869615580926506e-5
391
])
392
# Ensure that we do not have excessive memory allocations
393
# (e.g., from type instabilities)
394
let
395
t = sol.t[end]
396
u_ode = sol.u[end]
397
du_ode = similar(u_ode)
398
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
399
end
400
end
401
402
@testset "elixir_euler_source_terms_rotated.jl" begin
403
@trixi_testset "elixir_euler_source_terms_rotated.jl with α = 0.0" begin
404
@test_trixi_include(joinpath(EXAMPLES_DIR,
405
"elixir_euler_source_terms_rotated.jl"),
406
# Expected errors are exactly the same as in elixir_euler_source_terms!
407
l2=[
408
9.321181253186009e-7,
409
1.4181210743438511e-6,
410
1.4181210743487851e-6,
411
4.824553091276693e-6
412
],
413
linf=[
414
9.577246529612893e-6,
415
1.1707525976012434e-5,
416
1.1707525976456523e-5,
417
4.8869615580926506e-5
418
],
419
alpha=0.0)
420
# Ensure that we do not have excessive memory allocations
421
# (e.g., from type instabilities)
422
let
423
t = sol.t[end]
424
u_ode = sol.u[end]
425
du_ode = similar(u_ode)
426
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
427
end
428
end
429
430
@trixi_testset "elixir_euler_source_terms_rotated.jl with α = 0.1" begin
431
@test_trixi_include(joinpath(EXAMPLES_DIR,
432
"elixir_euler_source_terms_rotated.jl"),
433
# Expected errors differ only slightly from elixir_euler_source_terms!
434
l2=[
435
9.321188057029291e-7,
436
1.3195106906473365e-6,
437
1.510307360354032e-6,
438
4.82455408101712e-6
439
],
440
linf=[
441
9.57723626271445e-6,
442
1.0480225511866337e-5,
443
1.2817828088262928e-5,
444
4.886962393513272e-5
445
],
446
alpha=0.1)
447
# Ensure that we do not have excessive memory allocations
448
# (e.g., from type instabilities)
449
let
450
t = sol.t[end]
451
u_ode = sol.u[end]
452
du_ode = similar(u_ode)
453
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
454
end
455
end
456
457
@trixi_testset "elixir_euler_source_terms_rotated.jl with α = 0.2 * pi" begin
458
@test_trixi_include(joinpath(EXAMPLES_DIR,
459
"elixir_euler_source_terms_rotated.jl"),
460
# Expected errors differ only slightly from elixir_euler_source_terms!
461
l2=[
462
9.32127973957391e-7,
463
8.477824799744325e-7,
464
1.8175286311402784e-6,
465
4.824562453521076e-6
466
],
467
linf=[
468
9.576898420737834e-6,
469
5.057704352218195e-6,
470
1.635260719945464e-5,
471
4.886978754825577e-5
472
],
473
alpha=0.2 * pi)
474
# Ensure that we do not have excessive memory allocations
475
# (e.g., from type instabilities)
476
let
477
t = sol.t[end]
478
u_ode = sol.u[end]
479
du_ode = similar(u_ode)
480
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
481
end
482
end
483
484
@trixi_testset "elixir_euler_source_terms_rotated.jl with α = 0.5 * pi" begin
485
@test_trixi_include(joinpath(EXAMPLES_DIR,
486
"elixir_euler_source_terms_rotated.jl"),
487
# Expected errors are exactly the same as in elixir_euler_source_terms!
488
l2=[
489
9.321181253186009e-7,
490
1.4181210743438511e-6,
491
1.4181210743487851e-6,
492
4.824553091276693e-6
493
],
494
linf=[
495
9.577246529612893e-6,
496
1.1707525976012434e-5,
497
1.1707525976456523e-5,
498
4.8869615580926506e-5
499
],
500
alpha=0.5 * pi)
501
# Ensure that we do not have excessive memory allocations
502
# (e.g., from type instabilities)
503
let
504
t = sol.t[end]
505
u_ode = sol.u[end]
506
du_ode = similar(u_ode)
507
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
508
end
509
end
510
end
511
512
@trixi_testset "elixir_euler_source_terms_parallelogram.jl" begin
513
@test_trixi_include(joinpath(EXAMPLES_DIR,
514
"elixir_euler_source_terms_parallelogram.jl"),
515
l2=[
516
1.1167802955144833e-5,
517
1.0805775514153104e-5,
518
1.953188337010932e-5,
519
5.5033856574857146e-5
520
],
521
linf=[
522
8.297006495561199e-5,
523
8.663281475951301e-5,
524
0.00012264160606778596,
525
0.00041818802502024965
526
])
527
# Ensure that we do not have excessive memory allocations
528
# (e.g., from type instabilities)
529
let
530
t = sol.t[end]
531
u_ode = sol.u[end]
532
du_ode = similar(u_ode)
533
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
534
end
535
end
536
537
@trixi_testset "elixir_euler_source_terms_waving_flag.jl" begin
538
@test_trixi_include(joinpath(EXAMPLES_DIR,
539
"elixir_euler_source_terms_waving_flag.jl"),
540
l2=[
541
2.991891317562739e-5,
542
3.6063177168283174e-5,
543
2.7082941743640572e-5,
544
0.00011414695350996946
545
],
546
linf=[
547
0.0002437454930492855,
548
0.0003438936171968887,
549
0.00024217622945688078,
550
0.001266380414757684
551
])
552
# Ensure that we do not have excessive memory allocations
553
# (e.g., from type instabilities)
554
let
555
t = sol.t[end]
556
u_ode = sol.u[end]
557
du_ode = similar(u_ode)
558
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
559
end
560
end
561
562
@trixi_testset "elixir_euler_free_stream.jl" begin
563
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_free_stream.jl"),
564
l2=[
565
2.063350241405049e-15,
566
1.8571016296925367e-14,
567
3.1769447886391905e-14,
568
1.4104095258528071e-14
569
],
570
linf=[
571
1.9539925233402755e-14,
572
2.9791447087035294e-13,
573
6.502853810985698e-13,
574
2.7000623958883807e-13
575
],
576
atol=7.0e-13)
577
# Ensure that we do not have excessive memory allocations
578
# (e.g., from type instabilities)
579
let
580
t = sol.t[end]
581
u_ode = sol.u[end]
582
du_ode = similar(u_ode)
583
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
584
end
585
end
586
587
# Up to version 0.13.0, `max_abs_speed_naive` was used as the default wave speed estimate of
588
# `const flux_lax_friedrichs = FluxLaxFriedrichs(), i.e., `FluxLaxFriedrichs(max_abs_speed = max_abs_speed_naive)`.
589
# In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`.
590
# Thus, we exchanged in PR#2458 the default wave speed used in the LLF flux to `max_abs_speed`.
591
# To ensure that every example still runs we specify explicitly `FluxLaxFriedrichs(max_abs_speed_naive)`.
592
# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the
593
# `StepsizeCallback` (CFL-Condition) and less diffusion.
594
@trixi_testset "elixir_euler_free_stream.jl with FluxRotated(FluxLaxFriedrichs(max_abs_speed_naive))" begin
595
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_free_stream.jl"),
596
surface_flux=FluxRotated(FluxLaxFriedrichs(max_abs_speed_naive)),
597
l2=[
598
2.063350241405049e-15,
599
1.8571016296925367e-14,
600
3.1769447886391905e-14,
601
1.4104095258528071e-14
602
],
603
linf=[
604
1.9539925233402755e-14,
605
2.9791447087035294e-13,
606
6.502853810985698e-13,
607
2.7000623958883807e-13
608
],
609
atol=7.0e-13)
610
# Ensure that we do not have excessive memory allocations
611
# (e.g., from type instabilities)
612
let
613
t = sol.t[end]
614
u_ode = sol.u[end]
615
du_ode = similar(u_ode)
616
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
617
end
618
end
619
620
@trixi_testset "elixir_euler_source_terms_nonperiodic.jl" begin
621
@test_trixi_include(joinpath(EXAMPLES_DIR,
622
"elixir_euler_source_terms_nonperiodic.jl"),
623
l2=[
624
2.259440511901724e-6,
625
2.3188881559075347e-6,
626
2.3188881559568146e-6,
627
6.332786324137878e-6
628
],
629
linf=[
630
1.4987382622067003e-5,
631
1.918201192063762e-5,
632
1.918201192019353e-5,
633
6.052671713430158e-5
634
])
635
# Ensure that we do not have excessive memory allocations
636
# (e.g., from type instabilities)
637
let
638
t = sol.t[end]
639
u_ode = sol.u[end]
640
du_ode = similar(u_ode)
641
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
642
end
643
end
644
645
@trixi_testset "elixir_euler_vortex_perk4.jl" begin
646
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_vortex_perk4.jl"),
647
l2=[
648
0.0001846244731283424,
649
0.00042537910268029285,
650
0.0003724909264689687,
651
0.0026689613797051493
652
],
653
linf=[
654
0.0025031072787504716,
655
0.009266316022570331,
656
0.009876399281272374,
657
0.0306915591360557
658
])
659
# Ensure that we do not have excessive memory allocations
660
# (e.g., from type instabilities)
661
let
662
t = sol.t[end]
663
u_ode = sol.u[end]
664
du_ode = similar(u_ode)
665
# Larger values for allowed allocations due to usage of custom
666
# integrator which are not *recorded* for the methods from
667
# OrdinaryDiffEq.jl
668
# Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877
669
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 8000
670
end
671
end
672
673
@trixi_testset "elixir_euler_ec.jl" begin
674
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_ec.jl"),
675
l2=[
676
0.03774907669925568,
677
0.02845190575242045,
678
0.028262802829412605,
679
0.13785915638851698
680
],
681
linf=[
682
0.3368296929764073,
683
0.27644083771519773,
684
0.27990039685141377,
685
1.1971436487402016
686
],
687
tspan=(0.0, 0.3))
688
# Ensure that we do not have excessive memory allocations
689
# (e.g., from type instabilities)
690
let
691
t = sol.t[end]
692
u_ode = sol.u[end]
693
du_ode = similar(u_ode)
694
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
695
end
696
end
697
698
@trixi_testset "elixir_euler_sedov.jl" begin
699
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_sedov.jl"),
700
l2=[
701
3.69856202e-01,
702
2.35242180e-01,
703
2.41444928e-01,
704
1.28807120e+00
705
],
706
linf=[
707
1.82786223e+00,
708
1.30452904e+00,
709
1.40347257e+00,
710
6.21791658e+00
711
],
712
tspan=(0.0, 0.3))
713
# Ensure that we do not have excessive memory allocations
714
# (e.g., from type instabilities)
715
let
716
t = sol.t[end]
717
u_ode = sol.u[end]
718
du_ode = similar(u_ode)
719
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
720
end
721
end
722
723
@trixi_testset "elixir_euler_sedov_blast_wave_sc_subcell.jl (local bounds)" begin
724
@test_trixi_include(joinpath(EXAMPLES_DIR,
725
"elixir_euler_sedov_blast_wave_sc_subcell.jl"),
726
l2=[
727
0.6403528328480915,
728
0.3068073114438902,
729
0.3140151910019577,
730
1.2977732581465693
731
],
732
linf=[
733
2.239791987419344,
734
1.5580885989144924,
735
1.5392923786831547,
736
6.2729281824590855
737
],
738
tspan=(0.0, 0.5))
739
# Ensure that we do not have excessive memory allocations
740
# (e.g., from type instabilities)
741
let
742
t = sol.t[end]
743
u_ode = sol.u[end]
744
du_ode = similar(u_ode)
745
# Larger values for allowed allocations due to usage of custom
746
# integrator which are not *recorded* for the methods from
747
# OrdinaryDiffEq.jl
748
# Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877
749
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 10000
750
end
751
end
752
753
@trixi_testset "elixir_euler_sedov_blast_wave_sc_subcell.jl (global bounds)" begin
754
@test_trixi_include(joinpath(EXAMPLES_DIR,
755
"elixir_euler_sedov_blast_wave_sc_subcell.jl"),
756
positivity_variables_cons=["rho"],
757
positivity_variables_nonlinear=[pressure],
758
local_twosided_variables_cons=[],
759
local_onesided_variables_nonlinear=[],
760
l2=[
761
0.7979084213982606,
762
0.3980284851419719,
763
0.4021949448633982,
764
1.2956482394747346
765
],
766
linf=[
767
5.477809925838038,
768
3.7793130706228273,
769
3.2838862964081637,
770
6.316943647948965
771
],
772
tspan=(0.0, 0.5))
773
# Ensure that we do not have excessive memory allocations
774
# (e.g., from type instabilities)
775
let
776
t = sol.t[end]
777
u_ode = sol.u[end]
778
du_ode = similar(u_ode)
779
# Larger values for allowed allocations due to usage of custom
780
# integrator which are not *recorded* for the methods from
781
# OrdinaryDiffEq.jl
782
# Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877
783
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 10000
784
end
785
end
786
787
@trixi_testset "elixir_euler_rayleigh_taylor_instability.jl" begin
788
@test_trixi_include(joinpath(EXAMPLES_DIR,
789
"elixir_euler_rayleigh_taylor_instability.jl"),
790
l2=[
791
0.06365630515019809, 0.007166887172039836,
792
0.0028787103533600804, 0.010247678008197966
793
],
794
linf=[
795
0.47992143569849377, 0.02459548251933757,
796
0.02059810091623976, 0.0319077000843877
797
],
798
cells_per_dimension=(8, 8),
799
tspan=(0.0, 0.3))
800
# Ensure that we do not have excessive memory allocations
801
# (e.g., from type instabilities)
802
let
803
t = sol.t[end]
804
u_ode = sol.u[end]
805
du_ode = similar(u_ode)
806
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
807
end
808
end
809
810
@trixi_testset "elixir_euler_warm_bubble.jl" begin
811
@test_trixi_include(joinpath(EXAMPLES_DIR,
812
"elixir_euler_warm_bubble.jl"),
813
l2=[
814
0.00019387402388722496,
815
0.03086514388623955,
816
0.04541427917165,
817
43.892826583444716
818
],
819
linf=[
820
0.0015942305974430138,
821
0.17449778969139373,
822
0.3729704262394843,
823
307.6706958565337
824
],
825
cells_per_dimension=(32, 16),
826
tspan=(0.0, 10.0))
827
# Ensure that we do not have excessive memory allocations
828
# (e.g., from type instabilities)
829
let
830
t = sol.t[end]
831
u_ode = sol.u[end]
832
du_ode = similar(u_ode)
833
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 100
834
end
835
end
836
837
@trixi_testset "elixir_eulerpolytropic_convergence.jl" begin
838
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_eulerpolytropic_convergence.jl"),
839
l2=[
840
0.00166898321776379, 0.00259202637930991,
841
0.0032810744946276406
842
],
843
linf=[
844
0.010994883201888683, 0.013309526619369905,
845
0.020080326611175536
846
])
847
# Ensure that we do not have excessive memory allocations
848
# (e.g., from type instabilities)
849
let
850
t = sol.t[end]
851
u_ode = sol.u[end]
852
du_ode = similar(u_ode)
853
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
854
end
855
end
856
857
@trixi_testset "elixir_eulerpolytropic_convergence.jl with FluxHLL(min_max_speed_naive)" begin
858
@test_trixi_include(joinpath(EXAMPLES_DIR,
859
"elixir_eulerpolytropic_convergence.jl"),
860
solver=DGSEM(polydeg = 3,
861
surface_flux = FluxHLL(min_max_speed_naive),
862
volume_integral = VolumeIntegralFluxDifferencing(volume_flux)),
863
l2=[
864
0.001668882059653298, 0.002592168188567654,
865
0.0032809503514328307
866
],
867
linf=[
868
0.01099467966437917, 0.013311978456333584,
869
0.020080117011337606
870
])
871
# Ensure that we do not have excessive memory allocations
872
# (e.g., from type instabilities)
873
let
874
t = sol.t[end]
875
u_ode = sol.u[end]
876
du_ode = similar(u_ode)
877
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
878
end
879
end
880
881
@trixi_testset "elixir_eulerpolytropic_ec.jl" begin
882
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_eulerpolytropic_ec.jl"),
883
l2=[
884
0.03647890611450939,
885
0.025284915444045052,
886
0.025340697771609126
887
],
888
linf=[
889
0.32516731565355583,
890
0.37509762516540046,
891
0.29812843284727336
892
])
893
# Ensure that we do not have excessive memory allocations
894
# (e.g., from type instabilities)
895
let
896
t = sol.t[end]
897
u_ode = sol.u[end]
898
du_ode = similar(u_ode)
899
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
900
end
901
end
902
903
@trixi_testset "elixir_eulerpolytropic_isothermal_wave.jl" begin
904
@test_trixi_include(joinpath(EXAMPLES_DIR,
905
"elixir_eulerpolytropic_isothermal_wave.jl"),
906
l2=[
907
0.004998778512795407, 0.004998916021367992,
908
8.991558055435833e-17
909
],
910
linf=[
911
0.010001103632831354, 0.010051165055185603,
912
7.60697457718599e-16
913
])
914
# Ensure that we do not have excessive memory allocations
915
# (e.g., from type instabilities)
916
let
917
t = sol.t[end]
918
u_ode = sol.u[end]
919
du_ode = similar(u_ode)
920
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
921
end
922
end
923
924
@trixi_testset "elixir_eulerpolytropic_wave.jl" begin
925
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_eulerpolytropic_wave.jl"),
926
l2=[
927
0.23642871172548174, 0.2090519382039672,
928
8.778842676292274e-17
929
],
930
linf=[
931
0.4852276879687425, 0.25327870807625175,
932
5.533921691832115e-16
933
])
934
# Ensure that we do not have excessive memory allocations
935
# (e.g., from type instabilities)
936
let
937
t = sol.t[end]
938
u_ode = sol.u[end]
939
du_ode = similar(u_ode)
940
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
941
end
942
end
943
944
@trixi_testset "elixir_hypdiff_nonperiodic.jl" begin
945
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_hypdiff_nonperiodic.jl"),
946
l2=[0.8799744480157664, 0.8535008397034816, 0.7851383019164209],
947
linf=[1.0771947577311836, 1.9143913544309838, 2.149549109115789],
948
tspan=(0.0, 0.1),)
949
# Ensure that we do not have excessive memory allocations
950
# (e.g., from type instabilities)
951
let
952
t = sol.t[end]
953
u_ode = sol.u[end]
954
du_ode = similar(u_ode)
955
# Larger values for allowed allocations due to usage of custom
956
# integrator which are not *recorded* for the methods from
957
# OrdinaryDiffEq.jl
958
# Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877
959
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 15000
960
end
961
end
962
963
@trixi_testset "elixir_hypdiff_harmonic_nonperiodic.jl" begin
964
@test_trixi_include(joinpath(EXAMPLES_DIR,
965
"elixir_hypdiff_harmonic_nonperiodic.jl"),
966
l2=[
967
0.19357947606509474,
968
0.47041398037626814,
969
0.4704139803762686
970
],
971
linf=[
972
0.35026352556630114,
973
0.8344372248051408,
974
0.8344372248051408
975
],
976
tspan=(0.0, 0.1),)
977
# Ensure that we do not have excessive memory allocations
978
# (e.g., from type instabilities)
979
let
980
t = sol.t[end]
981
u_ode = sol.u[end]
982
du_ode = similar(u_ode)
983
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
984
end
985
end
986
987
@trixi_testset "elixir_mhd_ec.jl" begin
988
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_ec.jl"),
989
l2=[0.04937478399958968, 0.0611701500558669,
990
0.06099805934392425, 0.031551737882277144,
991
0.23191853685798858, 0.02476297013104899,
992
0.024482975007695532, 0.035440179203707095,
993
0.0016002328034991635],
994
linf=[0.24744671083295033, 0.2990591185187605,
995
0.3968520446251412, 0.2226544553988576,
996
0.9752669317263143, 0.12117894533967843,
997
0.12845218263379432, 0.17795590713819576,
998
0.0348517136607105],
999
tspan=(0.0, 0.3))
1000
# Ensure that we do not have excessive memory allocations
1001
# (e.g., from type instabilities)
1002
let
1003
t = sol.t[end]
1004
u_ode = sol.u[end]
1005
du_ode = similar(u_ode)
1006
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
1007
end
1008
end
1009
1010
@trixi_testset "elixir_mhd_alfven_wave.jl" begin
1011
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_alfven_wave.jl"),
1012
l2=[0.028905589451357638, 0.006259570019325034,
1013
0.005649791156739933, 0.0073272570974805004,
1014
0.004890348793116962, 0.00720944138561451,
1015
0.0069984328989438115, 0.006729800315219757,
1016
0.004318314151888631],
1017
linf=[0.17528323378978317, 0.06161030852803388,
1018
0.0388335541348234, 0.052906440559080926,
1019
0.0380036034027319, 0.04291841215471082,
1020
0.03702743958268562, 0.04815794489066357,
1021
0.0433064571343779],
1022
tspan=(0.0, 1.0))
1023
# Ensure that we do not have excessive memory allocations
1024
# (e.g., from type instabilities)
1025
let
1026
t = sol.t[end]
1027
u_ode = sol.u[end]
1028
du_ode = similar(u_ode)
1029
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
1030
end
1031
end
1032
1033
@trixi_testset "elixir_mhd_onion.jl" begin
1034
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_onion.jl"),
1035
l2=[0.00614563999392665, 0.04298975803343982,
1036
0.009442309044853874, 0.0,
1037
0.023466074865980138, 0.0037008480771081663,
1038
0.006939946049331198, 0.0, 5.379545284544848e-7],
1039
linf=[0.04033992113717799, 0.2507389500590966,
1040
0.05597919737542288, 0.0,
1041
0.14115256348718308, 0.01995761261479123,
1042
0.038667260744994714, 0.0, 3.376777801961409e-6])
1043
# Ensure that we do not have excessive memory allocations
1044
# (e.g., from type instabilities)
1045
let
1046
t = sol.t[end]
1047
u_ode = sol.u[end]
1048
du_ode = similar(u_ode)
1049
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
1050
end
1051
end
1052
1053
@trixi_testset "elixir_mhd_ec_shockcapturing.jl" begin
1054
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_ec_shockcapturing.jl"),
1055
l2=[0.03641928087745194, 0.04266672246194787,
1056
0.042616743034675685,
1057
0.025884076832341982,
1058
0.16181640309885276, 0.017346521291731105,
1059
0.017291600359415987, 0.026856207871456043,
1060
0.0007448774124272682],
1061
linf=[0.25144155032118376, 0.3288086335996786,
1062
0.30532573631664345, 0.20990150465080706,
1063
0.9929091025128138, 0.11053858971264774,
1064
0.12578085409726314,
1065
0.16283334251103732,
1066
0.026146463886273865])
1067
# Ensure that we do not have excessive memory allocations
1068
# (e.g., from type instabilities)
1069
let
1070
t = sol.t[end]
1071
u_ode = sol.u[end]
1072
du_ode = similar(u_ode)
1073
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
1074
end
1075
end
1076
1077
@trixi_testset "elixir_mhd_orszag_tang_sc_subcell.jl (local * symmetric)" begin
1078
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_orszag_tang_sc_subcell.jl"),
1079
l2=[
1080
0.01971024989875626,
1081
0.09104800714369102,
1082
0.09850531236459953,
1083
0.0,
1084
0.11257300398205827,
1085
0.0663796508325794,
1086
0.1046810844992422,
1087
0.0,
1088
1.3771070897457708e-7
1089
],
1090
linf=[
1091
0.06892691571947851,
1092
0.2359568430620927,
1093
0.27708425716878604,
1094
0.0,
1095
0.32729450754783485,
1096
0.16594293308909247,
1097
0.28427225533782474,
1098
0.0,
1099
1.5760984369383474e-6
1100
],
1101
tspan=(0.0, 0.025))
1102
# Ensure that we do not have excessive memory allocations
1103
# (e.g., from type instabilities)
1104
let
1105
t = sol.t[end]
1106
u_ode = sol.u[end]
1107
du_ode = similar(u_ode)
1108
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 10000
1109
end
1110
end
1111
1112
@trixi_testset "elixir_mhd_orszag_tang_sc_subcell.jl (local * jump)" begin
1113
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_orszag_tang_sc_subcell.jl"),
1114
l2=[
1115
0.019710787852084945,
1116
0.09104739316084506,
1117
0.09850451818593346,
1118
0.0,
1119
0.11257089275762928,
1120
0.0663755234418436,
1121
0.10468586115056747,
1122
0.0,
1123
4.200881361783599e-6
1124
],
1125
linf=[
1126
0.06893188693406871,
1127
0.23594610243501996,
1128
0.2770924621975269,
1129
0.0,
1130
0.32731120349573106,
1131
0.1659395971443428,
1132
0.2842678645407109,
1133
0.0,
1134
2.6014507178710646e-5
1135
],
1136
# Up to version 0.13.0, `max_abs_speed_naive` was used as the default wave speed estimate of
1137
# `const flux_lax_friedrichs = FluxLaxFriedrichs(), i.e., `FluxLaxFriedrichs(max_abs_speed = max_abs_speed_naive)`.
1138
# In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`.
1139
# Thus, we exchanged in PR#2458 the default wave speed used in the LLF flux to `max_abs_speed`.
1140
# To ensure that every example still runs we specify explicitly `FluxLaxFriedrichs(max_abs_speed_naive)`.
1141
# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the
1142
# `StepsizeCallback` (CFL-Condition) and less diffusion.
1143
surface_flux=(FluxLaxFriedrichs(max_abs_speed_naive),
1144
flux_nonconservative_powell_local_jump),
1145
volume_flux=(flux_central,
1146
flux_nonconservative_powell_local_jump),
1147
tspan=(0.0, 0.025))
1148
# Ensure that we do not have excessive memory allocations
1149
# (e.g., from type instabilities)
1150
let
1151
t = sol.t[end]
1152
u_ode = sol.u[end]
1153
du_ode = similar(u_ode)
1154
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 10000
1155
end
1156
end
1157
1158
@trixi_testset "elixir_mhd_coupled.jl" begin
1159
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_coupled.jl"),
1160
l2=[
1161
1.0743426976677776e-7,
1162
5.941703122781545e-8,
1163
6.373264854058786e-8,
1164
1.0327320202980158e-7,
1165
8.259193826511926e-8,
1166
8.377839796183567e-8,
1167
7.469434303577898e-8,
1168
1.0770585130793933e-7,
1169
8.735923402823923e-9,
1170
1.0743426990741475e-7,
1171
5.941703121622708e-8,
1172
6.373264853185012e-8,
1173
1.0327320202884373e-7,
1174
8.259193828324533e-8,
1175
8.377839796046157e-8,
1176
7.469434302767398e-8,
1177
1.077058513088068e-7,
1178
8.735923400740853e-9
1179
],
1180
linf=[
1181
9.021023420485719e-7,
1182
5.540360292766167e-7,
1183
8.97403747285308e-7,
1184
9.962467816537757e-7,
1185
9.48702334468976e-7,
1186
1.4284730157632097e-6,
1187
5.317911039304235e-7,
1188
9.92786089865083e-7,
1189
3.4306731372516224e-8,
1190
9.021023412714158e-7,
1191
5.540360226014007e-7,
1192
8.974037428166604e-7,
1193
9.962467838325884e-7,
1194
9.487023256982141e-7,
1195
1.4284730160962766e-6,
1196
5.317911003777098e-7,
1197
9.92786092363085e-7,
1198
3.430672968714232e-8
1199
])
1200
1201
@testset "analysis_callback(sol) for AnalysisCallbackCoupled" begin
1202
errors = analysis_callback(sol)
1203
@test errors.l2≈[
1204
1.0743426976677776e-7,
1205
5.941703122781545e-8,
1206
6.373264854058786e-8,
1207
1.0327320202980158e-7,
1208
8.259193826511926e-8,
1209
8.377839796183567e-8,
1210
7.469434303577898e-8,
1211
1.0770585130793933e-7,
1212
8.735923402823923e-9,
1213
1.0743426990741475e-7,
1214
5.941703121622708e-8,
1215
6.373264853185012e-8,
1216
1.0327320202884373e-7,
1217
8.259193828324533e-8,
1218
8.377839796046157e-8,
1219
7.469434302767398e-8,
1220
1.077058513088068e-7,
1221
8.735923400740853e-9
1222
] rtol=1.0e-4
1223
@test errors.linf≈[
1224
9.021023420485719e-7,
1225
5.540360292766167e-7,
1226
8.97403747285308e-7,
1227
9.962467816537757e-7,
1228
9.48702334468976e-7,
1229
1.4284730157632097e-6,
1230
5.317911039304235e-7,
1231
9.92786089865083e-7,
1232
3.4306731372516224e-8,
1233
9.021023412714158e-7,
1234
5.540360226014007e-7,
1235
8.974037428166604e-7,
1236
9.962467838325884e-7,
1237
9.487023256982141e-7,
1238
1.4284730160962766e-6,
1239
5.317911003777098e-7,
1240
9.92786092363085e-7,
1241
3.430672968714232e-8
1242
] rtol=1.0e-4
1243
# Ensure that we do not have excessive memory allocations
1244
# (e.g., from type instabilities)
1245
let
1246
t = sol.t[end]
1247
u_ode = sol.u[end]
1248
du_ode = similar(u_ode)
1249
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
1250
end
1251
end
1252
end
1253
1254
@trixi_testset "elixir_lbm_lid_driven_cavity.jl" begin
1255
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_lbm_lid_driven_cavity.jl"),
1256
l2=[
1257
0.0013650620243296592,
1258
0.00022198751341720896,
1259
0.0012598874493852138,
1260
0.0003717179135584138,
1261
0.0004378131417115368,
1262
0.0003981707758995024,
1263
0.00025217328296435736,
1264
0.00026487031088613346,
1265
0.0004424433618470548
1266
],
1267
linf=[
1268
0.024202160934419875,
1269
0.011909887052061488,
1270
0.021787515301598115,
1271
0.03618036838142735,
1272
0.008017773116953682,
1273
0.0068482058999433,
1274
0.010286155761527443,
1275
0.009919734282811003,
1276
0.05568155678921127
1277
],
1278
tspan=(0.0, 1.0))
1279
# Ensure that we do not have excessive memory allocations
1280
# (e.g., from type instabilities)
1281
let
1282
t = sol.t[end]
1283
u_ode = sol.u[end]
1284
du_ode = similar(u_ode)
1285
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
1286
end
1287
end
1288
1289
@trixi_testset "elixir_lbm_eulerpolytropic_coupled.jl" begin
1290
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_lbm_eulerpolytropic_coupled.jl"),
1291
l2=[
1292
0.004425408662988481,
1293
0.004450324455480091,
1294
6.443442487292444e-17,
1295
0.0013646410236054789,
1296
0.000492124768468392,
1297
0.00035879680384107377,
1298
0.0004921247684683822,
1299
0.0003411602559013719,
1300
8.969920096027091e-5,
1301
8.969920096027404e-5,
1302
0.00034116025590136945,
1303
0.001968499073873568
1304
],
1305
linf=[
1306
0.009769926457488198,
1307
0.009821015729172138,
1308
3.313984464407251e-16,
1309
0.003072464362545338,
1310
0.001104208150516095,
1311
0.000791310479149987,
1312
0.0011042081505159979,
1313
0.000768116090636338,
1314
0.0001978276197874898,
1315
0.00019782761978750715,
1316
0.0007681160906363102,
1317
0.0044168326020643245
1318
])
1319
1320
@testset "analysis_callback(sol) for AnalysisCallbackCoupled" begin
1321
# Ensure that we do not have excessive memory allocations
1322
# (e.g., from type instabilities)
1323
let
1324
t = sol.t[end]
1325
u_ode = sol.u[end]
1326
du_ode = similar(u_ode)
1327
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
1328
end
1329
end
1330
end
1331
end
1332
1333
# Clean up afterwards: delete Trixi.jl output directory
1334
@test_nowarn rm(outdir, recursive = true)
1335
1336
end # module
1337
1338