From c18d56e1f4bfc871438edcb2eea79d91e2a98785 Mon Sep 17 00:00:00 2001
From: loikki <loic.hausammann@protonmail.ch>
Date: Thu, 15 Aug 2019 11:48:41 +0200
Subject: [PATCH] Format

---
 src/adiabatic_index.h                         |  1 -
 src/hydro/Gadget2/hydro.h                     | 15 ++++++----
 src/hydro/GizmoMFM/hydro.h                    |  2 +-
 src/hydro/GizmoMFV/hydro.h                    |  2 +-
 src/hydro/PressureEnergy/hydro.h              | 12 ++++----
 src/hydro/Shadowswift/hydro.h                 |  6 ++--
 src/hydro/Shadowswift/hydro_io.h              |  2 +-
 src/pressure_floor/GEAR/pressure_floor.h      | 29 ++++++++++++-------
 src/pressure_floor/GEAR/pressure_floor_iact.h | 22 ++++----------
 src/pressure_floor/none/pressure_floor.h      |  6 ++--
 10 files changed, 49 insertions(+), 48 deletions(-)

diff --git a/src/adiabatic_index.h b/src/adiabatic_index.h
index db94a074d6..d64968d736 100644
--- a/src/adiabatic_index.h
+++ b/src/adiabatic_index.h
@@ -545,7 +545,6 @@ pow_three_gamma_minus_five_over_two(float x) {
 #endif
 }
 
-
 /**
  * @brief Return the argument to the power three (adiabatic index - 1).
  *
diff --git a/src/hydro/Gadget2/hydro.h b/src/hydro/Gadget2/hydro.h
index 0beeafa87c..3fa6f19cc1 100644
--- a/src/hydro/Gadget2/hydro.h
+++ b/src/hydro/Gadget2/hydro.h
@@ -390,7 +390,8 @@ hydro_set_drifted_physical_internal_energy(struct part *p,
 
   /* Compute the pressure */
   float comoving_pressure = gas_pressure_from_entropy(p->rho, p->entropy);
-  comoving_pressure = pressure_floor_get_comoving_pressure(p, comoving_pressure, cosmo);
+  comoving_pressure =
+      pressure_floor_get_comoving_pressure(p, comoving_pressure, cosmo);
 
   /* Compute the sound speed */
   const float soundspeed =
