Skip to content
GitLab
Menu
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
8120990d
Commit
8120990d
authored
Jun 12, 2018
by
Matthieu Schaller
Committed by
Matthieu Schaller
Jun 18, 2018
Browse files
Print the type of softening and truncation function to stdout and snapshots.
parent
a9926208
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/gravity_properties.c
View file @
8120990d
...
...
@@ -31,6 +31,7 @@
#include
"error.h"
#include
"gravity.h"
#include
"kernel_gravity.h"
#include
"kernel_long_gravity.h"
#define gravity_props_default_a_smooth 1.25f
#define gravity_props_default_r_cut_max 4.5f
...
...
@@ -112,6 +113,8 @@ void gravity_props_print(const struct gravity_props *p) {
message
(
"Self-gravity opening angle: theta=%.4f"
,
p
->
theta_crit
);
message
(
"Self-gravity softening: %s"
,
kernel_gravity_softening_name
);
message
(
"Self-gravity comoving softening: epsilon=%.4f (Plummer equivalent: "
"%.4f)"
,
...
...
@@ -127,8 +130,11 @@ void gravity_props_print(const struct gravity_props *p) {
message
(
"Self-gravity mesh side-length: N=%d"
,
p
->
mesh_size
);
message
(
"Self-gravity mesh smoothing-scale: a_smooth=%f"
,
p
->
a_smooth
);
message
(
"Self-gravity tree cut-off: r_cut_max=%f"
,
p
->
r_cut_max
);
message
(
"Self-gravity truncation cut-off: r_cut_min=%f"
,
p
->
r_cut_min
);
message
(
"Self-gravity tree cut-off ratio: r_cut_max=%f"
,
p
->
r_cut_max
);
message
(
"Self-gravity truncation cut-off ratio: r_cut_min=%f"
,
p
->
r_cut_min
);
message
(
"Self-gravity mesh truncation function: %s"
,
kernel_gravity_softening_name
);
message
(
"Self-gravity tree update frequency: f=%f"
,
p
->
rebuild_frequency
);
}
...
...
@@ -137,9 +143,9 @@ void gravity_props_print(const struct gravity_props *p) {
void
gravity_props_print_snapshot
(
hid_t
h_grpgrav
,
const
struct
gravity_props
*
p
)
{
io_write_attribute_f
(
h_grpgrav
,
"Tree update frequency"
,
p
->
rebuild_frequency
);
io_write_attribute_f
(
h_grpgrav
,
"Time integration eta"
,
p
->
eta
);
io_write_attribute_s
(
h_grpgrav
,
"Softening style"
,
kernel_gravity_softening_name
);
io_write_attribute_f
(
h_grpgrav
,
"Comoving softening length"
,
p
->
epsilon_comoving
*
kernel_gravity_softening_plummer_equivalent
);
...
...
@@ -155,8 +161,12 @@ void gravity_props_print_snapshot(hid_t h_grpgrav,
io_write_attribute_f
(
h_grpgrav
,
"Opening angle"
,
p
->
theta_crit
);
io_write_attribute_d
(
h_grpgrav
,
"MM order"
,
SELF_GRAVITY_MULTIPOLE_ORDER
);
io_write_attribute_f
(
h_grpgrav
,
"Mesh a_smooth"
,
p
->
a_smooth
);
io_write_attribute_f
(
h_grpgrav
,
"Mesh r_cut_max"
,
p
->
r_cut_max
);
io_write_attribute_f
(
h_grpgrav
,
"Mesh r_cut_min"
,
p
->
r_cut_min
);
io_write_attribute_f
(
h_grpgrav
,
"Mesh r_cut_max ratio"
,
p
->
r_cut_max
);
io_write_attribute_f
(
h_grpgrav
,
"Mesh r_cut_min ratio"
,
p
->
r_cut_min
);
io_write_attribute_f
(
h_grpgrav
,
"Tree update frequency"
,
p
->
rebuild_frequency
);
io_write_attribute_s
(
h_grpgrav
,
"Mesh truncation function"
,
r
kernel_gravity_softening_name
);
}
#endif
...
...
src/kernel_gravity.h
View file @
8120990d
...
...
@@ -32,10 +32,12 @@
/*! Conversion factor between Plummer softening and internal softening */
#define kernel_gravity_softening_plummer_equivalent 2.8
#define kernel_gravity_softening_plummer_equivalent_inv (1. / 2.8)
#define kernel_gravity_softening_name "Gadget-2 (spline kernel)"
#else
/*! Conversion factor between Plummer softening and internal softening */
#define kernel_gravity_softening_plummer_equivalent 3.
#define kernel_gravity_softening_plummer_equivalent_inv (1. / 3.)
#define kernel_gravity_softening_name "Wendland-C2"
#endif
/* GADGET2_SOFTENING_CORRECTION */
/**
...
...
src/kernel_long_gravity.h
View file @
8120990d
...
...
@@ -33,6 +33,12 @@
#define GADGET2_LONG_RANGE_CORRECTION
#ifdef GADGET2_LONG_RANGE_CORRECTION
#define kernel_gravity_softening_name "Gadget-2 (error function)"
#else
#define kernel_gravity_softening_name "Exp-based Sigmoid"
#endif
/**
* @brief Derivatives of the long-range truncation function \f$\chi(r,r_s)\f$ up
* to 5th order.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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