diff --git a/examples/EAGLE_100/eagle_100.yml b/examples/EAGLE_100/eagle_100.yml index a9b83b81f085e66b36d115c5265b66d6093ffdfb..54e56794c85c08ee3cf7f4a25e6e530ea434c77d 100644 --- a/examples/EAGLE_100/eagle_100.yml +++ b/examples/EAGLE_100/eagle_100.yml @@ -23,6 +23,14 @@ Snapshots: Statistics: delta_time: 1e-2 # Time between statistics output +# Parameters for the self-gravity scheme +Gravity: + eta: 0.025 # Constant dimensionless multiplier for time integration. + epsilon: 0.0001 # Softening length (in internal units). + theta: 0.7 # Opening angle (Multipole acceptance criterion) + a_smooth: 1.25 # PM smoothing scale in top-level cell-size units + r_cut: 4.5 # Distance beyong wwhich FMM forces are zero in top-level cell-size units + # Parameters for the hydrodynamics scheme SPH: resolution_eta: 1.2348 # Target smoothing length in units of the mean inter-particle separation (1.2348 == 48Ngbs with the cubic spline kernel). diff --git a/examples/EAGLE_12/eagle_12.yml b/examples/EAGLE_12/eagle_12.yml index b4697f96d4eed6c3768d492f0b1c52eaed878d5d..4bb04e757f8e43e9653e2dde066b8ca560956ce4 100644 --- a/examples/EAGLE_12/eagle_12.yml +++ b/examples/EAGLE_12/eagle_12.yml @@ -26,8 +26,10 @@ Statistics: # Parameters for the self-gravity scheme Gravity: eta: 0.025 # Constant dimensionless multiplier for time integration. - theta: 0.7 # Opening angle (Multipole acceptance criterion) epsilon: 0.0001 # Softening length (in internal units). + theta: 0.7 # Opening angle (Multipole acceptance criterion) + a_smooth: 1.25 # PM smoothing scale in top-level cell-size units + r_cut: 4.5 # Distance beyong wwhich FMM forces are zero in top-level cell-size un # Parameters for the hydrodynamics scheme SPH: diff --git a/examples/EAGLE_25/eagle_25.yml b/examples/EAGLE_25/eagle_25.yml index c755768bcfafebf3efe6307080e9e85d3a0a4bf5..8920fb89a9966d1de3ebbb0e3b043f4ae85df3f2 100644 --- a/examples/EAGLE_25/eagle_25.yml +++ b/examples/EAGLE_25/eagle_25.yml @@ -27,8 +27,9 @@ Statistics: Gravity: eta: 0.025 # Constant dimensionless multiplier for time integration. epsilon: 0.0001 # Softening length (in internal units). - a_smooth: 1000. - r_cut: 4. + theta: 0.7 # Opening angle (Multipole acceptance criterion) + a_smooth: 1.25 # PM smoothing scale in top-level cell-size units + r_cut: 4.5 # Distance beyong wwhich FMM forces are zero in top-level cell-size units # Parameters for the hydrodynamics scheme SPH: diff --git a/examples/UniformDMBox/uniformBox.yml b/examples/UniformDMBox/uniformBox.yml index cffd442a9a5b16d8e042e41caf9991fcf0e1202e..dd8ea53a20b14e9fe7206e1ac692d16f6524976d 100644 --- a/examples/UniformDMBox/uniformBox.yml +++ b/examples/UniformDMBox/uniformBox.yml @@ -28,7 +28,8 @@ Gravity: eta: 0.025 # Constant dimensionless multiplier for time integration. theta: 0.7 # Opening angle (Multipole acceptance criterion) epsilon: 0.00001 # Softening length (in internal units). - + a_smooth: 1.25 # PM smoothing scale in top-level cell-size units + r_cut: 4.5 # Distance beyong wwhich FMM forces are zero in top-level cell-size un # Parameters governing the conserved quantities statistics Statistics: delta_time: 1e-2 # Time between statistics output diff --git a/src/runner_doiact_grav.h b/src/runner_doiact_grav.h index d8e82c313e1ed18d98457c8065e7f9a8b90a5213..f4ee414cae212f498a1cc23a9e5ab1570dc1d5b3 100644 --- a/src/runner_doiact_grav.h +++ b/src/runner_doiact_grav.h @@ -180,9 +180,10 @@ void runner_dopair_grav_pp(struct runner *r, struct cell *ci, struct cell *cj) { const struct engine *e = r->e; const struct space *s = e->s; const int periodic = s->periodic; + const double cell_width = s->width[0]; const double dim[3] = {s->dim[0], s->dim[1], s->dim[2]}; const float a_smooth = e->gravity_properties->a_smooth; - const float rlr_inv = 1. / (a_smooth * ci->super->width[0]); + const float rlr_inv = 1. / (a_smooth * cell_width); /* Cell properties */ const int gcount_i = ci->gcount; @@ -336,8 +337,9 @@ void runner_doself_grav_pp(struct runner *r, struct cell *c) { const struct engine *e = r->e; const struct space *s = e->s; const int periodic = s->periodic; + const double cell_width = s->width[0]; const float a_smooth = e->gravity_properties->a_smooth; - const float rlr_inv = 1. / (a_smooth * c->super->width[0]); + const float rlr_inv = 1. / (a_smooth * cell_width); /* Cell properties */ const int gcount = c->gcount;