Skip to content
Snippets Groups Projects
Commit 3ba10960 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Set the reposition of BH to -FLT_MAX when the reposition does not happen.

parent be563ef1
No related branches found
No related tags found
1 merge request!876Black holes repositioning
......@@ -118,6 +118,8 @@ __attribute__((always_inline)) INLINE static void black_holes_predict_extra(
}
#endif
message("Reposition!");
bp->x[0] = bp->reposition.x[0];
bp->x[1] = bp->reposition.x[1];
bp->x[2] = bp->reposition.x[2];
......@@ -458,11 +460,9 @@ __attribute__((always_inline)) INLINE static void black_holes_prepare_feedback(
}
}
__attribute__((always_inline)) INLINE static void
black_holes_end_reposition(struct bpart* restrict bp,
const struct black_holes_props* props,
const struct phys_const* constants,
const struct cosmology* cosmo) {
__attribute__((always_inline)) INLINE static void black_holes_end_reposition(
struct bpart* restrict bp, const struct black_holes_props* props,
const struct phys_const* constants, const struct cosmology* cosmo) {
const float potential = gravity_get_comoving_potential(bp->gpart);
......@@ -471,8 +471,13 @@ black_holes_end_reposition(struct bpart* restrict bp,
if (potential < bp->reposition.min_potential ||
bp->subgrid_mass > props->max_reposition_mass) {
message("No repo!");
/* No need to reposition */
bp->reposition.min_potential = FLT_MAX;
bp->reposition.x[0] = -FLT_MAX;
bp->reposition.x[1] = -FLT_MAX;
bp->reposition.x[2] = -FLT_MAX;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment