From 870546fc612123d500ae7538f744317e87c24ed2 Mon Sep 17 00:00:00 2001 From: Stefan Arridge <stefan.arridge@durham.ac.uk> Date: Thu, 22 Sep 2016 12:28:42 +0100 Subject: [PATCH] Added task_type_grav_external to list of task types --- examples/HydrostaticHalo/run.sh | 2 +- src/engine.c | 18 ++++-------------- src/potential/isothermal/potential.h | 6 +++--- src/task.h | 1 + 4 files changed, 9 insertions(+), 18 deletions(-) diff --git a/examples/HydrostaticHalo/run.sh b/examples/HydrostaticHalo/run.sh index b37c3b4532..aa3f2ae307 100755 --- a/examples/HydrostaticHalo/run.sh +++ b/examples/HydrostaticHalo/run.sh @@ -2,7 +2,7 @@ # Generate the initial conditions if they are not present. echo "Generating initial conditions for the isothermal potential box example..." -python makeIC.py 1000 +python makeIC.py 10000 ../swift -g -s -t 16 hydrostatic.yml 2>&1 | tee output.log diff --git a/src/engine.c b/src/engine.c index 1272b501ad..e6f10d4a70 100644 --- a/src/engine.c +++ b/src/engine.c @@ -153,26 +153,20 @@ void engine_make_hierarchical_tasks(struct engine *e, struct cell *c) { } /* Generate the ghost task. */ -<<<<<<< HEAD - if (is_hydro) - c->ghost = scheduler_addtask(s, task_type_ghost, task_subtype_none, 0, - 0, c, NULL, 0); -======= c->ghost = scheduler_addtask(s, task_type_ghost, task_subtype_none, 0, 0, c, NULL, 0); ->>>>>>> master + #ifdef EXTRA_HYDRO_LOOP /* Generate the extra ghost task. */ if (is_hydro) c->extra_ghost = scheduler_addtask(s, task_type_extra_ghost, task_subtype_none, 0, 0, c, NULL, 0); #endif -<<<<<<< HEAD + /* Cooling task */ -======= ->>>>>>> master + if (is_with_cooling) c->cooling = scheduler_addtask(s, task_type_cooling, task_subtype_none, 0, 0, c, NULL, 0); @@ -1800,17 +1794,13 @@ void engine_make_extra_hydroloop_tasks(struct engine *e) { #endif } -<<<<<<< HEAD - /* Cooling tasks should depend on kick and does not unlock anything since - it is the last task*/ -======= /* External gravity tasks should depend on init and unlock the kick */ else if (t->type == task_type_grav_external) { scheduler_addunlock(sched, t->ci->init, t); scheduler_addunlock(sched, t, t->ci->kick); } /* Cooling tasks should depend on kick and unlock sourceterms */ ->>>>>>> master + else if (t->type == task_type_cooling) { scheduler_addunlock(sched, t->ci->kick, t); } diff --git a/src/potential/isothermal/potential.h b/src/potential/isothermal/potential.h index b1f0ef95b2..c6c504c5ad 100644 --- a/src/potential/isothermal/potential.h +++ b/src/potential/isothermal/potential.h @@ -110,9 +110,9 @@ __attribute__((always_inline)) INLINE static void external_gravity_acceleration( const double term = -potential->vrot2_over_G * rinv2; - g->a_grav[0] += term * dx; - g->a_grav[1] += term * dy; - g->a_grav[2] += term * dz; + g->a_grav[0] = term * dx; + g->a_grav[1] = term * dy; + g->a_grav[2] = term * dz; } /** diff --git a/src/task.h b/src/task.h index f840c0b4b8..3861f89ea4 100644 --- a/src/task.h +++ b/src/task.h @@ -53,6 +53,7 @@ enum task_types { task_type_grav_fft, task_type_grav_mm, task_type_grav_up, + task_type_grav_external, task_type_cooling, task_type_sourceterms, task_type_count -- GitLab