Skip to content

Commit

Permalink
new job tree_part6
Browse files Browse the repository at this point in the history
  • Loading branch information
ranocha committed Aug 23, 2021
1 parent 021b9a8 commit 1ec7adc
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 43 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
- tree_part3
- tree_part4
- tree_part5
- tree_part6
- structured
- p4est_part1
- p4est_part2
Expand Down
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ const TRIXI_NTHREADS = clamp(Sys.CPU_THREADS, 2, 3)
include("test_tree_3d_part2.jl")
end

@time if TRIXI_TEST == "all" || TRIXI_TEST == "tree_part6"
include("test_tree_3d_part3.jl")
end

@time if TRIXI_TEST == "all" || TRIXI_TEST == "structured"
include("test_structured_1d.jl")
include("test_structured_2d.jl")
Expand Down
22 changes: 1 addition & 21 deletions test/test_tree_3d_part1.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ isdir(outdir) && rm(outdir, recursive=true)
end


@testset "Displaying components 3D" begin
@trixi_testset "Displaying components 3D" begin
@test_nowarn include(joinpath(EXAMPLES_DIR, "elixir_advection_amr.jl"))

# test both short and long printing formats
Expand Down Expand Up @@ -81,26 +81,6 @@ end
end


@testset "Additional tests in 3D" begin
@testset "compressible Euler" begin
eqn = CompressibleEulerEquations3D(1.4)

@test isapprox(energy_total([1.0, 2.0, 3.0, 4.0, 20.0], eqn), 20.0)
@test isapprox(energy_kinetic([1.0, 2.0, 3.0, 4.0, 20], eqn), 14.5)
@test isapprox(energy_internal([1.0, 2.0, 3.0, 4.0, 20], eqn), 5.5)
end

@testset "hyperbolic diffusion" begin
@test_nowarn HyperbolicDiffusionEquations3D(nu=1.0)
eqn = HyperbolicDiffusionEquations3D(nu=1.0)

@test isapprox(initial_condition_sedov_self_gravity(collect(1:3), 4.5, eqn), zeros(4))
@test isapprox(boundary_condition_sedov_self_gravity(collect(1:4), 1, 1, collect(11:13), 2.3, flux_central, eqn), [-1.0, -19.739208802178712, 0.0, 0.0])
@test isapprox(boundary_condition_sedov_self_gravity(collect(1:4), 2, 2, collect(11:13), 4.5, flux_central, eqn), [-1.5, 0.0, -19.739208802178712, 0.0])
end
end


# Clean up afterwards: delete Trixi output directory
@test_nowarn rm(outdir, recursive=true)

Expand Down
35 changes: 13 additions & 22 deletions test/test_tree_3d_part2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,25 @@ isdir(outdir) && rm(outdir, recursive=true)

# Compressible Euler with self-gravity
include("test_tree_3d_eulergravity.jl")

# MHD
include("test_tree_3d_mhd.jl")

# Lattice-Boltzmann
include("test_tree_3d_lbm.jl")
end


@testset "Additional tests in 3D" begin
@testset "ideal GLM MHD" begin
eqn = IdealGlmMhdEquations3D(1.4)
u = [1.0, 2.0, 3.0, 4.0, 20.0, 0.1, 0.2, 0.3, 1.5]
@trixi_testset "Additional tests in 3D" begin
@trixi_testset "compressible Euler" begin
eqn = CompressibleEulerEquations3D(1.4)

@test isapprox(density(u, eqn), 1.0)
@test isapprox(pressure(u, eqn), 1.7219999999999995)
@test isapprox(density_pressure(u, eqn), 1.7219999999999995)

@test isapprox(Trixi.entropy_thermodynamic(u, eqn), 0.5434864060055388)
@test isapprox(Trixi.entropy_math(u, eqn), -1.3587160150138473)
@test isapprox(Trixi.entropy(u, eqn), -1.3587160150138473)
@test isapprox(energy_total([1.0, 2.0, 3.0, 4.0, 20.0], eqn), 20.0)
@test isapprox(energy_kinetic([1.0, 2.0, 3.0, 4.0, 20], eqn), 14.5)
@test isapprox(energy_internal([1.0, 2.0, 3.0, 4.0, 20], eqn), 5.5)
end

@test isapprox(energy_total(u, eqn), 20.0)
@test isapprox(energy_kinetic(u, eqn), 14.5)
@test isapprox(energy_magnetic(u, eqn), 0.07)
@test isapprox(energy_internal(u, eqn), 4.305)
@trixi_testset "hyperbolic diffusion" begin
@test_nowarn HyperbolicDiffusionEquations3D(nu=1.0)
eqn = HyperbolicDiffusionEquations3D(nu=1.0)

@test isapprox(cross_helicity(u, eqn), 2.0)
@test isapprox(initial_condition_sedov_self_gravity(collect(1:3), 4.5, eqn), zeros(4))
@test isapprox(boundary_condition_sedov_self_gravity(collect(1:4), 1, 1, collect(11:13), 2.3, flux_central, eqn), [-1.0, -19.739208802178712, 0.0, 0.0])
@test isapprox(boundary_condition_sedov_self_gravity(collect(1:4), 2, 2, collect(11:13), 4.5, flux_central, eqn), [-1.5, 0.0, -19.739208802178712, 0.0])
end
end

Expand Down

0 comments on commit 1ec7adc

Please sign in to comment.