From 3a5043686fee69f1ccf5b84fce7d44e5b1a5e380 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Thu, 15 Oct 2020 17:06:22 +0200
Subject: [PATCH] Clarify some comments in the new AGN feedback code

---
 src/black_holes/EAGLE/black_holes.h      | 9 ++++++++-
 src/black_holes/EAGLE/black_holes_iact.h | 2 +-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/black_holes/EAGLE/black_holes.h b/src/black_holes/EAGLE/black_holes.h
index 166fda0120..96d51d8372 100644
--- a/src/black_holes/EAGLE/black_holes.h
+++ b/src/black_holes/EAGLE/black_holes.h
@@ -893,10 +893,17 @@ __attribute__((always_inline)) INLINE static void black_holes_prepare_feedback(
         /* Initialise counter of energy injections */
         number_of_energy_injections = 0;
 
-        /* How many AGN energy injections will we get? */
+        /* How many AGN energy injections will we get?
+         *
+         * Note that we use the particles here to draw random numbers. This does
+         * not mean that the 'lucky' particles here are the ones that will be
+         * heated. If we get N lucky particles, we will use the first N random
+         * ray directions in the isotropic case or the first N closest particles
+         * in the other modes. */
         for (int i = 0; i < bp->num_ngbs; i++) {
           const double rand = random_unit_interval_part_ID_and_ray_idx(
               bp->id, i, ti_begin, random_number_BH_feedback);
+
           /* Increase the counter if we are lucky */
           if (rand < prob) number_of_energy_injections++;
         }
diff --git a/src/black_holes/EAGLE/black_holes_iact.h b/src/black_holes/EAGLE/black_holes_iact.h
index ae80ac82bc..79951d8f18 100644
--- a/src/black_holes/EAGLE/black_holes_iact.h
+++ b/src/black_holes/EAGLE/black_holes_iact.h
@@ -213,7 +213,7 @@ runner_iact_nonsym_bh_gas_density(
 
       /* Minimise separation between the gas particles and the BH. The rays
        * structs with smaller ids in the ray array will refer to the particles
-       * with smaller distances to the BH. */
+       * with smaller 'fake' distances to the BH. */
       ray_minimise_distance(dist, bi->rays, arr_size, gas_id, pj->mass);
       break;
     }
-- 
GitLab