Commit 54ad18df authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Correct counting of steps.

parent 921a4e6e
......@@ -1723,8 +1723,8 @@ void engine_init_particles(struct engine *e) {
TIMER_TIC;
engine_launch(e, e->nr_threads,
(1 << task_type_sort) | (1 << task_type_self) |
(1 << task_type_pair) | (1 << task_type_sub) |
(1 << task_type_init) | (1 << task_type_ghost) |
(1 << task_type_pair) | (1 << task_type_sub) |
(1 << task_type_init) | (1 << task_type_ghost) |
(1 << task_type_send) | (1 << task_type_recv),
1 << task_subtype_density);
......@@ -1738,7 +1738,7 @@ void engine_init_particles(struct engine *e) {
printParticle(e->s->parts, 515050, e->s->nr_parts);
/* Ready to go */
e->step = -1;
e->step = 0;
}
/**
......@@ -1818,6 +1818,9 @@ if ( e->nodeID == 0 )
printParticle(e->s->parts, 1000, e->s->nr_parts);
printParticle(e->s->parts, 515050, e->s->nr_parts);
if(e->step == 2) exit(0);
/* Move forward in time */
e->timeOld = e->time;
......@@ -1853,7 +1856,6 @@ if ( e->nodeID == 0 )
printParticle(e->s->parts, 1000, e->s->nr_parts);
printParticle(e->s->parts, 515050, e->s->nr_parts);
exit(0);
}
......
......@@ -859,13 +859,6 @@ void runner_dokick(struct runner *r, struct cell *c, int timer) {
const float new_dt_grav = gravity_compute_timestep(p, xp);
new_dt = fminf(new_dt_hydro, new_dt_grav);
if(p->id == 1000)
message("1000 dt_hydro=%e", new_dt_hydro);
if(p->id == 515050)
message("515050 dt_hydro=%e", new_dt_hydro);
/* Recover the current timestep */
const float current_dt = p->t_end - p->t_begin;
......@@ -894,6 +887,13 @@ void runner_dokick(struct runner *r, struct cell *c, int timer) {
p->t_begin = p->t_end;
p->t_end = p->t_begin + new_dt;
if(p->id == 1000 || p->id == 515050)
message("%lld: current_t=%f t_beg=%f t_end=%f\n",
p->id,
t_current,
p->t_begin,
p->t_end);
/* Kick particles in momentum space */
xp->v_full[0] += p->a[0] * dt;
xp->v_full[1] += p->a[1] * dt;
......
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