Commit 1695c6cf authored by Josh Borrow's avatar Josh Borrow
Browse files

Changed some integers to floats

parent e568907c
......@@ -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;
......
......@@ -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.0f / 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.0f / hi;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment