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

Read tree opening angle from YAML file.

parent 59c8e5d0
No related branches found
No related tags found
1 merge request!331Gravity multi dt
......@@ -28,7 +28,8 @@ Statistics:
# Parameters for the self-gravity scheme
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).
a_smooth: 1000.
r_cut: 4.
......
......@@ -52,6 +52,7 @@ SPH:
# Parameters for the self-gravity scheme
Gravity:
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).
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).
......
......@@ -47,6 +47,10 @@ void gravity_props_init(struct gravity_props *p,
/* Time integration */
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 */
p->epsilon = parser_get_param_double(params, "Gravity:epsilon");
p->epsilon2 = p->epsilon * p->epsilon;
......@@ -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 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)
message("Self-gravity smoothing-scale: a_smooth=%f", p->a_smooth);
......@@ -73,7 +79,8 @@ void gravity_props_print_snapshot(hid_t h_grpgrav,
const struct gravity_props *p) {
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 r_cut", p->r_cut);
}
......
......@@ -41,6 +41,12 @@ struct gravity_props {
/*! Time integration dimensionless multiplier */
float eta;
/*! Tree opening angle (Multipole acceptance criterion) */
double theta;
/*! Inverse of opening angle */
double theta_inv;
/*! Softening length */
double epsilon;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment