Commit d780bde1 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Applied code formatting tool

parent 9dc380df
......@@ -2363,11 +2363,11 @@ void engine_step(struct engine *e) {
!e->force_checks_only_all_active) {
/* Is this a snapshot timestep (and the option is selected)? */
if ((e->force_checks_snapshot_flag &&
e->force_checks_only_at_snapshots) ||
!e->force_checks_only_at_snapshots) {
/* Do checks */
gravity_exact_force_compute(e->s, e);
e->force_checks_only_at_snapshots) ||
!e->force_checks_only_at_snapshots) {
/* Do checks */
gravity_exact_force_compute(e->s, e);
}
}
}
......@@ -2396,14 +2396,14 @@ void engine_step(struct engine *e) {
!e->force_checks_only_all_active) {
/* Is this a snapshot timestep (and the option is selected)? */
if ((e->force_checks_snapshot_flag &&
e->force_checks_only_at_snapshots) ||
!e->force_checks_only_at_snapshots) {
/* Do checks */
gravity_exact_force_check(e->s, e, 1e-1);
/* Reset flag waiting for next output time */
e->force_checks_snapshot_flag = 0;
e->force_checks_only_at_snapshots) ||
!e->force_checks_only_at_snapshots) {
/* Do checks */
gravity_exact_force_check(e->s, e, 1e-1);
/* Reset flag waiting for next output time */
e->force_checks_snapshot_flag = 0;
}
}
}
......
......@@ -222,25 +222,25 @@ kernel_long_grav_force_eval_double(const double u, double *const W) {
const double one_over_sqrt_pi = ((double)(M_2_SQRTPI * 0.5));
const double arg1 = u * 0.5;
const double arg2 = -arg1 * arg1;
const double arg1 = u * 0.5;
const double arg2 = -arg1 * arg1;
const double term1 = erfc(arg1);
const double term2 = u * one_over_sqrt_pi * exp(arg2);
const double term1 = erfc(arg1);
const double term2 = u * one_over_sqrt_pi * exp(arg2);
*W = term1 + term2;
#else
const double x = 2. * u;
const double exp_x = exp(x);
const double alpha = 1. / (1. + exp_x);
const double x = 2. * u;
const double exp_x = exp(x);
const double alpha = 1. / (1. + exp_x);
/* We want 2*(x*alpha - x*alpha^2 - exp(x)*alpha + 1) */
*W = 1. - alpha;
*W = *W * x - exp_x;
*W = *W * alpha + 1.;
*W *= 2.;
#endif
/* We want 2*(x*alpha - x*alpha^2 - exp(x)*alpha + 1) */
*W = 1. - alpha;
*W = *W * x - exp_x;
*W = *W * alpha + 1.;
*W *= 2.;
#endif
#endif
}
......
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