Commit b5eff331 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Style improvements in cooling function signatures

parent 45221cef
...@@ -325,8 +325,9 @@ eagle_helium_reionization_extraheat( ...@@ -325,8 +325,9 @@ eagle_helium_reionization_extraheat(
* TO DO: outside table ranges, it uses at the moment the minimum, maximu value * TO DO: outside table ranges, it uses at the moment the minimum, maximu value
*/ */
__attribute__((always_inline)) INLINE static float colibre_convert_u_to_temp( __attribute__((always_inline)) INLINE static float colibre_convert_u_to_temp(
const double log_10_u_cgs, const float redshift, int n_H_index, float d_n_H, const double log_10_u_cgs, const float redshift, const int n_H_index,
int met_index, float d_met, int red_index, float d_red, const float d_n_H, const int met_index, const float d_met,
const int red_index, const float d_red,
const struct cooling_function_data *cooling) { const struct cooling_function_data *cooling) {
/* Get index of u along the internal energy axis */ /* Get index of u along the internal energy axis */
...@@ -377,8 +378,9 @@ __attribute__((always_inline)) INLINE static float colibre_convert_u_to_temp( ...@@ -377,8 +378,9 @@ __attribute__((always_inline)) INLINE static float colibre_convert_u_to_temp(
* TO DO: outside table ranges, it uses at the moment the minimum, maximu value * TO DO: outside table ranges, it uses at the moment the minimum, maximu value
*/ */
__attribute__((always_inline)) INLINE static float colibre_convert_temp_to_u( __attribute__((always_inline)) INLINE static float colibre_convert_temp_to_u(
const double log_10_T, const float redshift, int n_H_index, float d_n_H, const double log_10_T, const float redshift, const int n_H_index,
int met_index, float d_met, int red_index, float d_red, const float d_n_H, const int met_index, const float d_met,
const int red_index, const float d_red,
const struct cooling_function_data *cooling) { const struct cooling_function_data *cooling) {
/* Get index of u along the internal energy axis */ /* Get index of u along the internal energy axis */
...@@ -421,9 +423,10 @@ __attribute__((always_inline)) INLINE static float colibre_convert_temp_to_u( ...@@ -421,9 +423,10 @@ __attribute__((always_inline)) INLINE static float colibre_convert_temp_to_u(
* @return linear electron density in cm-3 (NOT the electron fraction) * @return linear electron density in cm-3 (NOT the electron fraction)
*/ */
INLINE static float colibre_meanparticlemass_temperature( INLINE static float colibre_meanparticlemass_temperature(
double log_T_cgs, double redshift, double n_H_cgs, float ZZsol, const double log_T_cgs, const double redshift, const double n_H_cgs,
int n_H_index, float d_n_H, int met_index, float d_met, int red_index, const float ZZsol, const int n_H_index, const float d_n_H,
float d_red, const struct cooling_function_data *cooling) { const int met_index, const float d_met, const int red_index,
const float d_red, const struct cooling_function_data *cooling) {
/* Get index of T along the temperature axis */ /* Get index of T along the temperature axis */
int T_index; int T_index;
...@@ -460,9 +463,11 @@ INLINE static float colibre_meanparticlemass_temperature( ...@@ -460,9 +463,11 @@ INLINE static float colibre_meanparticlemass_temperature(
* @return linear electron density in cm-3 (NOT the electron fraction) * @return linear electron density in cm-3 (NOT the electron fraction)
*/ */
INLINE static float colibre_electron_density( INLINE static float colibre_electron_density(
double log_u_cgs, double redshift, double n_H_cgs, float ZZsol, const double log_u_cgs, const double redshift, const double n_H_cgs,
const float abundance_ratio[colibre_cooling_N_elementtypes], int n_H_index, const float ZZsol,
float d_n_H, int met_index, float d_met, int red_index, float d_red, const float abundance_ratio[colibre_cooling_N_elementtypes],
const int n_H_index, const float d_n_H, const int met_index,
const float d_met, const int red_index, const float d_red,
const struct cooling_function_data *cooling) { const struct cooling_function_data *cooling) {
/* Get index of u along the internal energy axis */ /* Get index of u along the internal energy axis */
...@@ -503,9 +508,11 @@ INLINE static float colibre_electron_density( ...@@ -503,9 +508,11 @@ INLINE static float colibre_electron_density(
* @return linear electron density in cm-3 (NOT the electron fraction) * @return linear electron density in cm-3 (NOT the electron fraction)
*/ */
INLINE static float colibre_electron_density_temperature( INLINE static float colibre_electron_density_temperature(
double log_T_cgs, double redshift, double n_H_cgs, float ZZsol, const double log_T_cgs, const double redshift, const double n_H_cgs,
const float abundance_ratio[colibre_cooling_N_elementtypes], int n_H_index, const float ZZsol,
float d_n_H, int met_index, float d_met, int red_index, float d_red, const float abundance_ratio[colibre_cooling_N_elementtypes],
const int n_H_index, const float d_n_H, const int met_index,
const float d_met, const int red_index, const float d_red,
const struct cooling_function_data *cooling) { const struct cooling_function_data *cooling) {
/* Get index of u along the internal energy axis */ /* Get index of u along the internal energy axis */
...@@ -527,7 +534,7 @@ INLINE static float colibre_electron_density_temperature( ...@@ -527,7 +534,7 @@ INLINE static float colibre_electron_density_temperature(
} }
/** /**
* @brief Computes the net cooling rate (cooling - heating) for a given element * @brief Computes the net cooling rate (heating - cooling) for a given element
* abundance ratio, internal energy, redshift, and density. The unit of the net * abundance ratio, internal energy, redshift, and density. The unit of the net
* cooling rate is Lambda / nH**2 [erg cm^3 s-1] and all input values are in * cooling rate is Lambda / nH**2 [erg cm^3 s-1] and all input values are in
* cgs. The Compton cooling is not taken from the tables but calculated * cgs. The Compton cooling is not taken from the tables but calculated
...@@ -554,11 +561,12 @@ INLINE static float colibre_electron_density_temperature( ...@@ -554,11 +561,12 @@ INLINE static float colibre_electron_density_temperature(
* These are only used for testing: examples/CoolingRates/CoolingRatesCOLIBRE * These are only used for testing: examples/CoolingRates/CoolingRatesCOLIBRE
*/ */
INLINE static double colibre_cooling_rate( INLINE static double colibre_cooling_rate(
double log_u_cgs, double redshift, double n_H_cgs, const double log_u_cgs, const double redshift, const double n_H_cgs,
const float abundance_ratio[colibre_cooling_N_elementtypes], int n_H_index, const float abundance_ratio[colibre_cooling_N_elementtypes],
float d_n_H, int met_index, float d_met, int red_index, float d_red, const int n_H_index, const float d_n_H, const int met_index,
const struct cooling_function_data *cooling, int onlyicool, int onlyiheat, const float d_met, const int red_index, const float d_red,
int icool, int iheat) { const struct cooling_function_data *cooling, const int onlyicool,
const int onlyiheat, const int icool, const int iheat) {
/* Set weights for cooling rates */ /* Set weights for cooling rates */
float weights_cooling[colibre_cooling_N_cooltypes - 2]; float weights_cooling[colibre_cooling_N_cooltypes - 2];
...@@ -702,11 +710,12 @@ INLINE static double colibre_cooling_rate( ...@@ -702,11 +710,12 @@ INLINE static double colibre_cooling_rate(
* These are only used for testing: examples/CoolingRates/CoolingRatesCOLIBRE * These are only used for testing: examples/CoolingRates/CoolingRatesCOLIBRE
*/ */
INLINE static double colibre_cooling_rate_temperature( INLINE static double colibre_cooling_rate_temperature(
double log_T_cgs, double redshift, double n_H_cgs, const double log_T_cgs, const double redshift, const double n_H_cgs,
const float abundance_ratio[colibre_cooling_N_elementtypes], int n_H_index, const float abundance_ratio[colibre_cooling_N_elementtypes],
float d_n_H, int met_index, float d_met, int red_index, float d_red, const int n_H_index, const float d_n_H, const int met_index,
const struct cooling_function_data *cooling, int onlyicool, int onlyiheat, const float d_met, const int red_index, const float d_red,
int icool, int iheat) { const struct cooling_function_data *cooling, const int onlyicool,
const int onlyiheat, const int icool, const int iheat) {
/* Set weights for cooling rates */ /* Set weights for cooling rates */
float weights_cooling[colibre_cooling_N_cooltypes - 2]; float weights_cooling[colibre_cooling_N_cooltypes - 2];
......
...@@ -230,8 +230,9 @@ eagle_helium_reionization_extraheat( ...@@ -230,8 +230,9 @@ eagle_helium_reionization_extraheat(
* TO DO: outside table ranges, it uses at the moment the minimum, maximu value * TO DO: outside table ranges, it uses at the moment the minimum, maximu value
*/ */
__attribute__((always_inline)) INLINE static float qla_convert_u_to_temp( __attribute__((always_inline)) INLINE static float qla_convert_u_to_temp(
const double log_10_u_cgs, const float redshift, int n_H_index, float d_n_H, const double log_10_u_cgs, const float redshift, const int n_H_index,
int met_index, float d_met, int red_index, float d_red, const float d_n_H, const int met_index, const float d_met,
const int red_index, const float d_red,
const struct cooling_function_data *cooling) { const struct cooling_function_data *cooling) {
/* Get index of u along the internal energy axis */ /* Get index of u along the internal energy axis */
...@@ -281,8 +282,9 @@ __attribute__((always_inline)) INLINE static float qla_convert_u_to_temp( ...@@ -281,8 +282,9 @@ __attribute__((always_inline)) INLINE static float qla_convert_u_to_temp(
* TO DO: outside table ranges, it uses at the moment the minimum, maximu value * TO DO: outside table ranges, it uses at the moment the minimum, maximu value
*/ */
__attribute__((always_inline)) INLINE static float qla_convert_temp_to_u( __attribute__((always_inline)) INLINE static float qla_convert_temp_to_u(
const double log_10_T, const float redshift, int n_H_index, float d_n_H, const double log_10_T, const float redshift, const int n_H_index,
int met_index, float d_met, int red_index, float d_red, const float d_n_H, const int met_index, const float d_met,
const int red_index, const float d_red,
const struct cooling_function_data *cooling) { const struct cooling_function_data *cooling) {
/* Get index of u along the internal energy axis */ /* Get index of u along the internal energy axis */
...@@ -324,9 +326,10 @@ __attribute__((always_inline)) INLINE static float qla_convert_temp_to_u( ...@@ -324,9 +326,10 @@ __attribute__((always_inline)) INLINE static float qla_convert_temp_to_u(
* @return linear electron density in cm-3 (NOT the electron fraction) * @return linear electron density in cm-3 (NOT the electron fraction)
*/ */
INLINE static float qla_meanparticlemass_temperature( INLINE static float qla_meanparticlemass_temperature(
double log_T_cgs, double redshift, double n_H_cgs, float ZZsol, const double log_T_cgs, const double redshift, const double n_H_cgs,
int n_H_index, float d_n_H, int met_index, float d_met, int red_index, const float ZZsol, const int n_H_index, const float d_n_H,
float d_red, const struct cooling_function_data *cooling) { const int met_index, const float d_met, const int red_index,
const float d_red, const struct cooling_function_data *cooling) {
/* Get index of T along the temperature axis */ /* Get index of T along the temperature axis */
int T_index; int T_index;
...@@ -363,9 +366,10 @@ INLINE static float qla_meanparticlemass_temperature( ...@@ -363,9 +366,10 @@ INLINE static float qla_meanparticlemass_temperature(
* @return linear electron density in cm-3 (NOT the electron fraction) * @return linear electron density in cm-3 (NOT the electron fraction)
*/ */
INLINE static float qla_electron_density( INLINE static float qla_electron_density(
double log_u_cgs, double redshift, double n_H_cgs, float ZZsol, const double log_u_cgs, const double redshift, const double n_H_cgs,
const float abundance_ratio[qla_cooling_N_elementtypes], int n_H_index, const float ZZsol, const float abundance_ratio[qla_cooling_N_elementtypes],
float d_n_H, int met_index, float d_met, int red_index, float d_red, const int n_H_index, const float d_n_H, const int met_index,
const float d_met, const int red_index, const float d_red,
const struct cooling_function_data *cooling) { const struct cooling_function_data *cooling) {
/* Get index of u along the internal energy axis */ /* Get index of u along the internal energy axis */
...@@ -406,9 +410,10 @@ INLINE static float qla_electron_density( ...@@ -406,9 +410,10 @@ INLINE static float qla_electron_density(
* @return linear electron density in cm-3 (NOT the electron fraction) * @return linear electron density in cm-3 (NOT the electron fraction)
*/ */
INLINE static float qla_electron_density_temperature( INLINE static float qla_electron_density_temperature(
double log_T_cgs, double redshift, double n_H_cgs, float ZZsol, const double log_T_cgs, const double redshift, const double n_H_cgs,
const float abundance_ratio[qla_cooling_N_elementtypes], int n_H_index, const float ZZsol, const float abundance_ratio[qla_cooling_N_elementtypes],
float d_n_H, int met_index, float d_met, int red_index, float d_red, const int n_H_index, const float d_n_H, const int met_index,
const float d_met, const int red_index, const float d_red,
const struct cooling_function_data *cooling) { const struct cooling_function_data *cooling) {
/* Get index of u along the internal energy axis */ /* Get index of u along the internal energy axis */
...@@ -430,7 +435,7 @@ INLINE static float qla_electron_density_temperature( ...@@ -430,7 +435,7 @@ INLINE static float qla_electron_density_temperature(
} }
/** /**
* @brief Computes the net cooling rate (cooling - heating) for a given element * @brief Computes the net cooling rate (heating - cooling) for a given element
* abundance ratio, internal energy, redshift, and density. The unit of the net * abundance ratio, internal energy, redshift, and density. The unit of the net
* cooling rate is Lambda / nH**2 [erg cm^3 s-1] and all input values are in * cooling rate is Lambda / nH**2 [erg cm^3 s-1] and all input values are in
* cgs. The Compton cooling is not taken from the tables but calculated * cgs. The Compton cooling is not taken from the tables but calculated
...@@ -457,11 +462,12 @@ INLINE static float qla_electron_density_temperature( ...@@ -457,11 +462,12 @@ INLINE static float qla_electron_density_temperature(
* These are only used for testing. * These are only used for testing.
*/ */
INLINE static double qla_cooling_rate( INLINE static double qla_cooling_rate(
double log_u_cgs, double redshift, double n_H_cgs, const double log_u_cgs, const double redshift, const double n_H_cgs,
const float abundance_ratio[qla_cooling_N_elementtypes], int n_H_index, const float abundance_ratio[qla_cooling_N_elementtypes],
float d_n_H, int met_index, float d_met, int red_index, float d_red, const int n_H_index, const float d_n_H, const int met_index,
const struct cooling_function_data *cooling, int onlyicool, int onlyiheat, const float d_met, const int red_index, const float d_red,
int icool, int iheat) { const struct cooling_function_data *cooling, const int onlyicool,
const int onlyiheat, const int icool, const int iheat) {
/* Set weights for cooling rates */ /* Set weights for cooling rates */
float weights_cooling[qla_cooling_N_cooltypes - 2]; float weights_cooling[qla_cooling_N_cooltypes - 2];
...@@ -605,11 +611,12 @@ INLINE static double qla_cooling_rate( ...@@ -605,11 +611,12 @@ INLINE static double qla_cooling_rate(
* These are only used for testing. * These are only used for testing.
*/ */
INLINE static double qla_cooling_rate_temperature( INLINE static double qla_cooling_rate_temperature(
double log_T_cgs, double redshift, double n_H_cgs, const double log_T_cgs, const double redshift, const double n_H_cgs,
const float abundance_ratio[qla_cooling_N_elementtypes], int n_H_index, const float abundance_ratio[qla_cooling_N_elementtypes],
float d_n_H, int met_index, float d_met, int red_index, float d_red, const int n_H_index, const float d_n_H, const int met_index,
const struct cooling_function_data *cooling, int onlyicool, int onlyiheat, const float d_met, const int red_index, const float d_red,
int icool, int iheat) { const struct cooling_function_data *cooling, const int onlyicool,
const int onlyiheat, const int icool, const int iheat) {
/* Set weights for cooling rates */ /* Set weights for cooling rates */
float weights_cooling[qla_cooling_N_cooltypes - 2]; float weights_cooling[qla_cooling_N_cooltypes - 2];
......
Markdown is supported
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