Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
trixi-framework
GitHub Repository: trixi-framework/Trixi.jl
Path: blob/main/test/test_tree_1d_hypdiff.jl
2802 views
1
module TestExamples1DHypDiff
2
3
using Test
4
using Trixi
5
6
include("test_trixi.jl")
7
8
EXAMPLES_DIR = joinpath(examples_dir(), "tree_1d_dgsem")
9
10
@testset "Hyperbolic diffusion" begin
11
#! format: noindent
12
13
@trixi_testset "elixir_hypdiff_nonperiodic.jl" begin
14
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_hypdiff_nonperiodic.jl"),
15
l2=[1.3655114953278825e-7, 1.0200345026471077e-6],
16
linf=[7.173285075379177e-7, 4.507116828644797e-6])
17
# Ensure that we do not have excessive memory allocations
18
# (e.g., from type instabilities)
19
@test_allocations(Trixi.rhs!, semi, sol, 1000)
20
end
21
22
@trixi_testset "elixir_hypdiff_nonperiodic_perk4.jl" begin
23
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_hypdiff_nonperiodic_perk4.jl"),
24
l2=[1.3655114994521285e-7, 1.0200345014751413e-6],
25
linf=[7.173289867656862e-7, 4.507115296537023e-6],
26
atol=2.5e-13)
27
# Ensure that we do not have excessive memory allocations
28
# (e.g., from type instabilities)
29
# Larger values for allowed allocations due to usage of custom
30
# integrator which are not *recorded* for the methods from
31
# OrdinaryDiffEq.jl
32
# Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877
33
@test_allocations(Trixi.rhs!, semi, sol, 8000)
34
end
35
36
@trixi_testset "elixir_hypdiff_harmonic_nonperiodic.jl" begin
37
@test_trixi_include(joinpath(EXAMPLES_DIR,
38
"elixir_hypdiff_harmonic_nonperiodic.jl"),
39
l2=[3.0130941075207524e-12, 2.6240829677090014e-12],
40
linf=[4.054534485931072e-12, 3.8826719617190975e-12],
41
atol=2.5e-13)
42
# Ensure that we do not have excessive memory allocations
43
# (e.g., from type instabilities)
44
# Larger values for allowed allocations due to usage of custom
45
# integrator which are not *recorded* for the methods from
46
# OrdinaryDiffEq.jl
47
# Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877
48
@test_allocations(Trixi.rhs!, semi, sol, 10000)
49
end
50
end
51
52
end # module
53
54