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

Re-instated long-range truncation for periodic gravity.

parent 5be80e09
No related branches found
No related tags found
1 merge request!393Periodic gravity speed and accuracy improvements
...@@ -37,15 +37,14 @@ ...@@ -37,15 +37,14 @@
__attribute__((always_inline)) INLINE static void kernel_long_grav_eval( __attribute__((always_inline)) INLINE static void kernel_long_grav_eval(
float u, float *const W) { float u, float *const W) {
/* const float arg1 = u * 0.5f; */ const float arg1 = u * 0.5f;
/* const float arg2 = u * one_over_sqrt_pi; */ const float arg2 = u * one_over_sqrt_pi;
/* const float arg3 = -arg1 * arg1; */ const float arg3 = -arg1 * arg1;
/* const float term1 = erfcf(arg1); */ const float term1 = erfcf(arg1);
/* const float term2 = arg2 * expf(arg3); */ const float term2 = arg2 * expf(arg3);
/* *W = term1 + term2; */ *W = term1 + term2;
*W = 1.f;
} }
#endif // SWIFT_KERNEL_LONG_GRAVITY_H #endif // SWIFT_KERNEL_LONG_GRAVITY_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment