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

Also add the new meta-data to the output when using the conversio functions.

parent f1a71a73
Branches
Tags
1 merge request!824Add a description and a scale-factor exponent to each individual array written to the snapshots.
......@@ -62,9 +62,9 @@ __attribute__((always_inline)) INLINE static int cooling_write_particles(
const struct part* parts, const struct xpart* xparts, struct io_props* list,
const struct cooling_function_data* cooling) {
list[0] = io_make_output_field_convert_part("Temperature", FLOAT, 1,
UNIT_CONV_TEMPERATURE, parts,
xparts, convert_part_T);
list[0] = io_make_output_field_convert_part(
"Temperature", FLOAT, 1, UNIT_CONV_TEMPERATURE, 0.f, parts, xparts,
convert_part_T, "Temperature of the particles");
return 1;
}
......
......@@ -108,9 +108,11 @@ INLINE static void darkmatter_write_particles(const struct gpart* gparts,
/* List what we want to write */
list[0] = io_make_output_field_convert_gpart(
"Coordinates", DOUBLE, 3, UNIT_CONV_LENGTH, gparts, convert_gpart_pos);
"Coordinates", DOUBLE, 3, UNIT_CONV_LENGTH, 1.f, gparts,
convert_gpart_pos, "Position of the particles");
list[1] = io_make_output_field_convert_gpart(
"Velocities", FLOAT, 3, UNIT_CONV_SPEED, gparts, convert_gpart_vel);
"Velocities", FLOAT, 3, UNIT_CONV_SPEED, 0.f, gparts, convert_gpart_vel,
"Peculiar velocites of the particles");
list[2] = io_make_output_field("Masses", FLOAT, 1, UNIT_CONV_MASS, 0.f,
gparts, mass, "");
list[3] =
......
......@@ -160,11 +160,12 @@ INLINE static void hydro_write_particles(const struct part* parts,
*num_fields = 10;
/* List what we want to write */
list[0] = io_make_output_field_convert_part("Coordinates", DOUBLE, 3,
UNIT_CONV_LENGTH, parts, xparts,
convert_part_pos);
list[0] = io_make_output_field_convert_part(
"Coordinates", DOUBLE, 3, UNIT_CONV_LENGTH, 1.f, parts, xparts,
convert_part_pos, "Co-moving position of the particles");
list[1] = io_make_output_field_convert_part(
"Velocities", FLOAT, 3, UNIT_CONV_SPEED, parts, xparts, convert_part_vel);
"Velocities", FLOAT, 3, UNIT_CONV_SPEED, 0.f, parts, xparts,
convert_part_vel, "Peculiar velocites of the particles");
list[2] = io_make_output_field("Masses", FLOAT, 1, UNIT_CONV_MASS, 0.f, parts,
mass, "Masses of the particles");
list[3] = io_make_output_field(
......@@ -179,15 +180,16 @@ INLINE static void hydro_write_particles(const struct part* parts,
list[6] =
io_make_output_field("Density", FLOAT, 1, UNIT_CONV_DENSITY, -3.f, parts,
rho, "Physical mass density of the particles");
list[7] = io_make_output_field_convert_part("Entropy", FLOAT, 1,
UNIT_CONV_ENTROPY_PER_UNIT_MASS,
parts, xparts, convert_S);
list[7] = io_make_output_field_convert_part(
"Entropy", FLOAT, 1, UNIT_CONV_ENTROPY_PER_UNIT_MASS, 0.f, parts, xparts,
convert_S, "Entropy per unit mass of the particles");
list[8] = io_make_output_field_convert_part(
"Pressure", FLOAT, 1, UNIT_CONV_PRESSURE, parts, xparts, convert_P);
"Pressure", FLOAT, 1, UNIT_CONV_PRESSURE, 3 * hydro_gamma, parts, xparts,
convert_P, "Pressure of the particles");
list[9] = io_make_output_field_convert_part("Potential", FLOAT, 1,
UNIT_CONV_POTENTIAL, parts,
xparts, convert_part_potential);
list[9] = io_make_output_field_convert_part(
"Potential", FLOAT, 1, UNIT_CONV_POTENTIAL, 1.f, parts, xparts,
convert_part_potential, "Gravitational potential of the particles");
}
/**
......
This diff is collapsed.
......@@ -66,7 +66,7 @@ INLINE static void stars_write_particles(const struct spart *sparts,
/* List what we want to write */
list[0] = io_make_output_field("Coordinates", DOUBLE, 3, UNIT_CONV_LENGTH,
1.f, sparts, x, "");
list[1] = io_make_output_field("Velocities", FLOAT, 3, UNIT_CONV_SPEED, 1.f,
list[1] = io_make_output_field("Velocities", FLOAT, 3, UNIT_CONV_SPEED, 0.f,
sparts, v, "");
list[2] = io_make_output_field("Masses", FLOAT, 1, UNIT_CONV_MASS, 0.f,
sparts, mass, "");
......
......@@ -61,8 +61,9 @@ __attribute__((always_inline)) INLINE static int velociraptor_write_parts(
struct io_props* list) {
list[0] = io_make_output_field_convert_part(
"GroupID", LONGLONG, 1, UNIT_CONV_NO_UNITS, parts, xparts,
velociraptor_convert_part_groupID);
"GroupID", LONGLONG, 1, UNIT_CONV_NO_UNITS, 0.f, parts, xparts,
velociraptor_convert_part_groupID,
"Group ID of the particle in the VELOCIraptor catalogue");
return 1;
}
......@@ -70,8 +71,9 @@ __attribute__((always_inline)) INLINE static int velociraptor_write_parts(
__attribute__((always_inline)) INLINE static int velociraptor_write_gparts(
const struct velociraptor_gpart_data* group_data, struct io_props* list) {
list[0] = io_make_output_field("GroupID", LONGLONG, 1, UNIT_CONV_NO_UNITS,
0.f, group_data, groupID, "");
list[0] = io_make_output_field(
"GroupID", LONGLONG, 1, UNIT_CONV_NO_UNITS, 0.f, group_data, groupID,
"Group ID of the particle in the VELOCIraptor catalogue");
return 1;
}
......@@ -80,8 +82,9 @@ __attribute__((always_inline)) INLINE static int velociraptor_write_sparts(
const struct spart* sparts, struct io_props* list) {
list[0] = io_make_output_field_convert_spart(
"GroupID", LONGLONG, 1, UNIT_CONV_NO_UNITS, sparts,
velociraptor_convert_spart_groupID);
"GroupID", LONGLONG, 1, UNIT_CONV_NO_UNITS, 0.f, sparts,
velociraptor_convert_spart_groupID,
"Group ID of the particle in the VELOCIraptor catalogue");
return 1;
}
......@@ -90,8 +93,9 @@ __attribute__((always_inline)) INLINE static int velociraptor_write_bparts(
const struct bpart* bparts, struct io_props* list) {
list[0] = io_make_output_field_convert_bpart(
"GroupID", LONGLONG, 1, UNIT_CONV_NO_UNITS, bparts,
velociraptor_convert_bpart_groupID);
"GroupID", LONGLONG, 1, UNIT_CONV_NO_UNITS, 0.f, bparts,
velociraptor_convert_bpart_groupID,
"Group ID of the particle in the VELOCIraptor catalogue");
return 1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment