diff --git a/src/adiabatic_index.h b/src/adiabatic_index.h index db94a074d624e9107c0474543ccbc3d78f149db9..d64968d736df0f0539a568632e8cf9c50a85145e 100644 --- a/src/adiabatic_index.h +++ b/src/adiabatic_index.h @@ -545,7 +545,6 @@ pow_three_gamma_minus_five_over_two(float x) { #endif } - /** * @brief Return the argument to the power three (adiabatic index - 1). * diff --git a/src/hydro/Gadget2/hydro.h b/src/hydro/Gadget2/hydro.h index 0beeafa87cc265bf2d686f2b78b03f8dc578fbb3..3fa6f19cc145890feacbd7284368d5378654bf38 100644 --- a/src/hydro/Gadget2/hydro.h +++ b/src/hydro/Gadget2/hydro.h @@ -390,7 +390,8 @@ hydro_set_drifted_physical_internal_energy(struct part *p, /* Compute the pressure */ float comoving_pressure = gas_pressure_from_entropy(p->rho, p->entropy); - comoving_pressure = pressure_floor_get_comoving_pressure(p, comoving_pressure, cosmo); + comoving_pressure = + pressure_floor_get_comoving_pressure(p, comoving_pressure, cosmo); /* Compute the sound speed */ const float soundspeed = @@ -595,7 +596,8 @@ __attribute__((always_inline)) INLINE static void hydro_prepare_force( /* Compute the pressure */ float comoving_pressure = gas_pressure_from_entropy(p->rho, p->entropy); - comoving_pressure = pressure_floor_get_comoving_pressure(p, comoving_pressure, cosmo); + comoving_pressure = + pressure_floor_get_comoving_pressure(p, comoving_pressure, cosmo); /* Compute the sound speed */ const float soundspeed = @@ -673,7 +675,8 @@ __attribute__((always_inline)) INLINE static void hydro_reset_predicted_values( /* Re-compute the pressure */ float comoving_pressure = gas_pressure_from_entropy(p->rho, p->entropy); - comoving_pressure = pressure_floor_get_comoving_pressure(p, comoving_pressure, cosmo); + comoving_pressure = + pressure_floor_get_comoving_pressure(p, comoving_pressure, cosmo); /* Compute the new sound speed */ const float soundspeed = @@ -740,7 +743,8 @@ __attribute__((always_inline)) INLINE static void hydro_predict_extra( /* Re-compute the pressure */ float comoving_pressure = gas_pressure_from_entropy(p->rho, p->entropy); - comoving_pressure = pressure_floor_get_comoving_pressure(p, comoving_pressure, cosmo); + comoving_pressure = + pressure_floor_get_comoving_pressure(p, comoving_pressure, cosmo); /* Compute the new sound speed */ const float soundspeed = @@ -852,7 +856,8 @@ __attribute__((always_inline)) INLINE static void hydro_convert_quantities( /* Compute the pressure */ float comoving_pressure = gas_pressure_from_entropy(p->rho, p->entropy); - comoving_pressure = pressure_floor_get_comoving_pressure(p, comoving_pressure, cosmo); + comoving_pressure = + pressure_floor_get_comoving_pressure(p, comoving_pressure, cosmo); /* Compute the sound speed */ const float soundspeed = diff --git a/src/hydro/GizmoMFM/hydro.h b/src/hydro/GizmoMFM/hydro.h index d10666034a3d40d382098da6b1c93136e76029fe..890c7f4c113e289e167247bb4978c1a362b8ff5d 100644 --- a/src/hydro/GizmoMFM/hydro.h +++ b/src/hydro/GizmoMFM/hydro.h @@ -501,7 +501,7 @@ __attribute__((always_inline)) INLINE static void hydro_reset_acceleration( */ __attribute__((always_inline)) INLINE static void hydro_reset_predicted_values( struct part* restrict p, const struct xpart* restrict xp, - const struct cosmology *cosmo) { + const struct cosmology* cosmo) { // MATTHIEU: Do we need something here? } diff --git a/src/hydro/GizmoMFV/hydro.h b/src/hydro/GizmoMFV/hydro.h index cfc347118d6b6c409565ad23b694de5d4b0f46b1..58a8a19dccd2dd102beb2803ec04f1f555cdcec2 100644 --- a/src/hydro/GizmoMFV/hydro.h +++ b/src/hydro/GizmoMFV/hydro.h @@ -543,7 +543,7 @@ __attribute__((always_inline)) INLINE static void hydro_reset_gradient( */ __attribute__((always_inline)) INLINE static void hydro_reset_predicted_values( struct part* restrict p, const struct xpart* restrict xp, - const struct cosmology *cosmo) { + const struct cosmology* cosmo) { // MATTHIEU: Apply the entropy floor here. } diff --git a/src/hydro/PressureEnergy/hydro.h b/src/hydro/PressureEnergy/hydro.h index ec34064d23f37fe84ae2fe5e759ce320dd52a28f..e43c69fd49f817664f7a664983794dffa379714a 100644 --- a/src/hydro/PressureEnergy/hydro.h +++ b/src/hydro/PressureEnergy/hydro.h @@ -212,21 +212,19 @@ hydro_get_drifted_physical_entropy(const struct part *restrict p, return gas_entropy_from_internal_energy(p->rho, p->u); } - /** * @brief Update the sound speed of a particle * * @param p The particle of interest. * @param cosmo The cosmological model. */ -__attribute__((always_inline)) INLINE static void -hydro_update_soundspeed(struct part *restrict p, - const struct cosmology *cosmo) { +__attribute__((always_inline)) INLINE static void hydro_update_soundspeed( + struct part *restrict p, const struct cosmology *cosmo) { /* Compute the sound speed -- see theory section for justification */ /* IDEAL GAS ONLY -- P-U does not work with generic EoS. */ const float comoving_pressure = - pressure_floor_get_comoving_pressure(p, p->pressure_bar, cosmo); + pressure_floor_get_comoving_pressure(p, p->pressure_bar, cosmo); p->force.soundspeed = sqrtf(hydro_gamma * comoving_pressure / p->rho); } @@ -656,7 +654,7 @@ __attribute__((always_inline)) INLINE static void hydro_prepare_force( /* Get the pressures */ const float comoving_pressure_with_floor = - pressure_floor_get_comoving_pressure(p, p->pressure_bar, cosmo); + pressure_floor_get_comoving_pressure(p, p->pressure_bar, cosmo); /* Update variables. */ p->force.f = grad_h_term; @@ -774,7 +772,7 @@ __attribute__((always_inline)) INLINE static void hydro_predict_extra( /* update the required variables */ const float comoving_pressure_with_floor = - pressure_floor_get_comoving_pressure(p, p->pressure_bar, cosmo); + pressure_floor_get_comoving_pressure(p, p->pressure_bar, cosmo); p->force.pressure_bar_with_floor = comoving_pressure_with_floor; } diff --git a/src/hydro/Shadowswift/hydro.h b/src/hydro/Shadowswift/hydro.h index 5ce4836e2089552b3e482fc87eb7054c3f7ea3b6..8c0454025180598baaeafb4032699cddb44b26d1 100644 --- a/src/hydro/Shadowswift/hydro.h +++ b/src/hydro/Shadowswift/hydro.h @@ -401,7 +401,7 @@ __attribute__((always_inline)) INLINE static void hydro_reset_acceleration( */ __attribute__((always_inline)) INLINE static void hydro_reset_predicted_values( struct part* restrict p, const struct xpart* restrict xp, - const struct cosmology *cosmo) {} + const struct cosmology* cosmo) {} /** * @brief Converts the hydrodynamic variables from the initial condition file to @@ -799,7 +799,7 @@ __attribute__((always_inline)) INLINE static float hydro_get_comoving_density( */ __attribute__((always_inline)) INLINE static float hydro_get_physical_internal_energy(const struct part* restrict p, - const struct xpart *restrict xp, + const struct xpart* restrict xp, const struct cosmology* cosmo) { return cosmo->a_factor_internal_energy * @@ -903,7 +903,7 @@ hydro_get_drifted_physical_internal_energy(const struct part* p, */ __attribute__((always_inline)) INLINE static float hydro_get_drifted_physical_entropy(const struct part* p, - const struct cosmology* cosmo) { + const struct cosmology* cosmo) { error("Need implementing"); return 0; diff --git a/src/hydro/Shadowswift/hydro_io.h b/src/hydro/Shadowswift/hydro_io.h index 2127361038df98b59bd51e29dbf2c2f529371a13..e6190e5a6740a758b4bc9b077dcaaf4661b6c261 100644 --- a/src/hydro/Shadowswift/hydro_io.h +++ b/src/hydro/Shadowswift/hydro_io.h @@ -143,7 +143,7 @@ INLINE static void hydro_write_particles(const struct part* parts, convert_part_pos, "Co-moving positions of the particles"); list[1] = io_make_output_field( - "Velocities", FLOAT, 3, UNIT_CONV_SPEED, 0.f, parts, primitives.v, + "Velocities", FLOAT, 3, UNIT_CONV_SPEED, 0.f, parts, primitives.v, "Peculiar velocities of the stars. This is (a * dx/dt) where x is the " "co-moving positions of the particles"); diff --git a/src/pressure_floor/GEAR/pressure_floor.h b/src/pressure_floor/GEAR/pressure_floor.h index 24d8777e1e84b8571d14d5b822ed4db1a79f884d..de9ad6cf4450005becade48022be1be481fc1cc9 100644 --- a/src/pressure_floor/GEAR/pressure_floor.h +++ b/src/pressure_floor/GEAR/pressure_floor.h @@ -20,10 +20,12 @@ #define SWIFT_PRESSURE_FLOOR_GEAR_H /* Forward declaration */ -__attribute__((always_inline)) static INLINE float pressure_floor_get_comoving_pressure( - const struct part* p, const float pressure, const struct cosmology *cosmo); -__attribute__((always_inline)) static INLINE float pressure_floor_get_physical_pressure( - const struct part* p, const float pressure, const struct cosmology *cosmo); +__attribute__((always_inline)) static INLINE float +pressure_floor_get_comoving_pressure(const struct part* p, const float pressure, + const struct cosmology* cosmo); +__attribute__((always_inline)) static INLINE float +pressure_floor_get_physical_pressure(const struct part* p, const float pressure, + const struct cosmology* cosmo); #include "adiabatic_index.h" #include "cosmology.h" @@ -63,15 +65,17 @@ struct pressure_floor_properties { * * @return The physical pressure with the floor. */ -__attribute__((always_inline)) static INLINE float pressure_floor_get_physical_pressure( - const struct part* p, const float pressure_physical, const struct cosmology *cosmo) { +__attribute__((always_inline)) static INLINE float +pressure_floor_get_physical_pressure(const struct part* p, + const float pressure_physical, + const struct cosmology* cosmo) { const float H_phys = p->h * cosmo->a_inv * kernel_gamma; const float rho = hydro_get_physical_density(p, cosmo); /* Compute the pressure floor */ float floor = H_phys * H_phys * rho * pressure_floor_props.constants - - p->pressure_floor_data.sigma2; + p->pressure_floor_data.sigma2; floor *= rho * hydro_one_over_gamma; return fmaxf(pressure_physical, floor); @@ -88,14 +92,17 @@ __attribute__((always_inline)) static INLINE float pressure_floor_get_physical_p * * @return The physical or comoving pressure with the floor. */ -__attribute__((always_inline)) static INLINE float pressure_floor_get_comoving_pressure( - const struct part* p, const float pressure_comoving, const struct cosmology *cosmo) { +__attribute__((always_inline)) static INLINE float +pressure_floor_get_comoving_pressure(const struct part* p, + const float pressure_comoving, + const struct cosmology* cosmo) { const float a_coef = pow_three_gamma_minus_one(cosmo->a); const float rho = hydro_get_comoving_density(p); - + /* Compute the pressure floor */ - float floor = kernel_gamma * kernel_gamma * p->h * p->h * rho * pressure_floor_props.constants; + float floor = kernel_gamma * kernel_gamma * p->h * p->h * rho * + pressure_floor_props.constants; floor -= p->pressure_floor_data.sigma2 * cosmo->a * cosmo->a; floor *= a_coef * rho * hydro_one_over_gamma; diff --git a/src/pressure_floor/GEAR/pressure_floor_iact.h b/src/pressure_floor/GEAR/pressure_floor_iact.h index a1928cc1503062276f32e245f38620013a5cdb3f..5ffb0b0097bb1d117e024f0e01e7babe1f838c40 100644 --- a/src/pressure_floor/GEAR/pressure_floor_iact.h +++ b/src/pressure_floor/GEAR/pressure_floor_iact.h @@ -55,15 +55,10 @@ __attribute__((always_inline)) INLINE static void runner_iact_pressure_floor( /* Compute the velocity dispersion */ const float a2H = a * a * H; - const float sigma[3] = { - dv[0] + a2H * dx[0], - dv[1] + a2H * dx[1], - dv[2] + a2H * dx[2] - }; + const float sigma[3] = {dv[0] + a2H * dx[0], dv[1] + a2H * dx[1], + dv[2] + a2H * dx[2]}; const float sigma2 = - sigma[0] * sigma[0] + - sigma[1] * sigma[1] + - sigma[2] * sigma[2]; + sigma[0] * sigma[0] + sigma[1] * sigma[1] + sigma[2] * sigma[2]; /* Compute the velocity dispersion */ pi->pressure_floor_data.sigma2 += sigma2 * wi * hydro_get_mass(pj); @@ -97,15 +92,10 @@ runner_iact_nonsym_pressure_floor(float r2, const float *dx, float hi, float hj, /* Compute the velocity dispersion */ const float a2H = a * a * H; - const float sigma[3] = { - dv[0] + a2H * dx[0], - dv[1] + a2H * dx[1], - dv[2] + a2H * dx[2] - }; + const float sigma[3] = {dv[0] + a2H * dx[0], dv[1] + a2H * dx[1], + dv[2] + a2H * dx[2]}; const float sigma2 = - sigma[0] * sigma[0] + - sigma[1] * sigma[1] + - sigma[2] * sigma[2]; + sigma[0] * sigma[0] + sigma[1] * sigma[1] + sigma[2] * sigma[2]; /* Compute the velocity dispersion */ pi->pressure_floor_data.sigma2 += sigma2 * wi * hydro_get_mass(pj); diff --git a/src/pressure_floor/none/pressure_floor.h b/src/pressure_floor/none/pressure_floor.h index 3d316fbaf0dd7dcd8cbc48978bbae303cdb2852f..84db9cbaf682b36fa68abc7d26273e15cd1da191 100644 --- a/src/pressure_floor/none/pressure_floor.h +++ b/src/pressure_floor/none/pressure_floor.h @@ -49,7 +49,8 @@ struct pressure_floor_properties {}; * @return The physical pressure with the floor. */ static INLINE float pressure_floor_get_physical_pressure( - const struct part* p, const float physical_pressure, const struct cosmology *cosmo) { + const struct part* p, const float physical_pressure, + const struct cosmology* cosmo) { return physical_pressure; } @@ -65,7 +66,8 @@ static INLINE float pressure_floor_get_physical_pressure( * @return The comoving pressure with the floor. */ static INLINE float pressure_floor_get_comoving_pressure( - const struct part* p, const float comoving_pressure, const struct cosmology *cosmo) { + const struct part* p, const float comoving_pressure, + const struct cosmology* cosmo) { return comoving_pressure; }