Commit 2c177bd1 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Get the correct conversion factors for volumes.

parent f769a31b
......@@ -124,8 +124,8 @@ void hydro_write_particles(struct part* parts, struct io_props* list,
UNIT_CONV_ACCELERATION, parts, a_hydro);
list[7] = io_make_output_field("Density", FLOAT, 1, UNIT_CONV_DENSITY, parts,
primitives.rho);
list[8] = io_make_output_field("Volume", FLOAT, 1, UNIT_CONV_VOLUME, parts,
geometry.volume);
list[8] = io_make_output_field("Volume", FLOAT, 1, UNIT_CONV_INV_VOLUME,
parts, geometry.volume);
list[9] = io_make_output_field("GradDensity", FLOAT, 3, UNIT_CONV_DENSITY,
parts, primitives.gradients.rho);
list[10] = io_make_output_field_convert_part(
......
......@@ -319,6 +319,9 @@ void units_get_base_unit_exponants_array(float baseUnitsExp[5],
break;
case UNIT_CONV_VOLUME:
baseUnitsExp[UNIT_LENGTH] = 3.f;
case UNIT_CONV_INV_VOLUME:
baseUnitsExp[UNIT_LENGTH] = -3.f;
}
}
......
......@@ -90,7 +90,8 @@ enum UnitConversionFactor {
UNIT_CONV_MAGNETIC_FIELD,
UNIT_CONV_MAGNETIC_INDUCTANCE,
UNIT_CONV_TEMPERATURE,
UNIT_CONV_VOLUME
UNIT_CONV_VOLUME,
UNIT_CONV_INV_VOLUME
};
void units_init_cgs(struct UnitSystem*);
......
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