From eeb44fd1adfdbccbcd7a1a2d9e64b05fe37bf52e Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Wed, 30 Jan 2019 10:11:15 +1100
Subject: [PATCH] Make the ghost iterations abort based on h_old not on h_init
 to avoid cases where the code can't converge due to very poor and much too
 small initial guess.

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

diff --git a/src/runner.c b/src/runner.c
index 0d0765af3a..c3bf9321c5 100644
--- a/src/runner.c
+++ b/src/runner.c
@@ -1402,7 +1402,7 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) {
         }
 
         /* Check whether the particle has an inappropriate smoothing length */
-        if (fabsf(h_new - h_old) > eps * h_init) {
+        if (fabsf(h_new - h_old) > eps * h_old) {
 
           /* Ok, correct then */
 
-- 
GitLab