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

Don't forget to initialise x_old otherwise rebuild is triggered every time-step.

parent 5f1ebdf6
No related branches found
No related tags found
2 merge requests!136Master,!116Basic implementation of gparts
......@@ -1060,6 +1060,7 @@ void space_do_split(struct space *s, struct cell *c) {
struct cell *temp;
struct part *parts = c->parts;
struct gpart *gparts = c->gparts;
struct xpart *xparts = c->xparts;
/* Check the depth. */
if (c->depth > s->maxdepth) s->maxdepth = c->depth;
......@@ -1130,8 +1131,12 @@ void space_do_split(struct space *s, struct cell *c) {
/* Get dt_min/dt_max. */
for (int k = 0; k < count; k++) {
struct part *p = &parts[k];
struct xpart *xp = &xparts[k];
const float h = p->h;
const int ti_end = p->ti_end;
xp->x_old[0] = p->x[0];
xp->x_old[1] = p->x[1];
xp->x_old[2] = p->x[2];
if (h > h_max) h_max = h;
if (ti_end < ti_end_min) ti_end_min = ti_end;
if (ti_end > ti_end_max) ti_end_max = ti_end;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment