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

Correct units for internal energy and documentation fixes

parent d61ee7c0
......@@ -42,7 +42,7 @@ void hydro_read_particles(struct part* parts, struct io_props* list,
list[3] = io_make_input_field("SmoothingLength", FLOAT, 1, COMPULSORY,
UNIT_CONV_LENGTH, parts, h);
list[4] = io_make_input_field("InternalEnergy", FLOAT, 1, COMPULSORY,
UNIT_CONV_ENERGY, parts, u);
UNIT_CONV_ENERGY_PER_UNIT_MASS, parts, u);
list[5] = io_make_input_field("ParticleIDs", ULONGLONG, 1, COMPULSORY,
UNIT_CONV_NO_UNITS, parts, id);
list[6] = io_make_input_field("Accelerations", FLOAT, 3, OPTIONAL,
......@@ -72,7 +72,7 @@ void hydro_write_particles(struct part* parts, struct io_props* list,
io_make_output_field("Masses", FLOAT, 1, UNIT_CONV_MASS, parts, mass);
list[3] = io_make_output_field("SmoothingLength", FLOAT, 1, UNIT_CONV_LENGTH,
parts, h);
list[4] = io_make_output_field("Entropy", FLOAT, 1,
list[4] = io_make_output_field("InternalEnergy", FLOAT, 1,
UNIT_CONV_ENERGY_PER_UNIT_MASS, parts, u);
list[5] = io_make_output_field("ParticleIDs", ULONGLONG, 1,
UNIT_CONV_NO_UNITS, parts, id);
......
......@@ -43,7 +43,7 @@ void hydro_read_particles(struct part* parts, struct io_props* list,
list[3] = io_make_input_field("SmoothingLength", FLOAT, 1, COMPULSORY,
UNIT_CONV_LENGTH, parts, h);
list[4] = io_make_input_field("InternalEnergy", FLOAT, 1, COMPULSORY,
UNIT_CONV_ENERGY, parts, entropy);
UNIT_CONV_ENERGY_PER_UNIT_MASS, parts, entropy);
list[5] = io_make_input_field("ParticleIDs", ULONGLONG, 1, COMPULSORY,
UNIT_CONV_NO_UNITS, parts, id);
list[6] = io_make_input_field("Accelerations", FLOAT, 3, OPTIONAL,
......
......@@ -42,7 +42,7 @@ void hydro_read_particles(struct part* parts, struct io_props* list,
list[3] = io_make_input_field("SmoothingLength", FLOAT, 1, COMPULSORY,
UNIT_CONV_LENGTH, parts, h);
list[4] = io_make_input_field("InternalEnergy", FLOAT, 1, COMPULSORY,
UNIT_CONV_ENERGY, parts, u);
UNIT_CONV_ENERGY_PER_UNIT_MASS, parts, u);
list[5] = io_make_input_field("ParticleIDs", ULONGLONG, 1, COMPULSORY,
UNIT_CONV_NO_UNITS, parts, id);
list[6] = io_make_input_field("Accelerations", FLOAT, 3, OPTIONAL,
......@@ -72,7 +72,7 @@ void hydro_write_particles(struct part* parts, struct io_props* list,
io_make_output_field("Masses", FLOAT, 1, UNIT_CONV_MASS, parts, mass);
list[3] = io_make_output_field("SmoothingLength", FLOAT, 1, UNIT_CONV_LENGTH,
parts, h);
list[4] = io_make_output_field("Entropy", FLOAT, 1,
list[4] = io_make_output_field("InternalEnergy", FLOAT, 1,
UNIT_CONV_ENERGY_PER_UNIT_MASS, parts, u);
list[5] = io_make_output_field("ParticleIDs", ULONGLONG, 1,
UNIT_CONV_NO_UNITS, parts, id);
......
......@@ -62,7 +62,7 @@ struct io_props {
/* Conversion function for part */
float (*convert_part)(struct engine*, struct part*);
/* Conversion function for part */
/* Conversion function for gpart */
float (*convert_gpart)(struct engine*, struct gpart*);
};
......@@ -161,7 +161,6 @@ struct io_props io_make_output_field_(char name[FIELD_BUFFER_SIZE],
* @param name Name of the field to read
* @param type The type of the data
* @param dimension Dataset dimension (1D, 3D, ...)
* @param importance Is this dataset compulsory ?
* @param units The units of the dataset
* @param field Pointer to the field of the first particle
* @param partSize The size in byte of the particle
......@@ -194,11 +193,11 @@ struct io_props io_make_output_field_convert_part_(
/**
* @brief Constructs an #io_props (with conversion) from its parameters
*/
#define io_make_output_field_convert_part(name, type, dim, units, part, field, \
convert) \
io_make_output_field_convert_part_(name, type, dim, units, \
(char*)(&(part[0]).field), \
sizeof(part[0]), part, convert)
#define io_make_output_field_convert_gpart(name, type, dim, units, part, \
field, convert) \
io_make_output_field_convert_gpart_(name, type, dim, units, \
(char*)(&(part[0]).field), \
sizeof(part[0]), gpart, convert)
/**
* @brief Construct an #io_props from its parameters
......@@ -206,12 +205,11 @@ struct io_props io_make_output_field_convert_part_(
* @param name Name of the field to read
* @param type The type of the data
* @param dimension Dataset dimension (1D, 3D, ...)
* @param importance Is this dataset compulsory ?
* @param units The units of the dataset
* @param field Pointer to the field of the first particle
* @param partSize The size in byte of the particle
* @param parts The particle array
* @param functionPtr The function used to convert a particle to a float
* @param gparts The particle array
* @param functionPtr The function used to convert a g-particle to a float
*
* Do not call this function directly. Use the macro defined above.
*/
......
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