diff --git a/examples/parameter_example.yml b/examples/parameter_example.yml index 1219509296dbda6e6896ebd018ad0c73cf508b86..aabf9ac1078ad41288f1011d7bfe94626deefce3 100644 --- a/examples/parameter_example.yml +++ b/examples/parameter_example.yml @@ -48,6 +48,13 @@ SPH: diffusion_alpha_max: 1.0 # (Optional) Override the maximal thermal diffusion coefficient that is allowed for a given particle. diffusion_alpha_min: 0.0 # (Optional) Override the minimal thermal diffusion coefficient that is allowed for a given particle. +# Parameters of the stars neighbour search +Stars: + resolution_eta: 1.2348 # (Optional) Target smoothing length in units of the mean inter-particle separation (1.2348 == 48Ngbs with the cubic spline kernel). Defaults to the SPH value. + h_tolerance: 1e-4 # (Optional) Relative accuracy of the Netwon-Raphson scheme for the smoothing lengths. Defaults to the SPH value. + max_ghost_iterations: 30 # (Optional) Maximal number of iterations allowed to converge towards the smoothing length. Defaults to the SPH value. + max_volume_change: 1.4 # (Optional) Maximal allowed change of kernel volume over one time-step. Defaults to the SPH value. + birth_time: -1 # (Optional) Initial birth time of *all* the stars. If not -1, this value will overwrite all the values read from the ICs. # Parameters for the self-gravity scheme Gravity: diff --git a/src/stars/EAGLE/stars.h b/src/stars/EAGLE/stars.h index 09926d6a8bdd5af4eff120a9a6c57d15eb7e49c4..f102ddb22c0075d33b02c726d0447b64fa9d3df7 100644 --- a/src/stars/EAGLE/stars.h +++ b/src/stars/EAGLE/stars.h @@ -65,7 +65,8 @@ __attribute__((always_inline)) INLINE static void stars_first_init_spart( sp->time_bin = 0; sp->birth_density = 0.f; sp->f_E = -1.f; - sp->birth_time = stars_properties->spart_first_init_birth_time; + if (stars_properties->spart_first_init_birth_time != -1.f) + sp->birth_time = stars_properties->spart_first_init_birth_time; stars_init_spart(sp); } diff --git a/src/stars/EAGLE/stars_io.h b/src/stars/EAGLE/stars_io.h index b67c57078796a4be3d34d828884cedcff808614e..b91b5cf94595a05acd280cfd4f51755f91cce04d 100644 --- a/src/stars/EAGLE/stars_io.h +++ b/src/stars/EAGLE/stars_io.h @@ -35,7 +35,7 @@ INLINE static void stars_read_particles(struct spart *sparts, int *num_fields) { /* Say how much we want to read */ - *num_fields = 6; + *num_fields = 7; /* List what we want to read */ list[0] = io_make_input_field("Coordinates", DOUBLE, 3, COMPULSORY, @@ -50,6 +50,8 @@ INLINE static void stars_read_particles(struct spart *sparts, UNIT_CONV_LENGTH, sparts, h); list[5] = io_make_input_field("Masses", FLOAT, 1, COMPULSORY, UNIT_CONV_MASS, sparts, mass_init); + list[6] = io_make_input_field("StellarFormationTime", FLOAT, 1, OPTIONAL, + UNIT_CONV_NO_UNITS, sparts, birth_time); } INLINE static void convert_spart_pos(const struct engine *e, @@ -218,7 +220,7 @@ INLINE static void stars_props_init(struct stars_props *sp, /* Read birth time to set all stars in ICs to (defaults to -1 to indicate star * present in ICs) */ sp->spart_first_init_birth_time = - parser_get_opt_param_float(params, "Stars:birth_time", -1); + parser_get_opt_param_float(params, "Stars:birth_time", -1.f); } /** diff --git a/src/stars/EAGLE/stars_part.h b/src/stars/EAGLE/stars_part.h index bed54bb175026ae930668fb102dcfef9c9af76d7..4502b10edb7b646e9ba845e1ffffbb9255cdc01c 100644 --- a/src/stars/EAGLE/stars_part.h +++ b/src/stars/EAGLE/stars_part.h @@ -153,7 +153,7 @@ struct stars_props { /*! Maximal change of h over one time-step */ float log_max_h_change; - /*! Value to set birth time of stars read from ICs */ + /*! Value to set birth time of stars read from ICs if not set to -1 */ float spart_first_init_birth_time; };