Commit 825558a7 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Prevent the use of 0 or negative smoothing-scale for the gravity mesh forces.

parent 7a93b34f
......@@ -48,6 +48,9 @@ void gravity_props_init(struct gravity_props *p,
p->r_cut_min = parser_get_opt_param_float(params, "Gravity:r_cut_min",
gravity_props_default_r_cut_min);
if (p->a_smooth <= 0.)
error("The mesh smoothing scale 'a_smooth' must be > 0.");
/* Time integration */
p->eta = parser_get_param_float(params, "Gravity:eta");
......
......@@ -454,6 +454,7 @@ void runner_do_grav_fft(struct runner* r, int timer) {
TIMER_TIC;
if (cdim[0] != cdim[1] || cdim[0] != cdim[2]) error("Non-square mesh");
if (a_smooth <= 0.) error("Invalid value of a_smooth");
/* Some useful constants */
const int N = cdim[0];
......
......@@ -7,5 +7,5 @@ Gravity:
theta: 0.7 # Opening angle (Multipole acceptance criterion)
comoving_softening: 0.00001 # Comoving softening length (in internal units).
max_physical_softening: 0.00001 # Physical softening length (in internal units).
a_smooth: 0.
a_smooth: 0.00001
r_cut: 0.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment