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

Do not resinitialse the old accelerations to 0 in gravity_init()....

parent 07df10c8
No related branches found
No related tags found
1 merge request!1077Improved multipole acceptance criterion (MAC)
...@@ -160,7 +160,6 @@ __attribute__((always_inline)) INLINE static void gravity_init_gpart( ...@@ -160,7 +160,6 @@ __attribute__((always_inline)) INLINE static void gravity_init_gpart(
gp->a_grav[1] = 0.f; gp->a_grav[1] = 0.f;
gp->a_grav[2] = 0.f; gp->a_grav[2] = 0.f;
gp->potential = 0.f; gp->potential = 0.f;
gp->old_a_grav_norm = 0.f;
#ifdef SWIFT_GRAVITY_FORCE_CHECKS #ifdef SWIFT_GRAVITY_FORCE_CHECKS
gp->potential_PM = 0.f; gp->potential_PM = 0.f;
...@@ -215,6 +214,10 @@ __attribute__((always_inline)) INLINE static void gravity_end_force( ...@@ -215,6 +214,10 @@ __attribute__((always_inline)) INLINE static void gravity_end_force(
gp->old_a_grav_norm = sqrtf(gp->old_a_grav_norm); gp->old_a_grav_norm = sqrtf(gp->old_a_grav_norm);
#ifdef SWIFT_DEBUG_CHECKS
if (gp->old_a_grav_norm == 0.f) error("Old acceleration is 0!");
#endif
/* Let's get physical... */ /* Let's get physical... */
gp->a_grav[0] *= const_G; gp->a_grav[0] *= const_G;
gp->a_grav[1] *= const_G; gp->a_grav[1] *= const_G;
...@@ -267,6 +270,7 @@ __attribute__((always_inline)) INLINE static void gravity_first_init_gpart( ...@@ -267,6 +270,7 @@ __attribute__((always_inline)) INLINE static void gravity_first_init_gpart(
struct gpart* gp, const struct gravity_props* grav_props) { struct gpart* gp, const struct gravity_props* grav_props) {
gp->time_bin = 0; gp->time_bin = 0;
gp->old_a_grav_norm = 0.f;
gravity_init_gpart(gp); gravity_init_gpart(gp);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment