From 0d11b2e55a952ebdf2ce507b90a7884163f645a3 Mon Sep 17 00:00:00 2001 From: huiyuxie Date: Tue, 10 Sep 2024 22:30:15 -1000 Subject: [PATCH] minor fix --- .../ideal_glm_mhd_multicomponent_2d.jl | 27 +++++-------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/src/equations/ideal_glm_mhd_multicomponent_2d.jl b/src/equations/ideal_glm_mhd_multicomponent_2d.jl index 3c7a78b011..ba6372b01d 100644 --- a/src/equations/ideal_glm_mhd_multicomponent_2d.jl +++ b/src/equations/ideal_glm_mhd_multicomponent_2d.jl @@ -18,26 +18,6 @@ struct IdealGlmMhdMulticomponentEquations2D{NVARS, NCOMP, RealT <: Real} <: cp::SVector{NCOMP, RealT} c_h::RealT # GLM cleaning speed - function IdealGlmMhdMulticomponentEquations2D{NVARS, NCOMP, RealT}(gammas::SVector{NCOMP, - RealT}, - gas_constants::SVector{NCOMP, - RealT}) where { - NVARS, - NCOMP, - RealT <: - Real - } - NCOMP >= 1 || - throw(DimensionMismatch("`gammas` and `gas_constants` have to be filled with at least one value")) - - cv = gas_constants ./ (gammas .- 1) - cp = gas_constants + gas_constants ./ (gammas .- 1) - c_h = convert(eltype(gammas), NaN) - - new(gammas, gas_constants, cv, cp, c_h) - end - - # Inner constructor for `@reset` works correctly function IdealGlmMhdMulticomponentEquations2D{NVARS, NCOMP, RealT}(gammas::SVector{NCOMP, RealT}, gas_constants::SVector{NCOMP, @@ -48,8 +28,12 @@ struct IdealGlmMhdMulticomponentEquations2D{NVARS, NCOMP, RealT <: Real} <: RealT <: Real } + NCOMP >= 1 || + throw(DimensionMismatch("`gammas` and `gas_constants` have to be filled with at least one value")) + cv = gas_constants ./ (gammas .- 1) cp = gas_constants + gas_constants ./ (gammas .- 1) + c_h = convert(eltype(gammas), c_h) new(gammas, gas_constants, cv, cp, c_h) end @@ -67,7 +51,8 @@ function IdealGlmMhdMulticomponentEquations2D(; gammas, gas_constants) __gas_constants = SVector(map(RealT, _gas_constants)) return IdealGlmMhdMulticomponentEquations2D{NVARS, NCOMP, RealT}(__gammas, - __gas_constants) + __gas_constants, + NaN) end # Outer constructor for `@reset` works correctly