Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
aff8fd2f
Commit
aff8fd2f
authored
Apr 17, 2017
by
Matthieu Schaller
Browse files
Read tree opening angle from YAML file.
parent
59c8e5d0
Changes
4
Hide whitespace changes
Inline
Side-by-side
examples/EAGLE_12/eagle_12.yml
View file @
aff8fd2f
...
...
@@ -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.
...
...
examples/parameter_example.yml
View file @
aff8fd2f
...
...
@@ -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).
...
...
src/gravity_properties.c
View file @
aff8fd2f
...
...
@@ -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
);
}
...
...
src/gravity_properties.h
View file @
aff8fd2f
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment