Commit 30482afb authored by Bert Vandenbroucke's avatar Bert Vandenbroucke
Browse files

Restored Gizmo particle size computation.

parent 745cc6b1
......@@ -56,8 +56,9 @@ __attribute__((always_inline)) INLINE static float hydro_compute_timestep(
const float vmax =
sqrtf(vrel[0] * vrel[0] + vrel[1] * vrel[1] + vrel[2] * vrel[2]) +
sqrtf(hydro_gamma * p->primitives.P / p->primitives.rho);
return CFL_condition *
min(0.5 * p->timestepvars.rmin / vmax, p->timestepvars.dt_min);
const float psize = powf(p->geometry.volume / hydro_dimension_unit_sphere,
hydro_dimension_inv);
return CFL_condition * min(psize / vmax, p->timestepvars.dt_min);
}
/**
......@@ -420,7 +421,6 @@ __attribute__((always_inline)) INLINE static void hydro_prepare_force(
/* Initialize time step criterion variables */
p->timestepvars.dt_min = FLT_MAX;
p->timestepvars.rmin = FLT_MAX;
/* Set the actual velocity of the particle */
hydro_velocities_prepare_force(p, xp);
......
......@@ -46,8 +46,7 @@ __attribute__((always_inline)) INLINE static void hydro_debug_particle(
"volume=%.3e, "
"matrix_E=[[%.3e,%.3e,%.3e],[%.3e,%.3e,%.3e],[%.3e,%.3e,%.3e]]}, "
"timestepvars={"
"dt_min=%.3e, "
"rmin=%.3e},"
"dt_min=%.3e},"
"density={"
"div_v=%.3e, "
"wcount_dh=%.3e, "
......@@ -76,7 +75,7 @@ __attribute__((always_inline)) INLINE static void hydro_debug_particle(
p->geometry.matrix_E[1][0], p->geometry.matrix_E[1][1],
p->geometry.matrix_E[1][2], p->geometry.matrix_E[2][0],
p->geometry.matrix_E[2][1], p->geometry.matrix_E[2][2],
p->timestepvars.dt_min, p->timestepvars.rmin, p->density.div_v, p->density.wcount_dh,
p->timestepvars.dt_min, p->density.div_v, p->density.wcount_dh,
p->density.curl_v[0], p->density.curl_v[1], p->density.curl_v[2],
p->density.wcount);
}
......@@ -351,10 +351,8 @@ __attribute__((always_inline)) INLINE static void runner_iact_fluxes_common(
}
dt_min = r / vmax;
pi->timestepvars.dt_min = min(pi->timestepvars.dt_min, dt_min);
pi->timestepvars.rmin = min(pi->timestepvars.rmin, r);
if (mode == 1) {
pj->timestepvars.dt_min = min(pj->timestepvars.dt_min, dt_min);
pj->timestepvars.rmin = min(pj->timestepvars.rmin, r);
}
/* The flux will be exchanged using the smallest time step of the two
......
......@@ -159,9 +159,6 @@ struct part {
/* Minimum non-normalized timestep based on the neighbours. */
float dt_min;
/* Minimum distance between the particle and any of its neighbours. */
float rmin;
} timestepvars;
/* Quantities used during the volume (=density) loop. */
......
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