diff --git a/src/space.c b/src/space.c index d7aa9a32fd9c8e663a23b3287c26af81559652ce..9ca4a39fa14cf4a131912844e87c4c9558d2dbb8 100644 --- a/src/space.c +++ b/src/space.c @@ -314,14 +314,22 @@ void space_regrid(struct space *s, int verbose) { "small,\n" " - the (minimal) time-step is too large leading to particles with " "predicted smoothing lengths too large for the box size,\n" - " - particle with velocities so large that they move by more than two " + " - particles with velocities so large that they move by more than two " "box sizes per time-step.\n"); - /* Check if we have enough cells for gravity. */ - if (s->gravity && (cdim[0] < 8 || cdim[1] < 8 || cdim[2] < 8)) + /* Check if we have enough cells for periodic gravity. */ + if (s->gravity && s->periodic && (cdim[0] < 8 || cdim[1] < 8 || cdim[2] < 8)) error( - "Must have at least 8 cells in each spatial dimension when gravity " - "is switched on."); + "Must have at least 8 cells in each spatial dimension when periodic " + "gravity is switched on.\nThis error is often caused by any of the " + "followings:\n" + " - too few particles to generate a sensible grid,\n" + " - the initial value of 'Scheduler:max_top_level_cells' is too " + "small,\n" + " - the (minimal) time-step is too large leading to particles with " + "predicted smoothing lengths too large for the box size,\n" + " - particles with velocities so large that they move by more than two " + "box sizes per time-step.\n"); /* In MPI-Land, changing the top-level cell size requires that the * global partition is recomputed and the particles redistributed.