Skip to content
Snippets Groups Projects
Commit 7263d03f authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Remove the debugging information from the snapshots and stdout.

parent a7e80ee6
No related branches found
No related tags found
1 merge request!705Star formation following Schaye08
...@@ -522,9 +522,9 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) { ...@@ -522,9 +522,9 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
dt_star = get_timestep(p->time_bin, time_base); dt_star = get_timestep(p->time_bin, time_base);
} }
if (star_formation_convert_to_star(e, starform, p, xp, constants, cosmo, if (star_formation_should_convert_to_star(
hydro_props, us, cooling, dt_star, e, starform, p, xp, constants, cosmo, hydro_props, us, cooling,
with_cosmology)) { dt_star, with_cosmology)) {
/* Convert your particle to a star */ /* Convert your particle to a star */
struct spart *sp = cell_convert_part_to_spart(e, c, p, xp); struct spart *sp = cell_convert_part_to_spart(e, c, p, xp);
......
...@@ -212,7 +212,7 @@ INLINE static float EOS_temperature(const float n_H, ...@@ -212,7 +212,7 @@ INLINE static float EOS_temperature(const float n_H,
* @param cooling The cooling data struct. * @param cooling The cooling data struct.
* *
*/ */
INLINE static int star_formation_potential_to_become_star( INLINE static int star_formation_is_star_forming(
const struct star_formation* starform, const struct part* restrict p, const struct star_formation* starform, const struct part* restrict p,
const struct xpart* restrict xp, const struct phys_const* const phys_const, const struct xpart* restrict xp, const struct phys_const* const phys_const,
const struct cosmology* cosmo, const struct cosmology* cosmo,
...@@ -277,7 +277,7 @@ INLINE static int star_formation_potential_to_become_star( ...@@ -277,7 +277,7 @@ INLINE static int star_formation_potential_to_become_star(
* @param dt_star The time-step of this particle. * @param dt_star The time-step of this particle.
* @param with_cosmology Are we running with cosmology on? * @param with_cosmology Are we running with cosmology on?
*/ */
INLINE static int star_formation_convert_to_star( INLINE static int star_formation_should_convert_to_star(
const struct engine* e, const struct star_formation* starform, const struct engine* e, const struct star_formation* starform,
const struct part* restrict p, struct xpart* restrict xp, const struct part* restrict p, struct xpart* restrict xp,
const struct phys_const* const phys_const, const struct cosmology* cosmo, const struct phys_const* const phys_const, const struct cosmology* cosmo,
...@@ -287,10 +287,12 @@ INLINE static int star_formation_convert_to_star( ...@@ -287,10 +287,12 @@ INLINE static int star_formation_convert_to_star(
const int with_cosmology) { const int with_cosmology) {
/* Abort early if time-step size is 0 */ /* Abort early if time-step size is 0 */
if (dt_star == 0.f) return 0; if (dt_star == 0.f) {
return 0;
}
if (star_formation_potential_to_become_star( if (star_formation_is_star_forming(starform, p, xp, phys_const, cosmo,
starform, p, xp, phys_const, cosmo, hydro_props, us, cooling)) { hydro_props, us, cooling)) {
/* Hydrogen number density of this particle */ /* Hydrogen number density of this particle */
const double physical_density = hydro_get_physical_density(p, cosmo); const double physical_density = hydro_get_physical_density(p, cosmo);
...@@ -322,7 +324,6 @@ INLINE static int star_formation_convert_to_star( ...@@ -322,7 +324,6 @@ INLINE static int star_formation_convert_to_star(
/* Store the SFR */ /* Store the SFR */
xp->sf_data.SFR = SFRpergasmass * p->mass; xp->sf_data.SFR = SFRpergasmass * p->mass;
xp->sf_data.sSFR = SFRpergasmass;
/* Calculate the propability of forming a star */ /* Calculate the propability of forming a star */
const double prop = SFRpergasmass * dt_star; const double prop = SFRpergasmass * dt_star;
...@@ -339,10 +340,8 @@ INLINE static int star_formation_convert_to_star( ...@@ -339,10 +340,8 @@ INLINE static int star_formation_convert_to_star(
if (xp->sf_data.SFR > 0.f) { if (xp->sf_data.SFR > 0.f) {
if (with_cosmology) { if (with_cosmology) {
xp->sf_data.SFR = -cosmo->a; xp->sf_data.SFR = -cosmo->a;
xp->sf_data.sSFR = 0.f;
} else { } else {
xp->sf_data.SFR = -e->time; xp->sf_data.SFR = -e->time;
xp->sf_data.sSFR = 0.f;
} }
} }
...@@ -389,10 +388,6 @@ INLINE static void star_formation_copy_properties( ...@@ -389,10 +388,6 @@ INLINE static void star_formation_copy_properties(
/* Store the birth density in the star particle */ /* Store the birth density in the star particle */
sp->birth_density = hydro_get_physical_density(p, cosmo); sp->birth_density = hydro_get_physical_density(p, cosmo);
sp->new_star_flag = 1;
message("A star has been formed!");
} }
/** /**
......
...@@ -41,10 +41,7 @@ __attribute__((always_inline)) INLINE static int star_formation_write_particles( ...@@ -41,10 +41,7 @@ __attribute__((always_inline)) INLINE static int star_formation_write_particles(
list[0] = list[0] =
io_make_output_field("SFR", FLOAT, 1, UNIT_CONV_SFR, xparts, sf_data.SFR); io_make_output_field("SFR", FLOAT, 1, UNIT_CONV_SFR, xparts, sf_data.SFR);
list[1] = io_make_output_field("sSFR", FLOAT, 1, UNIT_CONV_SSFR, xparts, return 1;
sf_data.sSFR);
return 2;
} }
#endif /* SWIFT_STAR_FORMATION_EAGLE_IO_H */ #endif /* SWIFT_STAR_FORMATION_EAGLE_IO_H */
...@@ -27,9 +27,6 @@ struct star_formation_xpart_data { ...@@ -27,9 +27,6 @@ struct star_formation_xpart_data {
/*! Star formation rate */ /*! Star formation rate */
float SFR; float SFR;
/*! Specific star formation rate */
float sSFR;
}; };
#endif /* SWIFT_EAGLE_STAR_FORMATION_STRUCT_H */ #endif /* SWIFT_EAGLE_STAR_FORMATION_STRUCT_H */
...@@ -45,8 +45,7 @@ __attribute__((always_inline)) INLINE static void stars_first_init_spart( ...@@ -45,8 +45,7 @@ __attribute__((always_inline)) INLINE static void stars_first_init_spart(
struct spart* sp) { struct spart* sp) {
sp->time_bin = 0; sp->time_bin = 0;
sp->new_star_flag = 0; sp->birth_density = -1.f;
sp->birth_density = 0.f;
} }
/** /**
......
...@@ -62,7 +62,7 @@ INLINE static void stars_write_particles(const struct spart *sparts, ...@@ -62,7 +62,7 @@ INLINE static void stars_write_particles(const struct spart *sparts,
int *num_fields) { int *num_fields) {
/* Say how much we want to write */ /* Say how much we want to write */
*num_fields = 9; *num_fields = 8;
/* List what we want to write */ /* List what we want to write */
list[0] = io_make_output_field("Coordinates", DOUBLE, 3, UNIT_CONV_LENGTH, list[0] = io_make_output_field("Coordinates", DOUBLE, 3, UNIT_CONV_LENGTH,
...@@ -75,13 +75,11 @@ INLINE static void stars_write_particles(const struct spart *sparts, ...@@ -75,13 +75,11 @@ INLINE static void stars_write_particles(const struct spart *sparts,
sparts, id); sparts, id);
list[4] = io_make_output_field("SmoothingLength", FLOAT, 1, UNIT_CONV_LENGTH, list[4] = io_make_output_field("SmoothingLength", FLOAT, 1, UNIT_CONV_LENGTH,
sparts, h); sparts, h);
list[5] = io_make_output_field("NewStarFlag", INT, 1, UNIT_CONV_NO_UNITS, list[5] = io_make_output_field("BirthDensity", FLOAT, 1, UNIT_CONV_DENSITY,
sparts, new_star_flag);
list[6] = io_make_output_field("BirthDensity", FLOAT, 1, UNIT_CONV_DENSITY,
sparts, birth_density); sparts, birth_density);
list[7] = io_make_output_field("Initial_Masses", FLOAT, 1, UNIT_CONV_MASS, list[6] = io_make_output_field("Initial_Masses", FLOAT, 1, UNIT_CONV_MASS,
sparts, mass_init); sparts, mass_init);
list[8] = io_make_output_field("Birth_time", FLOAT, 1, UNIT_CONV_TIME, sparts, list[7] = io_make_output_field("Birth_time", FLOAT, 1, UNIT_CONV_TIME, sparts,
birth_time); birth_time);
} }
......
...@@ -70,9 +70,6 @@ struct spart { ...@@ -70,9 +70,6 @@ struct spart {
/*! Birth density */ /*! Birth density */
float birth_density; float birth_density;
/*! New star flag */
int new_star_flag;
/*! Tracer structure */ /*! Tracer structure */
struct tracers_xpart_data tracers_data; struct tracers_xpart_data tracers_data;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment