module TestExamples1DHypDiff
using Test
using Trixi
include("test_trixi.jl")
EXAMPLES_DIR = joinpath(examples_dir(), "tree_1d_dgsem")
@testset "Hyperbolic diffusion" begin
@trixi_testset "elixir_hypdiff_nonperiodic.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_hypdiff_nonperiodic.jl"),
l2=[1.3655114953278825e-7, 1.0200345026471077e-6],
linf=[7.173285075379177e-7, 4.507116828644797e-6])
let
t = sol.t[end]
u_ode = sol.u[end]
du_ode = similar(u_ode)
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
end
end
@trixi_testset "elixir_hypdiff_nonperiodic_perk4.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_hypdiff_nonperiodic_perk4.jl"),
l2=[1.3655114994521285e-7, 1.0200345014751413e-6],
linf=[7.173289867656862e-7, 4.507115296537023e-6],
atol=2.5e-13)
let
t = sol.t[end]
u_ode = sol.u[end]
du_ode = similar(u_ode)
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 8000
end
end
@trixi_testset "elixir_hypdiff_harmonic_nonperiodic.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR,
"elixir_hypdiff_harmonic_nonperiodic.jl"),
l2=[3.0130941075207524e-12, 2.6240829677090014e-12],
linf=[4.054534485931072e-12, 3.8826719617190975e-12],
atol=2.5e-13)
let
t = sol.t[end]
u_ode = sol.u[end]
du_ode = similar(u_ode)
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 10000
end
end
end
end