Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielDoehring committed Jan 12, 2024
1 parent 7d85892 commit c79ba8c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/auxiliary/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ in the stacktrace.
"""
@inline sqrt(x::Real) = x < zero(x) ? oftype(x, NaN) : Base.sqrt(x)

# For the `sqrt` we could use the `sqrt_llvm` call, but for transparency we use the direct LLVM calls here.
#@inline sqrt(x::Union{Float64, Float32, Float16}) = Base.sqrt_llvm(x)
@inline sqrt(x::Float64) = ccall("llvm.sqrt.f64", llvmcall, Float64, (Float64,), x)
@inline sqrt(x::Float32) = ccall("llvm.sqrt.f32", llvmcall, Float32, (Float32,), x)
Expand Down
3 changes: 1 addition & 2 deletions src/equations/compressible_euler_multicomponent_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,7 @@ end

total_entropy = zero(u[1])
for i in eachcomponent(equations)
total_entropy -= u[i + 2] *
(cv[i] * log(T) - gas_constants[i] * log(u[i + 2]))
total_entropy -= u[i + 2] * (cv[i] * log(T) - gas_constants[i] * log(u[i + 2]))
end

return total_entropy
Expand Down
3 changes: 1 addition & 2 deletions src/equations/compressible_euler_multicomponent_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,7 @@ end

total_entropy = zero(u[1])
for i in eachcomponent(equations)
total_entropy -= u[i + 3] *
(cv[i] * log(T) - gas_constants[i] * log(u[i + 3]))
total_entropy -= u[i + 3] * (cv[i] * log(T) - gas_constants[i] * log(u[i + 3]))
end

return total_entropy
Expand Down
3 changes: 1 addition & 2 deletions test/test_tree_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,7 @@ end
# characteristics
function initial_condition_sine(x, t,
equation::NonconservativeLinearAdvectionEquation)
x0 = -2 *
atan(sqrt(3) * tan(sqrt(3) / 2 * t - atan(tan(x[1] / 2) / sqrt(3))))
x0 = -2 * atan(sqrt(3) * tan(sqrt(3) / 2 * t - atan(tan(x[1] / 2) / sqrt(3))))
scalar = sin(x0)
advection_velocity = 2 + cos(x[1])
SVector(scalar, advection_velocity)
Expand Down

0 comments on commit c79ba8c

Please sign in to comment.