From 66f6f2e5aa122adecbaf45b3abfb35e9e8c407fc Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Sun, 20 Jan 2019 22:12:09 +0800
Subject: [PATCH] Applied code formatting.

---
 src/chemistry/EAGLE/chemistry_io.h         |  2 +-
 src/chemistry/GEAR/chemistry_io.h          |  2 +-
 src/chemistry/none/chemistry_io.h          |  2 +-
 src/hydro/Gadget2/hydro_part.h             |  2 +-
 src/parallel_io.c                          | 14 +++++++-------
 src/serial_io.c                            | 14 ++++++++------
 src/sftracers/EAGLE/sftracers_io.h         | 11 ++++-------
 src/sftracers/EAGLE/sftracers_struct.h     |  1 -
 src/sftracers_struct.h                     |  2 +-
 src/single_io.c                            |  9 +++++----
 src/starformation/schaye08/starformation.h | 19 ++++++++++---------
 11 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/src/chemistry/EAGLE/chemistry_io.h b/src/chemistry/EAGLE/chemistry_io.h
index 3bbff92b9a..d7ee9dc213 100644
--- a/src/chemistry/EAGLE/chemistry_io.h
+++ b/src/chemistry/EAGLE/chemistry_io.h
@@ -115,7 +115,7 @@ INLINE static int chemistry_write_particles(const struct part* parts,
  * @return Returns the number of fields to write.
  */
 INLINE static int chemistry_write_sparticles(const struct spart* sparts,
-                                            struct io_props* list) {
+                                             struct io_props* list) {
 
   /* List what we want to write */
   list[0] = io_make_output_field("ElementAbundance", FLOAT,
diff --git a/src/chemistry/GEAR/chemistry_io.h b/src/chemistry/GEAR/chemistry_io.h
index 5bbd5476ac..b29f7db65d 100644
--- a/src/chemistry/GEAR/chemistry_io.h
+++ b/src/chemistry/GEAR/chemistry_io.h
@@ -96,7 +96,7 @@ INLINE static int chemistry_write_particles(const struct part* parts,
  * @return Returns the number of fields to write.
  */
 INLINE static int chemistry_write_sparticles(const struct spart* sparts,
-                                            struct io_props* list) {
+                                             struct io_props* list) {
 
   /* List what we want to write */
   list[0] = io_make_output_field(
diff --git a/src/chemistry/none/chemistry_io.h b/src/chemistry/none/chemistry_io.h
index b0c82066c3..8373cb15b6 100644
--- a/src/chemistry/none/chemistry_io.h
+++ b/src/chemistry/none/chemistry_io.h
@@ -64,7 +64,7 @@ INLINE static int chemistry_write_particles(const struct part* parts,
  * @return Returns the number of fields to write.
  */
 INLINE static int chemistry_write_sparticles(const struct spart* sparts,
-                                            struct io_props* list) {
+                                             struct io_props* list) {
 
   /* update list according to hydro_io */
 
diff --git a/src/hydro/Gadget2/hydro_part.h b/src/hydro/Gadget2/hydro_part.h
index 109092e7db..369eff881d 100644
--- a/src/hydro/Gadget2/hydro_part.h
+++ b/src/hydro/Gadget2/hydro_part.h
@@ -34,8 +34,8 @@
 #include "chemistry_struct.h"
 #include "cooling_struct.h"
 #include "logger.h"
-#include "tracers_struct.h"
 #include "sftracers_struct.h"
+#include "tracers_struct.h"
 
 /* Extra particle data not needed during the SPH loops over neighbours. */
 struct xpart {
diff --git a/src/parallel_io.c b/src/parallel_io.c
index 9570bd2cab..2c885fa799 100644
--- a/src/parallel_io.c
+++ b/src/parallel_io.c
@@ -51,9 +51,9 @@
 #include "kernel_hydro.h"
 #include "part.h"
 #include "part_type.h"
+#include "sftracers_io.h"
 #include "stars_io.h"
 #include "tracers_io.h"
-#include "sftracers_io.h"
 #include "units.h"
 #include "xmf.h"
 
@@ -1145,8 +1145,8 @@ void prepare_file(struct engine* e, const char* baseName, long long N_total[6],
                                               e->cooling_func);
         num_fields += tracers_write_particles(parts, xparts, list + num_fields,
                                               with_cosmology);
-        num_fields += sftracers_write_particles(parts, xparts, list + num_fields,
-                                              with_cosmology);
+        num_fields += sftracers_write_particles(
+            parts, xparts, list + num_fields, with_cosmology);
 
         break;
 
@@ -1157,8 +1157,8 @@ void prepare_file(struct engine* e, const char* baseName, long long N_total[6],
       case swift_type_stars:
         stars_write_particles(sparts, list, &num_fields);
         num_fields += chemistry_write_sparticles(sparts, list + num_fields);
-        num_fields += tracers_write_sparticles(sparts, list + num_fields,
-                                              with_cosmology);
+        num_fields +=
+            tracers_write_sparticles(sparts, list + num_fields, with_cosmology);
         break;
 
       default:
@@ -1484,7 +1484,7 @@ void write_output_parallel(struct engine* e, const char* baseName,
           stars_write_particles(sparts, list, &num_fields);
           num_fields += chemistry_write_sparticles(sparts, list + num_fields);
           num_fields += tracers_write_sparticles(sparts, list + num_fields,
-                                              with_cosmology);
+                                                 with_cosmology);
         } else {
 
           /* Ok, we need to fish out the particles we want */
@@ -1503,7 +1503,7 @@ void write_output_parallel(struct engine* e, const char* baseName,
           stars_write_particles(sparts_written, list, &num_fields);
           num_fields += chemistry_write_sparticles(sparts, list + num_fields);
           num_fields += tracers_write_sparticles(sparts, list + num_fields,
-                                              with_cosmology);
+                                                 with_cosmology);
         }
       } break;
 
diff --git a/src/serial_io.c b/src/serial_io.c
index c6182d5a44..45746e5650 100644
--- a/src/serial_io.c
+++ b/src/serial_io.c
@@ -51,9 +51,9 @@
 #include "kernel_hydro.h"
 #include "part.h"
 #include "part_type.h"
+#include "sftracers_io.h"
 #include "stars_io.h"
 #include "tracers_io.h"
-#include "sftracers_io.h"
 #include "units.h"
 #include "xmf.h"
 
@@ -1115,7 +1115,7 @@ void write_output_serial(struct engine* e, const char* baseName,
                                           list + num_fields, with_cosmology);
               num_fields +=
                   sftracers_write_particles(parts_written, xparts_written,
-                                          list + num_fields, with_cosmology);
+                                            list + num_fields, with_cosmology);
             }
           } break;
 
@@ -1150,9 +1150,10 @@ void write_output_serial(struct engine* e, const char* baseName,
               /* No inhibted particles: easy case */
               Nparticles = Nstars;
               stars_write_particles(sparts, list, &num_fields);
-              num_fields += chemistry_write_sparticles(sparts, list + num_fields);
+              num_fields +=
+                  chemistry_write_sparticles(sparts, list + num_fields);
               num_fields += tracers_write_sparticles(sparts, list + num_fields,
-                  with_cosmology);
+                                                     with_cosmology);
             } else {
 
               /* Ok, we need to fish out the particles we want */
@@ -1169,9 +1170,10 @@ void write_output_serial(struct engine* e, const char* baseName,
 
               /* Select the fields to write */
               stars_write_particles(sparts_written, list, &num_fields);
-              num_fields += chemistry_write_sparticles(sparts, list + num_fields);
+              num_fields +=
+                  chemistry_write_sparticles(sparts, list + num_fields);
               num_fields += tracers_write_sparticles(sparts, list + num_fields,
-                  with_cosmology);
+                                                     with_cosmology);
             }
           } break;
 
diff --git a/src/sftracers/EAGLE/sftracers_io.h b/src/sftracers/EAGLE/sftracers_io.h
index b8b94d3e96..2fff68bcc4 100644
--- a/src/sftracers/EAGLE/sftracers_io.h
+++ b/src/sftracers/EAGLE/sftracers_io.h
@@ -54,14 +54,11 @@ __attribute__((always_inline)) INLINE static int sftracers_write_particles(
     const struct part* parts, const struct xpart* xparts, struct io_props* list,
     const int with_cosmology) {
 
-  list[0] = io_make_output_field("SFR", FLOAT, 1, 
-                                  UNIT_CONV_SFR, xparts,
-                                  sftracers_data.SFR);
-
-  list[1] = io_make_output_field("sSFR", FLOAT, 1, 
-                                  UNIT_CONV_SSFR, xparts,
-                                  sftracers_data.sSFR);
+  list[0] = io_make_output_field("SFR", FLOAT, 1, UNIT_CONV_SFR, xparts,
+                                 sftracers_data.SFR);
 
+  list[1] = io_make_output_field("sSFR", FLOAT, 1, UNIT_CONV_SSFR, xparts,
+                                 sftracers_data.sSFR);
 
   return 2;
 }
diff --git a/src/sftracers/EAGLE/sftracers_struct.h b/src/sftracers/EAGLE/sftracers_struct.h
index 4261086b25..ccc7ee5553 100644
--- a/src/sftracers/EAGLE/sftracers_struct.h
+++ b/src/sftracers/EAGLE/sftracers_struct.h
@@ -28,7 +28,6 @@ struct sftracers_xpart_data {
 
   /*! Specific star formation rate */
   float sSFR;
-
 };
 
 #endif /* SWIFT_SFTRACERS_STRUCT_EAGLE_H */
diff --git a/src/sftracers_struct.h b/src/sftracers_struct.h
index 419d2dec86..e13e259d2e 100644
--- a/src/sftracers_struct.h
+++ b/src/sftracers_struct.h
@@ -1,6 +1,6 @@
 /*******************************************************************************
  * This file is part of SWIFT.
- * Copyright (c) 2019 Folkert Nobels (nobels@strw.leidenuniv.nl) 
+ * Copyright (c) 2019 Folkert Nobels (nobels@strw.leidenuniv.nl)
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published
diff --git a/src/single_io.c b/src/single_io.c
index 4d2d221914..c80c8a9940 100644
--- a/src/single_io.c
+++ b/src/single_io.c
@@ -50,9 +50,9 @@
 #include "kernel_hydro.h"
 #include "part.h"
 #include "part_type.h"
+#include "sftracers_io.h"
 #include "stars_io.h"
 #include "tracers_io.h"
-#include "sftracers_io.h"
 #include "units.h"
 #include "xmf.h"
 
@@ -968,8 +968,8 @@ void write_output_single(struct engine* e, const char* baseName,
           N = Nstars;
           stars_write_particles(sparts, list, &num_fields);
           num_fields += chemistry_write_sparticles(sparts, list + num_fields);
-          num_fields += tracers_write_sparticles(
-              sparts, list + num_fields, with_cosmology);
+          num_fields += tracers_write_sparticles(sparts, list + num_fields,
+                                                 with_cosmology);
         } else {
 
           /* Ok, we need to fish out the particles we want */
@@ -986,7 +986,8 @@ void write_output_single(struct engine* e, const char* baseName,
 
           /* Select the fields to write */
           stars_write_particles(sparts_written, list, &num_fields);
-          num_fields += chemistry_write_sparticles(sparts_written, list + num_fields);
+          num_fields +=
+              chemistry_write_sparticles(sparts_written, list + num_fields);
           num_fields += tracers_write_sparticles(
               sparts_written, list + num_fields, with_cosmology);
         }
diff --git a/src/starformation/schaye08/starformation.h b/src/starformation/schaye08/starformation.h
index 54715ad099..bf5fc60b4b 100644
--- a/src/starformation/schaye08/starformation.h
+++ b/src/starformation/schaye08/starformation.h
@@ -218,26 +218,27 @@ INLINE static int star_formation_convert_to_star(
   if (star_formation_potential_to_become_star(
           starform, p, xp, phys_const, cosmo, hydro_props, us, cooling)) {
     /* Get the pressure */
-    
+
     const double pressure =
         starform->EOS_pressure_norm *
         pow(hydro_get_physical_density(p, cosmo) *
                 p->chemistry_data.smoothed_metal_mass_fraction[0] /
                 starform->EOS_density_norm / phys_const->const_proton_mass,
             starform->polytropic_index);
-    
 
     double SFRpergasmass;
     if (hydro_get_physical_density(p, cosmo) <
         starform->KS_high_den_thresh * phys_const->const_proton_mass) {
       /* Calculate the star formation rate */
-      SFRpergasmass = starform->SF_normalization *
-                                   pow(pressure, starform->SF_power_law);
-      //SFRpergasmass = starform->KS_normalization * pow(starform->Msunpsquaredpc,-starform->KS_power_law)*
-      //    pow(hydro_gamma * starform->fgas / phys_const->const_newton_G * pressure, (starform->KS_power_law-1.f)/2.f );
+      SFRpergasmass =
+          starform->SF_normalization * pow(pressure, starform->SF_power_law);
+      // SFRpergasmass = starform->KS_normalization *
+      // pow(starform->Msunpsquaredpc,-starform->KS_power_law)*
+      //    pow(hydro_gamma * starform->fgas / phys_const->const_newton_G *
+      //    pressure, (starform->KS_power_law-1.f)/2.f );
     } else {
       SFRpergasmass = starform->SF_high_den_normalization *
-                                   pow(pressure, starform->SF_high_den_power_law);
+                      pow(pressure, starform->SF_high_den_power_law);
     }
 
     /* Store the SFR */
@@ -262,10 +263,10 @@ INLINE static int star_formation_convert_to_star(
   /* Check if it is the first time steps after star formation */
   if (xp->sftracers_data.SFR > 0.f) {
     if (with_cosmology) {
-      xp->sftracers_data.SFR = - cosmo->a;
+      xp->sftracers_data.SFR = -cosmo->a;
       xp->sftracers_data.sSFR = 0.f;
     } else {
-      xp->sftracers_data.SFR = - e->time;
+      xp->sftracers_data.SFR = -e->time;
       xp->sftracers_data.sSFR = 0.f;
     }
   }
-- 
GitLab