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
...@@ -62,9 +62,9 @@ __attribute__((always_inline)) INLINE static int cooling_write_particles( ...@@ -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 part* parts, const struct xpart* xparts, struct io_props* list,
const struct cooling_function_data* cooling) { const struct cooling_function_data* cooling) {
list[0] = io_make_output_field_convert_part("Temperature", FLOAT, 1, list[0] = io_make_output_field_convert_part(
UNIT_CONV_TEMPERATURE, parts, "Temperature", FLOAT, 1, UNIT_CONV_TEMPERATURE, 0.f, parts, xparts,
xparts, convert_part_T); convert_part_T, "Temperature of the particles");
return 1; return 1;
} }
......
...@@ -108,9 +108,11 @@ INLINE static void darkmatter_write_particles(const struct gpart* gparts, ...@@ -108,9 +108,11 @@ INLINE static void darkmatter_write_particles(const struct gpart* gparts,
/* List what we want to write */ /* List what we want to write */
list[0] = io_make_output_field_convert_gpart( 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( 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, list[2] = io_make_output_field("Masses", FLOAT, 1, UNIT_CONV_MASS, 0.f,
gparts, mass, ""); gparts, mass, "");
list[3] = list[3] =
......
...@@ -160,11 +160,12 @@ INLINE static void hydro_write_particles(const struct part* parts, ...@@ -160,11 +160,12 @@ INLINE static void hydro_write_particles(const struct part* parts,
*num_fields = 10; *num_fields = 10;
/* List what we want to write */ /* List what we want to write */
list[0] = io_make_output_field_convert_part("Coordinates", DOUBLE, 3, list[0] = io_make_output_field_convert_part(
UNIT_CONV_LENGTH, parts, xparts, "Coordinates", DOUBLE, 3, UNIT_CONV_LENGTH, 1.f, parts, xparts,
convert_part_pos); convert_part_pos, "Co-moving position of the particles");
list[1] = io_make_output_field_convert_part( 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, list[2] = io_make_output_field("Masses", FLOAT, 1, UNIT_CONV_MASS, 0.f, parts,
mass, "Masses of the particles"); mass, "Masses of the particles");
list[3] = io_make_output_field( list[3] = io_make_output_field(
...@@ -179,15 +180,16 @@ INLINE static void hydro_write_particles(const struct part* parts, ...@@ -179,15 +180,16 @@ INLINE static void hydro_write_particles(const struct part* parts,
list[6] = list[6] =
io_make_output_field("Density", FLOAT, 1, UNIT_CONV_DENSITY, -3.f, parts, io_make_output_field("Density", FLOAT, 1, UNIT_CONV_DENSITY, -3.f, parts,
rho, "Physical mass density of the particles"); rho, "Physical mass density of the particles");
list[7] = io_make_output_field_convert_part("Entropy", FLOAT, 1, list[7] = io_make_output_field_convert_part(
UNIT_CONV_ENTROPY_PER_UNIT_MASS, "Entropy", FLOAT, 1, UNIT_CONV_ENTROPY_PER_UNIT_MASS, 0.f, parts, xparts,
parts, xparts, convert_S); convert_S, "Entropy per unit mass of the particles");
list[8] = io_make_output_field_convert_part( 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, list[9] = io_make_output_field_convert_part(
UNIT_CONV_POTENTIAL, parts, "Potential", FLOAT, 1, UNIT_CONV_POTENTIAL, 1.f, parts, xparts,
xparts, convert_part_potential); 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, ...@@ -66,7 +66,7 @@ INLINE static void stars_write_particles(const struct spart *sparts,
/* List what we want to write */ /* List what we want to write */
list[0] = io_make_output_field("Coordinates", DOUBLE, 3, UNIT_CONV_LENGTH, list[0] = io_make_output_field("Coordinates", DOUBLE, 3, UNIT_CONV_LENGTH,
1.f, sparts, x, ""); 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, ""); sparts, v, "");
list[2] = io_make_output_field("Masses", FLOAT, 1, UNIT_CONV_MASS, 0.f, list[2] = io_make_output_field("Masses", FLOAT, 1, UNIT_CONV_MASS, 0.f,
sparts, mass, ""); sparts, mass, "");
......
...@@ -61,8 +61,9 @@ __attribute__((always_inline)) INLINE static int velociraptor_write_parts( ...@@ -61,8 +61,9 @@ __attribute__((always_inline)) INLINE static int velociraptor_write_parts(
struct io_props* list) { struct io_props* list) {
list[0] = io_make_output_field_convert_part( list[0] = io_make_output_field_convert_part(
"GroupID", LONGLONG, 1, UNIT_CONV_NO_UNITS, parts, xparts, "GroupID", LONGLONG, 1, UNIT_CONV_NO_UNITS, 0.f, parts, xparts,
velociraptor_convert_part_groupID); velociraptor_convert_part_groupID,
"Group ID of the particle in the VELOCIraptor catalogue");
return 1; return 1;
} }
...@@ -70,8 +71,9 @@ __attribute__((always_inline)) INLINE static int velociraptor_write_parts( ...@@ -70,8 +71,9 @@ __attribute__((always_inline)) INLINE static int velociraptor_write_parts(
__attribute__((always_inline)) INLINE static int velociraptor_write_gparts( __attribute__((always_inline)) INLINE static int velociraptor_write_gparts(
const struct velociraptor_gpart_data* group_data, struct io_props* list) { const struct velociraptor_gpart_data* group_data, struct io_props* list) {
list[0] = io_make_output_field("GroupID", LONGLONG, 1, UNIT_CONV_NO_UNITS, list[0] = io_make_output_field(
0.f, group_data, groupID, ""); "GroupID", LONGLONG, 1, UNIT_CONV_NO_UNITS, 0.f, group_data, groupID,
"Group ID of the particle in the VELOCIraptor catalogue");
return 1; return 1;
} }
...@@ -80,8 +82,9 @@ __attribute__((always_inline)) INLINE static int velociraptor_write_sparts( ...@@ -80,8 +82,9 @@ __attribute__((always_inline)) INLINE static int velociraptor_write_sparts(
const struct spart* sparts, struct io_props* list) { const struct spart* sparts, struct io_props* list) {
list[0] = io_make_output_field_convert_spart( list[0] = io_make_output_field_convert_spart(
"GroupID", LONGLONG, 1, UNIT_CONV_NO_UNITS, sparts, "GroupID", LONGLONG, 1, UNIT_CONV_NO_UNITS, 0.f, sparts,
velociraptor_convert_spart_groupID); velociraptor_convert_spart_groupID,
"Group ID of the particle in the VELOCIraptor catalogue");
return 1; return 1;
} }
...@@ -90,8 +93,9 @@ __attribute__((always_inline)) INLINE static int velociraptor_write_bparts( ...@@ -90,8 +93,9 @@ __attribute__((always_inline)) INLINE static int velociraptor_write_bparts(
const struct bpart* bparts, struct io_props* list) { const struct bpart* bparts, struct io_props* list) {
list[0] = io_make_output_field_convert_bpart( list[0] = io_make_output_field_convert_bpart(
"GroupID", LONGLONG, 1, UNIT_CONV_NO_UNITS, bparts, "GroupID", LONGLONG, 1, UNIT_CONV_NO_UNITS, 0.f, bparts,
velociraptor_convert_bpart_groupID); velociraptor_convert_bpart_groupID,
"Group ID of the particle in the VELOCIraptor catalogue");
return 1; return 1;
} }
......
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