From 12d18a2c7d9571ce581dedd02387d5b87e36cb0d Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Fri, 12 Apr 2019 14:03:21 +0200
Subject: [PATCH] Documentation fixes.

---
 src/active.h                          |  4 +--
 src/black_holes/Default/black_holes.h | 45 +++++++++++----------------
 src/cell.c                            |  2 +-
 src/collectgroup.c                    | 10 ++++++
 src/engine.c                          |  4 +--
 src/io_properties.h                   | 12 +++----
 src/space.c                           |  2 ++
 7 files changed, 42 insertions(+), 37 deletions(-)

diff --git a/src/active.h b/src/active.h
index ca65c9cbb0..a0f793b553 100644
--- a/src/active.h
+++ b/src/active.h
@@ -419,7 +419,7 @@ __attribute__((always_inline)) INLINE static int spart_is_inhibited(
 /**
  * @brief Has this black hole particle been inhibited?
  *
- * @param sp The #bpart.
+ * @param bp The #bpart.
  * @param e The #engine containing information about the current time.
  * @return 1 if the #part is inhibited, 0 otherwise.
  */
@@ -583,7 +583,7 @@ __attribute__((always_inline)) INLINE static int spart_is_starting(
 /**
  * @brief Is this b-particle starting its time-step now ?
  *
- * @param sp The #bpart.
+ * @param bp The #bpart.
  * @param e The #engine containing information about the current time.
  * @return 1 if the #bpart is active, 0 otherwise.
  */
diff --git a/src/black_holes/Default/black_holes.h b/src/black_holes/Default/black_holes.h
index a29c045934..f0f53bdf46 100644
--- a/src/black_holes/Default/black_holes.h
+++ b/src/black_holes/Default/black_holes.h
@@ -25,9 +25,9 @@
 #include "minmax.h"
 
 /**
- * @brief Computes the gravity time-step of a given star particle.
+ * @brief Computes the gravity time-step of a given black hole particle.
  *
- * @param sp Pointer to the s-particle data.
+ * @param bp Pointer to the s-particle data.
  */
 __attribute__((always_inline)) INLINE static float black_holes_compute_timestep(
     const struct bpart* const bp) {
@@ -36,12 +36,12 @@ __attribute__((always_inline)) INLINE static float black_holes_compute_timestep(
 }
 
 /**
- * @brief Initialises the s-particles for the first time
+ * @brief Initialises the b-particles for the first time
  *
  * This function is called only once just after the ICs have been
  * read in to do some conversions.
  *
- * @param sp The particle to act upon
+ * @param bp The particle to act upon
  */
 __attribute__((always_inline)) INLINE static void black_holes_first_init_bpart(
     struct bpart* bp) {
@@ -50,17 +50,17 @@ __attribute__((always_inline)) INLINE static void black_holes_first_init_bpart(
 }
 
 /**
- * @brief Prepares a s-particle for its interactions
+ * @brief Prepares a b-particle for its interactions
  *
- * @param sp The particle to act upon
+ * @param bp The particle to act upon
  */
 __attribute__((always_inline)) INLINE static void black_holes_init_bpart(
     struct bpart* bp) {
 
 #ifdef DEBUG_INTERACTIONS_BLACK_HOLES
   for (int i = 0; i < MAX_NUM_OF_NEIGHBOURS_STARS; ++i)
-    sp->ids_ngbs_density[i] = -1;
-  sp->num_ngb_density = 0;
+    bp->ids_ngbs_density[i] = -1;
+  bp->num_ngb_density = 0;
 #endif
 
   bp->density.wcount = 0.f;
@@ -70,7 +70,7 @@ __attribute__((always_inline)) INLINE static void black_holes_init_bpart(
 /**
  * @brief Predict additional particle fields forward in time when drifting
  *
- * @param sp The particle
+ * @param bp The particle
  * @param dt_drift The drift time-step for positions.
  */
 __attribute__((always_inline)) INLINE static void black_holes_predict_extra(
@@ -80,32 +80,24 @@ __attribute__((always_inline)) INLINE static void black_holes_predict_extra(
  * @brief Sets the values to be predicted in the drifts to their values at a
  * kick time
  *
- * @param sp The particle.
+ * @param bp The particle.
  */
 __attribute__((always_inline)) INLINE static void
 black_holes_reset_predicted_values(struct bpart* restrict bp) {}
 
-/**
- * @brief Finishes the calculation of (non-gravity) forces acting on stars
- *
- * @param sp The particle to act upon
- */
-__attribute__((always_inline)) INLINE static void black_holes_end_feedback(
-    struct bpart* bp) {}
-
 /**
  * @brief Kick the additional variables
  *
- * @param sp The particle to act upon
+ * @param bp The particle to act upon
  * @param dt The time-step for this kick
  */
 __attribute__((always_inline)) INLINE static void black_holes_kick_extra(
     struct bpart* bp, float dt) {}
 
 /**
- * @brief Finishes the calculation of density on stars
+ * @brief Finishes the calculation of density on black holes
  *
- * @param sp The particle to act upon
+ * @param bp The particle to act upon
  * @param cosmo The current cosmological model.
  */
 __attribute__((always_inline)) INLINE static void black_holes_end_density(
@@ -126,7 +118,7 @@ __attribute__((always_inline)) INLINE static void black_holes_end_density(
  * @brief Sets all particle fields to sensible values when the #spart has 0
  * ngbs.
  *
- * @param sp The particle to act upon
+ * @param bp The particle to act upon
  * @param cosmo The current cosmological model.
  */
 __attribute__((always_inline)) INLINE static void
@@ -147,17 +139,18 @@ black_holes_bpart_has_no_neighbours(struct bpart* restrict bp,
  * @brief Reset acceleration fields of a particle
  *
  * This is the equivalent of hydro_reset_acceleration.
- * We do not compute the acceleration on star, therefore no need to use it.
+ * We do not compute the acceleration on black hole, therefore no need to use
+ * it.
  *
- * @param p The particle to act upon
+ * @param bp The particle to act upon
  */
 __attribute__((always_inline)) INLINE static void black_holes_reset_feedback(
     struct bpart* restrict bp) {
 
 #ifdef DEBUG_INTERACTIONS_BLACK_HOLES
   for (int i = 0; i < MAX_NUM_OF_NEIGHBOURS_STARS; ++i)
-    p->ids_ngbs_force[i] = -1;
-  p->num_ngb_force = 0;
+    bp->ids_ngbs_force[i] = -1;
+  bp->num_ngb_force = 0;
 #endif
 }
 
diff --git a/src/cell.c b/src/cell.c
index a57e3b4acf..ac9188642c 100644
--- a/src/cell.c
+++ b/src/cell.c
@@ -5129,7 +5129,7 @@ void cell_remove_spart(const struct engine *e, struct cell *c,
  *
  * @param e The #engine running on this node.
  * @param c The #cell from which to remove the particle.
- * @param sp The #bpart to remove.
+ * @param bp The #bpart to remove.
  */
 void cell_remove_bpart(const struct engine *e, struct cell *c,
                        struct bpart *bp) {
diff --git a/src/collectgroup.c b/src/collectgroup.c
index 25138f2bae..f956b7ef86 100644
--- a/src/collectgroup.c
+++ b/src/collectgroup.c
@@ -130,12 +130,16 @@ void collectgroup1_apply(struct collectgroup1 *grp1, struct engine *e) {
  * @param g_updated the number of updated gravity particles on this node this
  *                  step.
  * @param s_updated the number of updated star particles on this node this step.
+ * @param b_updated the number of updated black hole particles on this node this
+ * step.
  * @param inhibited the number of inhibited hydro particles on this node this
  *                  step.
  * @param g_inhibited the number of inhibited gravity particles on this node
  *                    this step.
  * @param s_inhibited the number of inhibited star particles on this node this
  *                    step.
+ * @param b_inhibited the number of inhibited black hole particles on this node
+ * this step.
  * @param ti_hydro_end_min the minimum end time for next hydro time step after
  *                         this step.
  * @param ti_hydro_end_max the maximum end time for next hydro time step after
@@ -154,6 +158,12 @@ void collectgroup1_apply(struct collectgroup1 *grp1, struct engine *e) {
  *                           after this step.
  * @param ti_stars_beg_max the maximum begin time for next stars time step
  *                           after this step.
+ * @param ti_black_holes_end_min the minimum end time for next black holes time
+ * step after this step.
+ * @param ti_black_holes_end_max the maximum end time for next black holes time
+ * step after this step.
+ * @param ti_black_holes_beg_max the maximum begin time for next black holes
+ * time step after this step.
  * @param forcerebuild whether a rebuild is required after this step.
  * @param total_nr_cells total number of all cells on rank.
  * @param total_nr_tasks total number of tasks on rank.
diff --git a/src/engine.c b/src/engine.c
index 53ff7a3a29..40bb6f2a96 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -1128,7 +1128,7 @@ void engine_redistribute(struct engine *e) {
                                s->bparts[k].x[1] * s->iwidth[1],
                                s->bparts[k].x[2] * s->iwidth[2]);
     if (cells[cid].nodeID != nodeID)
-      error("Received p-particle (%zu) that does not belong here (nodeID=%i).",
+      error("Received b-particle (%zu) that does not belong here (nodeID=%i).",
             k, cells[cid].nodeID);
   }
 
@@ -2151,7 +2151,7 @@ void engine_allocate_foreign_particles(struct engine *e) {
       error("Failed to allocate foreign spart data.");
   }
 
-  /* Allocate bpace for the foreign particles we will receive */
+  /* Allocate space for the foreign particles we will receive */
   if (count_bparts_in > s->size_bparts_foreign) {
     if (s->bparts_foreign != NULL)
       swift_free("bparts_foreign", s->bparts_foreign);
diff --git a/src/io_properties.h b/src/io_properties.h
index 8e5d31c9bd..815f261be3 100644
--- a/src/io_properties.h
+++ b/src/io_properties.h
@@ -716,8 +716,8 @@ INLINE static struct io_props io_make_output_field_convert_spart_LONGLONG(
  * @param type The type of the data
  * @param dimension Dataset dimension (1D, 3D, ...)
  * @param units The units of the dataset
- * @param spartSize The size in byte of the particle
- * @param sparts The particle array
+ * @param bpartSize The size in byte of the particle
+ * @param bparts The particle array
  * @param functionPtr The function used to convert a g-particle to a float
  *
  * Do not call this function directly. Use the macro defined above.
@@ -764,8 +764,8 @@ INLINE static struct io_props io_make_output_field_convert_bpart_FLOAT(
  * @param type The type of the data
  * @param dimension Dataset dimension (1D, 3D, ...)
  * @param units The units of the dataset
- * @param spartSize The size in byte of the particle
- * @param sparts The particle array
+ * @param bpartSize The size in byte of the particle
+ * @param bparts The particle array
  * @param functionPtr The function used to convert a s-particle to a double
  *
  * Do not call this function directly. Use the macro defined above.
@@ -812,8 +812,8 @@ INLINE static struct io_props io_make_output_field_convert_bpart_DOUBLE(
  * @param type The type of the data
  * @param dimension Dataset dimension (1D, 3D, ...)
  * @param units The units of the dataset
- * @param spartSize The size in byte of the particle
- * @param sparts The particle array
+ * @param bpartSize The size in byte of the particle
+ * @param bparts The particle array
  * @param functionPtr The function used to convert a s-particle to a double
  *
  * Do not call this function directly. Use the macro defined above.
diff --git a/src/space.c b/src/space.c
index 5341b1f279..ea1d453849 100644
--- a/src/space.c
+++ b/src/space.c
@@ -3156,6 +3156,8 @@ void space_map_cells_pre(struct space *s, int full,
  *        c->hydro.count or @c NULL.
  * @param sbuff A buffer for particle sorting, should be of size at least
  *        c->stars.count or @c NULL.
+ * @param bbuff A buffer for particle sorting, should be of size at least
+ *        c->black_holes.count or @c NULL.
  * @param gbuff A buffer for particle sorting, should be of size at least
  *        c->grav.count or @c NULL.
  */
-- 
GitLab