From 33eeb8ad24274dadde83c7883c07f0882199acf7 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <schaller@strw.leidenuniv.nl> Date: Fri, 19 Jan 2018 13:37:04 +0100 Subject: [PATCH] Add header guards to all the Gizmo files. Also use a more uniform style for the existing ones. --- src/hydro/Gizmo/hydro.h | 4 ++++ src/hydro/Gizmo/hydro_debug.h | 4 ++++ src/hydro/Gizmo/hydro_gradients.h | 7 +++---- src/hydro/Gizmo/hydro_gradients_gizmo.h | 5 +++++ src/hydro/Gizmo/hydro_gradients_sph.h | 5 +++++ src/hydro/Gizmo/hydro_iact.h | 4 ++++ src/hydro/Gizmo/hydro_io.h | 4 ++++ src/hydro/Gizmo/hydro_slope_limiters.h | 2 +- src/hydro/Gizmo/hydro_slope_limiters_cell.h | 4 ++++ src/hydro/Gizmo/hydro_slope_limiters_face.h | 5 +++++ src/hydro/Gizmo/hydro_unphysical.h | 2 +- src/hydro/Gizmo/hydro_velocities.h | 2 +- 12 files changed, 41 insertions(+), 7 deletions(-) diff --git a/src/hydro/Gizmo/hydro.h b/src/hydro/Gizmo/hydro.h index f76d1a10e9..a7ccde6a9b 100644 --- a/src/hydro/Gizmo/hydro.h +++ b/src/hydro/Gizmo/hydro.h @@ -17,6 +17,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************/ +#ifndef SWIFT_GIZMO_HYDRO_H +#define SWIFT_GIZMO_HYDRO_H #include "adiabatic_index.h" #include "approx_math.h" @@ -840,3 +842,5 @@ __attribute__((always_inline)) INLINE static void hydro_set_entropy( #endif p->primitives.P = S * pow_gamma(p->primitives.rho); } + +#endif /* SWIFT_GIZMO_HYDRO_H */ diff --git a/src/hydro/Gizmo/hydro_debug.h b/src/hydro/Gizmo/hydro_debug.h index f11104f8a6..0516068d34 100644 --- a/src/hydro/Gizmo/hydro_debug.h +++ b/src/hydro/Gizmo/hydro_debug.h @@ -16,6 +16,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************/ +#ifndef SWIFT_GIZMO_HYDRO_DEBUG_H +#define SWIFT_GIZMO_HYDRO_DEBUG_H __attribute__((always_inline)) INLINE static void hydro_debug_particle( const struct part* p, const struct xpart* xp) { @@ -75,3 +77,5 @@ __attribute__((always_inline)) INLINE static void hydro_debug_particle( p->geometry.matrix_E[2][1], p->geometry.matrix_E[2][2], p->timestepvars.vmax, p->density.wcount_dh, p->density.wcount); } + +#endif /* SWIFT_GIZMO_HYDRO_DEBUG_H */ diff --git a/src/hydro/Gizmo/hydro_gradients.h b/src/hydro/Gizmo/hydro_gradients.h index b01b4d90b8..8513308cc9 100644 --- a/src/hydro/Gizmo/hydro_gradients.h +++ b/src/hydro/Gizmo/hydro_gradients.h @@ -1,4 +1,3 @@ - /******************************************************************************* * This file is part of SWIFT. * Copyright (c) 2016 Bert Vandenbroucke (bert.vandenbroucke@gmail.com) @@ -18,8 +17,8 @@ * ******************************************************************************/ -#ifndef SWIFT_HYDRO_GRADIENTS_H -#define SWIFT_HYDRO_GRADIENTS_H +#ifndef SWIFT_HYDRO_GIZMO_GRADIENTS_H +#define SWIFT_HYDRO_GIZMO_GRADIENTS_H #include "hydro_slope_limiters.h" #include "hydro_unphysical.h" @@ -160,4 +159,4 @@ __attribute__((always_inline)) INLINE static void hydro_gradients_predict( gizmo_check_physical_quantity("pressure", Wj[4]); } -#endif // SWIFT_HYDRO_GRADIENTS_H +#endif /* SWIFT_HYDRO_GIZMO_GRADIENTS_H */ diff --git a/src/hydro/Gizmo/hydro_gradients_gizmo.h b/src/hydro/Gizmo/hydro_gradients_gizmo.h index bc50c10d84..034f03c619 100644 --- a/src/hydro/Gizmo/hydro_gradients_gizmo.h +++ b/src/hydro/Gizmo/hydro_gradients_gizmo.h @@ -22,6 +22,9 @@ * * @param p Particle. */ +#ifndef SWIFT_GIZMO_HYDRO_GRADIENTS_H +#define SWIFT_GIZMO_HYDRO_GRADIENTS_H + __attribute__((always_inline)) INLINE static void hydro_gradients_init( struct part *p) { @@ -484,3 +487,5 @@ __attribute__((always_inline)) INLINE static void hydro_gradients_finalize( hydro_slope_limit_cell(p); } + +#endif /* SWIFT_GIZMO_HYDRO_GRADIENTS_H */ diff --git a/src/hydro/Gizmo/hydro_gradients_sph.h b/src/hydro/Gizmo/hydro_gradients_sph.h index f635faecea..56a5a88cc1 100644 --- a/src/hydro/Gizmo/hydro_gradients_sph.h +++ b/src/hydro/Gizmo/hydro_gradients_sph.h @@ -22,6 +22,9 @@ * * @param p Particle. */ +#ifndef SWIFT_GIZMO_HYDRO_SPH_GRADIENTS_H +#define SWIFT_GIZMO_HYDRO_SPH_GRADIENTS_H + __attribute__((always_inline)) INLINE static void hydro_gradients_init( struct part *p) { @@ -246,3 +249,5 @@ __attribute__((always_inline)) INLINE static void hydro_gradients_finalize( hydro_slope_limit_cell(p); } + +#endif /* SWIFT_GIZMO_HYDRO_SPH_GRADIENTS_H */ diff --git a/src/hydro/Gizmo/hydro_iact.h b/src/hydro/Gizmo/hydro_iact.h index c2ed5dfd6f..a42c3d6a77 100644 --- a/src/hydro/Gizmo/hydro_iact.h +++ b/src/hydro/Gizmo/hydro_iact.h @@ -18,6 +18,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************/ +#ifndef SWIFT_GIZMO_HYDRO_IACT_H +#define SWIFT_GIZMO_HYDRO_IACT_H #include "adiabatic_index.h" #include "hydro_gradients.h" @@ -486,3 +488,5 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_force( runner_iact_fluxes_common(r2, dx, hi, hj, pi, pj, 0); } + +#endif /* SWIFT_GIZMO_HYDRO_IACT_H */ diff --git a/src/hydro/Gizmo/hydro_io.h b/src/hydro/Gizmo/hydro_io.h index 72f75405de..aa26316d54 100644 --- a/src/hydro/Gizmo/hydro_io.h +++ b/src/hydro/Gizmo/hydro_io.h @@ -16,6 +16,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************/ +#ifndef SWIFT_GIZMO_HYDRO_IO_H +#define SWIFT_GIZMO_HYDRO_IO_H #include "adiabatic_index.h" #include "hydro.h" @@ -186,3 +188,5 @@ void hydro_write_flavour(hid_t h_grpsph) { * @return 1 if entropy is in 'internal energy', 0 otherwise. */ int writeEntropyFlag() { return 0; } + +#endif /* SWIFT_GIZMO_HYDRO_IO_H */ diff --git a/src/hydro/Gizmo/hydro_slope_limiters.h b/src/hydro/Gizmo/hydro_slope_limiters.h index cd66f05ac9..acf3364a05 100644 --- a/src/hydro/Gizmo/hydro_slope_limiters.h +++ b/src/hydro/Gizmo/hydro_slope_limiters.h @@ -91,4 +91,4 @@ __attribute__((always_inline)) INLINE static void hydro_slope_limit_cell( #endif -#endif // SWIFT_HYDRO_SLOPE_LIMITERS_H +#endif /* SWIFT_HYDRO_SLOPE_LIMITERS_H */ diff --git a/src/hydro/Gizmo/hydro_slope_limiters_cell.h b/src/hydro/Gizmo/hydro_slope_limiters_cell.h index aa99b43721..ccab0a5d00 100644 --- a/src/hydro/Gizmo/hydro_slope_limiters_cell.h +++ b/src/hydro/Gizmo/hydro_slope_limiters_cell.h @@ -16,6 +16,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************/ +#ifndef SWIFT_GIZMO_SLOPE_LIMITER_CELL_H +#define SWIFT_GIZMO_SLOPE_LIMITER_CELL_H #include <float.h> @@ -171,3 +173,5 @@ __attribute__((always_inline)) INLINE static void hydro_slope_limit_cell( p->primitives.gradients.P[2] *= alpha; } } + +#endif /* SWIFT_GIZMO_SLOPE_LIMITER_CELL_H */ diff --git a/src/hydro/Gizmo/hydro_slope_limiters_face.h b/src/hydro/Gizmo/hydro_slope_limiters_face.h index ba96063d66..0d96dc4d43 100644 --- a/src/hydro/Gizmo/hydro_slope_limiters_face.h +++ b/src/hydro/Gizmo/hydro_slope_limiters_face.h @@ -29,6 +29,9 @@ * @return The slope limited difference between the quantity at the particle * position and the quantity at the interface position. */ +#ifndef SWIFT_GIZMO_SLOPE_LIMITER_FACE_H +#define SWIFT_GIZMO_SLOPE_LIMITER_FACE_H + __attribute__((always_inline)) INLINE static float hydro_slope_limit_face_quantity(float phi_i, float phi_j, float phi_mid0, float xij_norm, float r) { @@ -127,3 +130,5 @@ __attribute__((always_inline)) INLINE static void hydro_slope_limit_face( dWj[4] = hydro_slope_limit_face_quantity(Wj[4], Wi[4], Wj[4] + dWj[4], xij_j_norm, r); } + +#endif /* SWIFT_GIZMO_SLOPE_LIMITER_FACE_H */ diff --git a/src/hydro/Gizmo/hydro_unphysical.h b/src/hydro/Gizmo/hydro_unphysical.h index 517e3e0918..1a8bf334f8 100644 --- a/src/hydro/Gizmo/hydro_unphysical.h +++ b/src/hydro/Gizmo/hydro_unphysical.h @@ -52,4 +52,4 @@ #endif // defined(GIZMO_UNPHYSICAL_ERROR) || defined(GIZMO_UNPHYSICAL_RESCUE) -#endif // SWIFT_HYDRO_UNPHYSICAL_H +#endif /* SWIFT_HYDRO_UNPHYSICAL_H */ diff --git a/src/hydro/Gizmo/hydro_velocities.h b/src/hydro/Gizmo/hydro_velocities.h index eef5d408e6..549d8eac34 100644 --- a/src/hydro/Gizmo/hydro_velocities.h +++ b/src/hydro/Gizmo/hydro_velocities.h @@ -152,4 +152,4 @@ __attribute__((always_inline)) INLINE static void hydro_velocities_set( } } -#endif // SWIFT_HYDRO_VELOCITIES_H +#endif /* SWIFT_HYDRO_VELOCITIES_H */ -- GitLab