Skip to content

Commit

Permalink
unit tests for full coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielDoehring committed Apr 14, 2024
1 parent 240fc91 commit 8031fff
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions test/test_unit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1536,6 +1536,42 @@ end
end
end

@testset "Equivalent Wave Speed Estimates" begin
@timed_testset "Linearized Euler 3D" begin
equations = LinearizedEulerEquations3D(v_mean_global = (0.42, 0.37, 0.7),
c_mean_global = 1.0,
rho_mean_global = 1.0)

normal_x = SVector(1.0, 0.0, 0.0)
normal_y = SVector(0.0, 1.0, 0.0)
normal_z = SVector(0.0, 0.0, 1.0)

u_ll = SVector(0.3, 0.5, -0.7, 0.1, 1.0)
u_rr = SVector(0.5, -0.2, 0.1, 0.2, 5.0)

@test max_abs_speed_naive(u_ll, u_rr, 1, equations) ==
max_abs_speed_naive(u_ll, u_rr, normal_x, equations)
@test max_abs_speed_naive(u_ll, u_rr, 2, equations) ==
max_abs_speed_naive(u_ll, u_rr, normal_y, equations)
@test max_abs_speed_naive(u_ll, u_rr, 3, equations) ==
max_abs_speed_naive(u_ll, u_rr, normal_z, equations)

@test min_max_speed_naive(u_ll, u_rr, 1, equations) ==
min_max_speed_naive(u_ll, u_rr, normal_x, equations)
@test min_max_speed_naive(u_ll, u_rr, 2, equations) ==
min_max_speed_naive(u_ll, u_rr, normal_y, equations)
@test min_max_speed_naive(u_ll, u_rr, 3, equations) ==
min_max_speed_naive(u_ll, u_rr, normal_z, equations)

@test min_max_speed_davis(u_ll, u_rr, 1, equations) ==
min_max_speed_davis(u_ll, u_rr, normal_x, equations)
@test min_max_speed_davis(u_ll, u_rr, 2, equations) ==
min_max_speed_davis(u_ll, u_rr, normal_y, equations)
@test min_max_speed_davis(u_ll, u_rr, 3, equations) ==
min_max_speed_davis(u_ll, u_rr, normal_z, equations)
end
end

@testset "SimpleKronecker" begin
N = 3

Expand Down

0 comments on commit 8031fff

Please sign in to comment.