Commit 039540fd authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Re-factored the UnitSytem to use the same naming convention as the rest of the code.

parent 237a73ba
...@@ -351,7 +351,7 @@ int main(int argc, char *argv[]) { ...@@ -351,7 +351,7 @@ int main(int argc, char *argv[]) {
#endif #endif
/* Initialize unit system and constants */ /* Initialize unit system and constants */
struct UnitSystem us; struct unit_system us;
struct phys_const prog_const; struct phys_const prog_const;
units_init(&us, params, "InternalUnitSystem"); units_init(&us, params, "InternalUnitSystem");
phys_const_init(&us, &prog_const); phys_const_init(&us, &prog_const);
......
...@@ -294,11 +294,11 @@ void io_write_attribute_s(hid_t grp, const char* name, const char* str) { ...@@ -294,11 +294,11 @@ void io_write_attribute_s(hid_t grp, const char* name, const char* str) {
/** /**
* @brief Reads the Unit System from an IC file. * @brief Reads the Unit System from an IC file.
* @param h_file The (opened) HDF5 file from which to read. * @param h_file The (opened) HDF5 file from which to read.
* @param us The UnitSystem to fill. * @param us The unit_system to fill.
* *
* If the 'Units' group does not exist in the ICs, cgs units will be assumed * If the 'Units' group does not exist in the ICs, cgs units will be assumed
*/ */
void io_read_UnitSystem(hid_t h_file, struct UnitSystem* us) { void io_read_unit_system(hid_t h_file, struct unit_system* us) {
hid_t h_grp = H5Gopen(h_file, "/Units", H5P_DEFAULT); hid_t h_grp = H5Gopen(h_file, "/Units", H5P_DEFAULT);
...@@ -334,11 +334,11 @@ void io_read_UnitSystem(hid_t h_file, struct UnitSystem* us) { ...@@ -334,11 +334,11 @@ void io_read_UnitSystem(hid_t h_file, struct UnitSystem* us) {
/** /**
* @brief Writes the current Unit System * @brief Writes the current Unit System
* @param h_file The (opened) HDF5 file in which to write * @param h_file The (opened) HDF5 file in which to write
* @param us The UnitSystem to dump * @param us The unit_system to dump
* @param groupName The name of the HDF5 group to write to * @param groupName The name of the HDF5 group to write to
*/ */
void io_write_UnitSystem(hid_t h_file, const struct UnitSystem* us, void io_write_unit_system(hid_t h_file, const struct unit_system* us,
const char* groupName) { const char* groupName) {
hid_t h_grpunit = 0; hid_t h_grpunit = 0;
h_grpunit = H5Gcreate1(h_file, groupName, 0); h_grpunit = H5Gcreate1(h_file, groupName, 0);
......
...@@ -68,9 +68,9 @@ void io_write_attribute_s(hid_t grp, const char* name, const char* str); ...@@ -68,9 +68,9 @@ void io_write_attribute_s(hid_t grp, const char* name, const char* str);
void io_write_code_description(hid_t h_file); void io_write_code_description(hid_t h_file);
void io_read_UnitSystem(hid_t h_file, struct UnitSystem* us); void io_read_unit_system(hid_t h_file, struct unit_system* us);
void io_write_UnitSystem(hid_t h_grp, const struct UnitSystem* us, void io_write_unit_system(hid_t h_grp, const struct unit_system* us,
const char* groupName); const char* groupName);
#endif /* defined HDF5 */ #endif /* defined HDF5 */
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
* @param cooling The cooling properties to initialize * @param cooling The cooling properties to initialize
*/ */
void cooling_init(const struct swift_params* parameter_file, void cooling_init(const struct swift_params* parameter_file,
const struct UnitSystem* us, const struct unit_system* us,
const struct phys_const* phys_const, const struct phys_const* phys_const,
struct cooling_function_data* cooling) { struct cooling_function_data* cooling) {
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
/* Common functions */ /* Common functions */
void cooling_init(const struct swift_params* parameter_file, void cooling_init(const struct swift_params* parameter_file,
const struct UnitSystem* us, const struct unit_system* us,
const struct phys_const* phys_const, const struct phys_const* phys_const,
struct cooling_function_data* cooling); struct cooling_function_data* cooling);
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
*/ */
__attribute__((always_inline)) INLINE static void cooling_cool_part( __attribute__((always_inline)) INLINE static void cooling_cool_part(
const struct phys_const* restrict phys_const, const struct phys_const* restrict phys_const,
const struct UnitSystem* restrict us, const struct unit_system* restrict us,
const struct cooling_function_data* restrict cooling, const struct cooling_function_data* restrict cooling,
struct part* restrict p, struct xpart* restrict xp, float dt) { struct part* restrict p, struct xpart* restrict xp, float dt) {
...@@ -103,7 +103,7 @@ __attribute__((always_inline)) INLINE static void cooling_cool_part( ...@@ -103,7 +103,7 @@ __attribute__((always_inline)) INLINE static void cooling_cool_part(
__attribute__((always_inline)) INLINE static float cooling_timestep( __attribute__((always_inline)) INLINE static float cooling_timestep(
const struct cooling_function_data* restrict cooling, const struct cooling_function_data* restrict cooling,
const struct phys_const* restrict phys_const, const struct phys_const* restrict phys_const,
const struct UnitSystem* restrict us, const struct part* restrict p) { const struct unit_system* restrict us, const struct part* restrict p) {
const float cooling_rate = cooling->cooling_rate; const float cooling_rate = cooling->cooling_rate;
const float internal_energy = hydro_get_internal_energy(p); const float internal_energy = hydro_get_internal_energy(p);
...@@ -153,7 +153,7 @@ __attribute__((always_inline)) INLINE static float cooling_get_radiated_energy( ...@@ -153,7 +153,7 @@ __attribute__((always_inline)) INLINE static float cooling_get_radiated_energy(
* @param cooling The cooling properties to initialize * @param cooling The cooling properties to initialize
*/ */
static INLINE void cooling_init_backend( static INLINE void cooling_init_backend(
const struct swift_params* parameter_file, const struct UnitSystem* us, const struct swift_params* parameter_file, const struct unit_system* us,
const struct phys_const* phys_const, const struct phys_const* phys_const,
struct cooling_function_data* cooling) { struct cooling_function_data* cooling) {
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
* @param p Pointer to the particle data.. * @param p Pointer to the particle data..
*/ */
__attribute__((always_inline)) INLINE static float cooling_rate( __attribute__((always_inline)) INLINE static float cooling_rate(
const struct phys_const* const phys_const, const struct UnitSystem* us, const struct phys_const* const phys_const, const struct unit_system* us,
const struct cooling_function_data* cooling, const struct part* p) { const struct cooling_function_data* cooling, const struct part* p) {
/* Get particle density */ /* Get particle density */
...@@ -72,7 +72,7 @@ __attribute__((always_inline)) INLINE static float cooling_rate( ...@@ -72,7 +72,7 @@ __attribute__((always_inline)) INLINE static float cooling_rate(
*/ */
__attribute__((always_inline)) INLINE static void cooling_cool_part( __attribute__((always_inline)) INLINE static void cooling_cool_part(
const struct phys_const* restrict phys_const, const struct phys_const* restrict phys_const,
const struct UnitSystem* restrict us, const struct unit_system* restrict us,
const struct cooling_function_data* restrict cooling, const struct cooling_function_data* restrict cooling,
struct part* restrict p, struct xpart* restrict xp, float dt) { struct part* restrict p, struct xpart* restrict xp, float dt) {
...@@ -112,7 +112,7 @@ __attribute__((always_inline)) INLINE static void cooling_cool_part( ...@@ -112,7 +112,7 @@ __attribute__((always_inline)) INLINE static void cooling_cool_part(
__attribute__((always_inline)) INLINE static float cooling_timestep( __attribute__((always_inline)) INLINE static float cooling_timestep(
const struct cooling_function_data* restrict cooling, const struct cooling_function_data* restrict cooling,
const struct phys_const* restrict phys_const, const struct phys_const* restrict phys_const,
const struct UnitSystem* restrict us, const struct part* restrict p) { const struct unit_system* restrict us, const struct part* restrict p) {
/* Get current internal energy */ /* Get current internal energy */
const float u = hydro_get_internal_energy(p); const float u = hydro_get_internal_energy(p);
...@@ -158,7 +158,7 @@ __attribute__((always_inline)) INLINE static float cooling_get_radiated_energy( ...@@ -158,7 +158,7 @@ __attribute__((always_inline)) INLINE static float cooling_get_radiated_energy(
* @param cooling The cooling properties to initialize * @param cooling The cooling properties to initialize
*/ */
static INLINE void cooling_init_backend( static INLINE void cooling_init_backend(
const struct swift_params* parameter_file, const struct UnitSystem* us, const struct swift_params* parameter_file, const struct unit_system* us,
const struct phys_const* phys_const, const struct phys_const* phys_const,
struct cooling_function_data* cooling) { struct cooling_function_data* cooling) {
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
*/ */
__attribute__((always_inline)) INLINE static void cooling_cool_part( __attribute__((always_inline)) INLINE static void cooling_cool_part(
const struct phys_const* restrict phys_const, const struct phys_const* restrict phys_const,
const struct UnitSystem* restrict us, const struct unit_system* restrict us,
const struct cooling_function_data* restrict cooling, const struct cooling_function_data* restrict cooling,
struct part* restrict p, struct xpart* restrict xp, float dt) {} struct part* restrict p, struct xpart* restrict xp, float dt) {}
...@@ -66,7 +66,7 @@ __attribute__((always_inline)) INLINE static void cooling_cool_part( ...@@ -66,7 +66,7 @@ __attribute__((always_inline)) INLINE static void cooling_cool_part(
__attribute__((always_inline)) INLINE static float cooling_timestep( __attribute__((always_inline)) INLINE static float cooling_timestep(
const struct cooling_function_data* restrict cooling, const struct cooling_function_data* restrict cooling,
const struct phys_const* restrict phys_const, const struct phys_const* restrict phys_const,
const struct UnitSystem* restrict us, const struct part* restrict p) { const struct unit_system* restrict us, const struct part* restrict p) {
return FLT_MAX; return FLT_MAX;
} }
...@@ -107,7 +107,7 @@ __attribute__((always_inline)) INLINE static float cooling_get_radiated_energy( ...@@ -107,7 +107,7 @@ __attribute__((always_inline)) INLINE static float cooling_get_radiated_energy(
* @param cooling The cooling properties to initialize * @param cooling The cooling properties to initialize
*/ */
static INLINE void cooling_init_backend( static INLINE void cooling_init_backend(
const struct swift_params* parameter_file, const struct UnitSystem* us, const struct swift_params* parameter_file, const struct unit_system* us,
const struct phys_const* phys_const, const struct phys_const* phys_const,
struct cooling_function_data* cooling) {} struct cooling_function_data* cooling) {}
......
...@@ -3351,16 +3351,16 @@ void engine_dump_snapshot(struct engine *e) { ...@@ -3351,16 +3351,16 @@ void engine_dump_snapshot(struct engine *e) {
/* Dump... */ /* Dump... */
#if defined(WITH_MPI) #if defined(WITH_MPI)
#if defined(HAVE_PARALLEL_HDF5) #if defined(HAVE_PARALLEL_HDF5)
write_output_parallel(e, e->snapshotBaseName, e->internalUnits, write_output_parallel(e, e->snapshotBaseName, e->internal_units,
e->snapshotUnits, e->nodeID, e->nr_nodes, e->snapshotUnits, e->nodeID, e->nr_nodes,
MPI_COMM_WORLD, MPI_INFO_NULL); MPI_COMM_WORLD, MPI_INFO_NULL);
#else #else
write_output_serial(e, e->snapshotBaseName, e->internalUnits, write_output_serial(e, e->snapshotBaseName, e->internal_units,
e->snapshotUnits, e->nodeID, e->nr_nodes, MPI_COMM_WORLD, e->snapshotUnits, e->nodeID, e->nr_nodes, MPI_COMM_WORLD,
MPI_INFO_NULL); MPI_INFO_NULL);
#endif #endif
#else #else
write_output_single(e, e->snapshotBaseName, e->internalUnits, write_output_single(e, e->snapshotBaseName, e->internal_units,
e->snapshotUnits); e->snapshotUnits);
#endif #endif
...@@ -3448,7 +3448,7 @@ void engine_unpin() { ...@@ -3448,7 +3448,7 @@ void engine_unpin() {
void engine_init(struct engine *e, struct space *s, void engine_init(struct engine *e, struct space *s,
const struct swift_params *params, int nr_nodes, int nodeID, const struct swift_params *params, int nr_nodes, int nodeID,
int nr_threads, int with_aff, int policy, int verbose, int nr_threads, int with_aff, int policy, int verbose,
const struct UnitSystem *internal_units, const struct unit_system *internal_units,
const struct phys_const *physical_constants, const struct phys_const *physical_constants,
const struct hydro_props *hydro, const struct hydro_props *hydro,
const struct external_potential *potential, const struct external_potential *potential,
...@@ -3480,7 +3480,7 @@ void engine_init(struct engine *e, struct space *s, ...@@ -3480,7 +3480,7 @@ void engine_init(struct engine *e, struct space *s,
e->timeStep = 0.; e->timeStep = 0.;
e->timeBase = 0.; e->timeBase = 0.;
e->timeBase_inv = 0.; e->timeBase_inv = 0.;
e->internalUnits = internal_units; e->internal_units = internal_units;
e->timeFirstSnapshot = e->timeFirstSnapshot =
parser_get_param_double(params, "Snapshots:time_first"); parser_get_param_double(params, "Snapshots:time_first");
e->deltaTimeSnapshot = e->deltaTimeSnapshot =
...@@ -3489,7 +3489,7 @@ void engine_init(struct engine *e, struct space *s, ...@@ -3489,7 +3489,7 @@ void engine_init(struct engine *e, struct space *s,
parser_get_param_string(params, "Snapshots:basename", e->snapshotBaseName); parser_get_param_string(params, "Snapshots:basename", e->snapshotBaseName);
e->snapshotCompression = e->snapshotCompression =
parser_get_opt_param_int(params, "Snapshots:compression", 0); parser_get_opt_param_int(params, "Snapshots:compression", 0);
e->snapshotUnits = malloc(sizeof(struct UnitSystem)); e->snapshotUnits = malloc(sizeof(struct unit_system));
units_init_default(e->snapshotUnits, params, "Snapshots", internal_units); units_init_default(e->snapshotUnits, params, "Snapshots", internal_units);
e->dt_min = parser_get_param_double(params, "TimeIntegration:dt_min"); e->dt_min = parser_get_param_double(params, "TimeIntegration:dt_min");
e->dt_max = parser_get_param_double(params, "TimeIntegration:dt_max"); e->dt_max = parser_get_param_double(params, "TimeIntegration:dt_max");
......
...@@ -135,7 +135,7 @@ struct engine { ...@@ -135,7 +135,7 @@ struct engine {
size_t updates, g_updates, s_updates; size_t updates, g_updates, s_updates;
/* The internal system of units */ /* The internal system of units */
const struct UnitSystem *internalUnits; const struct unit_system *internal_units;
/* Snapshot information */ /* Snapshot information */
double timeFirstSnapshot; double timeFirstSnapshot;
...@@ -143,7 +143,7 @@ struct engine { ...@@ -143,7 +143,7 @@ struct engine {
integertime_t ti_nextSnapshot; integertime_t ti_nextSnapshot;
char snapshotBaseName[200]; char snapshotBaseName[200];
int snapshotCompression; int snapshotCompression;
struct UnitSystem *snapshotUnits; struct unit_system *snapshotUnits;
/* Statistics information */ /* Statistics information */
FILE *file_stats; FILE *file_stats;
...@@ -219,7 +219,7 @@ void engine_dump_snapshot(struct engine *e); ...@@ -219,7 +219,7 @@ void engine_dump_snapshot(struct engine *e);
void engine_init(struct engine *e, struct space *s, void engine_init(struct engine *e, struct space *s,
const struct swift_params *params, int nr_nodes, int nodeID, const struct swift_params *params, int nr_nodes, int nodeID,
int nr_threads, int with_aff, int policy, int verbose, int nr_threads, int with_aff, int policy, int verbose,
const struct UnitSystem *internal_units, const struct unit_system *internal_units,
const struct phys_const *physical_constants, const struct phys_const *physical_constants,
const struct hydro_props *hydro, const struct hydro_props *hydro,
const struct external_potential *potential, const struct external_potential *potential,
......
...@@ -47,7 +47,7 @@ struct io_props { ...@@ -47,7 +47,7 @@ struct io_props {
enum DATA_IMPORTANCE importance; enum DATA_IMPORTANCE importance;
/* Units of the quantity */ /* Units of the quantity */
enum UnitConversionFactor units; enum unit_conversion_factor units;
/* Pointer to the field of the first particle in the array */ /* Pointer to the field of the first particle in the array */
char* field; char* field;
...@@ -89,7 +89,7 @@ struct io_props { ...@@ -89,7 +89,7 @@ struct io_props {
struct io_props io_make_input_field_(char name[FIELD_BUFFER_SIZE], struct io_props io_make_input_field_(char name[FIELD_BUFFER_SIZE],
enum IO_DATA_TYPE type, int dimension, enum IO_DATA_TYPE type, int dimension,
enum DATA_IMPORTANCE importance, enum DATA_IMPORTANCE importance,
enum UnitConversionFactor units, enum unit_conversion_factor units,
char* field, size_t partSize) { char* field, size_t partSize) {
struct io_props r; struct io_props r;
strcpy(r.name, name); strcpy(r.name, name);
...@@ -128,7 +128,7 @@ struct io_props io_make_input_field_(char name[FIELD_BUFFER_SIZE], ...@@ -128,7 +128,7 @@ struct io_props io_make_input_field_(char name[FIELD_BUFFER_SIZE],
*/ */
struct io_props io_make_output_field_(char name[FIELD_BUFFER_SIZE], struct io_props io_make_output_field_(char name[FIELD_BUFFER_SIZE],
enum IO_DATA_TYPE type, int dimension, enum IO_DATA_TYPE type, int dimension,
enum UnitConversionFactor units, enum unit_conversion_factor units,
char* field, size_t partSize) { char* field, size_t partSize) {
struct io_props r; struct io_props r;
strcpy(r.name, name); strcpy(r.name, name);
...@@ -171,7 +171,7 @@ struct io_props io_make_output_field_(char name[FIELD_BUFFER_SIZE], ...@@ -171,7 +171,7 @@ struct io_props io_make_output_field_(char name[FIELD_BUFFER_SIZE],
*/ */
struct io_props io_make_output_field_convert_part_( struct io_props io_make_output_field_convert_part_(
char name[FIELD_BUFFER_SIZE], enum IO_DATA_TYPE type, int dimension, char name[FIELD_BUFFER_SIZE], enum IO_DATA_TYPE type, int dimension,
enum UnitConversionFactor units, char* field, size_t partSize, enum unit_conversion_factor units, char* field, size_t partSize,
struct part* parts, float (*functionPtr)(struct engine*, struct part*)) { struct part* parts, float (*functionPtr)(struct engine*, struct part*)) {
struct io_props r; struct io_props r;
...@@ -215,7 +215,7 @@ struct io_props io_make_output_field_convert_part_( ...@@ -215,7 +215,7 @@ struct io_props io_make_output_field_convert_part_(
*/ */
struct io_props io_make_output_field_convert_gpart_( struct io_props io_make_output_field_convert_gpart_(
char name[FIELD_BUFFER_SIZE], enum IO_DATA_TYPE type, int dimension, char name[FIELD_BUFFER_SIZE], enum IO_DATA_TYPE type, int dimension,
enum UnitConversionFactor units, char* field, size_t partSize, enum unit_conversion_factor units, char* field, size_t partSize,
struct gpart* gparts, float (*functionPtr)(struct engine*, struct gpart*)) { struct gpart* gparts, float (*functionPtr)(struct engine*, struct gpart*)) {
struct io_props r; struct io_props r;
......
...@@ -71,8 +71,8 @@ ...@@ -71,8 +71,8 @@
*/ */
void readArray(hid_t grp, const struct io_props prop, size_t N, void readArray(hid_t grp, const struct io_props prop, size_t N,
long long N_total, long long offset, long long N_total, long long offset,
const struct UnitSystem* internal_units, const struct unit_system* internal_units,
const struct UnitSystem* ic_units) { const struct unit_system* ic_units) {
const size_t typeSize = io_sizeof_type(prop.type); const size_t typeSize = io_sizeof_type(prop.type);
const size_t copySize = typeSize * prop.dimension; const size_t copySize = typeSize * prop.dimension;
...@@ -191,8 +191,8 @@ void readArray(hid_t grp, const struct io_props prop, size_t N, ...@@ -191,8 +191,8 @@ void readArray(hid_t grp, const struct io_props prop, size_t N,
* @param N The number of particles to write. * @param N The number of particles to write.
* @param N_total Total number of particles across all cores * @param N_total Total number of particles across all cores
* @param offset Offset in the array where this mpi task starts writing * @param offset Offset in the array where this mpi task starts writing
* @param internal_units The #UnitSystem used internally * @param internal_units The #unit_system used internally
* @param snapshot_units The #UnitSystem used in the snapshots * @param snapshot_units The #unit_system used in the snapshots
* *
* @todo A better version using HDF5 hyper-slabs to write the file directly from * @todo A better version using HDF5 hyper-slabs to write the file directly from
* the part array will be written once the structures have been stabilized. * the part array will be written once the structures have been stabilized.
...@@ -201,8 +201,8 @@ void readArray(hid_t grp, const struct io_props prop, size_t N, ...@@ -201,8 +201,8 @@ void readArray(hid_t grp, const struct io_props prop, size_t N,
void writeArray(struct engine* e, hid_t grp, char* fileName, FILE* xmfFile, void writeArray(struct engine* e, hid_t grp, char* fileName, FILE* xmfFile,
char* partTypeGroupName, const struct io_props props, size_t N, char* partTypeGroupName, const struct io_props props, size_t N,
long long N_total, int mpi_rank, long long offset, long long N_total, int mpi_rank, long long offset,
const struct UnitSystem* internal_units, const struct unit_system* internal_units,
const struct UnitSystem* snapshot_units) { const struct unit_system* snapshot_units) {
const size_t typeSize = io_sizeof_type(props.type); const size_t typeSize = io_sizeof_type(props.type);
const size_t copySize = typeSize * props.dimension; const size_t copySize = typeSize * props.dimension;
...@@ -374,7 +374,7 @@ void writeArray(struct engine* e, hid_t grp, char* fileName, FILE* xmfFile, ...@@ -374,7 +374,7 @@ void writeArray(struct engine* e, hid_t grp, char* fileName, FILE* xmfFile,
* Calls #error() if an error occurs. * Calls #error() if an error occurs.
* *
*/ */
void read_ic_parallel(char* fileName, const struct UnitSystem* internal_units, void read_ic_parallel(char* fileName, const struct unit_system* internal_units,
double dim[3], struct part** parts, struct gpart** gparts, double dim[3], struct part** parts, struct gpart** gparts,
struct spart** sparts, size_t* Ngas, size_t* Ngparts, struct spart** sparts, size_t* Ngas, size_t* Ngparts,
size_t* Nstars, int* periodic, int* flag_entropy, size_t* Nstars, int* periodic, int* flag_entropy,
...@@ -458,9 +458,9 @@ void read_ic_parallel(char* fileName, const struct UnitSystem* internal_units, ...@@ -458,9 +458,9 @@ void read_ic_parallel(char* fileName, const struct UnitSystem* internal_units,
H5Gclose(h_grp); H5Gclose(h_grp);
/* Read the unit system used in the ICs */ /* Read the unit system used in the ICs */
struct UnitSystem* ic_units = malloc(sizeof(struct UnitSystem)); struct unit_system* ic_units = malloc(sizeof(struct unit_system));
if (ic_units == NULL) error("Unable to allocate memory for IC unit system"); if (ic_units == NULL) error("Unable to allocate memory for IC unit system");
io_read_UnitSystem(h_file, ic_units); io_read_unit_system(h_file, ic_units);
/* Tell the user if a conversion will be needed */ /* Tell the user if a conversion will be needed */
if (mpi_rank == 0) { if (mpi_rank == 0) {
...@@ -620,8 +620,8 @@ void read_ic_parallel(char* fileName, const struct UnitSystem* internal_units, ...@@ -620,8 +620,8 @@ void read_ic_parallel(char* fileName, const struct UnitSystem* internal_units,
* *
* @param e The engine containing all the system. * @param e The engine containing all the system.
* @param baseName The common part of the snapshot file name. * @param baseName The common part of the snapshot file name.
* @param internal_units The #UnitSystem used internally * @param internal_units The #unit_system used internally
* @param snapshot_units The #UnitSystem used in the snapshots * @param snapshot_units The #unit_system used in the snapshots
* @param mpi_rank The MPI rank of this node. * @param mpi_rank The MPI rank of this node.
* @param mpi_size The number of MPI ranks. * @param mpi_size The number of MPI ranks.
* @param comm The MPI communicator. * @param comm The MPI communicator.
...@@ -636,8 +636,8 @@ void read_ic_parallel(char* fileName, const struct UnitSystem* internal_units, ...@@ -636,8 +636,8 @@ void read_ic_parallel(char* fileName, const struct UnitSystem* internal_units,
* *
*/ */
void write_output_parallel(struct engine* e, const char* baseName, void write_output_parallel(struct engine* e, const char* baseName,
const struct UnitSystem* internal_units, const struct unit_system* internal_units,
const struct UnitSystem* snapshot_units, const struct unit_system* snapshot_units,
int mpi_rank, int mpi_size, MPI_Comm comm, int mpi_rank, int mpi_size, MPI_Comm comm,
MPI_Info info) { MPI_Info info) {
...@@ -765,10 +765,10 @@ void write_output_parallel(struct engine* e, const char* baseName, ...@@ -765,10 +765,10 @@ void write_output_parallel(struct engine* e, const char* baseName,
H5Gclose(h_grp); H5Gclose(h_grp);
/* Print the system of Units used in the spashot */ /* Print the system of Units used in the spashot */
io_write_UnitSystem(h_file, snapshot_units, "Units"); io_write_unit_system(h_file, snapshot_units, "Units");
/* Print the system of Units used internally */ /* Print the system of Units used internally */
io_write_UnitSystem(h_file, internal_units, "InternalCodeUnits"); io_write_unit_system(h_file, internal_units, "InternalCodeUnits");
/* Tell the user if a conversion will be needed */ /* Tell the user if a conversion will be needed */
if (e->verbose && mpi_rank == 0) { if (e->verbose && mpi_rank == 0) {
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#if defined(HAVE_HDF5) && defined(WITH_MPI) && defined(HAVE_PARALLEL_HDF5) #if defined(HAVE_HDF5) && defined(WITH_MPI) && defined(HAVE_PARALLEL_HDF5)
void read_ic_parallel(char* fileName, const struct UnitSystem* internal_units, void read_ic_parallel(char* fileName, const struct unit_system* internal_units,
double dim[3], struct part** parts, struct gpart** gparts, double dim[3], struct part** parts, struct gpart** gparts,
struct spart** sparts, size_t* Ngas, size_t* Ngparts, struct spart** sparts, size_t* Ngas, size_t* Ngparts,
size_t* Nsparts, int* periodic, int* flag_entropy, size_t* Nsparts, int* periodic, int* flag_entropy,
...@@ -43,8 +43,8 @@ void read_ic_parallel(char* fileName, const struct UnitSystem* internal_units, ...@@ -43,8 +43,8 @@ void read_ic_parallel(char* fileName, const struct UnitSystem* internal_units,
int dry_run); int dry_run);
void write_output_parallel(struct engine* e, const char* baseName, void write_output_parallel(struct engine* e, const char* baseName,
const struct UnitSystem* internal_units, const struct unit_system* internal_units,
const struct UnitSystem* snapshot_units, const struct unit_system* snapshot_units,
int mpi_rank, int mpi_size, MPI_Comm comm, int mpi_rank, int mpi_size, MPI_Comm comm,
MPI_Info info); MPI_Info info);
#endif #endif
......
...@@ -34,7 +34,8 @@ ...@@ -34,7 +34,8 @@
* @param us The current internal system of units. * @param us The current internal system of units.
* @param internal_const The physical constants to initialize. * @param internal_const The physical constants to initialize.
*/ */
void phys_const_init(struct UnitSystem* us, struct phys_const* internal_const) { void phys_const_init(struct unit_system* us,
struct phys_const* internal_const) {
/* Units are declared as {U_M, U_L, U_t, U_I, U_T} */ /* Units are declared as {U_M, U_L, U_t, U_I, U_T} */
......
...@@ -78,7 +78,7 @@ struct phys_const { ...@@ -78,7 +78,7 @@ struct phys_const {
double const_earth_mass; double const_earth_mass;
}; };
void phys_const_init(struct UnitSystem* us, struct phys_const* internal_const); void phys_const_init(struct unit_system* us, struct phys_const* internal_const);
void phys_const_print(struct phys_const* internal_const); void phys_const_print(struct phys_const* internal_const