Commit 8e057a9d authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Created the drift and ghost tasks for the black holes.

parent 0501d3aa
......@@ -606,6 +606,13 @@ struct cell {
/*! The drift task for bparts */
struct task *drift;
/*! Implicit tasks marking the entry of the BH physics block of tasks
*/
struct task *black_holes_in;
/*! Implicit tasks marking the exit of the BH physics block of tasks */
struct task *black_holes_out;
/*! The star ghost task itself */
struct task *ghost;
......
......@@ -729,6 +729,7 @@ void engine_make_hierarchical_tasks_hydro(struct engine *e, struct cell *c) {
const int with_feedback = (e->policy & engine_policy_feedback);
const int with_cooling = (e->policy & engine_policy_cooling);
const int with_star_formation = (e->policy & engine_policy_star_formation);
const int with_black_holes = (e->policy & engine_policy_black_holes);
/* Are we in a super-cell ? */
if (c->hydro.super == c) {
......@@ -775,6 +776,13 @@ void engine_make_hierarchical_tasks_hydro(struct engine *e, struct cell *c) {
scheduler_addunlock(s, c->stars.drift, c->super->kick2);
}
/* Black holes */
if (with_black_holes) {
c->black_holes.drift = scheduler_addtask(
s, task_type_drift_bpart, task_subtype_none, 0, 0, c, NULL);
scheduler_addunlock(s, c->black_holes.drift, c->super->kick2);
}
/* Subgrid tasks: cooling */
if (with_cooling) {
......@@ -810,6 +818,25 @@ void engine_make_hierarchical_tasks_hydro(struct engine *e, struct cell *c) {
c->stars.stars_in);
}
}
/* Subgrid tasks: black hole feedback */
if (with_black_holes) {
c->black_holes.black_holes_in =
scheduler_addtask(s, task_type_bh_in, task_subtype_none, 0,
/* implicit = */ 1, c, NULL);
c->black_holes.black_holes_out =
scheduler_addtask(s, task_type_bh_out, task_subtype_none, 0,
/* implicit = */ 1, c, NULL);
c->black_holes.ghost = scheduler_addtask(
s, task_type_bh_ghost, task_subtype_none, 0, 0, c, NULL);
scheduler_addunlock(s, c->super->kick2, c->black_holes.black_holes_in);
scheduler_addunlock(s, c->black_holes.black_holes_out,
c->super->timestep);
}
}
} else { /* We are above the super-cell so need to go deeper */
......
......@@ -89,6 +89,8 @@ const char *taskID_names[task_type_count] = {"none",
"stars_ghost",
"stars_ghost_out",
"stars_sort",
"bh_in",
"bh_out",
"bh_ghost"};
/* Sub-task type names. */
......
......@@ -84,6 +84,8 @@ enum task_types {
task_type_stars_ghost,
task_type_stars_ghost_out, /* Implicit */
task_type_stars_sort,
task_type_bh_in, /* Implicit */
task_type_bh_out, /* Implicit */
task_type_bh_ghost,
task_type_count
} __attribute__((packed));
......
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