From f1235181c3b80e7f908baac8708d16f1f9d0220c Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Fri, 8 Feb 2019 21:46:22 +0100
Subject: [PATCH] Avoid a FPE arising from compiler optimisation of the h <
 h_min branch of the ghost.

---
 src/runner.c         | 6 ------
 tests/test125cells.c | 2 +-
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/runner.c b/src/runner.c
index 08f0432d81..e15bed84c7 100644
--- a/src/runner.c
+++ b/src/runner.c
@@ -1462,12 +1462,6 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) {
             /* Ok, this particle is a lost cause... */
             p->h = hydro_h_min;
 
-            /* Do some damage control if no neighbours at all were found */
-            if (has_no_neighbours) {
-              hydro_part_has_no_neighbours(p, xp, cosmo);
-              chemistry_part_has_no_neighbours(p, xp, chemistry, cosmo);
-            }
-
           } else if (p->h >= hydro_h_max) {
 
             /* Ok, this particle is a lost cause... */
diff --git a/tests/test125cells.c b/tests/test125cells.c
index 7923a90f9a..3b49e71163 100644
--- a/tests/test125cells.c
+++ b/tests/test125cells.c
@@ -601,7 +601,7 @@ int main(int argc, char *argv[]) {
   hp.eta_neighbours = h;
   hp.h_tolerance = 1e0;
   hp.h_max = FLT_MAX;
-  hp.h_min = h / 1e6;
+  hp.h_min = 0.f;
   hp.h_min_ratio = 0.f;
   hp.max_smoothing_iterations = 10;
   hp.CFL_condition = 0.1;
-- 
GitLab