Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
trixi-framework
GitHub Repository: trixi-framework/Trixi.jl
Path: blob/main/test/test_tree_1d_maxwell.jl
2055 views
1
module TestExamples1DMaxwell
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 "Maxwell" begin
11
#! format: noindent
12
13
@trixi_testset "elixir_maxwell_convergence.jl" begin
14
@test_trixi_include(joinpath(EXAMPLES_DIR,
15
"elixir_maxwell_convergence.jl"),
16
l2=[8933.196486422636, 2.979793603210305e-5],
17
linf=[21136.527033627033, 7.050386515528029e-5])
18
# Ensure that we do not have excessive memory allocations
19
# (e.g., from type instabilities)
20
let
21
t = sol.t[end]
22
u_ode = sol.u[end]
23
du_ode = similar(u_ode)
24
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
25
end
26
end
27
28
@trixi_testset "elixir_maxwell_E_excitation.jl" begin
29
@test_trixi_include(joinpath(EXAMPLES_DIR,
30
"elixir_maxwell_E_excitation.jl"),
31
l2=[1.8181768208894413e6, 0.09221738723979069],
32
linf=[2.5804473693440557e6, 0.1304024464192847])
33
# Ensure that we do not have excessive memory allocations
34
# (e.g., from type instabilities)
35
let
36
t = sol.t[end]
37
u_ode = sol.u[end]
38
du_ode = similar(u_ode)
39
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
40
end
41
end
42
end
43
44
end # module
45
46