Skip to content

Commit

Permalink
unit test 3D
Browse files Browse the repository at this point in the history
  • Loading branch information
huiyuxie committed Aug 15, 2024
1 parent b8079ee commit fc39274
Showing 1 changed file with 54 additions and 1 deletion.
55 changes: 54 additions & 1 deletion test/test_type.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1859,8 +1859,61 @@ isdir(outdir) && rm(outdir, recursive = true)
@test eltype(@inferred flux_godunov(u_ll, u_rr, normal_direction, equations)) ==
RealT

@test eltype(@inferred Trixi.max_abs_speeds(equations)) ==
@test eltype(@inferred Trixi.max_abs_speeds(equations)) == RealT
@test typeof(@inferred max_abs_speed_naive(u_ll, u_rr, normal_direction,
equations)) == RealT
@test eltype(@inferred min_max_speed_naive(u_ll, u_rr, normal_direction,
equations)) == RealT
@test eltype(@inferred min_max_speed_davis(u_ll, u_rr, normal_direction,
equations)) == RealT

@test eltype(@inferred cons2prim(u, equations)) == RealT
@test eltype(@inferred cons2entropy(u, equations)) == RealT
end
end

@timed_testset "Linearized Euler 3D" begin
for RealT in (Float32, Float64)
equations = @inferred LinearizedEulerEquations3D(v_mean_global = (RealT(0),
RealT(0),
RealT(0)),
c_mean_global = RealT(1),
rho_mean_global = RealT(1))

x = SVector(zero(RealT), zero(RealT), zero(RealT))
t = zero(RealT)
u = u_ll = u_rr = u_inner = SVector(one(RealT), one(RealT), one(RealT),
one(RealT), one(RealT))
orientations = [1, 2, 3]
directions = [1, 2, 3, 4, 5, 6]
normal_direction = SVector(one(RealT), zero(RealT), zero(RealT))

surface_flux_function = flux_hll

@test eltype(@inferred initial_condition_convergence_test(x, t, equations)) ==
RealT

for orientation in orientations
for direction in directions
@test eltype(@inferred boundary_condition_wall(u_inner, orientation,
direction, x, t,
surface_flux_function,
equations)) == RealT
end

@test eltype(@inferred flux(u, orientation, equations)) == RealT

@test typeof(@inferred max_abs_speed_naive(u_ll, u_rr, orientation,
equations)) == RealT
@test eltype(@inferred min_max_speed_naive(u_ll, u_rr, orientation,
equations)) == RealT
@test eltype(@inferred min_max_speed_davis(u_ll, u_rr, orientation,
equations)) == RealT
end

@test eltype(@inferred flux(u, normal_direction, equations)) == RealT

@test eltype(@inferred Trixi.max_abs_speeds(equations)) == RealT
@test typeof(@inferred max_abs_speed_naive(u_ll, u_rr, normal_direction,
equations)) == RealT
@test eltype(@inferred min_max_speed_naive(u_ll, u_rr, normal_direction,
Expand Down

0 comments on commit fc39274

Please sign in to comment.