From 8a32750c9db232a6f91f05aaf0c7ba3629e7ee2b Mon Sep 17 00:00:00 2001
From: loikki <loic.hausammann@protonmail.ch>
Date: Mon, 21 Jan 2019 15:25:08 +0100
Subject: [PATCH] Add check for hydro in cell_can_split_self_gravity_task (and
 pairs)

---
 src/cell.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/cell.h b/src/cell.h
index b73fd3ebe5..49ee0c2a00 100644
--- a/src/cell.h
+++ b/src/cell.h
@@ -941,7 +941,8 @@ __attribute__((always_inline)) INLINE static int cell_can_split_pair_stars_task(
   /* Note that since tasks are create after a rebuild no need to take */
   /* into account any part motion (i.e. dx_max == 0 here) */
   return c->split &&
-         (space_stretch * kernel_gamma * c->stars.h_max < 0.5f * c->dmin);
+    (space_stretch * kernel_gamma * c->stars.h_max < 0.5f * c->dmin) &&
+    (space_stretch * kernel_gamma * c->hydro.h_max < 0.5f * c->dmin);
 }
 
 /**
@@ -959,7 +960,8 @@ __attribute__((always_inline)) INLINE static int cell_can_split_self_stars_task(
   /* Note: No need for more checks here as all the sub-pairs and sub-self */
   /* tasks will be created. So no need to check for h_max */
   return c->split &&
-         (space_stretch * kernel_gamma * c->stars.h_max < 0.5f * c->dmin);
+    (space_stretch * kernel_gamma * c->stars.h_max < 0.5f * c->dmin) &&
+    (space_stretch * kernel_gamma * c->hydro.h_max < 0.5f * c->dmin);
 }
 
 /**
-- 
GitLab