diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index 5245c738e32b8f94bf58d7436d76b007b6808c1a..2b177a8a0d6abff8b2d7e83cb23b2950e3da2efe 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -766,8 +766,8 @@ INPUT += @top_srcdir@/src/stars/Default INPUT += @top_srcdir@/src/riemann INPUT += @top_srcdir@/src/potential/point_mass INPUT += @top_srcdir@/src/equation_of_state/ideal_gas -INPUT += @top_srcdir@/src/cooling/none -INPUT += @top_srcdir@/src/chemistry/none +INPUT += @top_srcdir@/src/cooling/EAGLE +INPUT += @top_srcdir@/src/chemistry/EAGLE # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -1993,6 +1993,7 @@ PREDEFINED = "__attribute__(x)= " PREDEFINED += HAVE_HDF5 PREDEFINED += WITH_MPI PREDEFINED += WITH_VECTORIZATION +PREDEFINED += __GNUC__ # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The diff --git a/src/align.h b/src/align.h index 243557ee0b4c6c0ae6d7ee75d92c50ec5e3b2f4a..6d329ae7983d68aee096f6f9e65990d5fed6a0f2 100644 --- a/src/align.h +++ b/src/align.h @@ -45,6 +45,7 @@ * * Note that this turns into a no-op but gives information to the compiler. * + * @param type The type of the array. * @param array The array. * @param alignment The alignment in bytes of the array. */ diff --git a/src/chemistry/EAGLE/chemistry.h b/src/chemistry/EAGLE/chemistry.h index 96a645806a495801f6165353cad9e1c87087f8e3..7f8a672669e1c5b1f8997ecf5971c63efee7522f 100644 --- a/src/chemistry/EAGLE/chemistry.h +++ b/src/chemistry/EAGLE/chemistry.h @@ -98,9 +98,12 @@ chemistry_part_has_no_neighbours(struct part* restrict p, * @brief Sets the chemistry properties of the (x-)particles to a valid start * state. * + * @param phys_const The physical constants in internal units. + * @param us The internal system of units. + * @param cosmo The current cosmological model. + * @param data The global chemistry information. * @param p Pointer to the particle data. * @param xp Pointer to the extended particle data. - * @param data The global chemistry information. */ __attribute__((always_inline)) INLINE static void chemistry_first_init_part( const struct phys_const* restrict phys_const, @@ -137,7 +140,7 @@ static INLINE void chemistry_init_backend(struct swift_params* parameter_file, for (int elem = 0; elem < chemistry_element_count; ++elem) { char buffer[50]; sprintf(buffer, "EAGLEChemistry:InitAbundance_%s", - chemistry_get_element_name(elem)); + chemistry_get_element_name((enum chemistry_element)elem)); data->initial_metal_mass_fraction[elem] = parser_get_param_float(parameter_file, buffer); diff --git a/src/chemistry/EAGLE/chemistry_io.h b/src/chemistry/EAGLE/chemistry_io.h index f87807579c46fe336f45e934d828318aed0377c7..a717318c1e649c3cede7ad833bce5d40dbff5d77 100644 --- a/src/chemistry/EAGLE/chemistry_io.h +++ b/src/chemistry/EAGLE/chemistry_io.h @@ -101,7 +101,7 @@ INLINE static int chemistry_write_particles(const struct part* parts, /** * @brief Writes the current model of SPH to the file - * @param h_grpsph The HDF5 group in which to write + * @param h_grp The HDF5 group in which to write */ INLINE static void chemistry_write_flavour(hid_t h_grp) { @@ -109,7 +109,8 @@ INLINE static void chemistry_write_flavour(hid_t h_grp) { for (int elem = 0; elem < chemistry_element_count; ++elem) { char buffer[20]; sprintf(buffer, "Element %d", elem); - io_write_attribute_s(h_grp, buffer, chemistry_get_element_name(elem)); + io_write_attribute_s(h_grp, buffer, chemistry_get_element_name( + (enum chemistry_element)elem)); } } #endif diff --git a/src/cooling/EAGLE/cooling.h b/src/cooling/EAGLE/cooling.h index f059d995c65cf791f0692ab5d8505f92c1a206ca..1c56572856a88d763d5ef7ca77e14d378891a264 100644 --- a/src/cooling/EAGLE/cooling.h +++ b/src/cooling/EAGLE/cooling.h @@ -79,9 +79,12 @@ __attribute__((always_inline)) INLINE static float cooling_timestep( * @brief Sets the cooling properties of the (x-)particles to a valid start * state. * + * @param phys_const The physical constants in internal units. + * @param us The internal system of units. + * @param cosmo The current cosmological model. + * @param cooling The properties of the cooling function. * @param p Pointer to the particle data. * @param xp Pointer to the extended particle data. - * @param cooling The properties of the cooling function. */ __attribute__((always_inline)) INLINE static void cooling_first_init_part( const struct phys_const* restrict phys_const, diff --git a/src/cooling/EAGLE/cooling_io.h b/src/cooling/EAGLE/cooling_io.h index d6ed4f122863be7b591b095b11803a3d2729f694..f98539605de5c231a821758e9bd8fdb89bd19a59 100644 --- a/src/cooling/EAGLE/cooling_io.h +++ b/src/cooling/EAGLE/cooling_io.h @@ -41,7 +41,7 @@ __attribute__((always_inline)) INLINE static void cooling_write_flavour( /** * @brief Specifies which particle fields to write to a dataset * - * @param parts The particle array. + * @param xparts The extended data particle array. * @param list The list of i/o properties to write. * @param cooling The #cooling_function_data * diff --git a/src/cosmology.c b/src/cosmology.c index dc612a0864c2bcc5254e10ddf490e38853d23bd4..e0ea1e9cd30610504821926720a73cb839e37312 100644 --- a/src/cosmology.c +++ b/src/cosmology.c @@ -614,7 +614,7 @@ double cosmology_get_therm_kick_factor(const struct cosmology *c, * @brief Compute the cosmic time (in internal units) between two points * on the integer time line. * - * @brief c The current #cosmology. + * @param c The current #cosmology. * @param ti_start the (integer) time of the start. * @param ti_end the (integer) time of the end. */ diff --git a/src/physical_constants.c b/src/physical_constants.c index 2c0ea6191b20e7786b0e2c55356b6c9decf7b0a4..097146a7a25e9e2fcc99c887b3767a2c0abc1feb 100644 --- a/src/physical_constants.c +++ b/src/physical_constants.c @@ -78,6 +78,11 @@ void phys_const_init(const struct unit_system *us, struct swift_params *params, const_thomson_cross_section_cgs / units_general_cgs_conversion_factor(us, dimension_thomson); + const float dimension_stefan[5] = {1, 0, -3, 0, -4}; + internal_const->const_stefan_boltzmann = + const_stefan_boltzmann_cgs / + units_general_cgs_conversion_factor(us, dimension_stefan); + const float dimension_ev[5] = {1, 2, -2, 0, 0}; internal_const->const_electron_volt = const_electron_volt_cgs / @@ -116,6 +121,11 @@ void phys_const_init(const struct unit_system *us, struct swift_params *params, internal_const->const_light_year = const_light_year_cgs / units_general_cgs_conversion_factor(us, dimension_length); + + const float dimension_temperature[5] = {0, 0, 0, 0, 1}; + internal_const->const_T_CMB_0 = + const_T_CMB_0_cgs / + units_general_cgs_conversion_factor(us, dimension_temperature); } /** diff --git a/src/physical_constants.h b/src/physical_constants.h index 606e7eeb584fc670c5c690aa9dfa683330ea3644..16628bfd6894699608e167d4b309fa5636209219 100644 --- a/src/physical_constants.h +++ b/src/physical_constants.h @@ -58,6 +58,9 @@ struct phys_const { /*! Thomson cross-section */ double const_thomson_cross_section; + /*! Stefan-Boltzmann constant */ + double const_stefan_boltzmann; + /*! Charge of the electron */ double const_electron_charge; @@ -87,6 +90,9 @@ struct phys_const { /*! Mass of the Earth */ double const_earth_mass; + + /*! Temperature of the CMB at present day */ + double const_T_CMB_0; }; void phys_const_init(const struct unit_system* us, struct swift_params* params, diff --git a/src/physical_constants_cgs.h b/src/physical_constants_cgs.h index 1d44dae491961b60a596ec85b5ca589411516079..f555d5df434cd583f2cff72556b9b1f8cbe5addf 100644 --- a/src/physical_constants_cgs.h +++ b/src/physical_constants_cgs.h @@ -29,6 +29,9 @@ * where all the constants are defined in the system of units specified * in the parameter file. * + * Of special interest if the value of G which is 0.03% different from the + * default value adopted by Gadget-2 (G = 6.672e-8). + * * All values are taken from C. Patrignani et al. (Particle Data Group), Chin. * Phys. C, 40, 100001 (2016) and 2017 update. * http://pdg.lbl.gov/2017/reviews/rpp2017-rev-phys-constants.pdf @@ -56,6 +59,9 @@ const double const_avogadro_number_cgs = 6.022140857e23; /*! Thomson cross-section [cm^2] */ const double const_thomson_cross_section_cgs = 6.6524587158e-25; +/*! Stefan-Boltzmann constant [g s^-3 K^-4] */ +const double const_stefan_boltzmann_cgs = 5.670367e-5; + /*! Elementary charge [A s^-1] */ const double const_electron_charge_cgs = 1.6021766208e-19; @@ -86,4 +92,7 @@ const double const_solar_mass_cgs = 1.98848e33; /*! Mass of the Earth [g] */ const double const_earth_mass_cgs = 5.9724e27; +/*! Temperature of the CMB at present day [K] */ +const double const_T_CMB_0_cgs = 2.72556; + #endif /* SWIFT_PHYSICAL_CONSTANTS_CGS_H */