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

Document the logic in runner_do_star_formation() a bit better

parent f3793a0e
No related branches found
No related tags found
No related merge requests found
...@@ -339,7 +339,9 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) { ...@@ -339,7 +339,9 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
const int spawn_spart = const int spawn_spart =
star_formation_should_spawn_spart(p, xp, sf_props); star_formation_should_spawn_spart(p, xp, sf_props);
/* Are we using a model that actually generates star particles? */
if (swift_star_formation_model_creates_stars) { if (swift_star_formation_model_creates_stars) {
/* Check if we should create a new particle or transform one */ /* Check if we should create a new particle or transform one */
if (spawn_spart) { if (spawn_spart) {
/* Spawn a new spart (+ gpart) */ /* Spawn a new spart (+ gpart) */
...@@ -348,7 +350,11 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) { ...@@ -348,7 +350,11 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
/* Convert the gas particle to a star particle */ /* Convert the gas particle to a star particle */
sp = cell_convert_part_to_spart(e, c, p, xp); sp = cell_convert_part_to_spart(e, c, p, xp);
} }
} else { } else {
/* We are in a model where spart don't exist
* --> convert the part to a DM gpart */
cell_convert_part_to_gpart(e, c, p, xp); cell_convert_part_to_gpart(e, c, p, xp);
} }
...@@ -393,7 +399,7 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) { ...@@ -393,7 +399,7 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
/* log_all */ 1, /* log_all */ 1,
/* special flags */ 0); /* special flags */ 0);
#endif #endif
} else { } else if (swift_star_formation_model_creates_stars) {
/* Do something about the fact no star could be formed. /* Do something about the fact no star could be formed.
Note that in such cases a tree rebuild to create more free Note that in such cases a tree rebuild to create more free
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment