Commit 88811430 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Better name for the parameter governing the clean-up and rescaling of smoothing lengths.

parent 9ff194f4
......@@ -31,6 +31,6 @@ SPH:
# Parameters related to the initial conditions
InitialConditions:
file_name: ./sedov.hdf5 # The file to read
h_scaling: 3.33
file_name: ./sedov.hdf5
smoothing_length_scaling: 3.33
......@@ -484,7 +484,7 @@ int main(int argc, char *argv[]) {
#endif
/* Common variables for restart and IC sections. */
int clean_h_values = 0;
int clean_smoothing_length_values = 0;
int flag_entropy_ICs = 0;
/* Work out where we will read and write restart files. */
......@@ -620,8 +620,8 @@ int main(int argc, char *argv[]) {
parser_get_param_string(params, "InitialConditions:file_name", ICfileName);
const int replicate =
parser_get_opt_param_int(params, "InitialConditions:replicate", 1);
clean_h_values =
parser_get_opt_param_int(params, "InitialConditions:cleanup_h", 0);
clean_smoothing_length_values = parser_get_opt_param_int(
params, "InitialConditions:cleanup_smoothing_lengths", 0);
if (myrank == 0) message("Reading ICs from file '%s'", ICfileName);
fflush(stdout);
......@@ -836,7 +836,7 @@ int main(int argc, char *argv[]) {
#endif
/* Initialise the particles */
engine_init_particles(&e, flag_entropy_ICs, clean_h_values);
engine_init_particles(&e, flag_entropy_ICs, clean_smoothing_length_values);
/* Write the state of the system before starting time integration. */
engine_dump_snapshot(&e);
......
......@@ -81,12 +81,12 @@ Statistics:
# Parameters related to the initial conditions
InitialConditions:
file_name: SedovBlast/sedov.hdf5 # The file to read
cleanup_h: 0 # (Optional) Clean the values of h that are read in. Set to 1 to activate.
h_scaling: 1. # (Optional) A scaling factor to apply to all smoothing lengths in the ICs.
cleanup_smoothing_lengths: 0 # (Optional) Clean the values of the smoothing lengths that are read in to remove stupid values. Set to 1 to activate.
smoothing_length_scaling: 1. # (Optional) A scaling factor to apply to all smoothing lengths in the ICs.
shift_x: 0. # (Optional) A shift to apply to all particles read from the ICs (in internal units).
shift_y: 0.
shift_z: 0.
replicate: 2 # (Optional) Replicate all particles along each axis a given number of times. Default 1.
replicate: 2 # (Optional) Replicate all particles along each axis a given integer number of times. Default 1.
# Parameters controlling restarts
Restarts:
......
......@@ -3665,10 +3665,10 @@ int engine_estimate_nr_tasks(struct engine *e) {
* @brief Rebuild the space and tasks.
*
* @param e The #engine.
* @param clean_h_values Are we cleaning up the values of h before building
* the tasks ?
* @param clean_smoothing_length_values Are we cleaning up the values of
* the smoothing lengths before building the tasks ?
*/
void engine_rebuild(struct engine *e, int clean_h_values) {
void engine_rebuild(struct engine *e, int clean_smoothing_length_values) {
const ticks tic = getticks();
......@@ -3679,7 +3679,7 @@ void engine_rebuild(struct engine *e, int clean_h_values) {
space_rebuild(e->s, e->verbose);
/* Initial cleaning up session ? */
if (clean_h_values) space_sanitize(e->s);
if (clean_smoothing_length_values) space_sanitize(e->s);
/* If in parallel, exchange the cell structure, top-level and neighbouring
* multipoles. */
......
......@@ -2948,8 +2948,8 @@ void space_init(struct space *s, const struct swift_params *params,
}
/* Apply h scaling */
const double scaling =
parser_get_opt_param_double(params, "InitialConditions:h_scaling", 1.0);
const double scaling = parser_get_opt_param_double(
params, "InitialConditions:smoothing_length_scaling", 1.0);
if (scaling != 1.0 && !dry_run) {
message("Re-scaling smoothing lengths by a factor %e", scaling);
for (size_t k = 0; k < Npart; k++) parts[k].h *= scaling;
......
Supports Markdown
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