Commit 5ee42c0f authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Added a function to check whether a given cell is starting its BH time integration on this step.

parent c4a9352b
......@@ -496,6 +496,28 @@ __attribute__((always_inline)) INLINE static int cell_is_starting_stars(
return (c->stars.ti_beg_max == e->ti_current);
}
/**
* @brief Does a cell contain any b-particle starting their time-step now ?
*
* @param c The #cell.
* @param e The #engine containing information about the current time.
* @return 1 if the #cell contains at least an active particle, 0 otherwise.
*/
__attribute__((always_inline)) INLINE static int cell_is_starting_black_holes(
const struct cell *c, const struct engine *e) {
#ifdef SWIFT_DEBUG_CHECKS
if (c->black_holes.ti_beg_max > e->ti_current)
error(
"cell in an impossible time-zone! c->ti_beg_max=%lld (t=%e) and "
"e->ti_current=%lld (t=%e, a=%e)",
c->black_holes.ti_beg_max, c->black_holes.ti_beg_max * e->time_base, e->ti_current,
e->ti_current * e->time_base, e->cosmology->a);
#endif
return (c->black_holes.ti_beg_max == e->ti_current);
}
/**
* @brief Is this particle starting its time-step now ?
*
......
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