Commit 8c30fc47 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Removed h_max from the YAML file. Users can now specify a maximal number of top-level cells.

parent a214d1a2
......@@ -8,11 +8,12 @@ InternalUnitSystem:
# Parameters for the task scheduling
Scheduler:
nr_queues: 0 # (Optional) The number of task queues to use. Use 0 to let the system decide.
cell_max_size: 8000000 # (Optional) Maximal number of interactions per task if we force the split (this is the default value).
cell_sub_size: 64000000 # (Optional) Maximal number of interactions per sub-task (this is the default value).
cell_split_size: 400 # (Optional) Maximal number of particles per cell (this is the default value).
cell_max_count: 10000 # (Optional) Maximal number of particles per cell allowed before triggering a sanitizing (this is the default value).
nr_queues: 0 # (Optional) The number of task queues to use. Use 0 to let the system decide.
cell_max_size: 8000000 # (Optional) Maximal number of interactions per task if we force the split (this is the default value).
cell_sub_size: 64000000 # (Optional) Maximal number of interactions per sub-task (this is the default value).
cell_split_size: 400 # (Optional) Maximal number of particles per cell (this is the default value).
cell_max_count: 10000 # (Optional) Maximal number of particles per cell allowed before triggering a sanitizing (this is the default value).
max_top_level_cells: 12 # (Optional) Maximal number of top-level cells per dimension. The number of top-level cells will be the cube of this.
# Parameters governing the time integration
TimeIntegration:
......@@ -43,9 +44,8 @@ Statistics:
SPH:
resolution_eta: 1.2348 # Target smoothing length in units of the mean inter-particle separation (1.2348 == 48Ngbs with the cubic spline kernel).
delta_neighbours: 0.1 # The tolerance for the targetted number of neighbours.
max_ghost_iterations: 30 # (Optional) Maximal number of iterations allowed to converge towards the smoothing length.
max_smoothing_length: 0.1 # Maximal smoothing length allowed (in internal units).
CFL_condition: 0.1 # Courant-Friedrich-Levy condition for time integration.
max_ghost_iterations: 30 # (Optional) Maximal number of iterations allowed to converge towards the smoothing length.
max_volume_change: 2. # (Optional) Maximal allowed change of kernel volume over one time-step
# Parameters related to the initial conditions
......
......@@ -1738,6 +1738,7 @@ void space_init(struct space *s, const struct swift_params *params,
s->dim[0] = dim[0];
s->dim[1] = dim[1];
s->dim[2] = dim[2];
const double dmax = max(max(dim[0], dim[1]), dim[2]);
s->periodic = periodic;
s->gravity = gravity;
s->nr_parts = Npart;
......@@ -1746,7 +1747,9 @@ void space_init(struct space *s, const struct swift_params *params,
s->nr_gparts = Ngpart;
s->size_gparts = Ngpart;
s->gparts = gparts;
s->cell_min = parser_get_param_double(params, "SPH:max_smoothing_length");
s->cell_min =
dmax / parser_get_opt_param_int(params, "Scheduler:max_top_level_cells",
space_max_top_level_cells_default);
s->nr_queues = 1; /* Temporary value until engine construction */
/* Get the constants for the scheduler */
......
......@@ -42,6 +42,7 @@
#define space_maxsize_default 8000000
#define space_subsize_default 64000000
#define space_maxcount_default 10000
#define space_max_top_level_cells_default 12
#define space_stretch 1.10f
#define space_maxreldx 0.25f
......
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