Skip to content
Snippets Groups Projects
Commit 4e3e6da9 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Initialise the softening lengths of the gparts from the parameter file.

parent 7b65cd6d
No related branches found
No related tags found
1 merge request!324Gravity multi dt
......@@ -2951,6 +2951,13 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs) {
if (e->nodeID == 0) message("Computing initial gas densities.");
/* Initialise the softening lengths */
if (e->policy & engine_policy_self_gravity) {
for (size_t i = 0; i < s->nr_gparts; ++i)
gravity_init_softening(&s->gparts[i], e->gravity_properties);
}
/* Construct all cells and tasks to start everything */
engine_rebuild(e);
......
......@@ -113,9 +113,20 @@ __attribute__((always_inline)) INLINE static void gravity_first_init_gpart(
struct gpart* gp) {
gp->time_bin = 0;
gp->epsilon = 0.1; // MATTHIEU
gp->epsilon = 0.f;
gravity_init_gpart(gp);
}
/**
* @brief Initialises the softening of the g-particles
*
* @param gp The particle to act upon
*/
__attribute__((always_inline)) INLINE static void gravity_init_softening(
struct gpart* gp, const struct gravity_props* grav_props) {
gp->epsilon = grav_props->epsilon;
}
#endif /* SWIFT_DEFAULT_GRAVITY_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment