Commit b2efc6e3 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Also add the option to name columns in the cooling i/o

parent 9058a801
......@@ -30,11 +30,14 @@
/**
* @brief Writes the current model of cooling to the file
*
* @param h_grp The HDF5 group in which to write
* @param cooling the parameters of the cooling function.
* @param h_grp_columns The HDF5 group containing named columns
* @param cooling The #cooling_function_data
*/
__attribute__((always_inline)) INLINE static void cooling_write_flavour(
hid_t h_grp, const struct cooling_function_data* cooling) {
hid_t h_grp, hid_t h_grp_columns,
const struct cooling_function_data* cooling) {
io_write_attribute_s(h_grp, "Cooling Model", "Compton cooling");
io_write_attribute_d(h_grp, "Compton rate [erg s^-1 K^-1]",
......
......@@ -32,10 +32,12 @@
* @brief Writes the current model of cooling to the file.
*
* @param h_grp The HDF5 group in which to write
* @param h_grp_columns The HDF5 group containing named columns
* @param cooling The #cooling_function_data
*/
__attribute__((always_inline)) INLINE static void cooling_write_flavour(
hid_t h_grp, const struct cooling_function_data* cooling) {
hid_t h_grp, hid_t h_grp_columns,
const struct cooling_function_data* cooling) {
io_write_attribute_s(h_grp, "Cooling Model", "EAGLE");
}
......
......@@ -32,10 +32,12 @@
* @brief Writes the current model of cooling to the file.
*
* @param h_grp The HDF5 group in which to write
* @param h_grp_columns The HDF5 group containing named columns
* @param cooling The #cooling_function_data
*/
__attribute__((always_inline)) INLINE static void cooling_write_flavour(
hid_t h_grp, const struct cooling_function_data* cooling) {
hid_t h_grp, hid_t h_grp_columns,
const struct cooling_function_data* cooling) {
io_write_attribute_s(h_grp, "Cooling Model",
"Quick Lyman-alpha (EAGLE with primordial Z only)");
......
......@@ -41,11 +41,14 @@
/**
* @brief Writes the current model of SPH to the file
*
* @param h_grp The HDF5 group in which to write
* @param cooling the parameters of the cooling function.
* @param h_grp_columns The HDF5 group containing named columns
* @param cooling The #cooling_function_data
*/
__attribute__((always_inline)) INLINE static void cooling_write_flavour(
hid_t h_grp, const struct cooling_function_data* cooling) {
hid_t h_grp, hid_t h_grp_columns,
const struct cooling_function_data* cooling) {
io_write_attribute_s(h_grp, "Cooling Model", "Constant du/dt");
}
......
......@@ -39,11 +39,14 @@
/**
* @brief Writes the current model of cooling to the file
*
* @param h_grp The HDF5 group in which to write
* @param cooling the parameters of the cooling function.
* @param h_grp_columns The HDF5 group containing named columns
* @param cooling The #cooling_function_data
*/
__attribute__((always_inline)) INLINE static void cooling_write_flavour(
hid_t h_grp, const struct cooling_function_data* cooling) {
hid_t h_grp, hid_t h_grp_columns,
const struct cooling_function_data* cooling) {
io_write_attribute_s(h_grp, "Cooling Model", "Constant Lambda");
io_write_attribute_d(h_grp, "Lambda/n_H^2 [cgs]", cooling->lambda_nH2_cgs);
......
......@@ -27,10 +27,14 @@
/**
* @brief Writes the current model of cooling to the file
*
* @param h_grp The HDF5 group in which to write
* @param h_grp_columns The HDF5 group containing named columns
* @param cooling The #cooling_function_data
*/
__attribute__((always_inline)) INLINE static void cooling_write_flavour(
hid_t h_grp, const struct cooling_function_data* cooling) {
hid_t h_grp, hid_t h_grp_columns,
const struct cooling_function_data* cooling) {
#if COOLING_GRACKLE_MODE == 0
io_write_attribute_s(h_grp, "Cooling Model", "Grackle");
......
......@@ -30,11 +30,14 @@
/**
* @brief Writes the current model of SPH to the file
*
* @param h_grp The HDF5 group in which to write
* @param h_grp_columns The HDF5 group containing named columns
* @param cooling the parameters of the cooling function.
*/
__attribute__((always_inline)) INLINE static void cooling_write_flavour(
hid_t h_grp, const struct cooling_function_data* cooling) {
hid_t h_grp, hid_t h_grp_columns,
const struct cooling_function_data* cooling) {
io_write_attribute_s(h_grp, "Cooling Model", "None");
}
......
......@@ -1178,7 +1178,7 @@ void prepare_file(struct engine* e, const char* baseName, long long N_total[6],
H5Gcreate(h_grp, "NamedColumns", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (h_grp_columns < 0) error("Error while creating named columns group");
entropy_floor_write_flavour(h_grp);
cooling_write_flavour(h_grp, e->cooling_func);
cooling_write_flavour(h_grp, h_grp_columns, e->cooling_func);
chemistry_write_flavour(h_grp, h_grp_columns);
tracers_write_flavour(h_grp);
feedback_write_flavour(e->feedback_props, h_grp);
......
......@@ -1043,7 +1043,7 @@ void write_output_serial(struct engine* e, const char* baseName,
H5Gcreate(h_grp, "NamedColumns", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (h_grp_columns < 0) error("Error while creating named columns group");
entropy_floor_write_flavour(h_grp);
cooling_write_flavour(h_grp, e->cooling_func);
cooling_write_flavour(h_grp, h_grp_columns, e->cooling_func);
chemistry_write_flavour(h_grp, h_grp_columns);
tracers_write_flavour(h_grp);
feedback_write_flavour(e->feedback_props, h_grp);
......
......@@ -888,7 +888,7 @@ void write_output_single(struct engine* e, const char* baseName,
H5Gcreate(h_grp, "NamedColumns", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (h_grp_columns < 0) error("Error while creating named columns group");
entropy_floor_write_flavour(h_grp);
cooling_write_flavour(h_grp, e->cooling_func);
cooling_write_flavour(h_grp, h_grp_columns, e->cooling_func);
chemistry_write_flavour(h_grp, h_grp_columns);
tracers_write_flavour(h_grp);
feedback_write_flavour(e->feedback_props, h_grp);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment