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 @@ ...@@ -29,9 +29,9 @@
* @param list The list of i/o properties to read. * @param list The list of i/o properties to read.
* @param num_fields The number of i/o fields to read. * @param num_fields The number of i/o fields to read.
*/ */
INLINE static void black_holes_read_particles(struct bpart *bparts, INLINE static void black_holes_read_particles(struct bpart* bparts,
struct io_props *list, struct io_props* list,
int *num_fields) { int* num_fields) {
/* Say how much we want to read */ /* Say how much we want to read */
*num_fields = 6; *num_fields = 6;
...@@ -51,6 +51,53 @@ INLINE static void black_holes_read_particles(struct bpart *bparts, ...@@ -51,6 +51,53 @@ INLINE static void black_holes_read_particles(struct bpart *bparts,
UNIT_CONV_ENERGY, bparts, energy_reservoir); 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 * @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, ...@@ -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 list The list of i/o properties to write.
* @param num_fields The number of i/o fields to write. * @param num_fields The number of i/o fields to write.
*/ */
INLINE static void black_holes_write_particles(const struct bpart *bparts, INLINE static void black_holes_write_particles(const struct bpart* bparts,
struct io_props *list, struct io_props* list,
int *num_fields) { int* num_fields,
int with_cosmology) {
/* Say how much we want to write */ /* Say how much we want to write */
*num_fields = 12; *num_fields = 12;
/* 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_convert_bpart(
bparts, x); "Coordinates", DOUBLE, 3, UNIT_CONV_LENGTH, 1.f, bparts,
list[1] = convert_bpart_pos, "Co-moving position of the particles");
io_make_output_field("Velocities", FLOAT, 3, UNIT_CONV_SPEED, bparts, v);
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] = 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, list[3] = io_make_output_field("ParticleIDs", LONGLONG, 1, UNIT_CONV_NO_UNITS,
bparts, id); 0.f, bparts, id, "Unique ID of the particles");
list[4] = io_make_output_field("SmoothingLength", FLOAT, 1, UNIT_CONV_LENGTH,
bparts, h); list[4] = io_make_output_field(
list[5] = io_make_output_field("SubgridMasses", FLOAT, 1, UNIT_CONV_MASS, "SmoothingLengths", FLOAT, 1, UNIT_CONV_LENGTH, 1.f, bparts, h,
bparts, subgrid_mass); "Co-moving smoothing lengths (FWHM of the kernel) of the particles");
list[6] = io_make_output_field("FormationTime", FLOAT, 1, UNIT_CONV_TIME,
bparts, formation_time); list[5] = io_make_output_field("SubgridMasses", FLOAT, 1, UNIT_CONV_MASS, 0.f,
list[7] = io_make_output_field("GasDensity", FLOAT, 1, UNIT_CONV_DENSITY, bparts, subgrid_mass,
bparts, rho_gas); "Subgrid masses of the particles");
list[8] = io_make_output_field("GasSoundSpeed", FLOAT, 1, UNIT_CONV_SPEED,
bparts, sound_speed_gas); if (with_cosmology) {
list[9] = io_make_output_field("EnergyReservoir", FLOAT, 1, UNIT_CONV_ENERGY, list[6] = io_make_output_field(
bparts, energy_reservoir); "FormationScaleFactors", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, bparts,
list[10] = io_make_output_field("AccretionRate", FLOAT, 1, formation_scale_factor, "Scale-factors at which the BHs were formed");
UNIT_CONV_MASS_PER_UNIT_TIME, bparts, } else {
accretion_rate); list[6] = io_make_output_field("FormationTimes", FLOAT, 1, UNIT_CONV_TIME,
list[11] = io_make_output_field("TotalAccretedMass", FLOAT, 1, 0.f, bparts, formation_time,
UNIT_CONV_MASS_PER_UNIT_TIME, bparts, "Times at which the BHs were formed");
total_accreted_mass); }
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 #ifdef DEBUG_INTERACTIONS_BLACK_HOLES
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#ifndef SWIFT_EAGLE_BLACK_HOLE_PART_H #ifndef SWIFT_EAGLE_BLACK_HOLE_PART_H
#define SWIFT_EAGLE_BLACK_HOLE_PART_H #define SWIFT_EAGLE_BLACK_HOLE_PART_H
#include "timeline.h"
/** /**
* @brief Particle fields for the black hole particles. * @brief Particle fields for the black hole particles.
* *
......
...@@ -58,50 +58,72 @@ INLINE static int chemistry_write_particles(const struct part* parts, ...@@ -58,50 +58,72 @@ INLINE static int chemistry_write_particles(const struct part* parts,
struct io_props* list) { struct io_props* list) {
/* List what we want to write */ /* List what we want to write */
list[0] = io_make_output_field("ElementAbundance", FLOAT, list[0] = io_make_output_field(
chemistry_element_count, UNIT_CONV_NO_UNITS, "ElementMassFractions", FLOAT, chemistry_element_count,
parts, chemistry_data.metal_mass_fraction); 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( list[1] = io_make_output_field(
"SmoothedElementAbundance", FLOAT, chemistry_element_count, "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] = list[2] = io_make_output_field(
io_make_output_field("Metallicity", FLOAT, 1, UNIT_CONV_NO_UNITS, parts, "MetalMassFractions", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, parts,
chemistry_data.metal_mass_fraction_total); chemistry_data.metal_mass_fraction_total,
"Fractions of the particles' masses that are in metals");
list[3] = io_make_output_field( list[3] = io_make_output_field(
"SmoothedMetallicity", FLOAT, 1, UNIT_CONV_NO_UNITS, parts, "SmoothedMetalMassFractions", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, parts,
chemistry_data.smoothed_metal_mass_fraction_total); chemistry_data.smoothed_metal_mass_fraction_total,
"Smoothed fractions of the particles masses that are in metals");
list[4] = io_make_output_field("TotalMassFromSNIa", FLOAT, 1, UNIT_CONV_MASS,
parts, chemistry_data.mass_from_SNIa); list[4] = io_make_output_field(
"MassesFromSNIa", FLOAT, 1, UNIT_CONV_MASS, 0.f, parts,
list[5] = io_make_output_field("MetalMassFracFromSNIa", FLOAT, 1, chemistry_data.mass_from_SNIa,
UNIT_CONV_NO_UNITS, parts, "Masses of gas that have been produced by SNIa stars");
chemistry_data.metal_mass_fraction_from_SNIa);
list[5] = io_make_output_field("MetalMassFractionsFromSNIa", FLOAT, 1,
list[6] = io_make_output_field("TotalMassFromAGB", FLOAT, 1, UNIT_CONV_MASS, UNIT_CONV_NO_UNITS, 0.f, parts,
parts, chemistry_data.mass_from_AGB); chemistry_data.metal_mass_fraction_from_SNIa,
"Fractions of the particles' masses that are "
list[7] = "in metals produced by SNIa stars");
io_make_output_field("MetalMassFracFromAGB", FLOAT, 1, UNIT_CONV_NO_UNITS,
parts, chemistry_data.metal_mass_fraction_from_AGB); list[6] = io_make_output_field(
"MassesFromAGB", FLOAT, 1, UNIT_CONV_MASS, 0.f, parts,
list[8] = io_make_output_field("TotalMassFromSNII", FLOAT, 1, UNIT_CONV_MASS, chemistry_data.mass_from_AGB,
parts, chemistry_data.mass_from_SNII); "Masses of gas that have been produced by AGN stars");
list[9] = io_make_output_field("MetalMassFracFromSNII", FLOAT, 1, list[7] = io_make_output_field("MetalMassFractionsFromAGB", FLOAT, 1,
UNIT_CONV_NO_UNITS, parts, UNIT_CONV_NO_UNITS, 0., parts,
chemistry_data.metal_mass_fraction_from_SNII); chemistry_data.metal_mass_fraction_from_AGB,
"Fractions of the particles' masses that are "
list[10] = "in metals produced by AGB stars");
io_make_output_field("IronMassFracFromSNIa", FLOAT, 1, UNIT_CONV_NO_UNITS,
parts, chemistry_data.iron_mass_fraction_from_SNIa); 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( list[11] = io_make_output_field(
"SmoothedIronMassFracFromSNIa", FLOAT, 1, UNIT_CONV_NO_UNITS, parts, "SmoothedIronMassFractionsFromSNIa", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f,
chemistry_data.smoothed_iron_mass_fraction_from_SNIa); 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; return 12;
} }
...@@ -118,50 +140,72 @@ INLINE static int chemistry_write_sparticles(const struct spart* sparts, ...@@ -118,50 +140,72 @@ INLINE static int chemistry_write_sparticles(const struct spart* sparts,
struct io_props* list) { struct io_props* list) {
/* List what we want to write */ /* List what we want to write */
list[0] = io_make_output_field("ElementAbundance", FLOAT, list[0] = io_make_output_field(
chemistry_element_count, UNIT_CONV_NO_UNITS, "ElementMassFractions", FLOAT, chemistry_element_count,
sparts, chemistry_data.metal_mass_fraction); 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( list[1] = io_make_output_field(
"SmoothedElementAbundance", FLOAT, chemistry_element_count, "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] = list[2] = io_make_output_field(
io_make_output_field("Metallicity", FLOAT, 1, UNIT_CONV_NO_UNITS, sparts, "MetalMassFractions", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, sparts,
chemistry_data.metal_mass_fraction_total); chemistry_data.metal_mass_fraction_total,
"Fractions of the particles' masses that are in metals");
list[3] = io_make_output_field( list[3] = io_make_output_field(
"SmoothedMetallicity", FLOAT, 1, UNIT_CONV_NO_UNITS, sparts, "SmoothedMetalMassFractions", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, sparts,
chemistry_data.smoothed_metal_mass_fraction_total); chemistry_data.smoothed_metal_mass_fraction_total,
"Smoothed fractions of the particles masses that are in metals");
list[4] = io_make_output_field("TotalMassFromSNIa", FLOAT, 1, UNIT_CONV_MASS,
sparts, chemistry_data.mass_from_SNIa); list[4] = io_make_output_field(
"MassesFromSNIa", FLOAT, 1, UNIT_CONV_MASS, 0.f, sparts,
list[5] = io_make_output_field("MetalMassFracFromSNIa", FLOAT, 1, chemistry_data.mass_from_SNIa,
UNIT_CONV_NO_UNITS, sparts, "Masses of gas that have been produced by SNIa stars");
chemistry_data.metal_mass_fraction_from_SNIa);
list[5] = io_make_output_field("MetalMassFractionsFromSNIa", FLOAT, 1,
list[6] = io_make_output_field("TotalMassFromAGB", FLOAT, 1, UNIT_CONV_MASS, UNIT_CONV_NO_UNITS, 0.f, sparts,
sparts, chemistry_data.mass_from_AGB); chemistry_data.metal_mass_fraction_from_SNIa,
"Fractions of the particles' masses that are "
list[7] = "in metals produced by SNIa stars");
io_make_output_field("MetalMassFracFromAGB", FLOAT, 1, UNIT_CONV_NO_UNITS,
sparts, chemistry_data.metal_mass_fraction_from_AGB); list[6] = io_make_output_field(
"MassesFromAGB", FLOAT, 1, UNIT_CONV_MASS, 0.f, sparts,
list[8] = io_make_output_field("TotalMassFromSNII", FLOAT, 1, UNIT_CONV_MASS, chemistry_data.mass_from_AGB,
sparts, chemistry_data.mass_from_SNII); "Masses of gas that have been produced by AGN stars");
list[9] = io_make_output_field("MetalMassFracFromSNII", FLOAT, 1, list[7] = io_make_output_field("MetalMassFractionsFromAGB", FLOAT, 1,
UNIT_CONV_NO_UNITS, sparts, UNIT_CONV_NO_UNITS, 0., sparts,
chemistry_data.metal_mass_fraction_from_SNII); chemistry_data.metal_mass_fraction_from_AGB,
"Fractions of the particles' masses that are "
list[10] = "in metals produced by AGB stars");
io_make_output_field("IronMassFracFromSNIa", FLOAT, 1, UNIT_CONV_NO_UNITS,
sparts, chemistry_data.iron_mass_fraction_from_SNIa); 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( list[11] = io_make_output_field(
"SmoothedIronMassFracFromSNIa", FLOAT, 1, UNIT_CONV_NO_UNITS, sparts, "SmoothedIronMassFractionsFromSNIa", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f,
chemistry_data.smoothed_iron_mass_fraction_from_SNIa); 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; return 12;
} }
......
...@@ -73,10 +73,11 @@ INLINE static int chemistry_write_particles(const struct part* parts, ...@@ -73,10 +73,11 @@ INLINE static int chemistry_write_particles(const struct part* parts,
struct io_props* list) { struct io_props* list) {
/* List what we want to write */ /* List what we want to write */
list[0] = io_make_output_field( list[0] =
"SmoothedElementAbundances", FLOAT, chemistry_element_count, io_make_output_field("SmoothedElementAbundances", FLOAT,
UNIT_CONV_NO_UNITS, 0.f, parts, chemistry_data.smoothed_metal_mass_fraction, chemistry_element_count, UNIT_CONV_NO_UNITS, 0.f,
"Element abundances smoothed over the neighbors"); 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, list[1] = io_make_output_field("Z", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, parts,
chemistry_data.Z, "Temporary field"); chemistry_data.Z, "Temporary field");
...@@ -84,7 +85,7 @@ INLINE static int chemistry_write_particles(const struct part* parts, ...@@ -84,7 +85,7 @@ INLINE static int chemistry_write_particles(const struct part* parts,
list[2] = io_make_output_field("ElementAbundances", FLOAT, list[2] = io_make_output_field("ElementAbundances", FLOAT,
chemistry_element_count, UNIT_CONV_NO_UNITS, chemistry_element_count, UNIT_CONV_NO_UNITS,
0.f, parts, chemistry_data.metal_mass_fraction, 0.f, parts, chemistry_data.metal_mass_fraction,
"Mass fraction of each element"); "Mass fraction of each element");
return 3; return 3;
} }
...@@ -101,18 +102,19 @@ INLINE static int chemistry_write_sparticles(const struct spart* sparts, ...@@ -101,18 +102,19 @@ INLINE static int chemistry_write_sparticles(const struct spart* sparts,
struct io_props* list) { struct io_props* list) {
/* List what we want to write */ /* List what we want to write */
list[0] = io_make_output_field( list[0] =
"SmoothedElementAbundances", FLOAT, chemistry_element_count, io_make_output_field("SmoothedElementAbundances", FLOAT,
UNIT_CONV_NO_UNITS, 0.f, sparts, chemistry_data.smoothed_metal_mass_fraction, chemistry_element_count, UNIT_CONV_NO_UNITS, 0.f,
"Element abundances smoothed over the neighbors"); 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, list[1] = io_make_output_field("Z", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, sparts,
chemistry_data.Z, "Temporary field"); chemistry_data.Z, "Temporary field");
list[2] = io_make_output_field("ElementAbundance", FLOAT, list[2] = io_make_output_field(
chemistry_element_count, UNIT_CONV_NO_UNITS, "ElementAbundance", FLOAT, chemistry_element_count, UNIT_CONV_NO_UNITS,
0.f, sparts, chemistry_data.metal_mass_fraction, 0.f, sparts, chemistry_data.metal_mass_fraction,
"Mass fraction of each element"); "Mass fraction of each element");
return 3; return 3;
} }
......
...@@ -24,10 +24,12 @@ ...@@ -24,10 +24,12 @@
/* This object's header. */ /* This object's header. */
#include "common_io.h" #include "common_io.h"
/* First common header */
#include "engine.h"
/* Local includes. */ /* Local includes. */
#include "black_holes_io.h" #include "black_holes_io.h"
#include "chemistry_io.h" #include "chemistry_io.h"
#include "engine.h"
#include "error.h" #include "error.h"
#include "gravity_io.h" #include "gravity_io.h"
#include "hydro.h" #include "hydro.h"
...@@ -1704,6 +1706,7 @@ void io_check_output_fields(const struct swift_params* params, ...@@ -1704,6 +1706,7 @@ void io_check_output_fields(const struct swift_params* params,
struct xpart xp; struct xpart xp;
struct spart sp; struct spart sp;
struct gpart gp; struct gpart gp;
struct bpart bp;
/* Copy N_total to array with length == 6 */ /* Copy N_total to array with length == 6 */
const long long nr_total[swift_type_count] = {N_total[0], N_total[1], 0, 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, ...@@ -1731,7 +1734,11 @@ void io_check_output_fields(const struct swift_params* params,
break; break;
case swift_type_stars: 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; break;
default: default:
...@@ -1821,11 +1828,11 @@ void io_write_output_field_parameter(const char* filename) { ...@@ -1821,11 +1828,11 @@ void io_write_output_field_parameter(const char* filename) {
break; break;
case swift_type_stars: case swift_type_stars:
stars_write_particles(NULL, list, &num_fields); stars_write_particles(NULL, list, &num_fields, 1);
break; break;
case swift_type_black_hole: case swift_type_black_hole:
black_holes_write_particles(NULL, list, &num_fields); black_holes_write_particles(NULL, list, &num_fields, 1);
break; break;
default: default:
......
...@@ -63,9 +63,9 @@ __attribute__((always_inline)) INLINE static int cooling_write_particles( ...@@ -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 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, "Temperatures", FLOAT, 1, UNIT_CONV_TEMPERATURE, 0.f, parts, xparts,
xparts, convert_part_T); convert_part_T, "Temperatures of the gas particles");
return 1; return 1;
} }
......
...@@ -63,23 +63,29 @@ __attribute__((always_inline)) INLINE static int cooling_write_particles( ...@@ -63,23 +63,29 @@ __attribute__((always_inline)) INLINE static int cooling_write_particles(
#if COOLING_GRACKLE_MODE >= 1 #if COOLING_GRACKLE_MODE >= 1
/* List what we want to write */ /* List what we want to write */
list[0] = io_make_output_field("HI", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts, list[0] =
cooling_data.HI_frac, "HI mass fraction"); 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] =
cooling_data.HII_frac, "HII mass fraction"); io_make_output_field("HII", FLOAT, 1, UNIT_CONV_NO_UNITS, 0.f, xparts,