Commit fb1c657f authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Reverted unnecessary changes in the self-gravity time-step calculation

parent 62ea2a87
./configure --enable-optimization=no --enable-debug=yes --disable-vec
......@@ -63,16 +63,15 @@ __attribute__((always_inline)) INLINE static float
gravity_compute_timestep_self(const struct phys_const* const phys_const,
const struct gpart* const gp) {
/* const float ac2 = gp->a_grav[0] * gp->a_grav[0] + */
/* gp->a_grav[1] * gp->a_grav[1] + */
/* gp->a_grav[2] * gp->a_grav[2]; */
const float ac2 = gp->a_grav[0] * gp->a_grav[0] +
gp->a_grav[1] * gp->a_grav[1] +
gp->a_grav[2] * gp->a_grav[2];
/* const float ac = (ac2 > 0.f) ? sqrtf(ac2) : FLT_MIN; */
const float ac = (ac2 > 0.f) ? sqrtf(ac2) : FLT_MIN;
/* const float dt = sqrt(2.f * const_gravity_eta * gp->epsilon / ac); */
const float dt = sqrt(2.f * const_gravity_eta * gp->epsilon / ac);
/* return dt; */
return FLT_MAX;
return dt;
}
/**
......@@ -117,7 +116,7 @@ __attribute__((always_inline)) INLINE static void gravity_init_gpart(
* @param const_G Newton's constant
*/
__attribute__((always_inline)) INLINE static void gravity_end_force(
struct gpart* gp, const double const_G) {
struct gpart* gp, double const_G) {
/* Let's get physical... */
gp->a_grav[0] *= const_G;
......
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