From fc0ef3b90733ee6394aa89f5a93c42e51cf7e86a Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Thu, 11 Apr 2019 15:44:17 +0200
Subject: [PATCH] When sorting the stars after having formed a star, only do so
 for the active cells.

---
 src/runner.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/runner.c b/src/runner.c
index 6f031ded72..b6be2abc05 100644
--- a/src/runner.c
+++ b/src/runner.c
@@ -1301,6 +1301,8 @@ void runner_do_all_stars_sort(struct runner *r, struct cell *c) {
   if (c->nodeID != engine_rank) error("Function called on a foreign cell!");
 #endif
 
+ if(!cell_is_active_stars(c, r->e) && !cell_is_active_hydro(c, r->e)) return;
+
   /* Shall we sort at this level? */
   if (c->hydro.super == c) {
 
-- 
GitLab