Skip to content
Snippets Groups Projects
Commit 45adeccf authored by James Willis's avatar James Willis
Browse files

Minor change to name of variable.

parent e88c008a
Branches
Tags
1 merge request!204Intrinsic vectorisation
...@@ -140,7 +140,7 @@ __attribute__((always_inline)) INLINE static void hydro_prepare_force( ...@@ -140,7 +140,7 @@ __attribute__((always_inline)) INLINE static void hydro_prepare_force(
const float pressure = (p->entropy + p->force.entropy_dt * dt) * pow_gamma(p->rho); const float pressure = (p->entropy + p->force.entropy_dt * dt) * pow_gamma(p->rho);
/* Divide the pressure by the density and density gradient */ /* Divide the pressure by the density and density gradient */
const float P_over_rho = pressure / (p->rho * p->rho) * p->rho_dh; const float P_over_rho2 = pressure / (p->rho * p->rho) * p->rho_dh;
/* Compute the sound speed */ /* Compute the sound speed */
const float soundspeed = sqrtf(hydro_gamma * pressure / p->rho); const float soundspeed = sqrtf(hydro_gamma * pressure / p->rho);
...@@ -150,7 +150,7 @@ __attribute__((always_inline)) INLINE static void hydro_prepare_force( ...@@ -150,7 +150,7 @@ __attribute__((always_inline)) INLINE static void hydro_prepare_force(
(fabsf(p->density.div_v) + curl_v + 0.0001f * p->force.soundspeed / fac_mu / p->h); (fabsf(p->density.div_v) + curl_v + 0.0001f * p->force.soundspeed / fac_mu / p->h);
/* Update variables. */ /* Update variables. */
p->force.P_over_rho = P_over_rho; p->force.P_over_rho2 = P_over_rho2;
p->force.soundspeed = soundspeed; p->force.soundspeed = soundspeed;
p->force.balsara = balsara; p->force.balsara = balsara;
} }
...@@ -199,13 +199,13 @@ __attribute__((always_inline)) INLINE static void hydro_predict_extra( ...@@ -199,13 +199,13 @@ __attribute__((always_inline)) INLINE static void hydro_predict_extra(
(p->entropy + p->force.entropy_dt * dt_entr) * pow_gamma(p->rho); (p->entropy + p->force.entropy_dt * dt_entr) * pow_gamma(p->rho);
/* Divide the pressure by the density and density gradient */ /* Divide the pressure by the density and density gradient */
const float P_over_rho = pressure / (p->rho * p->rho) * p->rho_dh; const float P_over_rho2 = pressure / (p->rho * p->rho) * p->rho_dh;
/* Compute the new sound speed */ /* Compute the new sound speed */
const float soundspeed = sqrtf(hydro_gamma * pressure / p->rho); const float soundspeed = sqrtf(hydro_gamma * pressure / p->rho);
/* Update variables */ /* Update variables */
p->force.P_over_rho = P_over_rho; p->force.P_over_rho2 = P_over_rho2;
p->force.soundspeed = soundspeed; p->force.soundspeed = soundspeed;
} }
......
...@@ -23,7 +23,7 @@ __attribute__((always_inline)) INLINE static void hydro_debug_particle( ...@@ -23,7 +23,7 @@ __attribute__((always_inline)) INLINE static void hydro_debug_particle(
"x=[%.3e,%.3e,%.3e], " "x=[%.3e,%.3e,%.3e], "
"v=[%.3e,%.3e,%.3e],v_full=[%.3e,%.3e,%.3e] \n a=[%.3e,%.3e,%.3e],\n " "v=[%.3e,%.3e,%.3e],v_full=[%.3e,%.3e,%.3e] \n a=[%.3e,%.3e,%.3e],\n "
"h=%.3e, " "h=%.3e, "
"wcount=%d, wcount_dh=%.3e, m=%.3e, dh_drho=%.3e, rho=%.3e, P_over_rho=%.3e, " "wcount=%d, wcount_dh=%.3e, m=%.3e, dh_drho=%.3e, rho=%.3e, P_over_rho2=%.3e, "
"S=%.3e, " "S=%.3e, "
"dS/dt=%.3e, c=%.3e\n" "dS/dt=%.3e, c=%.3e\n"
"divV=%.3e, rotV=[%.3e,%.3e,%.3e], balsara=%.3e \n " "divV=%.3e, rotV=[%.3e,%.3e,%.3e], balsara=%.3e \n "
...@@ -31,7 +31,7 @@ __attribute__((always_inline)) INLINE static void hydro_debug_particle( ...@@ -31,7 +31,7 @@ __attribute__((always_inline)) INLINE static void hydro_debug_particle(
p->x[0], p->x[1], p->x[2], p->v[0], p->v[1], p->v[2], xp->v_full[0], p->x[0], p->x[1], p->x[2], p->v[0], p->v[1], p->v[2], xp->v_full[0],
xp->v_full[1], xp->v_full[2], p->a_hydro[0], p->a_hydro[1], p->a_hydro[2], xp->v_full[1], xp->v_full[2], p->a_hydro[0], p->a_hydro[1], p->a_hydro[2],
p->h, (int)p->density.wcount, p->density.wcount_dh, p->mass, p->rho_dh, p->h, (int)p->density.wcount, p->density.wcount_dh, p->mass, p->rho_dh,
p->rho, p->force.P_over_rho, p->entropy, p->force.entropy_dt, p->force.soundspeed, p->rho, p->force.P_over_rho2, p->entropy, p->force.entropy_dt, p->force.soundspeed,
p->density.div_v, p->density.rot_v[0], p->density.rot_v[1], p->density.div_v, p->density.rot_v[0], p->density.rot_v[1],
p->density.rot_v[2], p->force.balsara, p->force.v_sig, p->h_dt, p->ti_begin, p->ti_end); p->density.rot_v[2], p->force.balsara, p->force.v_sig, p->h_dt, p->ti_begin, p->ti_end);
} }
...@@ -93,8 +93,8 @@ struct part { ...@@ -93,8 +93,8 @@ struct part {
/* Signal velocity. */ /* Signal velocity. */
float v_sig; float v_sig;
/* Pressure over density*/ /* Pressure over density sqaured*/
float P_over_rho; float P_over_rho2;
/* Particle sound speed. */ /* Particle sound speed. */
float soundspeed; float soundspeed;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment