Commit 23daf6d9 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

If we ran out of particles when creating a star, do not attempt to copy the...

If we ran out of particles when creating a star, do not attempt to copy the properties of the gas particle to the star.
parent 5b0e0eb1
......@@ -636,9 +636,13 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
/* Convert the gas particle to a star particle */
struct spart *sp = cell_convert_part_to_spart(e, c, p, xp);
/* Copy the properties of the gas particle to the star particle */
star_formation_copy_properties(p, xp, sp, e, sf_props, cosmo,
with_cosmology);
/* Did we get a star? (Or did we run out of spare ones?) */
if (sp != NULL) {
/* Copy the properties of the gas particle to the star particle */
star_formation_copy_properties(p, xp, sp, e, sf_props, cosmo,
with_cosmology);
}
}
} else { /* Are we not star-forming? */
......@@ -1878,6 +1882,7 @@ void runner_do_drift_spart(struct runner *r, struct cell *c, int timer) {
if (timer) TIMER_TOC(timer_drift_spart);
}
/**
* @brief Perform the first half-kick on all the active particles in a cell.
*
......
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