Skip to content
7 changes: 7 additions & 0 deletions src/equations/compressible_euler_quasi_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,13 @@ end
return SVector(w[1], w[2], w[3], a)
end

@inline function entropy2cons(w, equations::CompressibleEulerEquationsQuasi1D)
w_rho, w_rho_v1, w_rho_e, a = w
u = entropy2cons(SVector(w_rho, w_rho_v1, w_rho_e),
CompressibleEulerEquations1D(equations.gamma))
return SVector(a * u[1], a * u[2], a * u[3], a)
end

# Convert primitive to conservative variables
@inline function prim2cons(u, equations::CompressibleEulerEquationsQuasi1D)
rho, v1, p, a = u
Expand Down
2 changes: 1 addition & 1 deletion src/solvers/dgmulti/flux_differencing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ end

# For traditional SBP operators on triangles, the operators are fully dense. We avoid using
# sum factorization here, which is slower for fully dense matrices.
@inline function has_sparse_operators(::Union{Tri, Tet},
@inline function has_sparse_operators(::Union{Line, Tri, Tet},
approx_type::AT) where {AT <: SBP}
False()
end
Expand Down
26 changes: 26 additions & 0 deletions test/test_dgmulti_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,32 @@ end
@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000
end
end

@trixi_testset "elixir_euler_quasi_1d.jl (Polynomial) " begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_quasi_1d.jl"),
cells_per_dimension=(8,),
approximation_type=Polynomial(),
l2=[
3.3742251708854453e-6,
2.9716405988822176e-6,
3.1641250402788772e-6,
1.0482169269991052e-6
],
linf=[
8.056816211965412e-6,
6.031057946387364e-6,
6.90878439346676e-6,
1.5199471203874992e-6
])
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
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
end

# Clean up afterwards: delete Trixi.jl output directory
Expand Down
2 changes: 2 additions & 0 deletions test/test_unit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2070,6 +2070,8 @@ end

@test max_abs_speed_naive(u_ll, u_rr, 1, equations) ≈
max_abs_speed(u_ll, u_rr, 1, equations)

@test u_ll ≈ entropy2cons(cons2entropy(u_ll, equations), equations)
end
end

Expand Down
Loading