diff --git a/examples/parameter_example.yml b/examples/parameter_example.yml index 831619622a43f702381cacf96c918f3fcdb6d521..14d7acbfdcd6c24ae4d314dd302d8c7130bf7529 100644 --- a/examples/parameter_example.yml +++ b/examples/parameter_example.yml @@ -419,6 +419,8 @@ QLAStarFormation: GEARStarFormation: star_formation_efficiency: 0.01 # star formation efficiency (c_*) maximal_temperature: 3e4 # Upper limit to the temperature of a star forming particle + n_stars_per_particle: 4 # Number of stars that an hydro particle can generate + min_mass_frac: 0.5 # Minimal mass for a stellar particle as a fraction of the average mass for the stellar particles. # Parameters related to feedback models ----------------------------------------------- diff --git a/src/feedback/GEAR/stellar_evolution.c b/src/feedback/GEAR/stellar_evolution.c index 9007616717e4c257461cf6dca280179b6e3a301d..0516e9eb30e7c13b8db0a5b46ab33989dada7919 100644 --- a/src/feedback/GEAR/stellar_evolution.c +++ b/src/feedback/GEAR/stellar_evolution.c @@ -311,18 +311,18 @@ void stellar_evolution_evolve_spart( const float m_init = sp->sf_data.birth_mass / phys_const->const_solar_mass; /* Compute number of SNIa */ - const float number_snia_f = can_produce_snia - ? supernovae_ia_get_number_per_unit_mass( + const float number_snia_f = !can_produce_snia + ? 0 + : supernovae_ia_get_number_per_unit_mass( &sm->snia, m_end_step, m_beg_step) * - m_init - : 0; + m_init; /* Compute number of SNII */ - const float number_snii_f = can_produce_snii - ? supernovae_ii_get_number_per_unit_mass( + const float number_snii_f = !can_produce_snii + ? 0 + : supernovae_ii_get_number_per_unit_mass( &sm->snii, m_end_step, m_beg_step) * - m_init - : 0; + m_init; /* Does this star produce a supernovae? */ if (number_snia_f == 0 && number_snii_f == 0) return; diff --git a/src/feedback/GEAR/supernovae_ii.c b/src/feedback/GEAR/supernovae_ii.c index 6f9a7e9e2acb1564ae7abc0ff0e79461179f7d25..a18d87c2c767d31f99b90668bfe4c128ba832fcf 100644 --- a/src/feedback/GEAR/supernovae_ii.c +++ b/src/feedback/GEAR/supernovae_ii.c @@ -412,8 +412,7 @@ void supernovae_ii_dump(const struct supernovae_ii *snii, FILE *stream, if (snii->integrated.yields[i].data != NULL) { /* Generate name */ char name[200]; - strcpy(name, element_name); - strcat(name, "_int"); + sprintf(name, "%s_int", element_name); /* Write the array */ restart_write_blocks((void *)snii->integrated.yields[i].data, @@ -425,8 +424,7 @@ void supernovae_ii_dump(const struct supernovae_ii *snii, FILE *stream, if (snii->raw.yields[i].data != NULL) { /* Generate name */ char name[200]; - strcpy(name, element_name); - strcat(name, "_raw"); + sprintf(name, "%s_raw", element_name); /* Write the array */ restart_write_blocks((void *)snii->raw.yields[i].data, sizeof(float), @@ -488,8 +486,7 @@ void supernovae_ii_restore(struct supernovae_ii *snii, FILE *stream, if (snii->integrated.yields[i].data != NULL) { /* Generate name */ char name[200]; - strcpy(name, element_name); - strcat(name, "_int"); + sprintf(name, "%s_int", element_name); /* Allocate the memory */ snii->integrated.yields[i].data = @@ -508,8 +505,7 @@ void supernovae_ii_restore(struct supernovae_ii *snii, FILE *stream, if (snii->raw.yields[i].data != NULL) { /* Generate name */ char name[200]; - strcpy(name, element_name); - strcat(name, "_raw"); + sprintf(name, "%s_raw", element_name); /* Allocate the memory */ snii->raw.yields[i].data = diff --git a/src/pressure_floor/GEAR/pressure_floor.h b/src/pressure_floor/GEAR/pressure_floor.h index 642b36725a7d4859109ffb2bb559c865a52fe98e..52a93e534befc4d2993fe9ee124feefdb0074f43 100644 --- a/src/pressure_floor/GEAR/pressure_floor.h +++ b/src/pressure_floor/GEAR/pressure_floor.h @@ -24,9 +24,6 @@ struct cosmology; __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" @@ -55,25 +52,6 @@ struct pressure_floor_properties { float constants; }; -/** - * @brief Compute the physical pressure floor of a given #part. - * - * Note that the particle is not updated!! - * - * @param p The #part. - * @param pressure_physical The physical pressure without any pressure floor. - * @param cosmo The #cosmology model. - * - * @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) { - error("Not used."); - return 0; -} - /** * @brief Compute the comoving pressure floor of a given #part. *