diff --git a/src/equations/inviscid_burgers_1d.jl b/src/equations/inviscid_burgers_1d.jl index 8528f4e56db..afc6f9999c7 100644 --- a/src/equations/inviscid_burgers_1d.jl +++ b/src/equations/inviscid_burgers_1d.jl @@ -40,7 +40,7 @@ function initial_condition_convergence_test(x, t, equation::InviscidBurgersEquat c = 2 A = 1 L = 1 - f = 1 / L + f = 1.0f0 / L omega = 2 * convert(RealT, pi) * f scalar = c + A * sin(omega * (x[1] - t)) @@ -60,7 +60,7 @@ Source terms used for convergence tests in combination with c = 2 A = 1 L = 1 - f = 1 / L + f = 1.0f0 / L omega = 2 * convert(RealT, pi) * f du = omega * A * cos(omega * (x[1] - t)) * (c - 1 + A * sin(omega * (x[1] - t))) diff --git a/test/test_type.jl b/test/test_type.jl index a46c2a92bde..c45a750c07f 100644 --- a/test/test_type.jl +++ b/test/test_type.jl @@ -1475,6 +1475,48 @@ isdir(outdir) && rm(outdir, recursive = true) end end + @timed_testset "Inviscid Burgers 1D" begin + for RealT in (Float32, Float64) + equations = @inferred InviscidBurgersEquation1D() + + x = SVector(zero(RealT)) + t = zero(RealT) + u = u_ll = u_rr = SVector(one(RealT)) + orientation = 1 + + @test eltype(@inferred initial_condition_constant(x, t, equations)) == RealT + @test eltype(@inferred initial_condition_convergence_test(x, t, equations)) == + RealT + + @test eltype(@inferred source_terms_convergence_test(u, x, t, equations)) == + RealT + + @test eltype(@inferred flux(u, orientation, equations)) == RealT + @test eltype(@inferred flux_ec(u_ll, u_rr, orientation, equations)) == RealT + @test eltype(@inferred flux_godunov(u_ll, u_rr, orientation, equations)) == + RealT + @test eltype(@inferred Trixi.flux_engquist_osher(u_ll, u_rr, orientation, + equations)) == + RealT + + @test eltype(eltype(@inferred splitting_lax_friedrichs(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 Trixi.max_abs_speeds(u, equations)) == + RealT + @test eltype(@inferred cons2prim(u, equations)) == RealT + @test eltype(@inferred cons2entropy(u, equations)) == RealT + @test eltype(@inferred entropy2cons(u, equations)) == RealT + @test typeof(@inferred entropy(u, equations)) == RealT + @test typeof(@inferred energy_total(u, equations)) == RealT + end + end + @timed_testset "Linear Scalar Advection 1D" begin for RealT in (Float32, Float64) equations = @inferred LinearScalarAdvectionEquation1D(RealT(1))