Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix small amount of Float64 computation #2099

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions src/equations/compressible_euler_multicomponent_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -202,16 +202,15 @@ function initial_condition_weak_blast_wave(x, t,
r = abs(x_norm)
cos_phi = x_norm > 0 ? 1 : -1

prim_rho = SVector{ncomponents(equations), real(equations)}(r > 0.5f0 ?
2^(i - 1) * (1 - 2) /
(1 -
2^ncomponents(equations)) *
one(RealT) :
huiyuxie marked this conversation as resolved.
Show resolved Hide resolved
2^(i - 1) * (1 - 2) /
(1 -
2^ncomponents(equations)) *
convert(RealT, 1.1691)
for i in eachcomponent(equations))
prim_rho = SVector{ncomponents(equations), RealT}(r > 0.5f0 ?
2^(i - 1) * (1 - 2) /
(1 -
2^ncomponents(equations)) :
2^(i - 1) * (1 - 2) /
huiyuxie marked this conversation as resolved.
Show resolved Hide resolved
huiyuxie marked this conversation as resolved.
Show resolved Hide resolved
(1 -
2^ncomponents(equations)) *
1.1691
for i in eachcomponent(equations))

v1 = r > 0.5f0 ? zero(RealT) : convert(RealT, 0.1882) * cos_phi
p = r > 0.5f0 ? one(RealT) : convert(RealT, 1.245)
Expand Down
19 changes: 9 additions & 10 deletions src/equations/compressible_euler_multicomponent_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -220,16 +220,15 @@ function initial_condition_weak_blast_wave(x, t,
phi = atan(y_norm, x_norm)
sin_phi, cos_phi = sincos(phi)

prim_rho = SVector{ncomponents(equations), real(equations)}(r > 0.5f0 ?
2^(i - 1) * (1 - 2) /
(1 -
2^ncomponents(equations)) *
one(RealT) :
2^(i - 1) * (1 - 2) /
(1 -
2^ncomponents(equations)) *
convert(RealT, 1.1691)
for i in eachcomponent(equations))
prim_rho = SVector{ncomponents(equations), RealT}(r > 0.5f0 ?
2^(i - 1) * (1 - 2) /
(1 -
2^ncomponents(equations)) :
2^(i - 1) * (1 - 2) /
(1 -
2^ncomponents(equations)) *
1.1691
for i in eachcomponent(equations))

v1 = r > 0.5f0 ? zero(RealT) : convert(RealT, 0.1882) * cos_phi
v2 = r > 0.5f0 ? zero(RealT) : convert(RealT, 0.1882) * sin_phi
Expand Down
Loading