diff --git a/src/black_holes/Default/black_holes.h b/src/black_holes/Default/black_holes.h index ebc5a36841e07fe96d81319914f065516ef43517..a87f5dd902fea335b8b69945bffcda33b4ec9497 100644 --- a/src/black_holes/Default/black_holes.h +++ b/src/black_holes/Default/black_holes.h @@ -156,42 +156,6 @@ __attribute__((always_inline)) INLINE static void black_holes_swallow_part( /* Nothing to do here: No swallowing in the default model */ } -/** - * @brief Update a given #part's BH data field to mark the particle has - * not yet been swallowed. - * - * @param p_data The #part's #black_holes_part_data structure. - */ -__attribute__((always_inline)) INLINE static void -black_holes_mark_as_not_swallowed(struct black_holes_part_data* p_data) { - - /* Nothing to do here: No swallowing in the default model */ -} - -/** - * @brief Update a given #part's BH data field to mark the particle has - * having been been swallowed. - * - * @param p_data The #part's #black_holes_part_data structure. - */ -__attribute__((always_inline)) INLINE static void black_holes_mark_as_swallowed( - struct black_holes_part_data* p_data) { - - /* Nothing to do here: No swallowing in the default model */ -} - -/** - * @brief Return the ID of the BH that should swallow this #part. - * - * @param p_data The #part's #black_holes_part_data structure. - */ -__attribute__((always_inline)) INLINE static long long -black_holes_get_swallow_id(struct black_holes_part_data* p_data) { - - /* Return a non-existing ID */ - return -1; -} - /** * @brief Compute the accretion rate of the black hole and all the quantites * required for the feedback loop. diff --git a/src/black_holes/Default/black_holes_part.h b/src/black_holes/Default/black_holes_part.h index db8c9b18cb8bac72cd7b3b239930aa2306e5171d..5d614aa873f8260b53479088e0fd25a44ce0ce82 100644 --- a/src/black_holes/Default/black_holes_part.h +++ b/src/black_holes/Default/black_holes_part.h @@ -66,6 +66,9 @@ struct bpart { * content, etc.) */ struct chemistry_bpart_data chemistry_data; + /*! Black holes merger information (e.g. merging ID) */ + struct black_holes_bpart_data merger_data; + #ifdef SWIFT_DEBUG_CHECKS /* Time of the last drift */ diff --git a/src/black_holes/Default/black_holes_struct.h b/src/black_holes/Default/black_holes_struct.h index 3fdb0ee882b075d40a8725fa52b221d48dcbd722..7c922a69a2c2ff7d2da9f976b7fa2267c3ee88f6 100644 --- a/src/black_holes/Default/black_holes_struct.h +++ b/src/black_holes/Default/black_holes_struct.h @@ -24,4 +24,45 @@ */ struct black_holes_part_data {}; +/** + * @brief Black holes-related fields carried by each *BH* particle. + */ +struct black_holes_bpart_data {}; + +/** + * @brief Update a given #part's BH data field to mark the particle has + * not yet been swallowed. + * + * @param p_data The #part's #black_holes_part_data structure. + */ +__attribute__((always_inline)) INLINE static void +black_holes_mark_as_not_swallowed(struct black_holes_part_data* p_data) { + + /* Nothing to do here: No swallowing in the default model */ +} + +/** + * @brief Update a given #part's BH data field to mark the particle has + * having been been swallowed. + * + * @param p_data The #part's #black_holes_part_data structure. + */ +__attribute__((always_inline)) INLINE static void black_holes_mark_as_swallowed( + struct black_holes_part_data* p_data) { + + /* Nothing to do here: No swallowing in the default model */ +} + +/** + * @brief Return the ID of the BH that should swallow this #part. + * + * @param p_data The #part's #black_holes_part_data structure. + */ +__attribute__((always_inline)) INLINE static long long +black_holes_get_swallow_id(struct black_holes_part_data* p_data) { + + /* Return a non-existing ID */ + return -1; +} + #endif /* SWIFT_BLACK_HOLES_STRUCT_DEFAULT_H */ diff --git a/src/black_holes/EAGLE/black_holes.h b/src/black_holes/EAGLE/black_holes.h index a9a40b1cfb9604045913c90a25ed5b3771b0f3e4..88178da8c498182ffa7ee8718a8c7d6d93f5660c 100644 --- a/src/black_holes/EAGLE/black_holes.h +++ b/src/black_holes/EAGLE/black_holes.h @@ -234,41 +234,6 @@ __attribute__((always_inline)) INLINE static void black_holes_swallow_part( bp->ngb_mass -= gas_mass; } -/** - * @brief Update a given #part's BH data field to mark the particle has - * not yet been swallowed. - * - * @param p_data The #part's #black_holes_part_data structure. - */ -__attribute__((always_inline)) INLINE static void -black_holes_mark_as_not_swallowed(struct black_holes_part_data* p_data) { - - p_data->swallow_id = -1; -} - -/** - * @brief Update a given #part's BH data field to mark the particle has - * having been been swallowed. - * - * @param p_data The #part's #black_holes_part_data structure. - */ -__attribute__((always_inline)) INLINE static void black_holes_mark_as_swallowed( - struct black_holes_part_data* p_data) { - - p_data->swallow_id = -2; -} - -/** - * @brief Return the ID of the BH that should swallow this #part. - * - * @param p_data The #part's #black_holes_part_data structure. - */ -__attribute__((always_inline)) INLINE static long long -black_holes_get_swallow_id(struct black_holes_part_data* p_data) { - - return p_data->swallow_id; -} - /** * @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_part.h b/src/black_holes/EAGLE/black_holes_part.h index 598edffecae228a47f57224be9727ee50ccc4074..3c10fb8963d65244f6d9ba2ba9d543eb7f635241 100644 --- a/src/black_holes/EAGLE/black_holes_part.h +++ b/src/black_holes/EAGLE/black_holes_part.h @@ -118,6 +118,9 @@ struct bpart { * content, etc.) */ struct chemistry_bpart_data chemistry_data; + /*! Black holes merger information (e.g. merging ID) */ + struct black_holes_bpart_data merger_data; + #ifdef SWIFT_DEBUG_CHECKS /* Time of the last drift */ diff --git a/src/black_holes/EAGLE/black_holes_struct.h b/src/black_holes/EAGLE/black_holes_struct.h index cf0e9c3975c1a1d9bda0065a5072465ae886297f..d85dc442980ac50e261d04966fbc326b54c2f85d 100644 --- a/src/black_holes/EAGLE/black_holes_struct.h +++ b/src/black_holes/EAGLE/black_holes_struct.h @@ -28,4 +28,48 @@ struct black_holes_part_data { long long swallow_id; }; +/** + * @brief Black holes-related fields carried by each *BH* particle. + */ +struct black_holes_bpart_data { + + /*! ID of the black-hole that will swallow this #bpart. */ + long long swallow_id; +}; + +/** + * @brief Update a given #part's BH data field to mark the particle has + * not yet been swallowed. + * + * @param p_data The #part's #black_holes_part_data structure. + */ +__attribute__((always_inline)) INLINE static void +black_holes_mark_as_not_swallowed(struct black_holes_part_data* p_data) { + + p_data->swallow_id = -1; +} + +/** + * @brief Update a given #part's BH data field to mark the particle has + * having been been swallowed. + * + * @param p_data The #part's #black_holes_part_data structure. + */ +__attribute__((always_inline)) INLINE static void black_holes_mark_as_swallowed( + struct black_holes_part_data* p_data) { + + p_data->swallow_id = -2; +} + +/** + * @brief Return the ID of the BH that should swallow this #part. + * + * @param p_data The #part's #black_holes_part_data structure. + */ +__attribute__((always_inline)) INLINE static long long +black_holes_get_swallow_id(struct black_holes_part_data* p_data) { + + return p_data->swallow_id; +} + #endif /* SWIFT_BLACK_HOLES_STRUCT_EAGLE_H */