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

Be verbose about the choices made in the snapshots

parent a08bc6b1
No related branches found
No related tags found
1 merge request!195Gamma power speed up
......@@ -102,9 +102,6 @@ __attribute__((always_inline)) INLINE static void hydro_write_particles(
*/
void writeSPHflavour(hid_t h_grpsph) {
/* Kernel function description */
writeAttribute_s(h_grpsph, "Kernel", kernel_name);
/* Viscosity and thermal conduction */
writeAttribute_s(h_grpsph, "Thermal Conductivity Model",
"Price (2008) without switch");
......
......@@ -102,9 +102,6 @@ __attribute__((always_inline)) INLINE static void hydro_write_particles(
*/
void writeSPHflavour(hid_t h_grpsph) {
/* Kernel function description */
writeAttribute_s(h_grpsph, "Kernel", kernel_name);
/* Viscosity and thermal conduction */
writeAttribute_s(h_grpsph, "Thermal Conductivity Model",
"(No treatment) Legacy Gadget-2 as in Springel (2005)");
......
......@@ -102,9 +102,6 @@ __attribute__((always_inline)) INLINE static void hydro_write_particles(
*/
void writeSPHflavour(hid_t h_grpsph) {
/* Kernel function description */
writeAttribute_s(h_grpsph, "Kernel", kernel_name);
/* Viscosity and thermal conduction */
/* Nothing in this minimal model... */
writeAttribute_s(h_grpsph, "Thermal Conductivity Model", "No model");
......
......@@ -25,6 +25,7 @@
#include <math.h>
/* Local headers. */
#include "common_io.h"
#include "error.h"
#include "gamma.h"
#include "hydro.h"
......@@ -70,3 +71,21 @@ void hydro_props_print(const struct hydro_props *p) {
message("Maximal iterations in ghost task set to %d (default is %d)",
p->max_smoothing_iterations, hydro_props_default_max_iterations);
}
#if defined(HAVE_HDF5)
void hydro_props_print_snapshot(hid_t h_grpsph, const struct hydro_props *p) {
writeAttribute_f(h_grpsph, "Adiabatic index", hydro_gamma);
writeAttribute_s(h_grpsph, "Scheme", SPH_IMPLEMENTATION);
writeAttribute_s(h_grpsph, "Kernel function", kernel_name);
writeAttribute_f(h_grpsph, "Kernel target N_ngb", p->target_neighbours);
writeAttribute_f(h_grpsph, "Kernel delta N_ngb", p->delta_neighbours);
writeAttribute_f(h_grpsph, "Kernel eta", p->eta_neighbours);
writeAttribute_f(h_grpsph, "CFL parameter", p->CFL_condition);
writeAttribute_f(h_grpsph, "Volume log(max(delta h))", p->log_max_h_change);
writeAttribute_f(h_grpsph, "Volume max change time-step",
powf(expf(p->log_max_h_change), 3.f));
writeAttribute_f(h_grpsph, "Max ghost iterations",
p->max_smoothing_iterations);
}
#endif
......@@ -23,6 +23,10 @@
/* Config parameters. */
#include "../config.h"
#if defined(HAVE_HDF5)
#include <hdf5.h>
#endif
/* Local includes. */
#include "const.h"
#include "parser.h"
......@@ -53,4 +57,8 @@ struct hydro_props {
void hydro_props_print(const struct hydro_props *p);
void hydro_props_init(struct hydro_props *p, const struct swift_params *params);
#if defined(HAVE_HDF5)
void hydro_props_print_snapshot(hid_t h_grpsph, const struct hydro_props *p);
#endif
#endif /* SWIFT_HYDRO_PROPERTIES */
......@@ -39,6 +39,7 @@
#include "common_io.h"
#include "engine.h"
#include "error.h"
#include "hydro_properties.h"
#include "kernel_hydro.h"
#include "part.h"
#include "units.h"
......@@ -639,8 +640,10 @@ void write_output_parallel(struct engine* e, const char* baseName,
writeCodeDescription(h_file);
/* Print the SPH parameters */
h_grp = H5Gcreate(h_file, "/SPH", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
h_grp =
H5Gcreate(h_file, "/HydroScheme", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (h_grp < 0) error("Error while creating SPH group");
hydro_props_print_snapshot(h_grp, e->hydro_properties);
writeSPHflavour(h_grp);
H5Gclose(h_grp);
......
......@@ -39,6 +39,7 @@
#include "common_io.h"
#include "engine.h"
#include "error.h"
#include "hydro_properties.h"
#include "kernel_hydro.h"
#include "part.h"
#include "units.h"
......@@ -714,8 +715,10 @@ void write_output_serial(struct engine* e, const char* baseName,
writeCodeDescription(h_file);
/* Print the SPH parameters */
h_grp = H5Gcreate(h_file, "/SPH", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
h_grp = H5Gcreate(h_file, "/HydroScheme", H5P_DEFAULT, H5P_DEFAULT,
H5P_DEFAULT);
if (h_grp < 0) error("Error while creating SPH group");
hydro_props_print_snapshot(h_grp, e->hydro_properties);
writeSPHflavour(h_grp);
H5Gclose(h_grp);
......
......@@ -38,6 +38,7 @@
#include "common_io.h"
#include "engine.h"
#include "error.h"
#include "hydro_properties.h"
#include "kernel_hydro.h"
#include "part.h"
#include "units.h"
......@@ -564,8 +565,10 @@ void write_output_single(struct engine* e, const char* baseName,
writeCodeDescription(h_file);
/* Print the SPH parameters */
h_grp = H5Gcreate(h_file, "/SPH", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
h_grp =
H5Gcreate(h_file, "/HydroScheme", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (h_grp < 0) error("Error while creating SPH group");
hydro_props_print_snapshot(h_grp, e->hydro_properties);
writeSPHflavour(h_grp);
H5Gclose(h_grp);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment