diff --git a/src/hydro/Gadget2/hydro.h b/src/hydro/Gadget2/hydro.h index 09a8f50d5b2e9abd43c3b9bd43a12fad8a347258..2b17505c36f345779b269c90758931a13f9b4e0d 100644 --- a/src/hydro/Gadget2/hydro.h +++ b/src/hydro/Gadget2/hydro.h @@ -19,6 +19,18 @@ #ifndef SWIFT_GADGET2_HYDRO_H #define SWIFT_GADGET2_HYDRO_H +/** + * @file Gadget2/hydro.h + * @brief SPH interaction functions following the Gadget-2 version of SPH. + * + * The interactions computed here are the ones presented in the Gadget-2 paper + * Springel, V., MNRAS, Volume 364, Issue 4, pp. 1105-1134. + * We use the same numerical coefficients as the Gadget-2 code. When used with + * the Spline-3 kernel, the results should be equivalent to the ones obtained + * with Gadget-2 up to the rounding errors and interactions missed by the + * Gadget-2 tree-code neighbours search. + */ + #include "adiabatic_index.h" #include "approx_math.h" #include "dimension.h" diff --git a/src/hydro/Gadget2/hydro_iact.h b/src/hydro/Gadget2/hydro_iact.h index 82e98e87d0a50ee4346d272c7fbd1ba3f4316fc7..5ee8cd0370a970aa83cef3d1c8909d923c12ba24 100644 --- a/src/hydro/Gadget2/hydro_iact.h +++ b/src/hydro/Gadget2/hydro_iact.h @@ -20,18 +20,20 @@ #ifndef SWIFT_GADGET2_HYDRO_IACT_H #define SWIFT_GADGET2_HYDRO_IACT_H -#include "minmax.h" - /** + * @file Gadget2/hydro_iact.h * @brief SPH interaction functions following the Gadget-2 version of SPH. * * The interactions computed here are the ones presented in the Gadget-2 paper - * and use the same numerical coefficients as the Gadget-2 code. When used with + * Springel, V., MNRAS, Volume 364, Issue 4, pp. 1105-1134. + * We use the same numerical coefficients as the Gadget-2 code. When used with * the Spline-3 kernel, the results should be equivalent to the ones obtained * with Gadget-2 up to the rounding errors and interactions missed by the * Gadget-2 tree-code neighbours search. */ +#include "minmax.h" + /** * @brief Density loop */ diff --git a/src/hydro/Gadget2/hydro_part.h b/src/hydro/Gadget2/hydro_part.h index eac324c90c30aff6a54c7f961fe40b0ddf811c14..2c12a71ad6256d7372256b6e590790ee0ff4e22e 100644 --- a/src/hydro/Gadget2/hydro_part.h +++ b/src/hydro/Gadget2/hydro_part.h @@ -19,6 +19,18 @@ #ifndef SWIFT_GADGET2_HYDRO_PART_H #define SWIFT_GADGET2_HYDRO_PART_H +/** + * @file Gadget2/hydro_part.h + * @brief SPH interaction functions following the Gadget-2 version of SPH. + * + * The interactions computed here are the ones presented in the Gadget-2 paper + * Springel, V., MNRAS, Volume 364, Issue 4, pp. 1105-1134. + * We use the same numerical coefficients as the Gadget-2 code. When used with + * the Spline-3 kernel, the results should be equivalent to the ones obtained + * with Gadget-2 up to the rounding errors and interactions missed by the + * Gadget-2 tree-code neighbours search. + */ + #include "cooling_struct.h" /* Extra particle data not needed during the SPH loops over neighbours. */ diff --git a/src/hydro/Minimal/hydro.h b/src/hydro/Minimal/hydro.h index 0bbc77f4a2384c79f7d3329c20b92990598d5c63..eeb389537c56876126c60b2d29a728029c72844b 100644 --- a/src/hydro/Minimal/hydro.h +++ b/src/hydro/Minimal/hydro.h @@ -29,9 +29,8 @@ * term is implemented. * * This corresponds to equations (43), (44), (45), (101), (103) and (104) with - * \f$\beta=3\f$ and \f$\alpha_u=0\f$ of - * Price, D., Journal of Computational Physics, 2012, Volume 231, Issue 3, - * pp. 759-794. + * \f$\beta=3\f$ and \f$\alpha_u=0\f$ of Price, D., Journal of Computational + * Physics, 2012, Volume 231, Issue 3, pp. 759-794. */ #include "adiabatic_index.h" diff --git a/src/hydro/Minimal/hydro_iact.h b/src/hydro/Minimal/hydro_iact.h index 9e2028c978dc7cad03cfba17931f645bbfbfe1a0..edb060e4fd71fcc136e1bedf6e8a752d1d50d54f 100644 --- a/src/hydro/Minimal/hydro_iact.h +++ b/src/hydro/Minimal/hydro_iact.h @@ -28,9 +28,8 @@ * term is implemented. * * This corresponds to equations (43), (44), (45), (101), (103) and (104) with - * \f$\beta=3\f$ and \f$\alpha_u=0\f$ of - * Price, D., Journal of Computational Physics, 2012, Volume 231, Issue 3, - * pp. 759-794. + * \f$\beta=3\f$ and \f$\alpha_u=0\f$ of Price, D., Journal of Computational + * Physics, 2012, Volume 231, Issue 3, pp. 759-794. */ #include "adiabatic_index.h" diff --git a/src/hydro/Minimal/hydro_part.h b/src/hydro/Minimal/hydro_part.h index c83797b42b73f8cd8dd5bc993053769ba0cd354e..8e23bddf5153043421319810683266b27d297f93 100644 --- a/src/hydro/Minimal/hydro_part.h +++ b/src/hydro/Minimal/hydro_part.h @@ -28,9 +28,8 @@ * term is implemented. * * This corresponds to equations (43), (44), (45), (101), (103) and (104) with - * \f$\beta=3\f$ and \f$\alpha_u=0\f$ of - * Price, D., Journal of Computational Physics, 2012, Volume 231, Issue 3, - * pp. 759-794. + * \f$\beta=3\f$ and \f$\alpha_u=0\f$ of Price, D., Journal of Computational + * Physics, 2012, Volume 231, Issue 3, pp. 759-794. */ #include "cooling_struct.h" @@ -44,13 +43,14 @@ */ struct xpart { - float x_diff[3]; /*!< Offset between current position and position at last - tree rebuild. */ + /*! Offset between current position and position at last tree rebuild. */ + float x_diff[3]; - float v_full[3]; /*!< Velocity at the last full step. */ + /*! Velocity at the last full step. */ + float v_full[3]; - struct cooling_xpart_data - cooling_data; /*!< Additional data used to record cooling information */ + /*! Additional data used to record cooling information */ + struct cooling_xpart_data cooling_data; } SWIFT_STRUCT_ALIGN; @@ -63,27 +63,38 @@ struct xpart { */ struct part { - double x[3]; /*!< Particle position. */ + /*! Particle position. */ + double x[3]; - float v[3]; /*!< Particle predicted velocity. */ + /*! Particle predicted velocity. */ + float v[3]; - float a_hydro[3]; /*!< Particle acceleration. */ + /*! Particle acceleration. */ + float a_hydro[3]; - float mass; /*!< Particle mass. */ + /*! Particle mass. */ + float mass; - float h; /*!< Particle smoothing length. */ + /*! Particle smoothing length. */ + float h; - int ti_begin; /*!< Time at the beginning of time-step. */ + /*! Time at the beginning of time-step. */ + int ti_begin; - int ti_end; /*!< Time at the end of time-step. */ + /*! Time at the end of time-step. */ + int ti_end; - float u; /*!< Particle internal energy. */ + /*! Particle internal energy. */ + float u; - float u_dt; /*!< Time derivative of the internal energy. */ + /*! Time derivative of the internal energy. */ + float u_dt; - float rho; /*!< Particle density. */ + /*! Particle density. */ + float rho; - float rho_dh; /*!< Derivative of density with respect to h */ + /*! Derivative of density with respect to h */ + float rho_dh; /* Store density/force specific stuff. */ union { @@ -97,10 +108,12 @@ struct part { */ struct { - float wcount; /*!< Neighbour number count. */ + /*! Neighbour number count. */ + float wcount; + + /*! Derivative of the neighbour number with respect to h. */ + float wcount_dh; - float wcount_dh; /*!< Derivative of the neighbour number with respect to - h. */ } density; /** @@ -112,19 +125,24 @@ struct part { */ struct { - float pressure; /*!< Particle pressure. */ + /*! Particle pressure. */ + float pressure; - float v_sig; /*!< Particle signal velocity */ + /*! Particle signal velocity */ + float v_sig; - float h_dt; /*!< Time derivative of smoothing length */ + /*! Time derivative of smoothing length */ + float h_dt; } force; }; - long long id; /*!< Particle unique ID. */ + /*! Particle unique ID. */ + long long id; - struct gpart* gpart; /*!< Pointer to corresponding gravity part. */ + /*! Pointer to corresponding gravity part. */ + struct gpart* gpart; -} __attribute__((aligned(part_align))); +} SWIFT_STRUCT_ALIGN; #endif /* SWIFT_MINIMAL_HYDRO_PART_H */