Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
trixi-framework
GitHub Repository: trixi-framework/Trixi.jl
Path: blob/main/test/test_tree_1d_eulergravity.jl
2055 views
1
module TestExamples1DEulerGravity
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 "Compressible Euler with self-gravity" begin
11
#! format: noindent
12
13
@trixi_testset "elixir_eulergravity_convergence.jl" begin
14
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_eulergravity_convergence.jl"),
15
l2=[
16
0.00021708496949694728, 0.0002913795242132917,
17
0.0006112500956552259
18
],
19
linf=[
20
0.0004977733237385706, 0.0013594226727522418,
21
0.0020418739554664
22
])
23
# Ensure that we do not have excessive memory allocations
24
# (e.g., from type instabilities)
25
let
26
t = sol.t[end]
27
u_ode = sol.u[end]
28
du_ode = similar(u_ode)
29
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
30
end
31
end
32
end
33
34
end # module
35
36