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

Read tree opening angle from YAML file.

parent 59c8e5d0
...@@ -28,7 +28,8 @@ Statistics: ...@@ -28,7 +28,8 @@ Statistics:
# Parameters for the self-gravity scheme # Parameters for the self-gravity scheme
Gravity: Gravity:
eta: 0.025 # Constant dimensionless multiplier for time integration. eta: 0.025 # Constant dimensionless multiplier for time integration.
theta: 0.7 # Opening angle (Multipole acceptance criterion)
epsilon: 0.0001 # Softening length (in internal units). epsilon: 0.0001 # Softening length (in internal units).
a_smooth: 1000. a_smooth: 1000.
r_cut: 4. r_cut: 4.
......
...@@ -52,6 +52,7 @@ SPH: ...@@ -52,6 +52,7 @@ SPH:
# Parameters for the self-gravity scheme # Parameters for the self-gravity scheme
Gravity: Gravity:
eta: 0.025 # Constant dimensionless multiplier for time integration. eta: 0.025 # Constant dimensionless multiplier for time integration.
theta: 0.7 # Opening angle (Multipole acceptance criterion)
epsilon: 0.1 # Softening length (in internal units). epsilon: 0.1 # Softening length (in internal units).
a_smooth: 1.25 # (Optional) Smoothing scale in top-level cell sizes to smooth the long-range forces over (this is the default value). a_smooth: 1.25 # (Optional) Smoothing scale in top-level cell sizes to smooth the long-range forces over (this is the default value).
r_cut: 4.5 # (Optional) Cut-off in number of top-level cells beyond which no FMM forces are computed (this is the default value). r_cut: 4.5 # (Optional) Cut-off in number of top-level cells beyond which no FMM forces are computed (this is the default value).
......
...@@ -47,6 +47,10 @@ void gravity_props_init(struct gravity_props *p, ...@@ -47,6 +47,10 @@ void gravity_props_init(struct gravity_props *p,
/* Time integration */ /* Time integration */
p->eta = parser_get_param_float(params, "Gravity:eta"); p->eta = parser_get_param_float(params, "Gravity:eta");
/* Opening angle */
p->theta = parser_get_param_double(params, "Gravity:theta");
p->theta_inv = 1. / p->theta;
/* Softening lengths */ /* Softening lengths */
p->epsilon = parser_get_param_double(params, "Gravity:epsilon"); p->epsilon = parser_get_param_double(params, "Gravity:epsilon");
p->epsilon2 = p->epsilon * p->epsilon; p->epsilon2 = p->epsilon * p->epsilon;
...@@ -59,7 +63,9 @@ void gravity_props_print(const struct gravity_props *p) { ...@@ -59,7 +63,9 @@ void gravity_props_print(const struct gravity_props *p) {
message("Self-gravity time integration: eta=%.4f", p->eta); message("Self-gravity time integration: eta=%.4f", p->eta);
message("Self-gravity softening: epsilon=%.4f", p->epsilon); message("Self-gravity opening angle: theta=%.4f", p->theta);
message("Self-gravity softening: epsilon=%.4f", p->epsilon);
if (p->a_smooth != gravity_props_default_a_smooth) if (p->a_smooth != gravity_props_default_a_smooth)
message("Self-gravity smoothing-scale: a_smooth=%f", p->a_smooth); message("Self-gravity smoothing-scale: a_smooth=%f", p->a_smooth);
...@@ -73,7 +79,8 @@ void gravity_props_print_snapshot(hid_t h_grpgrav, ...@@ -73,7 +79,8 @@ void gravity_props_print_snapshot(hid_t h_grpgrav,
const struct gravity_props *p) { const struct gravity_props *p) {
io_write_attribute_f(h_grpgrav, "Time integration eta", p->eta); io_write_attribute_f(h_grpgrav, "Time integration eta", p->eta);
io_write_attribute_f(h_grpgrav, "Softening", p->epsilon); io_write_attribute_f(h_grpgrav, "Softening length", p->epsilon);
io_write_attribute_f(h_grpgrav, "Opening angle", p->theta);
io_write_attribute_f(h_grpgrav, "MM a_smooth", p->a_smooth); io_write_attribute_f(h_grpgrav, "MM a_smooth", p->a_smooth);
io_write_attribute_f(h_grpgrav, "MM r_cut", p->r_cut); io_write_attribute_f(h_grpgrav, "MM r_cut", p->r_cut);
} }
......
...@@ -41,6 +41,12 @@ struct gravity_props { ...@@ -41,6 +41,12 @@ struct gravity_props {
/*! Time integration dimensionless multiplier */ /*! Time integration dimensionless multiplier */
float eta; float eta;
/*! Tree opening angle (Multipole acceptance criterion) */
double theta;
/*! Inverse of opening angle */
double theta_inv;
/*! Softening length */ /*! Softening length */
double epsilon; double epsilon;
......
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