Commit 33eeb8ad authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Add header guards to all the Gizmo files. Also use a more uniform style for the existing ones.

parent cb2debe8
......@@ -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 */
......@@ -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 */
/*******************************************************************************
* 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 */
......@@ -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 */
......@@ -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 */
......@@ -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 */
......@@ -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 */
......@@ -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 */
......@@ -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 */
......@@ -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 */
......@@ -52,4 +52,4 @@
#endif // defined(GIZMO_UNPHYSICAL_ERROR) || defined(GIZMO_UNPHYSICAL_RESCUE)
#endif // SWIFT_HYDRO_UNPHYSICAL_H
#endif /* SWIFT_HYDRO_UNPHYSICAL_H */
......@@ -152,4 +152,4 @@ __attribute__((always_inline)) INLINE static void hydro_velocities_set(
}
}
#endif // SWIFT_HYDRO_VELOCITIES_H
#endif /* SWIFT_HYDRO_VELOCITIES_H */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment