From 8e92f21442e5d01037ebd91fbd32c6aec071086f Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Wed, 6 Mar 2019 13:19:41 +0100
Subject: [PATCH] Make sure we can compile the code with GIZMO and EAGLE
 subgrid switched on.

---
 .../EAGLE/star_formation_iact.h               |  2 ++
 src/star_formation/GEAR/star_formation_iact.h |  2 ++
 src/stars/Default/stars_iact.h                | 26 ++++++++++++++++++-
 src/stars/EAGLE/stars_iact.h                  | 25 +++++++++++++++++-
 4 files changed, 53 insertions(+), 2 deletions(-)

diff --git a/src/star_formation/EAGLE/star_formation_iact.h b/src/star_formation/EAGLE/star_formation_iact.h
index 84fbad9f23..ab917cbe7a 100644
--- a/src/star_formation/EAGLE/star_formation_iact.h
+++ b/src/star_formation/EAGLE/star_formation_iact.h
@@ -1,4 +1,6 @@
 /*******************************************************************************
+ * This file is part of SWIFT.
+ * Copyright (c) 2018 Matthieu Schaller (matthieu.schaller@durham.ac.uk)
  *
  * 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/star_formation/GEAR/star_formation_iact.h b/src/star_formation/GEAR/star_formation_iact.h
index ef47470015..749b608068 100644
--- a/src/star_formation/GEAR/star_formation_iact.h
+++ b/src/star_formation/GEAR/star_formation_iact.h
@@ -1,4 +1,6 @@
 /*******************************************************************************
+ * This file is part of SWIFT.
+ * Copyright (c) 2019 Loic Hausammann (loic.hausammann@epfl.ch)
  *
  * 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/stars/Default/stars_iact.h b/src/stars/Default/stars_iact.h
index 994ff98d01..cbf3065f1d 100644
--- a/src/stars/Default/stars_iact.h
+++ b/src/stars/Default/stars_iact.h
@@ -1,3 +1,25 @@
+/*******************************************************************************
+ * This file is part of SWIFT.
+ * Copyright (c) 2018 Matthieu Schaller (matthieu.schaller@durham.ac.uk)
+ *                    Loic Hausammann (loic.hausammann@epfl.ch)
+ *
+ * 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
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ ******************************************************************************/
+#ifndef SWIFT_DEFAULT_STARS_IACT_H
+#define SWIFT_DEFAULT_STARS_IACT_H
+
 /**
  * @brief Density interaction between two particles (non-symmetric).
  *
@@ -58,7 +80,7 @@ runner_iact_nonsym_stars_feedback(float r2, const float *dx, float hi, float hj,
                                   struct spart *restrict si,
                                   struct part *restrict pj, float a, float H) {
 
-  const float mj = pj->mass;
+  const float mj = hydro_get_mass(pj);
   const float rhoj = pj->rho;
   const float r = sqrtf(r2);
   const float ri = 1.f / r;
@@ -87,3 +109,5 @@ runner_iact_nonsym_stars_feedback(float r2, const float *dx, float hi, float hj,
   ++si->num_ngb_force;
 #endif
 }
+
+#endif /* SWIFT_DEFAULT_STARS_IACT_H */
diff --git a/src/stars/EAGLE/stars_iact.h b/src/stars/EAGLE/stars_iact.h
index 5c4d94c206..aad611f504 100644
--- a/src/stars/EAGLE/stars_iact.h
+++ b/src/stars/EAGLE/stars_iact.h
@@ -1,3 +1,24 @@
+/*******************************************************************************
+ * This file is part of SWIFT.
+ * Copyright (c) 2018 Matthieu Schaller (matthieu.schaller@durham.ac.uk)
+ *
+ * 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
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ ******************************************************************************/
+#ifndef SWIFT_EAGLE_STARS_IACT_H
+#define SWIFT_EAGLE_STARS_IACT_H
+
 /**
  * @brief Density interaction between two particles (non-symmetric).
  *
@@ -17,7 +38,7 @@ runner_iact_nonsym_stars_density(float r2, const float *dx, float hi, float hj,
                                  float H) {
 
   /* Get the gas mass. */
-  const float mj = pj->mass;
+  const float mj = hydro_get_mass(pj);
 
   float wi, wi_dx;
 
@@ -61,3 +82,5 @@ __attribute__((always_inline)) INLINE static void
 runner_iact_nonsym_stars_feedback(float r2, const float *dx, float hi, float hj,
                                   struct spart *restrict si,
                                   struct part *restrict pj, float a, float H) {}
+
+#endif /* SWIFT_EAGLE_STARS_IACT_H */
-- 
GitLab