From 66de389e29a626229412f99adaf85d7817c91a81 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <schaller@strw.leidenuniv.nl> Date: Thu, 4 Jul 2019 12:59:28 +0200 Subject: [PATCH] Added function stubs to update the BH properties in a merger event. --- src/black_holes/Default/black_holes.h | 14 ++++++++++++++ src/black_holes/EAGLE/black_holes.h | 12 ++++++++++++ src/runner.c | 6 +++--- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/black_holes/Default/black_holes.h b/src/black_holes/Default/black_holes.h index a87f5dd902..56866764fe 100644 --- a/src/black_holes/Default/black_holes.h +++ b/src/black_holes/Default/black_holes.h @@ -156,6 +156,20 @@ __attribute__((always_inline)) INLINE static void black_holes_swallow_part( /* Nothing to do here: No swallowing in the default model */ } +/** + * @brief Update the properties of a black hole particles by swallowing + * a BH particle. + * + * @param bpi The #bpart to update. + * @param bpj The #bpart that is swallowed. + * @param cosmo The current cosmological model. + */ +__attribute__((always_inline)) INLINE static void black_holes_swallow_bpart( + struct bpart* bpi, const struct bpart* bpj, const struct cosmology* cosmo) { + + /* Nothing to do here: No merging in the default model */ +} + /** * @brief Compute the accretion rate of the black hole and all the quantites * required for the feedback loop. diff --git a/src/black_holes/EAGLE/black_holes.h b/src/black_holes/EAGLE/black_holes.h index 88178da8c4..ac12102803 100644 --- a/src/black_holes/EAGLE/black_holes.h +++ b/src/black_holes/EAGLE/black_holes.h @@ -234,6 +234,18 @@ __attribute__((always_inline)) INLINE static void black_holes_swallow_part( bp->ngb_mass -= gas_mass; } +/** + * @brief Update the properties of a black hole particles by swallowing + * a BH particle. + * + * @param bpi The #bpart to update. + * @param bpj The #bpart that is swallowed. + * @param cosmo The current cosmological model. + */ +__attribute__((always_inline)) INLINE static void black_holes_swallow_bpart( + struct bpart* bpi, const struct bpart* bpj, const struct cosmology* cosmo) { +} + /** * @brief Compute the accretion rate of the black hole and all the quantites * required for the feedback loop. diff --git a/src/runner.c b/src/runner.c index 830bd5ffaa..8c33b09517 100644 --- a/src/runner.c +++ b/src/runner.c @@ -4031,7 +4031,7 @@ void runner_do_bh_swallow(struct runner *r, struct cell *c, int timer) { lock_lock(&s->lock); /* Swallow the gas particle (i.e. update the BH properties) */ - // black_holes_swallow_part(bp, p, xp, e->cosmology); + black_holes_swallow_bpart(bp, cell_bp, e->cosmology); /* Release the space as we are done updating the bpart */ if (lock_unlock(&s->lock) != 0) @@ -4061,9 +4061,9 @@ void runner_do_bh_swallow(struct runner *r, struct cell *c, int timer) { #ifdef WITH_MPI - /* We could also be in the case of a local gas particle being + /* We could also be in the case of a local BH particle being * swallowed by a foreign BH. In this case, we won't update the - * BH but just remove the particle from the local list. */ + * foreign BH but just remove the particle from the local list. */ if (c->nodeID == e->nodeID && !found) { /* Let's look for the foreign hungry black hole */ -- GitLab