From 3bfd0dea820588f5774cd103ec4058163dfaf91c Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <schaller@strw.leidenuniv.nl> Date: Wed, 1 May 2019 17:28:18 +0200 Subject: [PATCH] Don't let the code start if the black hole smoothing lengths are 0 --- src/space.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/space.c b/src/space.c index 2b974a8234..60ee47d5b9 100644 --- a/src/space.c +++ b/src/space.c @@ -4263,6 +4263,13 @@ void space_first_init_bparts_mapper(void *restrict map_data, int count, #endif } + /* Check that the smoothing lengths are non-zero */ + for (int k = 0; k < count; k++) { + if (bp[k].h <= 0.) + error("Invalid value of smoothing length for bpart %lld h=%e", bp[k].id, + bp[k].h); + } + /* Initialise the rest */ for (int k = 0; k < count; k++) { -- GitLab