From cd1cb6d9405e34f9e98611bae7ec3f9ae25a30f7 Mon Sep 17 00:00:00 2001
From: wjr21 <wjr21@sussex.ac.uk>
Date: Mon, 25 Apr 2022 23:54:31 +0100
Subject: [PATCH] reading cdim from parameter file for check in gravity props
 initialisation

---
 examples/main.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/examples/main.c b/examples/main.c
index da49a44b41..485ea97ea0 100644
--- a/examples/main.c
+++ b/examples/main.c
@@ -1312,6 +1312,16 @@ int main(int argc, char *argv[]) {
     neutrino_props_init(&neutrino_properties, &prog_const, &us, params, &cosmo,
                         with_neutrinos);
 
+    /* Get cdim from parameter file for gravity property intialisation */
+    /* Set the zoom cdim. */
+    int cdim[3]
+    cdim[0] = parser_get_opt_param_int(params, "Scheduler:max_top_level_cells",
+                                       space_max_top_level_cells_default);
+    cdim[1] = parser_get_opt_param_int(params, "Scheduler:max_top_level_cells",
+                                       space_max_top_level_cells_default);
+    cdim[2] = parser_get_opt_param_int(params, "Scheduler:max_top_level_cells",
+                                       space_max_top_level_cells_default);
+
     /* Initialise the gravity properties */
     bzero(&gravity_properties, sizeof(struct gravity_props));
     if (with_self_gravity)
@@ -1320,7 +1330,7 @@ int main(int argc, char *argv[]) {
                          with_cosmology, with_external_gravity,
                          with_baryon_particles, with_DM_particles,
                          with_neutrinos, with_DM_background_particles, periodic,
-                         dim, s.cdim);
+                         dim, cdim);
 
     /* Initialize the space with these data. */
     if (myrank == 0) clocks_gettime(&tic);
-- 
GitLab