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

Change the behaviour of the initial stellar birth time overwrite parameter.

parent b1123688
No related branches found
No related tags found
No related merge requests found
...@@ -40,7 +40,8 @@ SPH: ...@@ -40,7 +40,8 @@ SPH:
# Properties of the stars # Properties of the stars
Stars: Stars:
birth_time: 0.00991 # Give the star in the ICs a decent birth time overwrite_birth_time: 1
birth_time: 0.00991 # Give the star in the ICs a decent birth time
# Parameters related to the initial conditions # Parameters related to the initial conditions
InitialConditions: InitialConditions:
......
...@@ -34,7 +34,8 @@ SPH: ...@@ -34,7 +34,8 @@ SPH:
# Properties of the stars # Properties of the stars
Stars: Stars:
birth_time: 0. # Give the star in the ICs a decent birth time overwrite_birth_time: 1
birth_time: 0. # Give the star in the ICs a decent birth time
# Parameters related to the initial conditions # Parameters related to the initial conditions
InitialConditions: InitialConditions:
......
...@@ -54,7 +54,8 @@ Stars: ...@@ -54,7 +54,8 @@ Stars:
h_tolerance: 1e-4 # (Optional) Relative accuracy of the Netwon-Raphson scheme for the smoothing lengths. 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_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. 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. overwrite_birth_time: 0 # (Optional) Do we want to overwrite the birth time of the stars read from the ICs? (default: 0).
birth_time: -1 # (Optional) Initial birth times of *all* the stars to be used if we are overwriting them. (-1 means the stars remain inactive feedback-wise througout the run).
# Parameters for the self-gravity scheme # Parameters for the self-gravity scheme
Gravity: Gravity:
......
...@@ -65,7 +65,7 @@ __attribute__((always_inline)) INLINE static void stars_first_init_spart( ...@@ -65,7 +65,7 @@ __attribute__((always_inline)) INLINE static void stars_first_init_spart(
sp->time_bin = 0; sp->time_bin = 0;
sp->birth_density = 0.f; sp->birth_density = 0.f;
sp->f_E = -1.f; sp->f_E = -1.f;
if (stars_properties->spart_first_init_birth_time != -1.f) if (stars_properties->overwrite_birth_time)
sp->birth_time = stars_properties->spart_first_init_birth_time; sp->birth_time = stars_properties->spart_first_init_birth_time;
stars_init_spart(sp); stars_init_spart(sp);
......
...@@ -217,8 +217,11 @@ INLINE static void stars_props_init(struct stars_props *sp, ...@@ -217,8 +217,11 @@ INLINE static void stars_props_init(struct stars_props *sp,
else else
sp->log_max_h_change = logf(powf(max_volume_change, hydro_dimension_inv)); sp->log_max_h_change = logf(powf(max_volume_change, hydro_dimension_inv));
/* Read birth time to set all stars in ICs to (defaults to -1 to indicate star /* Do we want to overwrite the stars' birth time? */
* present in ICs) */ sp->overwrite_birth_time =
parser_get_opt_param_int(params, "Stars:overwrite_birth_time", 0);
/* Read birth time to set all stars in ICs */
sp->spart_first_init_birth_time = sp->spart_first_init_birth_time =
parser_get_opt_param_float(params, "Stars:birth_time", -1.f); parser_get_opt_param_float(params, "Stars:birth_time", -1.f);
} }
...@@ -244,6 +247,10 @@ INLINE static void stars_props_print(const struct stars_props *sp) { ...@@ -244,6 +247,10 @@ INLINE static void stars_props_print(const struct stars_props *sp) {
message("Maximal iterations in ghost task set to %d", message("Maximal iterations in ghost task set to %d",
sp->max_smoothing_iterations); sp->max_smoothing_iterations);
if (sp->overwrite_birth_time)
message("Stars' birth time read from the ICs will be overwritten to %f",
sp->spart_first_init_birth_time);
} }
#if defined(HAVE_HDF5) #if defined(HAVE_HDF5)
......
...@@ -144,7 +144,7 @@ struct stars_props { ...@@ -144,7 +144,7 @@ struct stars_props {
/*! Smoothing length tolerance */ /*! Smoothing length tolerance */
float h_tolerance; float h_tolerance;
/*! Tolerance on neighbour number (for info only)*/ /*! Tolerance on neighbour number (for info only) */
float delta_neighbours; float delta_neighbours;
/*! Maximal number of iterations to converge h */ /*! Maximal number of iterations to converge h */
...@@ -153,7 +153,10 @@ struct stars_props { ...@@ -153,7 +153,10 @@ struct stars_props {
/*! Maximal change of h over one time-step */ /*! Maximal change of h over one time-step */
float log_max_h_change; float log_max_h_change;
/*! Value to set birth time of stars read from ICs if not set to -1 */ /*! Are we overwriting the stars' birth time read from the ICs? */
int overwrite_birth_time;
/*! Value to set birth time of stars read from ICs */
float spart_first_init_birth_time; float spart_first_init_birth_time;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment