Commit f6fb95a8 authored by Loic Hausammann's avatar Loic Hausammann

GEAR: first corrections

parent 80f7bdf6
...@@ -419,6 +419,8 @@ QLAStarFormation: ...@@ -419,6 +419,8 @@ QLAStarFormation:
GEARStarFormation: GEARStarFormation:
star_formation_efficiency: 0.01 # star formation efficiency (c_*) star_formation_efficiency: 0.01 # star formation efficiency (c_*)
maximal_temperature: 3e4 # Upper limit to the temperature of a star forming particle 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 ----------------------------------------------- # Parameters related to feedback models -----------------------------------------------
......
...@@ -311,18 +311,18 @@ void stellar_evolution_evolve_spart( ...@@ -311,18 +311,18 @@ void stellar_evolution_evolve_spart(
const float m_init = sp->sf_data.birth_mass / phys_const->const_solar_mass; const float m_init = sp->sf_data.birth_mass / phys_const->const_solar_mass;
/* Compute number of SNIa */ /* Compute number of SNIa */
const float number_snia_f = can_produce_snia const float number_snia_f = !can_produce_snia
? supernovae_ia_get_number_per_unit_mass( ? 0
: supernovae_ia_get_number_per_unit_mass(
&sm->snia, m_end_step, m_beg_step) * &sm->snia, m_end_step, m_beg_step) *
m_init m_init;
: 0;
/* Compute number of SNII */ /* Compute number of SNII */
const float number_snii_f = can_produce_snii const float number_snii_f = !can_produce_snii
? supernovae_ii_get_number_per_unit_mass( ? 0
: supernovae_ii_get_number_per_unit_mass(
&sm->snii, m_end_step, m_beg_step) * &sm->snii, m_end_step, m_beg_step) *
m_init m_init;
: 0;
/* Does this star produce a supernovae? */ /* Does this star produce a supernovae? */
if (number_snia_f == 0 && number_snii_f == 0) return; if (number_snia_f == 0 && number_snii_f == 0) return;
......
...@@ -412,8 +412,7 @@ void supernovae_ii_dump(const struct supernovae_ii *snii, FILE *stream, ...@@ -412,8 +412,7 @@ void supernovae_ii_dump(const struct supernovae_ii *snii, FILE *stream,
if (snii->integrated.yields[i].data != NULL) { if (snii->integrated.yields[i].data != NULL) {
/* Generate name */ /* Generate name */
char name[200]; char name[200];
strcpy(name, element_name); sprintf(name, "%s_int", element_name);
strcat(name, "_int");
/* Write the array */ /* Write the array */
restart_write_blocks((void *)snii->integrated.yields[i].data, restart_write_blocks((void *)snii->integrated.yields[i].data,
...@@ -425,8 +424,7 @@ void supernovae_ii_dump(const struct supernovae_ii *snii, FILE *stream, ...@@ -425,8 +424,7 @@ void supernovae_ii_dump(const struct supernovae_ii *snii, FILE *stream,
if (snii->raw.yields[i].data != NULL) { if (snii->raw.yields[i].data != NULL) {
/* Generate name */ /* Generate name */
char name[200]; char name[200];
strcpy(name, element_name); sprintf(name, "%s_raw", element_name);
strcat(name, "_raw");
/* Write the array */ /* Write the array */
restart_write_blocks((void *)snii->raw.yields[i].data, sizeof(float), 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, ...@@ -488,8 +486,7 @@ void supernovae_ii_restore(struct supernovae_ii *snii, FILE *stream,
if (snii->integrated.yields[i].data != NULL) { if (snii->integrated.yields[i].data != NULL) {
/* Generate name */ /* Generate name */
char name[200]; char name[200];
strcpy(name, element_name); sprintf(name, "%s_int", element_name);
strcat(name, "_int");
/* Allocate the memory */ /* Allocate the memory */
snii->integrated.yields[i].data = snii->integrated.yields[i].data =
...@@ -508,8 +505,7 @@ void supernovae_ii_restore(struct supernovae_ii *snii, FILE *stream, ...@@ -508,8 +505,7 @@ void supernovae_ii_restore(struct supernovae_ii *snii, FILE *stream,
if (snii->raw.yields[i].data != NULL) { if (snii->raw.yields[i].data != NULL) {
/* Generate name */ /* Generate name */
char name[200]; char name[200];
strcpy(name, element_name); sprintf(name, "%s_raw", element_name);
strcat(name, "_raw");
/* Allocate the memory */ /* Allocate the memory */
snii->raw.yields[i].data = snii->raw.yields[i].data =
......
...@@ -24,9 +24,6 @@ struct cosmology; ...@@ -24,9 +24,6 @@ struct cosmology;
__attribute__((always_inline)) static INLINE float __attribute__((always_inline)) static INLINE float
pressure_floor_get_comoving_pressure(const struct part* p, const float pressure, pressure_floor_get_comoving_pressure(const struct part* p, const float pressure,
const struct cosmology* cosmo); 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 "adiabatic_index.h"
#include "cosmology.h" #include "cosmology.h"
...@@ -55,25 +52,6 @@ struct pressure_floor_properties { ...@@ -55,25 +52,6 @@ struct pressure_floor_properties {
float constants; 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. * @brief Compute the comoving pressure floor of a given #part.
* *
......
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