Commit e3ca8990 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Make the new task synchronize the particles hit by feedback and force them to...

Make the new task synchronize the particles hit by feedback and force them to recompute a time-step. Propagate the time-step upwards.
parent e5420802
......@@ -2589,6 +2589,42 @@ void cell_activate_drift_part(struct cell *c, struct scheduler *s) {
}
}
void cell_activate_sync_part(struct cell *c, struct scheduler *s) {
/* If this cell is already marked for drift, quit early. */
if (cell_get_flag(c, cell_flag_do_hydro_sync)) return;
/* Mark this cell for synchronization. */
cell_set_flag(c, cell_flag_do_hydro_sync);
/* Set the do_sub_sync all the way up and activate the super sync
if this has not yet been done. */
if (c == c->super) {
#ifdef SWIFT_DEBUG_CHECKS
if (c->timestep_sync == NULL)
error("Trying to activate un-existing c->timestep_sync");
#endif
scheduler_activate(s, c->timestep_sync);
scheduler_activate(s, c->kick1);
} else {
for (struct cell *parent = c->parent;
parent != NULL && !cell_get_flag(parent, cell_flag_do_hydro_sub_sync);
parent = parent->parent) {
/* Mark this cell for drifting */
cell_set_flag(parent, cell_flag_do_hydro_sub_sync);
if (parent == c->super) {
#ifdef SWIFT_DEBUG_CHECKS
if (parent->timestep_sync == NULL)
error("Trying to activate un-existing parent->timestep_sync");
#endif
scheduler_activate(s, parent->timestep_sync);
scheduler_activate(s, parent->kick1);
break;
}
}
}
}
/**
* @brief Activate the #gpart drifts on the given cell.
*/
......@@ -3017,6 +3053,7 @@ void cell_activate_subcell_stars_tasks(struct cell *ci, struct cell *cj,
/* We have reached the bottom of the tree: activate drift */
cell_activate_drift_spart(ci, s);
cell_activate_drift_part(ci, s);
cell_activate_sync_part(ci, s);
}
}
......@@ -3064,6 +3101,7 @@ void cell_activate_subcell_stars_tasks(struct cell *ci, struct cell *cj,
/* Activate the drifts if the cells are local. */
if (ci->nodeID == engine_rank) cell_activate_drift_spart(ci, s);
if (cj->nodeID == engine_rank) cell_activate_drift_part(cj, s);
if (cj->nodeID == engine_rank) cell_activate_sync_part(cj, s);
/* Do we need to sort the cells? */
cell_activate_hydro_sorts(cj, sid, s);
......@@ -3082,6 +3120,7 @@ void cell_activate_subcell_stars_tasks(struct cell *ci, struct cell *cj,
/* Activate the drifts if the cells are local. */
if (ci->nodeID == engine_rank) cell_activate_drift_part(ci, s);
if (cj->nodeID == engine_rank) cell_activate_drift_spart(cj, s);
if (ci->nodeID == engine_rank) cell_activate_sync_part(ci, s);
/* Do we need to sort the cells? */
cell_activate_hydro_sorts(ci, sid, s);
......@@ -3775,8 +3814,9 @@ int cell_unskip_stars_tasks(struct cell *c, struct scheduler *s,
/* Activate the drifts */
if (t->type == task_type_self && ci_active) {
cell_activate_drift_part(ci, s);
cell_activate_drift_spart(ci, s);
cell_activate_drift_part(ci, s);
cell_activate_sync_part(ci, s);
}
/* Only activate tasks that involve a local active cell. */
......@@ -3798,6 +3838,7 @@ int cell_unskip_stars_tasks(struct cell *c, struct scheduler *s,
/* Activate the drift tasks. */
if (ci_nodeID == nodeID) cell_activate_drift_spart(ci, s);
if (cj_nodeID == nodeID) cell_activate_drift_part(cj, s);
if (cj_nodeID == nodeID) cell_activate_sync_part(cj, s);
/* Check the sorts and activate them if needed. */
cell_activate_stars_sorts(ci, t->flags, s);
......@@ -3817,6 +3858,7 @@ int cell_unskip_stars_tasks(struct cell *c, struct scheduler *s,
/* Activate the drift tasks. */
if (cj_nodeID == nodeID) cell_activate_drift_spart(cj, s);
if (ci_nodeID == nodeID) cell_activate_drift_part(ci, s);
if (ci_nodeID == nodeID) cell_activate_sync_part(ci, s);
/* Check the sorts and activate them if needed. */
cell_activate_hydro_sorts(ci, t->flags, s);
......
......@@ -766,9 +766,10 @@ struct cell {
/*! The task to limit the time-step of inactive particles */
struct task *timestep_limiter;
/*! The task to synchronize the time-step of inactive particles hit by feedback */
/*! The task to synchronize the time-step of inactive particles hit by
* feedback */
struct task *timestep_sync;
#ifdef WITH_LOGGER
/*! The logger task */
struct task *logger;
......@@ -910,6 +911,7 @@ void cell_activate_drift_part(struct cell *c, struct scheduler *s);
void cell_activate_drift_gpart(struct cell *c, struct scheduler *s);
void cell_activate_drift_spart(struct cell *c, struct scheduler *s);
void cell_activate_drift_bpart(struct cell *c, struct scheduler *s);
void cell_activate_sync_part(struct cell *c, struct scheduler *s);
void cell_activate_hydro_sorts(struct cell *c, int sid, struct scheduler *s);
void cell_activate_stars_sorts(struct cell *c, int sid, struct scheduler *s);
void cell_activate_limiter(struct cell *c, struct scheduler *s);
......
......@@ -34,6 +34,8 @@
* current value asserts that they must match within 0.1%. */
#define io_redshift_tolerance 1e-3f
#define ICHECK 12510
/* Type of gradients to use (GIZMO_SPH only) */
/* If no option is chosen, no gradients are used (first order scheme) */
//#define GRADIENTS_SPH
......
......@@ -94,6 +94,9 @@ __attribute__((always_inline)) INLINE static void drift_part(
p->ti_drift = ti_current;
#endif
if (p->id == ICHECK)
message("Drifting particle %lld to t=%lld", p->id, ti_current);
/* Drift... */
p->x[0] += xp->v_full[0] * dt_drift;
p->x[1] += xp->v_full[1] * dt_drift;
......
......@@ -1778,6 +1778,7 @@ void engine_skip_force_and_kick(struct engine *e) {
t->type == task_type_kick1 || t->type == task_type_kick2 ||
t->type == task_type_timestep ||
t->type == task_type_timestep_limiter ||
t->type == task_type_timestep_sync ||
t->subtype == task_subtype_force ||
t->subtype == task_subtype_limiter || t->subtype == task_subtype_grav ||
t->type == task_type_end_hydro_force ||
......
......@@ -849,9 +849,9 @@ void engine_make_hierarchical_tasks_common(struct engine *e, struct cell *c) {
c->timestep_limiter = scheduler_addtask(
s, task_type_timestep_limiter, task_subtype_none, 0, 0, c, NULL);
c->timestep_sync = scheduler_addtask(
s, task_type_timestep_sync, task_subtype_none, 0, 0, c, NULL);
c->timestep_sync = scheduler_addtask(s, task_type_timestep_sync,
task_subtype_none, 0, 0, c, NULL);
scheduler_addunlock(s, c->timestep, c->timestep_limiter);
scheduler_addunlock(s, c->timestep_limiter, c->kick1);
scheduler_addunlock(s, c->timestep, c->timestep_sync);
......@@ -1187,8 +1187,7 @@ void engine_make_hierarchical_tasks_hydro(struct engine *e, struct cell *c,
scheduler_addunlock(s, c->hydro.limiter_out, c->super->timestep);
scheduler_addunlock(s, c->hydro.limiter_out,
c->super->timestep_limiter);
scheduler_addunlock(s, c->hydro.limiter_out,
c->super->timestep_sync);
scheduler_addunlock(s, c->hydro.limiter_out, c->super->timestep_sync);
if (with_star_formation && c->hydro.count > 0) {
scheduler_addunlock(s, c->top->hydro.star_formation,
......@@ -1989,6 +1988,10 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
scheduler_addunlock(sched, ci->hydro.super->hydro.drift, t_limiter);
scheduler_addunlock(sched, t_limiter,
ci->hydro.super->hydro.limiter_out);
if (with_feedback) {
scheduler_addunlock(sched, t_star_feedback, ci->super->timestep_sync);
}
}
}
......@@ -2181,6 +2184,10 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
t_limiter);
scheduler_addunlock(sched, t_limiter,
ci->hydro.super->hydro.limiter_out);
if (with_feedback) {
scheduler_addunlock(sched, t_star_feedback,
ci->super->timestep_sync);
}
}
} else /*(ci->nodeID != nodeID) */ {
if (with_feedback) {
......@@ -2263,6 +2270,16 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
cj->hydro.super->hydro.limiter_out);
}
}
if (ci->super != cj->super) {
if (with_limiter) {
if (with_feedback) {
scheduler_addunlock(sched, t_star_feedback,
cj->super->timestep_sync);
}
}
}
} else /*(cj->nodeID != nodeID) */ {
if (with_feedback) {
scheduler_addunlock(sched, cj->hydro.super->stars.sorts,
......@@ -2431,6 +2448,10 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
t_limiter);
scheduler_addunlock(sched, t_limiter,
ci->hydro.super->hydro.limiter_out);
if (with_feedback) {
scheduler_addunlock(sched, t_star_feedback, ci->super->timestep_sync);
}
}
}
......@@ -2627,6 +2648,11 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
t_limiter);
scheduler_addunlock(sched, t_limiter,
ci->hydro.super->hydro.limiter_out);
if (with_feedback) {
scheduler_addunlock(sched, t_star_feedback,
ci->super->timestep_sync);
}
}
} else /* ci->nodeID != nodeID */ {
......@@ -2711,6 +2737,17 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
cj->hydro.super->hydro.limiter_out);
}
}
if (ci->super != cj->super) {
if (with_limiter) {
if (with_feedback) {
scheduler_addunlock(sched, t_star_feedback,
cj->super->timestep_sync);
}
}
}
} else /* cj->nodeID != nodeID */ {
if (with_feedback) {
scheduler_addunlock(sched, cj->hydro.super->stars.sorts,
......
......@@ -151,6 +151,7 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
scheduler_activate(s, t);
cell_activate_drift_part(ci, s);
cell_activate_drift_spart(ci, s);
cell_activate_sync_part(ci, s);
}
}
......@@ -357,6 +358,7 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
/* Activate the drift tasks. */
if (ci_nodeID == nodeID) cell_activate_drift_spart(ci, s);
if (cj_nodeID == nodeID) cell_activate_drift_part(cj, s);
if (cj_nodeID == nodeID) cell_activate_sync_part(cj, s);
/* Check the sorts and activate them if needed. */
cell_activate_hydro_sorts(cj, t->flags, s);
......@@ -377,6 +379,7 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
/* Activate the drift tasks. */
if (ci_nodeID == nodeID) cell_activate_drift_part(ci, s);
if (cj_nodeID == nodeID) cell_activate_drift_spart(cj, s);
if (ci_nodeID == nodeID) cell_activate_sync_part(ci, s);
/* Check the sorts and activate them if needed. */
cell_activate_hydro_sorts(ci, t->flags, s);
......
......@@ -182,13 +182,13 @@ struct part {
/* Need waking-up ? */
timebin_t wakeup;
/*! Minimal time-bin across all neighbours */
timebin_t min_ngb_time_bin;
/* Do we want this particle to be synched back on the time-line? */
char to_be_synchronized;
#ifdef SWIFT_DEBUG_CHECKS
/* Time of the last drift */
......
......@@ -94,6 +94,8 @@ __attribute__((always_inline)) INLINE static void kick_part(
p->ti_kick = ti_end;
#endif
if (p->id == ICHECK) message("Kickin particle %lld to t=%lld", p->id, ti_end);
/* Kick particles in momentum space (hydro acc.) */
xp->v_full[0] += p->a_hydro[0] * dt_kick_hydro;
xp->v_full[1] += p->a_hydro[1] * dt_kick_hydro;
......
......@@ -160,6 +160,8 @@ void runner_do_kick1(struct runner *r, struct cell *c, int timer) {
dt_kick_corr = (ti_step / 2) * time_base;
}
if (p->id == ICHECK) message("kick1");
/* do the kick */
kick_part(p, xp, dt_kick_hydro, dt_kick_grav, dt_kick_therm,
dt_kick_corr, cosmo, hydro_props, entropy_floor, ti_begin,
......@@ -196,7 +198,7 @@ void runner_do_kick1(struct runner *r, struct cell *c, int timer) {
if (ti_begin != ti_current)
error(
"Particle in wrong time-bin, ti_end=%lld, ti_begin=%lld, "
"G-particle in wrong time-bin, ti_end=%lld, ti_begin=%lld, "
"ti_step=%lld time_bin=%d ti_current=%lld",
ti_end, ti_begin, ti_step, gp->time_bin, ti_current);
#endif
......@@ -234,7 +236,7 @@ void runner_do_kick1(struct runner *r, struct cell *c, int timer) {
if (ti_begin != ti_current)
error(
"Particle in wrong time-bin, ti_end=%lld, ti_begin=%lld, "
"S-particle in wrong time-bin, ti_end=%lld, ti_begin=%lld, "
"ti_step=%lld time_bin=%d ti_current=%lld",
ti_end, ti_begin, ti_step, sp->time_bin, ti_current);
#endif
......@@ -272,7 +274,7 @@ void runner_do_kick1(struct runner *r, struct cell *c, int timer) {
if (ti_begin != ti_current)
error(
"Particle in wrong time-bin, ti_end=%lld, ti_begin=%lld, "
"B-particle in wrong time-bin, ti_end=%lld, ti_begin=%lld, "
"ti_step=%lld time_bin=%d ti_current=%lld",
ti_end, ti_begin, ti_step, bp->time_bin, ti_current);
#endif
......@@ -396,6 +398,8 @@ void runner_do_kick2(struct runner *r, struct cell *c, int timer) {
dt_kick_corr = (ti_end - (ti_begin + ti_step / 2)) * time_base;
}
if (p->id == ICHECK) message("kick2");
/* Finish the time-step with a second half-kick */
kick_part(p, xp, dt_kick_hydro, dt_kick_grav, dt_kick_therm,
dt_kick_corr, cosmo, hydro_props, entropy_floor,
......@@ -1080,9 +1084,11 @@ void runner_do_limiter(struct runner *r, struct cell *c, int force, int timer) {
}
void runner_do_sync(struct runner *r, struct cell *c, int force, int timer) {
const struct engine *e = r->e;
const integertime_t ti_current = e->ti_current;
const struct cosmology *cosmo = e->cosmology;
const int with_cosmology = (e->policy & engine_policy_cosmology);
const int count = c->hydro.count;
struct part *restrict parts = c->hydro.parts;
struct xpart *restrict xparts = c->hydro.xparts;
......@@ -1094,10 +1100,10 @@ void runner_do_sync(struct runner *r, struct cell *c, int force, int timer) {
if (c->nodeID != engine_rank) error("Syncing of a foreign cell is nope.");
#endif
/* integertime_t ti_hydro_end_min = max_nr_timesteps, ti_hydro_end_max = 0, */
/* ti_hydro_beg_max = 0; */
/* integertime_t ti_gravity_end_min = max_nr_timesteps, ti_gravity_end_max = 0, */
/* ti_gravity_beg_max = 0; */
integertime_t ti_hydro_end_min = max_nr_timesteps, ti_hydro_end_max = 0,
ti_hydro_beg_max = 0;
integertime_t ti_gravity_end_min = max_nr_timesteps, ti_gravity_end_max = 0,
ti_gravity_beg_max = 0;
/* Limit irrespective of cell flags? */
force = (force || cell_get_flag(c, cell_flag_do_hydro_sync));
......@@ -1116,39 +1122,108 @@ void runner_do_sync(struct runner *r, struct cell *c, int force, int timer) {
if (c->progeny[k] != NULL) {
struct cell *restrict cp = c->progeny[k];
/* Recurse */
runner_do_sync(r, cp, force, 0);
/* Recurse */
runner_do_sync(r, cp, force, 0);
/* And aggregate */
ti_hydro_end_min = min(cp->hydro.ti_end_min, ti_hydro_end_min);
ti_hydro_end_max = max(cp->hydro.ti_end_max, ti_hydro_end_max);
ti_hydro_beg_max = max(cp->hydro.ti_beg_max, ti_hydro_beg_max);
ti_gravity_end_min = min(cp->grav.ti_end_min, ti_gravity_end_min);
ti_gravity_end_max = max(cp->grav.ti_end_max, ti_gravity_end_max);
ti_gravity_beg_max = max(cp->grav.ti_beg_max, ti_gravity_beg_max);
}
}
/* Store the updated values */
c->hydro.ti_end_min = min(c->hydro.ti_end_min, ti_hydro_end_min);
c->hydro.ti_end_max = max(c->hydro.ti_end_max, ti_hydro_end_max);
c->hydro.ti_beg_max = max(c->hydro.ti_beg_max, ti_hydro_beg_max);
c->grav.ti_end_min = min(c->grav.ti_end_min, ti_gravity_end_min);
c->grav.ti_end_max = max(c->grav.ti_end_max, ti_gravity_end_max);
c->grav.ti_beg_max = max(c->grav.ti_beg_max, ti_gravity_beg_max);
} else if (!c->split && force) {
ti_hydro_end_min = c->hydro.ti_end_min;
ti_hydro_end_max = c->hydro.ti_end_max;
ti_hydro_beg_max = c->hydro.ti_beg_max;
ti_gravity_end_min = c->grav.ti_end_min;
ti_gravity_end_max = c->grav.ti_end_max;
ti_gravity_beg_max = c->grav.ti_beg_max;
/* Loop over the gas particles in this cell. */
for (int k = 0; k < count; k++) {
/* Get a handle on the part. */
struct part *restrict p = &parts[k];
struct xpart *restrict xp = &xparts[k];
/* Avoid inhibited particles */
if (part_is_inhibited(p, e)) continue;
/* If the particle is active no need to sync it */
if (part_is_active(p, e) && p->to_be_synchronized)
p->to_be_synchronized = 0;
p->to_be_synchronized = 0;
if (p->to_be_synchronized) {
timestep_process_sync_part(p, xp, e, cosmo);
/* Finish this particle's time-step */
timestep_process_sync_part(p, xp, e, cosmo);
/* Get new time-step */
integertime_t ti_new_step = get_part_timestep(p, xp, e);
const timebin_t new_time_bin =
min(get_time_bin(ti_new_step), e->min_active_bin);
ti_new_step = get_integer_timestep(new_time_bin);
/* Update particle */
p->time_bin = new_time_bin;
if (p->gpart != NULL) p->gpart->time_bin = new_time_bin;
message("new time_bin = %d", new_time_bin);
/* Update the tracers properties */
tracers_after_timestep(p, xp, e->internal_units, e->physical_constants,
with_cosmology, e->cosmology,
e->hydro_properties, e->cooling_func, e->time);
/* What is the next sync-point ? */
ti_hydro_end_min = min(ti_current + ti_new_step, ti_hydro_end_min);
ti_hydro_end_max = max(ti_current + ti_new_step, ti_hydro_end_max);
/* What is the next starting point for this cell ? */
ti_hydro_beg_max = max(ti_current, ti_hydro_beg_max);
/* Also limit the gpart counter-part */
if (p->gpart != NULL) {
/* Register the time-bin */
p->gpart->time_bin = p->time_bin;
/* What is the next sync-point ? */
ti_gravity_end_min =
min(ti_current + ti_new_step, ti_gravity_end_min);
ti_gravity_end_max =
max(ti_current + ti_new_step, ti_gravity_end_max);
}
}
/* What is the next starting point for this cell ? */
ti_gravity_beg_max = max(ti_current, ti_gravity_beg_max);
}
}
}
/* Store the updated values */
c->hydro.ti_end_min = min(c->hydro.ti_end_min, ti_hydro_end_min);
c->hydro.ti_end_max = max(c->hydro.ti_end_max, ti_hydro_end_max);
c->hydro.ti_beg_max = max(c->hydro.ti_beg_max, ti_hydro_beg_max);
c->grav.ti_end_min = min(c->grav.ti_end_min, ti_gravity_end_min);
c->grav.ti_end_max = max(c->grav.ti_end_max, ti_gravity_end_max);
c->grav.ti_beg_max = max(c->grav.ti_beg_max, ti_gravity_beg_max);
}
/* Clear the sync flags. */
cell_clear_flag(c,
cell_flag_do_hydro_sync | cell_flag_do_hydro_sub_sync);
cell_clear_flag(c, cell_flag_do_hydro_sync | cell_flag_do_hydro_sub_sync);
if (timer) TIMER_TOC(timer_do_sync);
}
......@@ -5295,6 +5295,8 @@ void space_check_limiter_mapper(void *map_data, int nr_parts,
if (parts[k].time_bin == time_bin_inhibited) continue;
if (parts[k].time_bin < 0) error("Particle has negative time-bin!");
if (parts[k].wakeup == time_bin_awake)
error("Particle still woken up! id=%lld", parts[k].id);
......
......@@ -71,7 +71,7 @@ const char *taskID_names[task_type_count] = {"none",
"kick2",
"timestep",
"timestep_limiter",
"timestep_sync",
"timestep_sync",
"limiter_in",
"limiter_out",
"send",
......@@ -168,6 +168,7 @@ __attribute__((always_inline)) INLINE static enum task_actions task_acts_on(
case task_type_ghost:
case task_type_extra_ghost:
case task_type_timestep_limiter:
case task_type_timestep_sync:
case task_type_cooling:
case task_type_end_hydro_force:
return task_action_part;
......
......@@ -180,6 +180,9 @@ __attribute__((always_inline)) INLINE static integertime_t get_part_timestep(
const integertime_t new_dti = make_integer_timestep(
new_dt, p->time_bin, e->ti_current, e->time_base_inv);
if (p->id == ICHECK)
message("Computing dt for particle %lld dt=%lld", p->id, new_dti);
/* Are we allowed to use this bin given the neighbours? */
timebin_t new_bin = get_time_bin(new_dti);
new_bin =
......@@ -222,7 +225,7 @@ __attribute__((always_inline)) INLINE static integertime_t get_spart_timestep(
new_dt *= e->cosmology->time_step_factor;
/* Limit timestep within the allowed range */
new_dt = min(new_dt, e->dt_max) / 8.;
new_dt = min(new_dt, e->dt_max) / 16.;
if (new_dt < e->dt_min) {
error("spart (id=%lld) wants a time-step (%e) below dt_min (%e)", sp->id,
new_dt, e->dt_min);
......
......@@ -24,16 +24,16 @@
#include "kick.h"
__attribute__((always_inline)) INLINE static void timestep_sync_part(struct part *p) {
__attribute__((always_inline)) INLINE static void timestep_sync_part(
struct part *p) {
p->to_be_synchronized = 1;
message("Demanding a synchronization for particle %lld", p->id);
message("Demanding a synchronization for particle %lld", p->id);
}
INLINE static void timestep_process_sync_part(struct part *p, struct xpart *xp,
const struct engine *e,
const struct cosmology *cosmo) {
const struct engine *e,
const struct cosmology *cosmo) {
const int with_cosmology = (e->policy & engine_policy_cosmology);
const integertime_t ti_current = e->ti_current;
......@@ -41,6 +41,8 @@ INLINE static void timestep_process_sync_part(struct part *p, struct xpart *xp,
const timebin_t min_active_bin = e->min_active_bin;
const double time_base = e->time_base;
p->to_be_synchronized = 0;
/* This particle is already active. Nothing to do here... */
if (p->time_bin <= max_active_bin) return;
......@@ -105,16 +107,16 @@ INLINE static void timestep_process_sync_part(struct part *p, struct xpart *xp,
e->cosmology, e->hydro_properties, e->entropy_floor,
old_ti_beg + old_dti / 2, old_ti_beg);
/* ...and apply the new one (dt is positiive) */
/* We can now produce a kick to the current point */
if (with_cosmology) {
dt_kick_hydro = cosmology_get_hydro_kick_factor(cosmo, new_ti_beg,
new_ti_beg + new_dti);
dt_kick_grav =
cosmology_get_grav_kick_factor(cosmo, new_ti_beg, new_ti_beg + new_dti);
dt_kick_therm = cosmology_get_therm_kick_factor(cosmo, new_ti_beg,
cosmology_get_grav_kick_factor(cosmo, old_ti_beg, new_ti_beg + new_dti);
dt_kick_therm = cosmology_get_therm_kick_factor(cosmo, old_ti_beg,
new_ti_beg + new_dti);
dt_kick_corr =
cosmology_get_corr_kick_factor(cosmo, new_ti_beg, new_ti_beg + new_dti);
cosmology_get_corr_kick_factor(cosmo, old_ti_beg, new_ti_beg + new_dti);
} else {
dt_kick_hydro = (new_dti)*time_base;
dt_kick_grav = (new_dti)*time_base;
......@@ -126,17 +128,10 @@ INLINE static void timestep_process_sync_part(struct part *p, struct xpart *xp,
e->cosmology, e->hydro_properties, e->entropy_floor, new_ti_beg,
new_ti_beg + new_dti);
#ifdef SWIFT_DEBUG_CHECKS
if (p->ti_kick != ti_current)
error("Particle has not been synchronized correctly.");
p->synchronized = 1;
#endif
p->time_bin = min_active_bin;
p->wakeup = time_bin_not_awake;
/* The particle is now ready to compute its new time-step size and for the
* next kick */
p->time_bin = -min_active_bin;
p->wakeup = time_bin_not_awake;
}
#endif /* SWIFT_TIMESTEP_SYNC_H */
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