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

Make use of the Plummer conversion constant for the time-step as well.

parent 9610ab37
......@@ -107,8 +107,8 @@ gravity_compute_timestep_self(const struct gpart* const gp,
const float epsilon = gravity_get_softening(gp, grav_props);
/* Note that 0.66666667 = 2. (from Gadget) / 3. (Plummer softening) */
const float dt =
sqrtf(0.66666667f * cosmo->a * grav_props->eta * epsilon * ac_inv);
const float dt = sqrtf(2. * kernel_gravity_softening_plummer_equivalent_inv *
cosmo->a * grav_props->eta * epsilon * ac_inv);
return dt;
}
......
......@@ -28,6 +28,7 @@
/*! Conversion factor between Plummer softening and internal softening */
#define kernel_gravity_softening_plummer_equivalent 3.
#define kernel_gravity_softening_plummer_equivalent_inv (1. / 3.)
/**
* @brief Computes the gravity softening function for potential.
......
Markdown is supported
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