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

Print the type of softening and truncation function to stdout and snapshots.

parent a9926208
No related branches found
No related tags found
2 merge requests!566Periodic gravity calculation,!565Mesh force task
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "error.h" #include "error.h"
#include "gravity.h" #include "gravity.h"
#include "kernel_gravity.h" #include "kernel_gravity.h"
#include "kernel_long_gravity.h"
#define gravity_props_default_a_smooth 1.25f #define gravity_props_default_a_smooth 1.25f
#define gravity_props_default_r_cut_max 4.5f #define gravity_props_default_r_cut_max 4.5f
...@@ -112,6 +113,8 @@ void gravity_props_print(const struct gravity_props *p) { ...@@ -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 opening angle: theta=%.4f", p->theta_crit);
message("Self-gravity softening: %s", kernel_gravity_softening_name);
message( message(
"Self-gravity comoving softening: epsilon=%.4f (Plummer equivalent: " "Self-gravity comoving softening: epsilon=%.4f (Plummer equivalent: "
"%.4f)", "%.4f)",
...@@ -127,8 +130,11 @@ void gravity_props_print(const struct gravity_props *p) { ...@@ -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 side-length: N=%d", p->mesh_size);
message("Self-gravity mesh smoothing-scale: a_smooth=%f", p->a_smooth); 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 tree cut-off ratio: 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 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); message("Self-gravity tree update frequency: f=%f", p->rebuild_frequency);
} }
...@@ -137,9 +143,9 @@ void gravity_props_print(const struct gravity_props *p) { ...@@ -137,9 +143,9 @@ void gravity_props_print(const struct gravity_props *p) {
void gravity_props_print_snapshot(hid_t h_grpgrav, 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, "Tree update frequency",
p->rebuild_frequency);
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_s(h_grpgrav, "Softening style",
kernel_gravity_softening_name);
io_write_attribute_f( io_write_attribute_f(
h_grpgrav, "Comoving softening length", h_grpgrav, "Comoving softening length",
p->epsilon_comoving * kernel_gravity_softening_plummer_equivalent); p->epsilon_comoving * kernel_gravity_softening_plummer_equivalent);
...@@ -155,8 +161,12 @@ void gravity_props_print_snapshot(hid_t h_grpgrav, ...@@ -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_f(h_grpgrav, "Opening angle", p->theta_crit);
io_write_attribute_d(h_grpgrav, "MM order", SELF_GRAVITY_MULTIPOLE_ORDER); 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 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_max ratio", 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_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 #endif
......
...@@ -32,10 +32,12 @@ ...@@ -32,10 +32,12 @@
/*! Conversion factor between Plummer softening and internal softening */ /*! Conversion factor between Plummer softening and internal softening */
#define kernel_gravity_softening_plummer_equivalent 2.8 #define kernel_gravity_softening_plummer_equivalent 2.8
#define kernel_gravity_softening_plummer_equivalent_inv (1. / 2.8) #define kernel_gravity_softening_plummer_equivalent_inv (1. / 2.8)
#define kernel_gravity_softening_name "Gadget-2 (spline kernel)"
#else #else
/*! Conversion factor between Plummer softening and internal softening */ /*! Conversion factor between Plummer softening and internal softening */
#define kernel_gravity_softening_plummer_equivalent 3. #define kernel_gravity_softening_plummer_equivalent 3.
#define kernel_gravity_softening_plummer_equivalent_inv (1. / 3.) #define kernel_gravity_softening_plummer_equivalent_inv (1. / 3.)
#define kernel_gravity_softening_name "Wendland-C2"
#endif /* GADGET2_SOFTENING_CORRECTION */ #endif /* GADGET2_SOFTENING_CORRECTION */
/** /**
......
...@@ -33,6 +33,12 @@ ...@@ -33,6 +33,12 @@
#define GADGET2_LONG_RANGE_CORRECTION #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 * @brief Derivatives of the long-range truncation function \f$\chi(r,r_s)\f$ up
* to 5th order. * to 5th order.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment