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

When generating gas particles from DM ICs, check that the IDs do not overflow.

parent 3f7769ae
......@@ -3245,6 +3245,12 @@ void space_generate_gas(struct space *s, const struct cosmology *cosmo,
p->id = gp_gas->id_or_neg_offset * 2 + 1;
gp_dm->id_or_neg_offset *= 2;
if(gp_dm->id_or_neg_offset <= 0)
error("DM particle ID overflowd");
if(p->id <= 0)
error("gas particle ID overflowd");
/* Set the links correctly */
p->gpart = gp_gas;
gp_gas->id_or_neg_offset = -i;
......@@ -3277,7 +3283,7 @@ void space_generate_gas(struct space *s, const struct cosmology *cosmo,
p->v[2] = gp_gas->v_full[2];
/* Set the smoothing length to the mean inter-particle separation */
p->h = d;
p->h = 30. * d;
}
/* Replace the content of the space */
......
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