diff --git a/src/cell.c b/src/cell.c index 079950c136a569fb50d0887e079d70222ee51b00..5128ef727488fb4fca330f79e26eff849ffbf5b3 100644 --- a/src/cell.c +++ b/src/cell.c @@ -264,7 +264,6 @@ int cell_unpack(struct pcell *restrict pc, struct cell *restrict c, temp->depth = c->depth + 1; temp->split = 0; temp->dx_max_part = 0.f; - temp->dx_max_gpart = 0.f; temp->dx_max_sort = 0.f; temp->nodeID = c->nodeID; temp->parent = c; @@ -302,7 +301,6 @@ int cell_pack_end_step(struct cell *restrict c, pcells[0].ti_gravity_end_min = c->ti_gravity_end_min; pcells[0].ti_gravity_end_max = c->ti_gravity_end_max; pcells[0].dx_max_part = c->dx_max_part; - pcells[0].dx_max_gpart = c->dx_max_gpart; /* Fill in the progeny, depth-first recursion. */ int count = 1; @@ -339,7 +337,6 @@ int cell_unpack_end_step(struct cell *restrict c, c->ti_gravity_end_min = pcells[0].ti_gravity_end_min; c->ti_gravity_end_max = pcells[0].ti_gravity_end_max; c->dx_max_part = pcells[0].dx_max_part; - c->dx_max_gpart = pcells[0].dx_max_gpart; /* Fill in the progeny, depth-first recursion. */ int count = 1; @@ -2609,8 +2606,6 @@ void cell_drift_gpart(struct cell *c, const struct engine *e, int force) { struct gpart *const gparts = c->gparts; struct spart *const sparts = c->sparts; - float dx_max = 0.f, dx2_max = 0.f; - /* Drift irrespective of cell flags? */ force |= c->do_grav_drift; @@ -2632,15 +2627,9 @@ void cell_drift_gpart(struct cell *c, const struct engine *e, int force) { /* Recurse */ cell_drift_gpart(cp, e, force); - - /* Update */ - dx_max = max(dx_max, cp->dx_max_gpart); } } - /* Store the values */ - c->dx_max_gpart = dx_max; - /* Update the time of the last drift */ c->ti_old_gpart = ti_current; @@ -2664,12 +2653,6 @@ void cell_drift_gpart(struct cell *c, const struct engine *e, int force) { /* Drift... */ drift_gpart(gp, dt_drift, ti_old_gpart, ti_current); - /* Compute (square of) motion since last cell construction */ - const float dx2 = gp->x_diff[0] * gp->x_diff[0] + - gp->x_diff[1] * gp->x_diff[1] + - gp->x_diff[2] * gp->x_diff[2]; - dx2_max = max(dx2_max, dx2); - /* Init gravity force fields. */ if (gpart_is_active(gp, e)) { gravity_init_gpart(gp); @@ -2689,12 +2672,6 @@ void cell_drift_gpart(struct cell *c, const struct engine *e, int force) { /* Note: no need to compute dx_max as all spart have a gpart */ } - /* Now, get the maximal particle motion from its square */ - dx_max = sqrtf(dx2_max); - - /* Store the values */ - c->dx_max_gpart = dx_max; - /* Update the time of the last drift */ c->ti_old_gpart = ti_current; } @@ -2730,7 +2707,7 @@ void cell_drift_all_multipoles(struct cell *c, const struct engine *e) { /* Drift the multipole */ if (ti_current > ti_old_multipole) - gravity_drift(c->multipole, dt_drift, c->dx_max_gpart); + gravity_drift(c->multipole, dt_drift, 0.f /*c->dx_max_gpart*/); /* Are we not in a leaf ? */ if (c->split) { @@ -2772,7 +2749,7 @@ void cell_drift_multipole(struct cell *c, const struct engine *e) { dt_drift = (ti_current - ti_old_multipole) * e->time_base; if (ti_current > ti_old_multipole) - gravity_drift(c->multipole, dt_drift, c->dx_max_gpart); + gravity_drift(c->multipole, dt_drift, 0.f /*c->dx_max_gpart*/); /* Update the time of the last drift */ c->ti_old_multipole = ti_current; diff --git a/src/cell.h b/src/cell.h index 2fcd3e20ee3d18c1b6f012f9cd4f61f364348b9f..31d525b02b49463563b21bf5aa904a8b4301f989 100644 --- a/src/cell.h +++ b/src/cell.h @@ -148,9 +148,6 @@ struct pcell_step { /*! Maximal distance any #part has travelled since last rebuild */ float dx_max_part; - - /*! Maximal distance any #gpart has travelled since last rebuild */ - float dx_max_gpart; }; /** @@ -359,9 +356,6 @@ struct cell { /*! Maximum part movement in this cell since last construction. */ float dx_max_part; - /*! Maximum gpart movement in this cell since last construction. */ - float dx_max_gpart; - /*! Nr of #part in this cell. */ int count; diff --git a/src/drift.h b/src/drift.h index b7d5e3abe648e327f1560641676685b2d038ce3b..ff0fea744012b7143afed2a05b286d4646cdd69a 100644 --- a/src/drift.h +++ b/src/drift.h @@ -56,11 +56,6 @@ __attribute__((always_inline)) INLINE static void drift_gpart( gp->x[0] += gp->v_full[0] * dt_drift; gp->x[1] += gp->v_full[1] * dt_drift; gp->x[2] += gp->v_full[2] * dt_drift; - - /* Compute offset since last cell construction */ - gp->x_diff[0] -= gp->v_full[0] * dt_drift; - gp->x_diff[1] -= gp->v_full[1] * dt_drift; - gp->x_diff[2] -= gp->v_full[2] * dt_drift; } /** diff --git a/src/gravity/Default/gravity_part.h b/src/gravity/Default/gravity_part.h index 9af294715bb8ae9db4486a347fbde3e72f55fe82..3c38bfb2300126d63b9164c075c0696bee7eac10 100644 --- a/src/gravity/Default/gravity_part.h +++ b/src/gravity/Default/gravity_part.h @@ -29,9 +29,6 @@ struct gpart { /*! Particle position. */ double x[3]; - /*! Offset between current position and position at last tree rebuild. */ - float x_diff[3]; - /*! Particle velocity. */ float v_full[3]; @@ -75,6 +72,6 @@ struct gpart { double potential_exact; #endif -} SWIFT_STRUCT_ALIGN; +}; #endif /* SWIFT_DEFAULT_GRAVITY_PART_H */ diff --git a/src/gravity/Potential/gravity_part.h b/src/gravity/Potential/gravity_part.h index d325baf4de0938d8df539d38ae10f8f3f3ec7d2b..25ad78d4ff1a15e4efb63b6baadc6022a83e3699 100644 --- a/src/gravity/Potential/gravity_part.h +++ b/src/gravity/Potential/gravity_part.h @@ -29,9 +29,6 @@ struct gpart { /*! Particle position. */ double x[3]; - /*! Offset between current position and position at last tree rebuild. */ - float x_diff[3]; - /*! Particle velocity. */ float v_full[3]; diff --git a/src/space.c b/src/space.c index 20d2159f015790542c7615302058d17d71fbf70b..a4c0d9b595e979381ea02de5a4ea3e466f5e4163 100644 --- a/src/space.c +++ b/src/space.c @@ -169,7 +169,6 @@ void space_rebuild_recycle_mapper(void *map_data, int num_elements, c->force = NULL; c->grav = NULL; c->dx_max_part = 0.0f; - c->dx_max_gpart = 0.0f; c->dx_max_sort = 0.0f; c->sorted = 0; c->count = 0; @@ -1823,7 +1822,6 @@ void space_split_recursive(struct space *s, struct cell *c, cp->split = 0; cp->h_max = 0.f; cp->dx_max_part = 0.f; - cp->dx_max_gpart = 0.f; cp->dx_max_sort = 0.f; cp->nodeID = c->nodeID; cp->parent = c; @@ -1977,7 +1975,7 @@ void space_split_recursive(struct space *s, struct cell *c, xparts[k].x_diff[2] = 0.f; } - /* gparts: Get dt_min/dt_max, reset x_diff. */ + /* gparts: Get dt_min/dt_max. */ for (int k = 0; k < gcount; k++) { #ifdef SWIFT_DEBUG_CHECKS if (gparts[k].time_bin == time_bin_inhibited) @@ -1985,9 +1983,6 @@ void space_split_recursive(struct space *s, struct cell *c, #endif gravity_time_bin_min = min(gravity_time_bin_min, gparts[k].time_bin); gravity_time_bin_max = max(gravity_time_bin_max, gparts[k].time_bin); - gparts[k].x_diff[0] = 0.f; - gparts[k].x_diff[1] = 0.f; - gparts[k].x_diff[2] = 0.f; } /* sparts: Get dt_min/dt_max */