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

Added description and scale-factor dependence to all the EAGLE i/o fields

parent 35370a29
......@@ -29,9 +29,9 @@
* @param list The list of i/o properties to read.
* @param num_fields The number of i/o fields to read.
*/
INLINE static void black_holes_read_particles(struct bpart *bparts,
struct io_props *list,
int *num_fields) {
INLINE static void black_holes_read_particles(struct bpart* bparts,
struct io_props* list,
int* num_fields) {
/* Say how much we want to read */
*num_fields = 6;
......@@ -51,6 +51,53 @@ INLINE static void black_holes_read_particles(struct bpart *bparts,
UNIT_CONV_ENERGY, bparts, energy_reservoir);
}
INLINE static void convert_bpart_pos(const struct engine* e,
const struct bpart* bp, double* ret) {
if (e->s->periodic) {
ret[0] = box_wrap(bp->x[0], 0.0, e->s->dim[0]);
ret[1] = box_wrap(bp->x[1], 0.0, e->s->dim[1]);
ret[2] = box_wrap(bp->x[2], 0.0, e->s->dim[2]);
} else {
ret[0] = bp->x[0];
ret[1] = bp->x[1];
ret[2] = bp->x[2];
}
}
INLINE static void convert_bpart_vel(const struct engine* e,
const struct bpart* bp, float* ret) {
const int with_cosmology = (e->policy & engine_policy_cosmology);
const struct cosmology* cosmo = e->cosmology;
const integertime_t ti_current = e->ti_current;
const double time_base = e->time_base;
const integertime_t ti_beg = get_integer_time_begin(ti_current, bp->time_bin);
const integertime_t ti_end = get_integer_time_end(ti_current, bp->time_bin);
/* Get time-step since the last kick */
float dt_kick_grav;
if (with_cosmology) {
dt_kick_grav = cosmology_get_grav_kick_factor(cosmo, ti_beg, ti_current);
dt_kick_grav -=
cosmology_get_grav_kick_factor(cosmo, ti_beg, (ti_beg + ti_end) / 2);
} else {
dt_kick_grav = (ti_current - ((ti_beg + ti_end) / 2)) * time_base;
}
/* Extrapolate the velocites to the current time */
const struct gpart* gp = bp->gpart;
ret[0] = gp->v_full[0] + gp->a_grav[0] * dt_kick_grav;
ret[1] = gp->v_full[1] + gp->a_grav[1] * dt_kick_grav;
ret[2] = gp->v_full[2] + gp->a_grav[2] * dt_kick_grav;
/* Conversion from internal units to peculiar velocities */
ret[0] *= cosmo->a_inv;
ret[1] *= cosmo->a_inv;
ret[2] *= cosmo->a_inv;
}
/**
* @brief Specifies which b-particle fields to write to a dataset
*
......@@ -58,40 +105,72 @@ INLINE static void black_holes_read_particles(struct bpart *bparts,
* @param list The list of i/o properties to write.
* @param num_fields The number of i/o fields to write.
*/
INLINE static void black_holes_write_particles(const struct bpart *bparts,
struct io_props *list,
int *num_fields) {
INLINE static void black_holes_write_particles(const struct bpart* bparts,
struct io_props* list,
int* num_fields,
int with_cosmology) {
/* Say how much we want to write */
*num_fields = 12;
/* List what we want to write */
list[0] = io_make_output_field("Coordinates", DOUBLE, 3, UNIT_CONV_LENGTH,
bparts, x);
list[1] =
io_make_output_field("Velocities", FLOAT, 3, UNIT_CONV_SPEED, bparts, v);
list[0] = io_make_output_field_convert_bpart(
"Coordinates", DOUBLE, 3, UNIT_CONV_LENGTH, 1.f, bparts,
convert_bpart_pos, "Co-moving position of the particles");
list[1] = io_make_output_field_convert_bpart(
"Velocities", FLOAT, 3, UNIT_CONV_SPEED, 0.f, bparts, convert_bpart_vel,
"Peculiar velocities of the particles. This is a * dx/dt where x is the "
"co-moving position of the particles.");
list[2] =
io_make_output_field("Masses", FLOAT, 1, UNIT_CONV_MASS, bparts, mass);
io_make_output_field("DynamicalMasses", FLOAT, 1, UNIT_CONV_MASS, 0.f,
bparts, mass, "Dynamical masses of the particles");
list[3] = io_make_output_field("ParticleIDs", LONGLONG, 1, UNIT_CONV_NO_UNITS,
bparts, id);
list[4] = io_make_output_field("SmoothingLength", FLOAT, 1, UNIT_CONV_LENGTH,
bparts, h);
list[5] = io_make_output_field("SubgridMasses", FLOAT, 1, UNIT_CONV_MASS,
bparts, subgrid_mass);
list[6] = io_make_output_field("FormationTime", FLOAT, 1, UNIT_CONV_TIME,
bparts, formation_time);
list[7] = io_make_output_field("GasDensity", FLOAT, 1, UNIT_CONV_DENSITY,
bparts, rho_gas);
list[8] = io_make_output_field("GasSoundSpeed", FLOAT, 1, UNIT_CONV_SPEED,
bparts, sound_speed_gas);
list[9] = io_make_output_field("EnergyReservoir", FLOAT, 1, UNIT_CONV_ENERGY,
bparts, energy_reservoir);
list[10] = io_make_output_field("AccretionRate", FLOAT, 1,
UNIT_CONV_MASS_PER_UNIT_TIME, bparts,
accretion_rate);
list[11] = io_make_output_field("TotalAccretedMass", FLOAT, 1,
UNIT_CONV_MASS_PER_UNIT_TIME, bparts,
total_accreted_mass);
0.f, bparts, id, "Unique ID of the particles");
list[4] = io_make_output_field(
"SmoothingLengths", FLOAT, 1, UNIT_CONV_LENGTH, 1.f, bparts, h,
"Co-moving smoothing lengths (FWHM of the kernel) of the particles");
list[5] = io_make_output_field("SubgridMasses", FLOAT, 1, UNIT_CONV_MASS, 0.f,
bparts, subgrid_mass,
"Subgrid masses of the particles");
if (with_cosmology) {
list[6] = io_make_output_field(
"FormationScaleFactors", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, bparts,
formation_scale_factor, "Scale-factors at which the BHs were formed");
} else {
list[6] = io_make_output_field("FormationTimes", FLOAT, 1, UNIT_CONV_TIME,
0.f, bparts, formation_time,
"Times at which the BHs were formed");
}
list[7] = io_make_output_field(
"GasDensities", FLOAT, 1, UNIT_CONV_DENSITY, 0.f, bparts, rho_gas,
"Co-moving densities of the gas around the particles");
list[8] = io_make_output_field(
"GasSoundSpeeds", FLOAT, 1, UNIT_CONV_SPEED, 1.5f * hydro_gamma_minus_one,
bparts, sound_speed_gas,
"Co-moving sound-speeds of the gas around the particles");
list[9] = io_make_output_field(
"EnergyReservoirs", FLOAT, 1, UNIT_CONV_ENERGY, 0.f, bparts,
energy_reservoir,
"Physcial energy contained in the feedback reservoir of the particles");
list[10] = io_make_output_field(
"AccretionRates", FLOAT, 1, UNIT_CONV_MASS_PER_UNIT_TIME, 0.f, bparts,
accretion_rate,
"Physical instantaneous accretion rates of the particles");
list[11] = io_make_output_field(
"TotalAccretedMasses", FLOAT, 1, UNIT_CONV_MASS_PER_UNIT_TIME, 0.f,
bparts, total_accreted_mass,
"Total masses accreted onto the particles since its birth");
#ifdef DEBUG_INTERACTIONS_BLACK_HOLES
......
......@@ -19,6 +19,8 @@
#ifndef SWIFT_EAGLE_BLACK_HOLE_PART_H
#define SWIFT_EAGLE_BLACK_HOLE_PART_H
#include "timeline.h"
/**
* @brief Particle fields for the black hole particles.
*
......
......@@ -58,50 +58,72 @@ INLINE static int chemistry_write_particles(const struct part* parts,
struct io_props* list) {
/* List what we want to write */
list[0] = io_make_output_field("ElementAbundance", FLOAT,
chemistry_element_count, UNIT_CONV_NO_UNITS,
parts, chemistry_data.metal_mass_fraction);
list[0] = io_make_output_field(
"ElementMassFractions", FLOAT, chemistry_element_count,
UNIT_CONV_NO_UNITS, 0.f, parts, chemistry_data.metal_mass_fraction,
"Fractions of the particles' masses that are in the given element");
list[1] = io_make_output_field(
"SmoothedElementAbundance", FLOAT, chemistry_element_count,
UNIT_CONV_NO_UNITS, parts, chemistry_data.smoothed_metal_mass_fraction);
UNIT_CONV_NO_UNITS, 0.f, parts,
chemistry_data.smoothed_metal_mass_fraction,
"Smoothed fractions of the particles' masses that are "
"in the given element");
list[2] =
io_make_output_field("Metallicity", FLOAT, 1, UNIT_CONV_NO_UNITS, parts,
chemistry_data.metal_mass_fraction_total);
list[2] = io_make_output_field(
"MetalMassFractions", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, parts,
chemistry_data.metal_mass_fraction_total,
"Fractions of the particles' masses that are in metals");
list[3] = io_make_output_field(
"SmoothedMetallicity", FLOAT, 1, UNIT_CONV_NO_UNITS, parts,
chemistry_data.smoothed_metal_mass_fraction_total);
list[4] = io_make_output_field("TotalMassFromSNIa", FLOAT, 1, UNIT_CONV_MASS,
parts, chemistry_data.mass_from_SNIa);
list[5] = io_make_output_field("MetalMassFracFromSNIa", FLOAT, 1,
UNIT_CONV_NO_UNITS, parts,
chemistry_data.metal_mass_fraction_from_SNIa);
list[6] = io_make_output_field("TotalMassFromAGB", FLOAT, 1, UNIT_CONV_MASS,
parts, chemistry_data.mass_from_AGB);
list[7] =
io_make_output_field("MetalMassFracFromAGB", FLOAT, 1, UNIT_CONV_NO_UNITS,
parts, chemistry_data.metal_mass_fraction_from_AGB);
list[8] = io_make_output_field("TotalMassFromSNII", FLOAT, 1, UNIT_CONV_MASS,
parts, chemistry_data.mass_from_SNII);
list[9] = io_make_output_field("MetalMassFracFromSNII", FLOAT, 1,
UNIT_CONV_NO_UNITS, parts,
chemistry_data.metal_mass_fraction_from_SNII);
list[10] =
io_make_output_field("IronMassFracFromSNIa", FLOAT, 1, UNIT_CONV_NO_UNITS,
parts, chemistry_data.iron_mass_fraction_from_SNIa);
"SmoothedMetalMassFractions", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, parts,
chemistry_data.smoothed_metal_mass_fraction_total,
"Smoothed fractions of the particles masses that are in metals");
list[4] = io_make_output_field(
"MassesFromSNIa", FLOAT, 1, UNIT_CONV_MASS, 0.f, parts,
chemistry_data.mass_from_SNIa,
"Masses of gas that have been produced by SNIa stars");
list[5] = io_make_output_field("MetalMassFractionsFromSNIa", FLOAT, 1,
UNIT_CONV_NO_UNITS, 0.f, parts,
chemistry_data.metal_mass_fraction_from_SNIa,
"Fractions of the particles' masses that are "
"in metals produced by SNIa stars");
list[6] = io_make_output_field(
"MassesFromAGB", FLOAT, 1, UNIT_CONV_MASS, 0.f, parts,
chemistry_data.mass_from_AGB,
"Masses of gas that have been produced by AGN stars");
list[7] = io_make_output_field("MetalMassFractionsFromAGB", FLOAT, 1,
UNIT_CONV_NO_UNITS, 0., parts,
chemistry_data.metal_mass_fraction_from_AGB,
"Fractions of the particles' masses that are "
"in metals produced by AGB stars");
list[8] = io_make_output_field(
"MassesFromSNII", FLOAT, 1, UNIT_CONV_MASS, 0.f, parts,
chemistry_data.mass_from_SNII,
"Masses of gas that have been produced by SNII stars");
list[9] = io_make_output_field("MetalMassFractionsFromSNII", FLOAT, 1,
UNIT_CONV_NO_UNITS, 0.f, parts,
chemistry_data.metal_mass_fraction_from_SNII,
"Fractions of the particles' masses that are "
"in metals produced by SNII stars");
list[10] = io_make_output_field("IronMassFractionsFromSNIa", FLOAT, 1,
UNIT_CONV_NO_UNITS, 0.f, parts,
chemistry_data.iron_mass_fraction_from_SNIa,
"Fractions of the particles' masses that are "
"in iron produced by SNIa stars");
list[11] = io_make_output_field(
"SmoothedIronMassFracFromSNIa", FLOAT, 1, UNIT_CONV_NO_UNITS, parts,
chemistry_data.smoothed_iron_mass_fraction_from_SNIa);
"SmoothedIronMassFractionsFromSNIa", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f,
parts, chemistry_data.smoothed_iron_mass_fraction_from_SNIa,
"Smoothed fractions of the particles' masses that are "
"in iron produced by SNIa stars");
return 12;
}
......@@ -118,50 +140,72 @@ INLINE static int chemistry_write_sparticles(const struct spart* sparts,
struct io_props* list) {
/* List what we want to write */
list[0] = io_make_output_field("ElementAbundance", FLOAT,
chemistry_element_count, UNIT_CONV_NO_UNITS,
sparts, chemistry_data.metal_mass_fraction);
list[0] = io_make_output_field(
"ElementMassFractions", FLOAT, chemistry_element_count,
UNIT_CONV_NO_UNITS, 0.f, sparts, chemistry_data.metal_mass_fraction,
"Fractions of the particles' masses that are in the given element");
list[1] = io_make_output_field(
"SmoothedElementAbundance", FLOAT, chemistry_element_count,
UNIT_CONV_NO_UNITS, sparts, chemistry_data.smoothed_metal_mass_fraction);
UNIT_CONV_NO_UNITS, 0.f, sparts,
chemistry_data.smoothed_metal_mass_fraction,
"Smoothed fractions of the particles' masses that are "
"in the given element");
list[2] =
io_make_output_field("Metallicity", FLOAT, 1, UNIT_CONV_NO_UNITS, sparts,
chemistry_data.metal_mass_fraction_total);
list[2] = io_make_output_field(
"MetalMassFractions", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, sparts,
chemistry_data.metal_mass_fraction_total,
"Fractions of the particles' masses that are in metals");
list[3] = io_make_output_field(
"SmoothedMetallicity", FLOAT, 1, UNIT_CONV_NO_UNITS, sparts,
chemistry_data.smoothed_metal_mass_fraction_total);
list[4] = io_make_output_field("TotalMassFromSNIa", FLOAT, 1, UNIT_CONV_MASS,
sparts, chemistry_data.mass_from_SNIa);
list[5] = io_make_output_field("MetalMassFracFromSNIa", FLOAT, 1,
UNIT_CONV_NO_UNITS, sparts,
chemistry_data.metal_mass_fraction_from_SNIa);
list[6] = io_make_output_field("TotalMassFromAGB", FLOAT, 1, UNIT_CONV_MASS,
sparts, chemistry_data.mass_from_AGB);
list[7] =
io_make_output_field("MetalMassFracFromAGB", FLOAT, 1, UNIT_CONV_NO_UNITS,
sparts, chemistry_data.metal_mass_fraction_from_AGB);
list[8] = io_make_output_field("TotalMassFromSNII", FLOAT, 1, UNIT_CONV_MASS,
sparts, chemistry_data.mass_from_SNII);
list[9] = io_make_output_field("MetalMassFracFromSNII", FLOAT, 1,
UNIT_CONV_NO_UNITS, sparts,
chemistry_data.metal_mass_fraction_from_SNII);
list[10] =
io_make_output_field("IronMassFracFromSNIa", FLOAT, 1, UNIT_CONV_NO_UNITS,
sparts, chemistry_data.iron_mass_fraction_from_SNIa);
"SmoothedMetalMassFractions", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, sparts,
chemistry_data.smoothed_metal_mass_fraction_total,
"Smoothed fractions of the particles masses that are in metals");
list[4] = io_make_output_field(
"MassesFromSNIa", FLOAT, 1, UNIT_CONV_MASS, 0.f, sparts,
chemistry_data.mass_from_SNIa,
"Masses of gas that have been produced by SNIa stars");
list[5] = io_make_output_field("MetalMassFractionsFromSNIa", FLOAT, 1,
UNIT_CONV_NO_UNITS, 0.f, sparts,
chemistry_data.metal_mass_fraction_from_SNIa,
"Fractions of the particles' masses that are "
"in metals produced by SNIa stars");
list[6] = io_make_output_field(
"MassesFromAGB", FLOAT, 1, UNIT_CONV_MASS, 0.f, sparts,
chemistry_data.mass_from_AGB,
"Masses of gas that have been produced by AGN stars");
list[7] = io_make_output_field("MetalMassFractionsFromAGB", FLOAT, 1,
UNIT_CONV_NO_UNITS, 0., sparts,
chemistry_data.metal_mass_fraction_from_AGB,
"Fractions of the particles' masses that are "
"in metals produced by AGB stars");
list[8] = io_make_output_field(
"MassesFromSNII", FLOAT, 1, UNIT_CONV_MASS, 0.f, sparts,
chemistry_data.mass_from_SNII,
"Masses of gas that have been produced by SNII stars");
list[9] = io_make_output_field("MetalMassFractionsFromSNII", FLOAT, 1,
UNIT_CONV_NO_UNITS, 0.f, sparts,
chemistry_data.metal_mass_fraction_from_SNII,
"Fractions of the particles' masses that are "
"in metals produced by SNII stars");
list[10] = io_make_output_field("IronMassFractionsFromSNIa", FLOAT, 1,
UNIT_CONV_NO_UNITS, 0.f, sparts,
chemistry_data.iron_mass_fraction_from_SNIa,
"Fractions of the particles' masses that are "
"in iron produced by SNIa stars");
list[11] = io_make_output_field(
"SmoothedIronMassFracFromSNIa", FLOAT, 1, UNIT_CONV_NO_UNITS, sparts,
chemistry_data.smoothed_iron_mass_fraction_from_SNIa);
"SmoothedIronMassFractionsFromSNIa", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f,
sparts, chemistry_data.smoothed_iron_mass_fraction_from_SNIa,
"Smoothed fractions of the particles' masses that are "
"in iron produced by SNIa stars");
return 12;
}
......
......@@ -73,9 +73,10 @@ INLINE static int chemistry_write_particles(const struct part* parts,
struct io_props* list) {
/* List what we want to write */
list[0] = io_make_output_field(
"SmoothedElementAbundances", FLOAT, chemistry_element_count,
UNIT_CONV_NO_UNITS, 0.f, parts, chemistry_data.smoothed_metal_mass_fraction,
list[0] =
io_make_output_field("SmoothedElementAbundances", FLOAT,
chemistry_element_count, UNIT_CONV_NO_UNITS, 0.f,
parts, chemistry_data.smoothed_metal_mass_fraction,
"Element abundances smoothed over the neighbors");
list[1] = io_make_output_field("Z", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, parts,
......@@ -101,16 +102,17 @@ INLINE static int chemistry_write_sparticles(const struct spart* sparts,
struct io_props* list) {
/* List what we want to write */
list[0] = io_make_output_field(
"SmoothedElementAbundances", FLOAT, chemistry_element_count,
UNIT_CONV_NO_UNITS, 0.f, sparts, chemistry_data.smoothed_metal_mass_fraction,
list[0] =
io_make_output_field("SmoothedElementAbundances", FLOAT,
chemistry_element_count, UNIT_CONV_NO_UNITS, 0.f,
sparts, chemistry_data.smoothed_metal_mass_fraction,
"Element abundances smoothed over the neighbors");
list[1] = io_make_output_field("Z", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, sparts,
chemistry_data.Z, "Temporary field");
list[2] = io_make_output_field("ElementAbundance", FLOAT,
chemistry_element_count, UNIT_CONV_NO_UNITS,
list[2] = io_make_output_field(
"ElementAbundance", FLOAT, chemistry_element_count, UNIT_CONV_NO_UNITS,
0.f, sparts, chemistry_data.metal_mass_fraction,
"Mass fraction of each element");
......
......@@ -24,10 +24,12 @@
/* This object's header. */
#include "common_io.h"
/* First common header */
#include "engine.h"
/* Local includes. */
#include "black_holes_io.h"
#include "chemistry_io.h"
#include "engine.h"
#include "error.h"
#include "gravity_io.h"
#include "hydro.h"
......@@ -1704,6 +1706,7 @@ void io_check_output_fields(const struct swift_params* params,
struct xpart xp;
struct spart sp;
struct gpart gp;
struct bpart bp;
/* Copy N_total to array with length == 6 */
const long long nr_total[swift_type_count] = {N_total[0], N_total[1], 0,
......@@ -1731,7 +1734,11 @@ void io_check_output_fields(const struct swift_params* params,
break;
case swift_type_stars:
stars_write_particles(&sp, list, &num_fields);
stars_write_particles(&sp, list, &num_fields, 1);
break;
case swift_type_black_hole:
black_holes_write_particles(&bp, list, &num_fields, 1);
break;
default:
......@@ -1821,11 +1828,11 @@ void io_write_output_field_parameter(const char* filename) {
break;
case swift_type_stars:
stars_write_particles(NULL, list, &num_fields);
stars_write_particles(NULL, list, &num_fields, 1);
break;
case swift_type_black_hole:
black_holes_write_particles(NULL, list, &num_fields);
black_holes_write_particles(NULL, list, &num_fields, 1);
break;
default:
......
......@@ -63,9 +63,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(
"Temperatures", FLOAT, 1, UNIT_CONV_TEMPERATURE, 0.f, parts, xparts,
convert_part_T, "Temperatures of the gas particles");
return 1;
}
......
......@@ -63,22 +63,28 @@ __attribute__((always_inline)) INLINE static int cooling_write_particles(
#if COOLING_GRACKLE_MODE >= 1
/* List what we want to write */
list[0] = io_make_output_field("HI", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
list[0] =
io_make_output_field("HI", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
cooling_data.HI_frac, "HI mass fraction");
list[1] = io_make_output_field("HII", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
list[1] =
io_make_output_field("HII", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
cooling_data.HII_frac, "HII mass fraction");
list[2] = io_make_output_field("HeI", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
list[2] =
io_make_output_field("HeI", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
cooling_data.HeI_frac, "HeI mass fraction");
list[3] = io_make_output_field("HeII", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
list[3] =
io_make_output_field("HeII", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
cooling_data.HeII_frac, "HeII mass fraction");
list[4] = io_make_output_field("HeIII", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
list[4] =
io_make_output_field("HeIII", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
cooling_data.HeIII_frac, "HeIII mass fraction");
list[5] = io_make_output_field("e", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
list[5] =
io_make_output_field("e", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
cooling_data.e_frac, "free electron mass fraction");
num += 6;
......@@ -87,13 +93,16 @@ __attribute__((always_inline)) INLINE static int cooling_write_particles(
#if COOLING_GRACKLE_MODE >= 2
list += num;
list[0] = io_make_output_field("HM", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
list[0] =
io_make_output_field("HM", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
cooling_data.HM_frac, "H- mass fraction");
list[1] = io_make_output_field("H2I", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
list[1] =
io_make_output_field("H2I", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
cooling_data.H2I_frac, "H2I mass fraction");
list[2] = io_make_output_field("H2II", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
list[2] =
io_make_output_field("H2II", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
cooling_data.H2II_frac, "H2II mass fraction");
num += 3;
......@@ -102,13 +111,16 @@ __attribute__((always_inline)) INLINE static int cooling_write_particles(
#if COOLING_GRACKLE_MODE >= 3
list += num;
list[0] = io_make_output_field("DI", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
list[0] =
io_make_output_field("DI", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
cooling_data.DI_frac, "DI mass fraction");
list[1] = io_make_output_field("DII", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
list[1] =
io_make_output_field("DII", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
cooling_data.DII_frac, "DII mass fraction");
list[2] = io_make_output_field("HDI", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
list[2] =
io_make_output_field("HDI", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,
cooling_data.HDI_frac, "HDI mass fraction");
num += 3;
......
......@@ -109,17 +109,23 @@ 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, 1.f, gparts,
convert_gpart_pos, "Position of the particles");
convert_gpart_pos, "Co-moving position of the particles");
list[1] = io_make_output_field_convert_gpart(
"Velocities", FLOAT, 3, UNIT_CONV_SPEED, 0.f, gparts, convert_gpart_vel,
"Peculiar velocites of the particles");
"Peculiar velocities of the stars. This is a * dx/dt where x is the "
"co-moving position of the particles.");
list[2] = io_make_output_field("Masses", FLOAT, 1, UNIT_CONV_MASS, 0.f,
gparts, mass, "");
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, "");
gparts, mass, "Masses of the particles");
list[3] = io_make_output_field(