diff --git a/src/black_holes/Default/black_holes.h b/src/black_holes/Default/black_holes.h index f0f53bdf46cdd6afe062777c993e333ac5ef56c6..3c35d0862df99ff194fd609d6058c1be7065b0bf 100644 --- a/src/black_holes/Default/black_holes.h +++ b/src/black_holes/Default/black_holes.h @@ -20,6 +20,9 @@ #define SWIFT_DEFAULT_BLACK_HOLES_H #include <float.h> + +/* Local includes */ +#include "black_holes_properties.h" #include "dimension.h" #include "kernel_hydro.h" #include "minmax.h" @@ -42,9 +45,10 @@ __attribute__((always_inline)) INLINE static float black_holes_compute_timestep( * read in to do some conversions. * * @param bp The particle to act upon + * @param props The properties of the black holes model. */ __attribute__((always_inline)) INLINE static void black_holes_first_init_bpart( - struct bpart* bp) { + struct bpart* bp, const struct black_holes_props* props) { bp->time_bin = 0; } @@ -135,6 +139,23 @@ black_holes_bpart_has_no_neighbours(struct bpart* restrict bp, bp->density.wcount_dh = 0.f; } +/** + * @brief Compute the accretion rate of the black hole and all the quantites + * required for the feedback loop. + * + * Nothing to do here. + * + * @param bp The black hole particle. + * @param props The properties of the black hole scheme. + * @param constants The physical constants (in internal units). + * @param cosmo The cosmological model. + * @param dt The time-step size (in physical internal units). + */ +__attribute__((always_inline)) INLINE static void black_holes_prepare_feedback( + struct bpart* restrict bp, const struct black_holes_props* props, + const struct phys_const* constants, const struct cosmology* cosmo, + const double dt) {} + /** * @brief Reset acceleration fields of a particle * diff --git a/src/black_holes/Default/black_holes_iact.h b/src/black_holes/Default/black_holes_iact.h index 382906487f12ced85221f7634a92ce1fa293a620..e1e075a6f912cf888575e6b2f73ce6b2982831de 100644 --- a/src/black_holes/Default/black_holes_iact.h +++ b/src/black_holes/Default/black_holes_iact.h @@ -33,8 +33,9 @@ */ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_bh_density( const float r2, const float *dx, const float hi, const float hj, - struct bpart *restrict bi, const struct part *restrict pj, const float a, - const float H) { + struct bpart *restrict bi, const struct part *restrict pj, + const struct xpart *restrict xpj, const struct cosmology *cosmo, + const integertime_t ti_current) { float wi, wi_dx; @@ -76,8 +77,10 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_bh_density( __attribute__((always_inline)) INLINE static void runner_iact_nonsym_bh_feedback(const float r2, const float *dx, const float hi, const float hj, struct bpart *restrict bi, - struct part *restrict pj, const float a, - const float H) { + struct part *restrict pj, + const struct xpart *restrict xpj, + const struct cosmology *cosmo, + const integertime_t ti_current) { #ifdef DEBUG_INTERACTIONS_BH /* Update ngb counters */ if (si->num_ngb_force < MAX_NUM_OF_NEIGHBOURS_BH) diff --git a/src/black_holes/Default/black_holes_properties.h b/src/black_holes/Default/black_holes_properties.h index 8213bd21441537e3ba7f366ad5a07778ac499552..c5098bba7e9b83696a309210065c0a9551d258aa 100644 --- a/src/black_holes/Default/black_holes_properties.h +++ b/src/black_holes/Default/black_holes_properties.h @@ -61,12 +61,12 @@ struct black_holes_props { * @param hydro_props The already read-in properties of the hydro scheme. * @param cosmo The cosmological model. */ -void black_holes_props_init(struct black_holes_props *bp, - const struct phys_const *phys_const, - const struct unit_system *us, - struct swift_params *params, - const struct hydro_props *hydro_props, - const struct cosmology *cosmo) { +static INLINE void black_holes_props_init(struct black_holes_props *bp, + const struct phys_const *phys_const, + const struct unit_system *us, + struct swift_params *params, + const struct hydro_props *hydro_props, + const struct cosmology *cosmo) { /* Kernel properties */ bp->eta_neighbours = parser_get_opt_param_float(