From 04fa011db044c810ccf517dc65b8577c16c812d7 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Tue, 27 Jun 2017 11:32:35 +0200
Subject: [PATCH] Make sure gravity (self or external) is switched on when
 running with stars.

---
 examples/main.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/examples/main.c b/examples/main.c
index ad28d16c25..7c0f86325e 100644
--- a/examples/main.c
+++ b/examples/main.c
@@ -294,6 +294,14 @@ int main(int argc, char *argv[]) {
     if (myrank == 0) print_help_message();
     return 1;
   }
+  if (with_stars && !with_external_gravity && !with_self_gravity) {
+    if (myrank == 0)
+      printf(
+          "Error: Cannot run with stars but without gravity, -g or -G must be "
+          "chosen.\n");
+    if (myrank == 0) print_help_message();
+    return 1;
+  }
 
   /* Genesis 1.1: And then, there was time ! */
   clocks_set_cpufreq(cpufreq);
-- 
GitLab