Skip to content
Snippets Groups Projects
Commit d7ad8d65 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Use the top-level cell size and not the super-cell size to compute the MM cut-off distance.

parent 87f203c6
No related branches found
No related tags found
1 merge request!393Periodic gravity speed and accuracy improvements
......@@ -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).
......
......@@ -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:
......
......@@ -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:
......
......@@ -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
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment