Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
huiyuxie committed Sep 11, 2024
1 parent faeb8b7 commit 0d11b2e
Showing 1 changed file with 6 additions and 21 deletions.
27 changes: 6 additions & 21 deletions src/equations/ideal_glm_mhd_multicomponent_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 0d11b2e

Please sign in to comment.