Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
0444cb29
Commit
0444cb29
authored
Apr 08, 2018
by
Matthieu Schaller
Browse files
Avoid divisions in the vacuum detection code
parent
4c1ddb3f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/riemann/riemann_vacuum.h
View file @
0444cb29
...
...
@@ -27,17 +27,17 @@ __attribute__((always_inline)) INLINE static int riemann_is_vacuum(
float
*
WL
,
float
*
WR
,
float
vL
,
float
vR
,
float
aL
,
float
aR
)
{
/* vacuum */
if
(
!
WL
[
0
]
||
!
WR
[
0
])
{
return
1
;
}
if
(
!
WL
[
0
]
||
!
WR
[
0
])
return
1
;
/* vacuum generation */
if
(
2
.
0
f
*
aL
/
hydro_gamma_minus_one
+
2
.
0
f
*
aR
/
hydro_gamma_minus_one
<=
vR
-
vL
)
{
else
if
(
hydro_two_over_gamma_minus_one
*
aL
+
hydro_two_over_gamma_minus_one
*
aR
<=
vR
-
vL
)
return
1
;
}
/* no vacuum */
return
0
;
else
return
0
;
}
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment