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

Print the description of the output fields as comments in the output list yaml file.

parent 20e2cd54
Branches
Tags
1 merge request!824Add a description and a scale-factor exponent to each individual array written to the snapshots.
......@@ -22,6 +22,8 @@
/* Some standard headers. */
#include <stdlib.h>
#include "timeline.h"
/**
* @brief Particle fields for the black hole particles.
*
......
......@@ -25,6 +25,7 @@
#include "common_io.h"
/* Local includes. */
#include "black_holes_io.h"
#include "chemistry_io.h"
#include "engine.h"
#include "error.h"
......@@ -1819,6 +1820,10 @@ void io_write_output_field_parameter(const char* filename) {
stars_write_particles(NULL, list, &num_fields);
break;
case swift_type_black_hole:
black_holes_write_particles(NULL, list, &num_fields);
break;
default:
break;
}
......@@ -1830,7 +1835,9 @@ void io_write_output_field_parameter(const char* filename) {
/* Write all the fields of this particle type */
for (int i = 0; i < num_fields; ++i)
fprintf(file, " %s_%s: 1\n", list[i].name, part_type_names[ptype]);
fprintf(file, " %s_%s: %*d \t # %s\n", list[i].name,
part_type_names[ptype], (int)(28 - strlen(list[i].name)), 1,
list[i].description);
fprintf(file, "\n");
}
......
......@@ -116,8 +116,8 @@ INLINE static void darkmatter_write_particles(const struct gpart* gparts,
list[3] =
io_make_output_field("ParticleIDs", ULONGLONG, 1, UNIT_CONV_NO_UNITS, 0.f,
gparts, id_or_neg_offset, "");
list[4] = io_make_output_field("GroupIDs", INT, 1, UNIT_CONV_NO_UNITS, 0.f, gparts,
group_id, "");
list[4] = io_make_output_field("GroupIDs", INT, 1, UNIT_CONV_NO_UNITS, 0.f,
gparts, group_id, "");
}
#endif /* SWIFT_DEFAULT_GRAVITY_IO_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment