Skip to content
GitLab
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
1695c6cf
Commit
1695c6cf
authored
May 11, 2018
by
Josh Borrow
Browse files
Changed some integers to floats
parent
e568907c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/hydro/PressureEnergy/hydro.h
View file @
1695c6cf
...
...
@@ -453,8 +453,9 @@ __attribute__((always_inline)) INLINE static void hydro_prepare_force(
/* Compute the "grad h" term */
const
float
common_factor
=
p
->
h
/
(
hydro_dimension
*
p
->
density
.
wcount
);
const
float
grad_h_term
=
(
p
->
density
.
pressure_bar_dh
*
common_factor
/
hydro_gamma_minus_one
)
/
(
1
+
common_factor
*
p
->
density
.
wcount_dh
);
(
p
->
density
.
pressure_bar_dh
*
common_factor
*
hydro_one_over_gamma_minus_one
)
/
(
1
.
f
+
common_factor
*
p
->
density
.
wcount_dh
);
/* Update variables. */
p
->
force
.
f
=
grad_h_term
;
...
...
src/hydro/PressureEnergy/hydro_iact.h
View file @
1695c6cf
...
...
@@ -206,8 +206,8 @@ __attribute__((always_inline)) INLINE static void runner_iact_force(
const
float
rhoi
=
pi
->
rho
;
const
float
rhoj
=
pj
->
rho
;
/* Compute gradient terms */
const
float
f_ij
=
1
-
(
pi
->
force
.
f
/
mjuj
);
const
float
f_ji
=
1
-
(
pj
->
force
.
f
/
miui
);
const
float
f_ij
=
1
.
f
-
(
pi
->
force
.
f
/
mjuj
);
const
float
f_ji
=
1
.
f
-
(
pj
->
force
.
f
/
miui
);
/* Get the kernel for hi. */
const
float
hi_inv
=
1
.
0
f
/
hi
;
...
...
@@ -331,8 +331,8 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_force(
const
float
rhoi
=
pi
->
rho
;
const
float
rhoj
=
pj
->
rho
;
/* Compute gradient terms */
const
float
f_ij
=
1
-
(
pi
->
force
.
f
/
mjuj
);
const
float
f_ji
=
1
-
(
pj
->
force
.
f
/
miui
);
const
float
f_ij
=
1
.
f
-
(
pi
->
force
.
f
/
mjuj
);
const
float
f_ji
=
1
.
f
-
(
pj
->
force
.
f
/
miui
);
/* Get the kernel for hi. */
const
float
hi_inv
=
1
.
0
f
/
hi
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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