From 2df3e4e812c270b2be9d0f8b80d8ff0c4fdfa9a5 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <schaller@strw.leidenuniv.nl> Date: Sat, 18 Jan 2025 20:37:46 +0100 Subject: [PATCH] Post-merge fixes --- src/mhd/DirectInduction/mhd.h | 8 +++----- src/mhd/DirectInduction/mhd_iact.h | 5 ++--- src/mhd/DirectInduction/mhd_struct.h | 1 - src/rt/none/rt_iact.h | 16 ++++++++-------- src/runner_time_integration.c | 4 ++-- 5 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/mhd/DirectInduction/mhd.h b/src/mhd/DirectInduction/mhd.h index 5dbe0b01a8..00826cdc25 100644 --- a/src/mhd/DirectInduction/mhd.h +++ b/src/mhd/DirectInduction/mhd.h @@ -110,10 +110,11 @@ __attribute__((always_inline)) INLINE static float mhd_get_divB_error( p->mhd_data.B_over_rho[1] * p->mhd_data.B_over_rho[1] + p->mhd_data.B_over_rho[2] * p->mhd_data.B_over_rho[2]; - const float error = B_over_rho2 != 0.0f ? fabs(p->mhd_data.divB) * p->h / sqrtf(B_over_rho2 * rho * rho) : 0.0f; + const float error = B_over_rho2 != 0.0f ? fabs(p->mhd_data.divB) * p->h / + sqrtf(B_over_rho2 * rho * rho) + : 0.0f; return error; - } /** @@ -450,7 +451,6 @@ __attribute__((always_inline)) INLINE static void mhd_prepare_force( xp->mhd_data.psi_over_ch_full += p->mhd_data.psi_over_ch_dt * dt_alpha; p->mhd_data.psi_over_ch = xp->mhd_data.psi_over_ch_full; - } /** @@ -531,7 +531,6 @@ __attribute__((always_inline)) INLINE static void mhd_predict_extra( p->mhd_data.B_over_rho[2] += p->mhd_data.B_over_rho_dt[2] * dt_therm; p->mhd_data.psi_over_ch += p->mhd_data.psi_over_ch_dt * dt_therm; - } /** @@ -634,7 +633,6 @@ __attribute__((always_inline)) INLINE static void mhd_convert_quantities( xp->mhd_data.B_over_rho_full[2] = p->mhd_data.B_over_rho[2]; xp->mhd_data.psi_over_ch_full = p->mhd_data.psi_over_ch; - } /** diff --git a/src/mhd/DirectInduction/mhd_iact.h b/src/mhd/DirectInduction/mhd_iact.h index 7ce356989d..104a492e66 100644 --- a/src/mhd/DirectInduction/mhd_iact.h +++ b/src/mhd/DirectInduction/mhd_iact.h @@ -54,9 +54,8 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_mhd_density(const float r2, const float dx[3], const float hi, const float hj, struct part *restrict pi, - const struct part *restrict pj, - const float mu_0, const float a, - const float H) {} + const struct part *restrict pj, const float mu_0, + const float a, const float H) {} /** * @brief Calculate the MHD-gradient interaction between particle i and particle diff --git a/src/mhd/DirectInduction/mhd_struct.h b/src/mhd/DirectInduction/mhd_struct.h index 35cf7e0055..67054a31af 100644 --- a/src/mhd/DirectInduction/mhd_struct.h +++ b/src/mhd/DirectInduction/mhd_struct.h @@ -82,7 +82,6 @@ struct mhd_xpart_data { /*! Full Step Dedner Scalar */ float psi_over_ch_full; - }; #endif /* SWIFT_DIRECT_INDUCTION_MHD_STRUCT_H */ diff --git a/src/rt/none/rt_iact.h b/src/rt/none/rt_iact.h index af1ad67e6a..0ebab0a45b 100644 --- a/src/rt/none/rt_iact.h +++ b/src/rt/none/rt_iact.h @@ -79,8 +79,8 @@ __attribute__((always_inline)) INLINE static void runner_iact_rt_inject( */ __attribute__((always_inline)) INLINE static void runner_iact_rt_transport( const float r2, const float dx[3], const float hi, const float hj, - struct part *restrict pi, struct part *restrict pj, const float a, - const float H) {} + struct part *restrict pi, struct part *restrict pj, const float mu_0, + const float a, const float H) {} /** * @brief Flux calculation between particle i and particle j: non-symmetric @@ -100,8 +100,8 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_rt_transport(const float r2, const float dx[3], const float hi, const float hj, struct part *restrict pi, - struct part *restrict pj, const float a, - const float H) {} + struct part *restrict pj, const float mu_0, + const float a, const float H) {} /** * @brief Calculate the gradient interaction between particle i and particle j @@ -118,8 +118,8 @@ runner_iact_nonsym_rt_transport(const float r2, const float dx[3], */ __attribute__((always_inline)) INLINE static void runner_iact_rt_gradient( const float r2, const float dx[3], const float hi, const float hj, - struct part *restrict pi, struct part *restrict pj, const float a, - const float H) {} + struct part *restrict pi, struct part *restrict pj, const float mu_0, + const float a, const float H) {} /** * @brief Calculate the gradient interaction between particle i and particle j: @@ -139,7 +139,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_rt_gradient(const float r2, const float dx[3], const float hi, const float hj, struct part *restrict pi, - struct part *restrict pj, const float a, - const float H) {} + struct part *restrict pj, const float mu_0, + const float a, const float H) {} #endif /* SWIFT_RT_IACT_NONE_H */ diff --git a/src/runner_time_integration.c b/src/runner_time_integration.c index 6ebb0a5a19..4b2417af68 100644 --- a/src/runner_time_integration.c +++ b/src/runner_time_integration.c @@ -461,8 +461,8 @@ void runner_do_kick2(struct runner *r, struct cell *c, const int timer) { /* Prepare the values to be drifted */ hydro_reset_predicted_values(p, xp, cosmo, pressure_floor); - mhd_reset_predicted_values(p, xp , cosmo); - } + mhd_reset_predicted_values(p, xp, cosmo); + } } /* Loop over the g-particles in this cell. */ -- GitLab