From dd823b4fd69233f74001a207163e293925bffbb8 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <matthieu.schaller@durham.ac.uk> Date: Wed, 6 Apr 2016 13:00:12 +0100 Subject: [PATCH] Make sure we run with gravity or SPH. --- examples/main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/main.c b/examples/main.c index ae27534632..5cfae5efba 100644 --- a/examples/main.c +++ b/examples/main.c @@ -200,11 +200,17 @@ int main(int argc, char *argv[]) { } else if (optind > argc - 1) { if (myrank == 0) printf("Error: A parameter file name must be provided\n"); if (myrank == 0) print_help_message(); - exit(1); + return 1; } else { if (myrank == 0) printf("Error: Too many parameters given\n"); if (myrank == 0) print_help_message(); - exit(1); + return 1; + } + if (!with_self_gravity && !with_hydro && !with_external_gravity) { + if (myrank == 0) + printf("Error: At least one of -s, -g or -G must be chosen.\n"); + if (myrank == 0) print_help_message(); + return 1; } /* Genesis 1.1: And then, there was time ! */ -- GitLab