@@ -595,7 +596,8 @@ __attribute__((always_inline)) INLINE static void hydro_prepare_force(
 
   /* Compute the pressure */
   float comoving_pressure = gas_pressure_from_entropy(p->rho, p->entropy);
-  comoving_pressure = pressure_floor_get_comoving_pressure(p, comoving_pressure, cosmo);
+  comoving_pressure =
+      pressure_floor_get_comoving_pressure(p, comoving_pressure, cosmo);
 
   /* Compute the sound speed */
   const float soundspeed =
@@ -673,7 +675,8 @@ __attribute__((always_inline)) INLINE static void hydro_reset_predicted_values(
 
   /* Re-compute the pressure */
   float comoving_pressure = gas_pressure_from_entropy(p->rho, p->entropy);
-  comoving_pressure = pressure_floor_get_comoving_pressure(p, comoving_pressure, cosmo);
+  comoving_pressure =
+      pressure_floor_get_comoving_pressure(p, comoving_pressure, cosmo);
 
   /* Compute the new sound speed */
   const float soundspeed =
@@ -740,7 +743,8 @@ __attribute__((always_inline)) INLINE static void hydro_predict_extra(
 
   /* Re-compute the pressure */
   float comoving_pressure = gas_pressure_from_entropy(p->rho, p->entropy);
-  comoving_pressure = pressure_floor_get_comoving_pressure(p, comoving_pressure, cosmo);
+  comoving_pressure =
+      pressure_floor_get_comoving_pressure(p, comoving_pressure, cosmo);
 
   /* Compute the new sound speed */
   const float soundspeed =
@@ -852,7 +856,8 @@ __attribute__((always_inline)) INLINE static void hydro_convert_quantities(
 
   /* Compute the pressure */
   float comoving_pressure = gas_pressure_from_entropy(p->rho, p->entropy);
-  comoving_pressure = pressure_floor_get_comoving_pressure(p, comoving_pressure, cosmo);
+  comoving_pressure =
+      pressure_floor_get_comoving_pressure(p, comoving_pressure, cosmo);
 
   /* Compute the sound speed */
   const float soundspeed =
diff --git a/src/hydro/GizmoMFM/hydro.h b/src/hydro/GizmoMFM/hydro.h
index d10666034a..890c7f4c11 100644
--- a/src/hydro/GizmoMFM/hydro.h
+++ b/src/hydro/GizmoMFM/hydro.h
@@ -501,7 +501,7 @@ __attribute__((always_inline)) INLINE static void hydro_reset_acceleration(
  */
 __attribute__((always_inline)) INLINE static void hydro_reset_predicted_values(
     struct part* restrict p, const struct xpart* restrict xp,
-    const struct cosmology *cosmo) {
+    const struct cosmology* cosmo) {
   // MATTHIEU: Do we need something here?
 }
 
diff --git a/src/hydro/GizmoMFV/hydro.h b/src/hydro/GizmoMFV/hydro.h
index cfc347118d..58a8a19dcc 100644
--- a/src/hydro/GizmoMFV/hydro.h
+++ b/src/hydro/GizmoMFV/hydro.h
@@ -543,7 +543,7 @@ __attribute__((always_inline)) INLINE static void hydro_reset_gradient(
  */
 __attribute__((always_inline)) INLINE static void hydro_reset_predicted_values(
     struct part* restrict p, const struct xpart* restrict xp,
-    const struct cosmology *cosmo) {
+    const struct cosmology* cosmo) {
   // MATTHIEU: Apply the entropy floor here.
 }
 
diff --git a/src/hydro/PressureEnergy/hydro.h b/src/hydro/PressureEnergy/hydro.h
index ec34064d23..e43c69fd49 100644
--- a/src/hydro/PressureEnergy/hydro.h
+++ b/src/hydro/PressureEnergy/hydro.h
@@ -212,21 +212,19 @@ hydro_get_drifted_physical_entropy(const struct part *restrict p,
   return gas_entropy_from_internal_energy(p->rho, p->u);
 }
 
-
 /**
  * @brief Update the sound speed of a particle
  *
  * @param p The particle of interest.
  * @param cosmo The cosmological model.
  */
-__attribute__((always_inline)) INLINE static void
-hydro_update_soundspeed(struct part *restrict p,
-			const struct cosmology *cosmo) {
+__attribute__((always_inline)) INLINE static void hydro_update_soundspeed(
+    struct part *restrict p, const struct cosmology *cosmo) {
 
   /* Compute the sound speed -- see theory section for justification */
   /* IDEAL GAS ONLY -- P-U does not work with generic EoS. */
   const float comoving_pressure =
-    pressure_floor_get_comoving_pressure(p, p->pressure_bar, cosmo);
+      pressure_floor_get_comoving_pressure(p, p->pressure_bar, cosmo);
   p->force.soundspeed = sqrtf(hydro_gamma * comoving_pressure / p->rho);
 }
 
@@ -656,7 +654,7 @@ __attribute__((always_inline)) INLINE static void hydro_prepare_force(
 
   /* Get the pressures */
   const float comoving_pressure_with_floor =
-    pressure_floor_get_comoving_pressure(p, p->pressure_bar, cosmo);
+      pressure_floor_get_comoving_pressure(p, p->pressure_bar, cosmo);
 
   /* Update variables. */
   p->force.f = grad_h_term;
@@ -774,7 +772,7 @@ __attribute__((always_inline)) INLINE static void hydro_predict_extra(
 
   /* update the required variables */
   const float comoving_pressure_with_floor =
-    pressure_floor_get_comoving_pressure(p, p->pressure_bar, cosmo);
+      pressure_floor_get_comoving_pressure(p, p->pressure_bar, cosmo);
   p->force.pressure_bar_with_floor = comoving_pressure_with_floor;
 }
 
diff --git a/src/hydro/Shadowswift/hydro.h b/src/hydro/Shadowswift/hydro.h
index 5ce4836e20..8c04540251 100644
--- a/src/hydro/Shadowswift/hydro.h
+++ b/src/hydro/Shadowswift/hydro.h
@@ -401,7 +401,7 @@ __attribute__((always_inline)) INLINE static void hydro_reset_acceleration(
  */
 __attribute__((always_inline)) INLINE static void hydro_reset_predicted_values(
     struct part* restrict p, const struct xpart* restrict xp,
-    const struct cosmology *cosmo) {}
+    const struct cosmology* cosmo) {}
 
 /**
  * @brief Converts the hydrodynamic variables from the initial condition file to
@@ -799,7 +799,7 @@ __attribute__((always_inline)) INLINE static float hydro_get_comoving_density(
  */
 __attribute__((always_inline)) INLINE static float
 hydro_get_physical_internal_energy(const struct part* restrict p,
-                                   const struct xpart *restrict xp,
+                                   const struct xpart* restrict xp,
                                    const struct cosmology* cosmo) {
 
   return cosmo->a_factor_internal_energy *
@@ -903,7 +903,7 @@ hydro_get_drifted_physical_internal_energy(const struct part* p,
  */
 __attribute__((always_inline)) INLINE static float
 hydro_get_drifted_physical_entropy(const struct part* p,
-				   const struct cosmology* cosmo) {
+                                   const struct cosmology* cosmo) {
   error("Need implementing");
 
   return 0;
diff --git a/src/hydro/Shadowswift/hydro_io.h b/src/hydro/Shadowswift/hydro_io.h
index 2127361038..e6190e5a67 100644
--- a/src/hydro/Shadowswift/hydro_io.h
+++ b/src/hydro/Shadowswift/hydro_io.h
@@ -143,7 +143,7 @@ INLINE static void hydro_write_particles(const struct part* parts,
       convert_part_pos, "Co-moving positions of the particles");
 
   list[1] = io_make_output_field(
-       "Velocities", FLOAT, 3, UNIT_CONV_SPEED, 0.f, parts, primitives.v,
+      "Velocities", FLOAT, 3, UNIT_CONV_SPEED, 0.f, parts, primitives.v,
       "Peculiar velocities of the stars. This is (a * dx/dt) where x is the "
       "co-moving positions of the particles");
 
diff --git a/src/pressure_floor/GEAR/pressure_floor.h b/src/pressure_floor/GEAR/pressure_floor.h
index 24d8777e1e..de9ad6cf44 100644
--- a/src/pressure_floor/GEAR/pressure_floor.h
+++ b/src/pressure_floor/GEAR/pressure_floor.h
@@ -20,10 +20,12 @@
 #define SWIFT_PRESSURE_FLOOR_GEAR_H
 
 /* Forward declaration */
-__attribute__((always_inline)) static INLINE float pressure_floor_get_comoving_pressure(
-    const struct part* p, const float pressure, const struct cosmology *cosmo);
-__attribute__((always_inline)) static INLINE float pressure_floor_get_physical_pressure(
-    const struct part* p, const float pressure, const struct cosmology *cosmo);
+__attribute__((always_inline)) static INLINE float
+pressure_floor_get_comoving_pressure(const struct part* p, const float pressure,
+                                     const struct cosmology* cosmo);
+__attribute__((always_inline)) static INLINE float
+pressure_floor_get_physical_pressure(const struct part* p, const float pressure,
+                                     const struct cosmology* cosmo);
 
 #include "adiabatic_index.h"
 #include "cosmology.h"
@@ -63,15 +65,17 @@ struct pressure_floor_properties {
  *
  * @return The physical pressure with the floor.
  */
-__attribute__((always_inline)) static INLINE float pressure_floor_get_physical_pressure(
-    const struct part* p, const float pressure_physical, const struct cosmology *cosmo) {
+__attribute__((always_inline)) static INLINE float
+pressure_floor_get_physical_pressure(const struct part* p,
+                                     const float pressure_physical,
+                                     const struct cosmology* cosmo) {
 
   const float H_phys = p->h * cosmo->a_inv * kernel_gamma;
   const float rho = hydro_get_physical_density(p, cosmo);
 
   /* Compute the pressure floor */
   float floor = H_phys * H_phys * rho * pressure_floor_props.constants -
-    p->pressure_floor_data.sigma2;
+                p->pressure_floor_data.sigma2;
   floor *= rho * hydro_one_over_gamma;
 
   return fmaxf(pressure_physical, floor);
@@ -88,14 +92,17 @@ __attribute__((always_inline)) static INLINE float pressure_floor_get_physical_p
  *
  * @return The physical or comoving pressure with the floor.
  */
-__attribute__((always_inline)) static INLINE float pressure_floor_get_comoving_pressure(
-    const struct part* p, const float pressure_comoving, const struct cosmology *cosmo) {
+__attribute__((always_inline)) static INLINE float
+pressure_floor_get_comoving_pressure(const struct part* p,
+                                     const float pressure_comoving,
+                                     const struct cosmology* cosmo) {
 
   const float a_coef = pow_three_gamma_minus_one(cosmo->a);
   const float rho = hydro_get_comoving_density(p);
-  
+
   /* Compute the pressure floor */
-  float floor = kernel_gamma * kernel_gamma * p->h * p->h * rho * pressure_floor_props.constants;
+  float floor = kernel_gamma * kernel_gamma * p->h * p->h * rho *
+                pressure_floor_props.constants;
   floor -= p->pressure_floor_data.sigma2 * cosmo->a * cosmo->a;
   floor *= a_coef * rho * hydro_one_over_gamma;
 
diff --git a/src/pressure_floor/GEAR/pressure_floor_iact.h b/src/pressure_floor/GEAR/pressure_floor_iact.h
index a1928cc150..5ffb0b0097 100644
--- a/src/pressure_floor/GEAR/pressure_floor_iact.h
+++ b/src/pressure_floor/GEAR/pressure_floor_iact.h
@@ -55,15 +55,10 @@ __attribute__((always_inline)) INLINE static void runner_iact_pressure_floor(
 
   /* Compute the velocity dispersion */
   const float a2H = a * a * H;
-  const float sigma[3] = {
-    dv[0] + a2H * dx[0],
-    dv[1] + a2H * dx[1],
-    dv[2] + a2H * dx[2]
-  };
+  const float sigma[3] = {dv[0] + a2H * dx[0], dv[1] + a2H * dx[1],
+                          dv[2] + a2H * dx[2]};
   const float sigma2 =
-    sigma[0] * sigma[0] +
-    sigma[1] * sigma[1] +
-    sigma[2] * sigma[2];
+      sigma[0] * sigma[0] + sigma[1] * sigma[1] + sigma[2] * sigma[2];
 
   /* Compute the velocity dispersion */
   pi->pressure_floor_data.sigma2 += sigma2 * wi * hydro_get_mass(pj);
@@ -97,15 +92,10 @@ runner_iact_nonsym_pressure_floor(float r2, const float *dx, float hi, float hj,
 
   /* Compute the velocity dispersion */
   const float a2H = a * a * H;
-  const float sigma[3] = {
-    dv[0] + a2H * dx[0],
-    dv[1] + a2H * dx[1],
-    dv[2] + a2H * dx[2]
-  };
+  const float sigma[3] = {dv[0] + a2H * dx[0], dv[1] + a2H * dx[1],
+                          dv[2] + a2H * dx[2]};
   const float sigma2 =
-    sigma[0] * sigma[0] +
-    sigma[1] * sigma[1] +
-    sigma[2] * sigma[2];
+      sigma[0] * sigma[0] + sigma[1] * sigma[1] + sigma[2] * sigma[2];
 
   /* Compute the velocity dispersion */
   pi->pressure_floor_data.sigma2 += sigma2 * wi * hydro_get_mass(pj);
diff --git a/src/pressure_floor/none/pressure_floor.h b/src/pressure_floor/none/pressure_floor.h
index 3d316fbaf0..84db9cbaf6 100644
--- a/src/pressure_floor/none/pressure_floor.h
+++ b/src/pressure_floor/none/pressure_floor.h
@@ -49,7 +49,8 @@ struct pressure_floor_properties {};
  * @return The physical pressure with the floor.
  */
 static INLINE float pressure_floor_get_physical_pressure(
-    const struct part* p, const float physical_pressure, const struct cosmology *cosmo) {
+    const struct part* p, const float physical_pressure,
+    const struct cosmology* cosmo) {
   return physical_pressure;
 }
 
@@ -65,7 +66,8 @@ static INLINE float pressure_floor_get_physical_pressure(
  * @return The comoving pressure with the floor.
  */
 static INLINE float pressure_floor_get_comoving_pressure(
-    const struct part* p, const float comoving_pressure, const struct cosmology *cosmo) {
+    const struct part* p, const float comoving_pressure,
+    const struct cosmology* cosmo) {
   return comoving_pressure;
 }
 
-- 
GitLab