Commit 1ccdb8c6 authored by lhausamm's avatar lhausamm
Browse files

formating

parent 18da2ec4
......@@ -92,7 +92,8 @@ __attribute__((always_inline)) INLINE static void cooling_first_init_part(
#if COOLING_GRACKLE_MODE >= 3
/* primordial chemistry >= 3 */
xp->cooling_data.DI_frac = grackle_data->HydrogenFractionByMass * grackle_data->DeuteriumToHydrogenRatio;
xp->cooling_data.DI_frac = grackle_data->HydrogenFractionByMass *
grackle_data->DeuteriumToHydrogenRatio;
xp->cooling_data.DII_frac = zero;
xp->cooling_data.HDI_frac = zero;
#endif // MODE >= 3
......@@ -100,7 +101,6 @@ __attribute__((always_inline)) INLINE static void cooling_first_init_part(
#endif // MODE >= 2
#endif // MODE >= 1
}
/**
......@@ -120,7 +120,7 @@ __attribute__((always_inline)) INLINE static void cooling_compute_density(
xp->cooling_data.HeIII_frac *= rho;
xp->cooling_data.e_frac *= rho;
#if COOLING_GRACKLE_MODE >= 2
#if COOLING_GRACKLE_MODE >= 2
/* primordial chemistry >= 2 */
xp->cooling_data.HM_frac *= rho;
xp->cooling_data.H2I_frac *= rho;
......@@ -157,7 +157,7 @@ __attribute__((always_inline)) INLINE static void cooling_compute_fraction(
xp->cooling_data.HeIII_frac /= rho;
xp->cooling_data.e_frac /= rho;
#if COOLING_GRACKLE_MODE >= 2
#if COOLING_GRACKLE_MODE >= 2
/* primordial chemistry >= 2 */
xp->cooling_data.HM_frac /= rho;
xp->cooling_data.H2I_frac /= rho;
......@@ -207,7 +207,8 @@ __attribute__((always_inline)) INLINE static void cooling_print_backend(
message("CloudyTable = %s", cooling->cloudy_table);
message("UVbackground = %d", cooling->uv_background);
message("Redshift = %g", cooling->redshift);
message("Solar Metal Fraction = %g", cooling->chemistry.SolarMetalFractionByMass);
message("Solar Metal Fraction = %g",
cooling->chemistry.SolarMetalFractionByMass);
message("Units:");
message("\tComoving = %i", cooling->units.comoving_coordinates);
message("\tLength = %g", cooling->units.length_units);
......@@ -215,55 +216,72 @@ __attribute__((always_inline)) INLINE static void cooling_print_backend(
message("\tTime = %g", cooling->units.time_units);
message("\tScale Factor = %g", cooling->units.a_units);
#ifdef SWIFT_DEBUG_CHECKS
/*
const chemistry_data *tmp = &cooling->chemistry;
message("Debug:");
message("UVBackground = %i", tmp->UVbackground);
message("Grackle data file = %s", tmp->grackle_data_file);
message("CMB temperature floor = %i", tmp->cmb_temperature_floor);
message("Gamma = %g", tmp->Gamma);
message("H2 on dust = %i", tmp->h2_on_dust);
message("Photoelectric heating = %i", tmp->photoelectric_heating);
message("Photoelectric heating rate = %g", tmp->photoelectric_heating_rate);
message("Use volumetric heating rate = %i", tmp->use_volumetric_heating_rate);
message("Use specific heating rate = %i", tmp->use_specific_heating_rate);
message("Three body = %i", tmp->three_body_rate);
message("Cie cooling = %i", tmp->cie_cooling);
message("h2 optical depth approx = %i", tmp->h2_optical_depth_approximation);
message("ih2co = %i", tmp->ih2co);
message("ipiht = %i", tmp->ipiht);
message("Hydrogen Fraction = %g", tmp->HydrogenFractionByMass);
message("Deuterium/Hydrogen ratio = %g", tmp->DeuteriumToHydrogenRatio);
message("Solar metal fraction = %g", tmp->SolarMetalFractionByMass);
message("Number T bins = %i", tmp->NumberOfTemperatureBins);
message("Case B recombination = %i", tmp->CaseBRecombination);
message("T start = %g", tmp->TemperatureStart);
message("T end = %g", tmp->TemperatureEnd);
message("Number dust T bins = %i", tmp->NumberOfDustTemperatureBins);
message("Dust T start = %g", tmp->DustTemperatureStart);
message("Dust T end = %g", tmp->DustTemperatureEnd);
message("Compton xray heating = %i", tmp->Compton_xray_heating);
message("LW background sawtooth suppression = %i", tmp->LWbackground_sawtooth_suppression);
message("LW background intensity = %g", tmp->LWbackground_intensity);
message("UV redshift on = %g", tmp->UVbackground_redshift_on);
message("UV redshift off = %g", tmp->UVbackground_redshift_off);
message("UV redshift fullon = %g", tmp->UVbackground_redshift_fullon);
message("UV redshift drop = %g", tmp->UVbackground_redshift_drop);
message("Cloudy electron fraction = %g", tmp->cloudy_electron_fraction_factor);
message("Use radiative transfer = %i", tmp->use_radiative_transfer);
message("RT coupled rate solver = %i", tmp->radiative_transfer_coupled_rate_solver);
message("RT intermediate step = %i", tmp->radiative_transfer_intermediate_step);
message("RT H only = %i", tmp->radiative_transfer_hydrogen_only);
message("Self shielding method = %i", tmp->self_shielding_method);
*/
/*
const chemistry_data *tmp = &cooling->chemistry;
message("Debug:");
message("UVBackground = %i", tmp->UVbackground);
message("Grackle data file = %s", tmp->grackle_data_file);
message("CMB temperature floor = %i", tmp->cmb_temperature_floor);
message("Gamma = %g", tmp->Gamma);
message("H2 on dust = %i", tmp->h2_on_dust);
message("Photoelectric heating = %i", tmp->photoelectric_heating);
message("Photoelectric heating rate = %g",
tmp->photoelectric_heating_rate);
message("Use volumetric heating rate = %i",
tmp->use_volumetric_heating_rate);
message("Use specific heating rate = %i",
tmp->use_specific_heating_rate);
message("Three body = %i", tmp->three_body_rate);
message("Cie cooling = %i", tmp->cie_cooling);
message("h2 optical depth approx = %i",
tmp->h2_optical_depth_approximation);
message("ih2co = %i", tmp->ih2co);
message("ipiht = %i", tmp->ipiht);
message("Hydrogen Fraction = %g", tmp->HydrogenFractionByMass);
message("Deuterium/Hydrogen ratio = %g",
tmp->DeuteriumToHydrogenRatio);
message("Solar metal fraction = %g",
tmp->SolarMetalFractionByMass);
message("Number T bins = %i",
tmp->NumberOfTemperatureBins);
message("Case B recombination = %i", tmp->CaseBRecombination);
message("T start = %g", tmp->TemperatureStart);
message("T end = %g", tmp->TemperatureEnd);
message("Number dust T bins = %i",
tmp->NumberOfDustTemperatureBins);
message("Dust T start = %g", tmp->DustTemperatureStart);
message("Dust T end = %g", tmp->DustTemperatureEnd);
message("Compton xray heating = %i", tmp->Compton_xray_heating);
message("LW background sawtooth suppression = %i",
tmp->LWbackground_sawtooth_suppression);
message("LW background intensity = %g", tmp->LWbackground_intensity);
message("UV redshift on = %g",
tmp->UVbackground_redshift_on);
message("UV redshift off = %g",
tmp->UVbackground_redshift_off);
message("UV redshift fullon = %g",
tmp->UVbackground_redshift_fullon);
message("UV redshift drop = %g",
tmp->UVbackground_redshift_drop);
message("Cloudy electron fraction = %g",
tmp->cloudy_electron_fraction_factor);
message("Use radiative transfer = %i", tmp->use_radiative_transfer);
message("RT coupled rate solver = %i",
tmp->radiative_transfer_coupled_rate_solver);
message("RT intermediate step = %i",
tmp->radiative_transfer_intermediate_step);
message("RT H only = %i",
tmp->radiative_transfer_hydrogen_only);
message("Self shielding method = %i", tmp->self_shielding_method);
*/
#endif
}
......@@ -272,7 +290,8 @@ __attribute__((always_inline)) INLINE static void cooling_print_backend(
*
* @param data the #grackle_field_data
*/
__attribute__((always_inline)) INLINE static void cooling_malloc_data(grackle_field_data *data) {
__attribute__((always_inline)) INLINE static void cooling_malloc_data(
grackle_field_data* data) {
#if COOLING_GRACKLE_MODE >= 1
/* primordial chemistry >= 1 */
......@@ -306,7 +325,6 @@ __attribute__((always_inline)) INLINE static void cooling_malloc_data(grackle_fi
/* /\* specific heating rate *\/ */
/* data->specific_heating_rate = NULL; */
}
/**
......@@ -315,7 +333,8 @@ __attribute__((always_inline)) INLINE static void cooling_malloc_data(grackle_fi
* @param data the #grackle_field_data
*/
__attribute__((always_inline)) INLINE static void cooling_free_data(grackle_field_data *data) {
__attribute__((always_inline)) INLINE static void cooling_free_data(
grackle_field_data* data) {
#if COOLING_GRACKLE_MODE >= 1
/* primordial chemistry >= 1 */
......@@ -349,7 +368,6 @@ __attribute__((always_inline)) INLINE static void cooling_free_data(grackle_fiel
/* /\* specific heating rate *\/ */
/* data->specific_heating_rate = NULL; */
}
/**
......@@ -360,7 +378,8 @@ __attribute__((always_inline)) INLINE static void cooling_free_data(grackle_fiel
* @param data the #grackle_field_data
* @param xp the #xpart
*/
__attribute__((always_inline)) INLINE static void cooling_copy_to_data(grackle_field_data *data, const struct xpart *xp) {
__attribute__((always_inline)) INLINE static void cooling_copy_to_data(
grackle_field_data* data, const struct xpart* xp) {
#if COOLING_GRACKLE_MODE >= 1
/* primordial chemistry >= 1 */
......@@ -396,14 +415,14 @@ __attribute__((always_inline)) INLINE static void cooling_copy_to_data(grackle_f
data->specific_heating_rate = NULL;
}
/**
* @brief copy data to xp
*
* @param data the #grackle_field_data
* @param xp the #xpart
*/
__attribute__((always_inline)) INLINE static void cooling_copy_to_particle(const grackle_field_data *data, struct xpart *xp) {
__attribute__((always_inline)) INLINE static void cooling_copy_to_particle(
const grackle_field_data* data, struct xpart* xp) {
#if COOLING_GRACKLE_MODE >= 1
/* primordial chemistry >= 1 */
......@@ -437,10 +456,8 @@ __attribute__((always_inline)) INLINE static void cooling_copy_to_particle(const
/* /\* specific heating rate *\/ */
/* data->specific_heating_rate = NULL; */
}
/**
* @brief Compute the cooling rate and update the particle chemistry data
*
......@@ -458,8 +475,7 @@ __attribute__((always_inline)) INLINE static double cooling_rate(
const struct unit_system* restrict us,
const struct cosmology* restrict cosmo,
const struct cooling_function_data* restrict cooling,
struct part* restrict p, struct xpart* restrict xp,
double dt) {
struct part* restrict p, struct xpart* restrict xp, double dt) {
/* set current time */
code_units units = cooling->units;
......
......@@ -58,7 +58,7 @@ struct cooling_xpart_data {
/*! Energy radiated away by this particle since the start of the run */
float radiated_energy;
/* here all fractions are mass fraction */
/* here all fractions are mass fraction */
#if COOLING_GRACKLE_MODE >= 1
/* primordial chemistry >= 1 */
float HI_frac;
......
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