diff --git a/src/chemistry/EAGLE/chemistry.h b/src/chemistry/EAGLE/chemistry.h index 8b007b40fa858237fc589af0f11e6ada6af0d1cf..96a645806a495801f6165353cad9e1c87087f8e3 100644 --- a/src/chemistry/EAGLE/chemistry.h +++ b/src/chemistry/EAGLE/chemistry.h @@ -124,9 +124,10 @@ __attribute__((always_inline)) INLINE static void chemistry_first_init_part( * @param phys_const The physical constants in internal units. * @param data The properties to initialise. */ -static INLINE void chemistry_init_backend( - struct swift_params* parameter_file, const struct unit_system* us, - const struct phys_const* phys_const, struct chemistry_global_data* data) { +static INLINE void chemistry_init_backend(struct swift_params* parameter_file, + const struct unit_system* us, + const struct phys_const* phys_const, + struct chemistry_global_data* data) { /* Read the total metallicity */ data->initial_metal_mass_fraction_total = diff --git a/src/chemistry/GEAR/chemistry.h b/src/chemistry/GEAR/chemistry.h index abed5b913683fe72c5c1f197e5506b14100a0ab5..6212ed1efb423717b800d431a83f0e8bec7c6c6f 100644 --- a/src/chemistry/GEAR/chemistry.h +++ b/src/chemistry/GEAR/chemistry.h @@ -72,9 +72,10 @@ static INLINE void chemistry_print_backend( * @param phys_const The physical constants in internal units. * @param data The properties to initialise. */ -static INLINE void chemistry_init_backend( - struct swift_params* parameter_file, const struct unit_system* us, - const struct phys_const* phys_const, struct chemistry_global_data* data) { +static INLINE void chemistry_init_backend(struct swift_params* parameter_file, + const struct unit_system* us, + const struct phys_const* phys_const, + struct chemistry_global_data* data) { /* read parameters */ data->initial_metallicity = parser_get_opt_param_float( diff --git a/src/chemistry/none/chemistry.h b/src/chemistry/none/chemistry.h index 2114b1c85f161e309ddfb4304df2ce23506d041a..dce06ffda339e8a6c4925c7b7c430485a208adb7 100644 --- a/src/chemistry/none/chemistry.h +++ b/src/chemistry/none/chemistry.h @@ -59,9 +59,10 @@ chemistry_get_element_name(enum chemistry_element elem) { * @param phys_const The physical constants in internal units. * @param data The global chemistry information (to be filled). */ -static INLINE void chemistry_init_backend( - struct swift_params* parameter_file, const struct unit_system* us, - const struct phys_const* phys_const, struct chemistry_global_data* data) {} +static INLINE void chemistry_init_backend(struct swift_params* parameter_file, + const struct unit_system* us, + const struct phys_const* phys_const, + struct chemistry_global_data* data) {} /** * @brief Prints the properties of the chemistry model to stdout. diff --git a/src/cooling/EAGLE/cooling.h b/src/cooling/EAGLE/cooling.h index 6227dd24267f2d1789ada94a9ac686c65ebaf380..f059d995c65cf791f0692ab5d8505f92c1a206ca 100644 --- a/src/cooling/EAGLE/cooling.h +++ b/src/cooling/EAGLE/cooling.h @@ -109,10 +109,11 @@ __attribute__((always_inline)) INLINE static float cooling_get_radiated_energy( * @param phys_const The physical constants in internal units. * @param cooling The cooling properties to initialize */ -static INLINE void cooling_init_backend( - struct swift_params* parameter_file, const struct unit_system* us, - const struct phys_const* phys_const, - struct cooling_function_data* cooling) {} +static INLINE void cooling_init_backend(struct swift_params* parameter_file, + const struct unit_system* us, + const struct phys_const* phys_const, + struct cooling_function_data* cooling) { +} /** * @brief Prints the properties of the cooling model to stdout. diff --git a/src/cooling/const_du/cooling.h b/src/cooling/const_du/cooling.h index f436e1e28360532c2bee1300369577b2376676f2..b6fea7eea7b0fb208c4bffece425ec836d5df0c0 100644 --- a/src/cooling/const_du/cooling.h +++ b/src/cooling/const_du/cooling.h @@ -163,10 +163,10 @@ __attribute__((always_inline)) INLINE static float cooling_get_radiated_energy( * @param phys_const The physical constants in internal units. * @param cooling The cooling properties to initialize */ -static INLINE void cooling_init_backend( - struct swift_params* parameter_file, const struct unit_system* us, - const struct phys_const* phys_const, - struct cooling_function_data* cooling) { +static INLINE void cooling_init_backend(struct swift_params* parameter_file, + const struct unit_system* us, + const struct phys_const* phys_const, + struct cooling_function_data* cooling) { cooling->cooling_rate = parser_get_param_double(parameter_file, "ConstCooling:cooling_rate"); diff --git a/src/cooling/const_lambda/cooling.h b/src/cooling/const_lambda/cooling.h index e54071204c9634a28bf57a2293d9d37bbc2593a8..f1a7abdbe14a39d98bbd01eb36ba870c8af0ee1a 100644 --- a/src/cooling/const_lambda/cooling.h +++ b/src/cooling/const_lambda/cooling.h @@ -171,10 +171,10 @@ __attribute__((always_inline)) INLINE static float cooling_get_radiated_energy( * @param phys_const The physical constants in internal units. * @param cooling The cooling properties to initialize */ -static INLINE void cooling_init_backend( - struct swift_params* parameter_file, const struct unit_system* us, - const struct phys_const* phys_const, - struct cooling_function_data* cooling) { +static INLINE void cooling_init_backend(struct swift_params* parameter_file, + const struct unit_system* us, + const struct phys_const* phys_const, + struct cooling_function_data* cooling) { const double lambda_cgs = parser_get_param_double(parameter_file, "LambdaCooling:lambda_cgs"); diff --git a/src/cooling/none/cooling.h b/src/cooling/none/cooling.h index bf096ff84ecf58c9c37cc23bb3e843d1b75934ee..0cc465adcdad8fe19afe4a9867e5d68a22ed9119 100644 --- a/src/cooling/none/cooling.h +++ b/src/cooling/none/cooling.h @@ -119,10 +119,11 @@ __attribute__((always_inline)) INLINE static float cooling_get_radiated_energy( * @param phys_const The physical constants in internal units. * @param cooling The cooling properties to initialize */ -static INLINE void cooling_init_backend( - struct swift_params* parameter_file, const struct unit_system* us, - const struct phys_const* phys_const, - struct cooling_function_data* cooling) {} +static INLINE void cooling_init_backend(struct swift_params* parameter_file, + const struct unit_system* us, + const struct phys_const* phys_const, + struct cooling_function_data* cooling) { +} /** * @brief Prints the properties of the cooling model to stdout. diff --git a/src/cosmology.c b/src/cosmology.c index 0cc528c8a095637de1b60a83a15181d63c43b092..09472fd77cd98185ff8799e79f687b6552bcd901 100644 --- a/src/cosmology.c +++ b/src/cosmology.c @@ -387,8 +387,7 @@ void cosmology_init_tables(struct cosmology *c) { * @param phys_const The physical constants in the current system of units. * @param c The #cosmology to initialise. */ -void cosmology_init(struct swift_params *params, - const struct unit_system *us, +void cosmology_init(struct swift_params *params, const struct unit_system *us, const struct phys_const *phys_const, struct cosmology *c) { /* Read in the cosmological parameters */ diff --git a/src/cosmology.h b/src/cosmology.h index 93751fba6f07785d25d8f8fc343d3ac2897fc19b..ea992d12deffbe60154ea56ca5fff69a1b06587c 100644 --- a/src/cosmology.h +++ b/src/cosmology.h @@ -181,8 +181,7 @@ double cosmology_get_therm_kick_factor(const struct cosmology *cosmo, double cosmology_get_delta_time(const struct cosmology *c, double a1, double a2); -void cosmology_init(struct swift_params *params, - const struct unit_system *us, +void cosmology_init(struct swift_params *params, const struct unit_system *us, const struct phys_const *phys_const, struct cosmology *c); void cosmology_init_no_cosmo(struct cosmology *c); diff --git a/src/engine.c b/src/engine.c index c62feb434d0eee53b938ee3770aaf87b70d2c859..c7a87500aab6b3b9f1bcbcf8409283f538324927 100644 --- a/src/engine.c +++ b/src/engine.c @@ -5421,10 +5421,9 @@ void engine_unpin(void) { * @param chemistry The chemistry information. * @param sourceterms The properties of the source terms function. */ -void engine_init(struct engine *e, struct space *s, - struct swift_params *params, long long Ngas, - long long Ngparts, long long Nstars, int policy, int verbose, - struct repartition *reparttype, +void engine_init(struct engine *e, struct space *s, struct swift_params *params, + long long Ngas, long long Ngparts, long long Nstars, + int policy, int verbose, struct repartition *reparttype, const struct unit_system *internal_units, const struct phys_const *physical_constants, struct cosmology *cosmo, const struct hydro_props *hydro, @@ -5552,10 +5551,9 @@ void engine_init(struct engine *e, struct space *s, * @param verbose Is this #engine talkative ? * @param restart_file The name of our restart file. */ -void engine_config(int restart, struct engine *e, - struct swift_params *params, int nr_nodes, int nodeID, - int nr_threads, int with_aff, int verbose, - const char *restart_file) { +void engine_config(int restart, struct engine *e, struct swift_params *params, + int nr_nodes, int nodeID, int nr_threads, int with_aff, + int verbose, const char *restart_file) { /* Store the values and initialise global fields. */ e->nodeID = nodeID; diff --git a/src/engine.h b/src/engine.h index 877dbf362765d78e5aef603d3a0b7caebcfa6380..2b0af9aa6073327441ddef8fa25d091a89ff3d25 100644 --- a/src/engine.h +++ b/src/engine.h @@ -354,10 +354,9 @@ void engine_drift_top_multipoles(struct engine *e); void engine_reconstruct_multipoles(struct engine *e); void engine_print_stats(struct engine *e); void engine_dump_snapshot(struct engine *e); -void engine_init(struct engine *e, struct space *s, - struct swift_params *params, long long Ngas, - long long Ngparts, long long Nstars, int policy, int verbose, - struct repartition *reparttype, +void engine_init(struct engine *e, struct space *s, struct swift_params *params, + long long Ngas, long long Ngparts, long long Nstars, + int policy, int verbose, struct repartition *reparttype, const struct unit_system *internal_units, const struct phys_const *physical_constants, struct cosmology *cosmo, const struct hydro_props *hydro, @@ -366,10 +365,9 @@ void engine_init(struct engine *e, struct space *s, const struct cooling_function_data *cooling_func, const struct chemistry_global_data *chemistry, struct sourceterms *sourceterms); -void engine_config(int restart, struct engine *e, - struct swift_params *params, int nr_nodes, int nodeID, - int nr_threads, int with_aff, int verbose, - const char *restart_file); +void engine_config(int restart, struct engine *e, struct swift_params *params, + int nr_nodes, int nodeID, int nr_threads, int with_aff, + int verbose, const char *restart_file); void engine_launch(struct engine *e); void engine_prepare(struct engine *e); void engine_init_particles(struct engine *e, int flag_entropy_ICs, diff --git a/src/gravity_properties.c b/src/gravity_properties.c index 05e28dc860a6b8c22c56d0c33fe78e2f8f828afd..481ed2cd5e35382cd85d9bec4f94c109738ffb70 100644 --- a/src/gravity_properties.c +++ b/src/gravity_properties.c @@ -37,8 +37,7 @@ #define gravity_props_default_r_cut_min 0.1f #define gravity_props_default_rebuild_frequency 0.01f -void gravity_props_init(struct gravity_props *p, - struct swift_params *params, +void gravity_props_init(struct gravity_props *p, struct swift_params *params, const struct cosmology *cosmo) { /* Tree updates */ diff --git a/src/gravity_properties.h b/src/gravity_properties.h index 6f0898a164077adc2af8f624da28ddf75c6951d4..7faaa88d5e82b7882404269009b2f0542896eee1 100644 --- a/src/gravity_properties.h +++ b/src/gravity_properties.h @@ -82,8 +82,7 @@ struct gravity_props { }; void gravity_props_print(const struct gravity_props *p); -void gravity_props_init(struct gravity_props *p, - struct swift_params *params, +void gravity_props_init(struct gravity_props *p, struct swift_params *params, const struct cosmology *cosmo); void gravity_update(struct gravity_props *p, const struct cosmology *cosmo); diff --git a/src/parallel_io.c b/src/parallel_io.c index 8720a6ce6e00d6ca1e0c63410264ca5c96d71877..d37c8632675dc13e487e0c80e2f7390f5c14e527 100644 --- a/src/parallel_io.c +++ b/src/parallel_io.c @@ -1022,8 +1022,8 @@ void prepare_file(struct engine* e, const char* baseName, long long N_total[6], H5Gclose(h_grp); /* Print the runtime unused parameters */ - h_grp = - H5Gcreate(h_file, "/UnusedParameters", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + h_grp = H5Gcreate(h_file, "/UnusedParameters", H5P_DEFAULT, H5P_DEFAULT, + H5P_DEFAULT); if (h_grp < 0) error("Error while creating parameters group"); parser_write_params_to_hdf5(e->parameter_file, h_grp, 0); H5Gclose(h_grp); diff --git a/src/physical_constants.c b/src/physical_constants.c index b0f0df7745fe29b290062d7e039d6b33bdd6ad84..2c0ea6191b20e7786b0e2c55356b6c9decf7b0a4 100644 --- a/src/physical_constants.c +++ b/src/physical_constants.c @@ -38,8 +38,7 @@ * @param params The parsed parameter file. * @param internal_const The physical constants to initialize. */ -void phys_const_init(const struct unit_system *us, - struct swift_params *params, +void phys_const_init(const struct unit_system *us, struct swift_params *params, struct phys_const *internal_const) { /* Units are declared as {U_M, U_L, U_t, U_I, U_T} */ diff --git a/src/physical_constants.h b/src/physical_constants.h index 75b79bc0a5f19bf0169a505eb82b8dccf2f8042a..606e7eeb584fc670c5c690aa9dfa683330ea3644 100644 --- a/src/physical_constants.h +++ b/src/physical_constants.h @@ -89,8 +89,7 @@ struct phys_const { double const_earth_mass; }; -void phys_const_init(const struct unit_system* us, - struct swift_params* params, +void phys_const_init(const struct unit_system* us, struct swift_params* params, struct phys_const* internal_const); void phys_const_print(const struct phys_const* internal_const); diff --git a/src/potential/disc_patch/potential.h b/src/potential/disc_patch/potential.h index 290f4847e838a2252ebbc19fc7c6ce2d342710fb..40c747314994cfdc4a38679d747e3351e4fbd4d1 100644 --- a/src/potential/disc_patch/potential.h +++ b/src/potential/disc_patch/potential.h @@ -269,9 +269,9 @@ external_gravity_get_potential_energy( * @param potential The external potential properties to initialize */ static INLINE void potential_init_backend( - struct swift_params* parameter_file, - const struct phys_const* phys_const, const struct unit_system* us, - const struct space* s, struct external_potential* potential) { + struct swift_params* parameter_file, const struct phys_const* phys_const, + const struct unit_system* us, const struct space* s, + struct external_potential* potential) { potential->surface_density = parser_get_param_double( parameter_file, "DiscPatchPotential:surface_density"); diff --git a/src/potential/isothermal/potential.h b/src/potential/isothermal/potential.h index a9d3c7d6c3a2a6e4f9da9891e8bdc091a32cda68..4267c9becc7251ffe276b69f078e374504c22aab 100644 --- a/src/potential/isothermal/potential.h +++ b/src/potential/isothermal/potential.h @@ -162,9 +162,9 @@ external_gravity_get_potential_energy( * @param potential The external potential properties to initialize */ static INLINE void potential_init_backend( - struct swift_params* parameter_file, - const struct phys_const* phys_const, const struct unit_system* us, - const struct space* s, struct external_potential* potential) { + struct swift_params* parameter_file, const struct phys_const* phys_const, + const struct unit_system* us, const struct space* s, + struct external_potential* potential) { potential->x = s->dim[0] / 2. + diff --git a/src/potential/none/potential.h b/src/potential/none/potential.h index c96b5e80f1435945dd58ff64539eae9c106202ac..2303f2531d059660a063a92be999405f05e9e6aa 100644 --- a/src/potential/none/potential.h +++ b/src/potential/none/potential.h @@ -98,9 +98,9 @@ external_gravity_get_potential_energy( * @param potential The external potential properties to initialize */ static INLINE void potential_init_backend( - struct swift_params* parameter_file, - const struct phys_const* phys_const, const struct unit_system* us, - const struct space* s, struct external_potential* potential) {} + struct swift_params* parameter_file, const struct phys_const* phys_const, + const struct unit_system* us, const struct space* s, + struct external_potential* potential) {} /** * @brief Prints the properties of the external potential to stdout. diff --git a/src/potential/point_mass/potential.h b/src/potential/point_mass/potential.h index 0939adcb07700695d19b21f9bf6f813e2e8687e7..db875842d51f6c0a28dd1308fd7dd1728e746ce4 100644 --- a/src/potential/point_mass/potential.h +++ b/src/potential/point_mass/potential.h @@ -152,9 +152,9 @@ external_gravity_get_potential_energy( * @param potential The external potential properties to initialize */ static INLINE void potential_init_backend( - struct swift_params* parameter_file, - const struct phys_const* phys_const, const struct unit_system* us, - const struct space* s, struct external_potential* potential) { + struct swift_params* parameter_file, const struct phys_const* phys_const, + const struct unit_system* us, const struct space* s, + struct external_potential* potential) { potential->x = parser_get_param_double(parameter_file, "PointMassPotential:position_x"); diff --git a/src/potential/point_mass_ring/potential.h b/src/potential/point_mass_ring/potential.h index 5c38380a23e988bf33e9f71cad21d59956be66cb..551efe32521a5c5ee8068ba409dbb81547103e8f 100644 --- a/src/potential/point_mass_ring/potential.h +++ b/src/potential/point_mass_ring/potential.h @@ -192,9 +192,9 @@ external_gravity_get_potential_energy( * @param potential The external potential properties to initialize */ static INLINE void potential_init_backend( - struct swift_params* parameter_file, - const struct phys_const* phys_const, const struct unit_system* us, - const struct space* s, struct external_potential* potential) { + struct swift_params* parameter_file, const struct phys_const* phys_const, + const struct unit_system* us, const struct space* s, + struct external_potential* potential) { potential->x = parser_get_param_double(parameter_file, "PointMassPotential:position_x"); diff --git a/src/potential/point_mass_softened/potential.h b/src/potential/point_mass_softened/potential.h index 92f0ba145184f2033615c6b8967443c34c3cb440..80959ec923cbedcbea5fba3293c8ae4f94f65679 100644 --- a/src/potential/point_mass_softened/potential.h +++ b/src/potential/point_mass_softened/potential.h @@ -179,9 +179,9 @@ external_gravity_get_potential_energy( * @param potential The external potential properties to initialize */ static INLINE void potential_init_backend( - struct swift_params* parameter_file, - const struct phys_const* phys_const, const struct unit_system* us, - const struct space* s, struct external_potential* potential) { + struct swift_params* parameter_file, const struct phys_const* phys_const, + const struct unit_system* us, const struct space* s, + struct external_potential* potential) { potential->x = parser_get_param_double(parameter_file, "PointMassPotential:position_x"); diff --git a/src/potential/sine_wave/potential.h b/src/potential/sine_wave/potential.h index 9b72d36c1eb6af4f3d13382a87248233660b79fb..8a1786baaf9ed0b0683ea16fdefee997ecb4eceb 100644 --- a/src/potential/sine_wave/potential.h +++ b/src/potential/sine_wave/potential.h @@ -117,9 +117,9 @@ external_gravity_get_potential_energy( * @param potential The external potential properties to initialize */ static INLINE void potential_init_backend( - struct swift_params* parameter_file, - const struct phys_const* phys_const, const struct unit_system* us, - const struct space* s, struct external_potential* potential) { + struct swift_params* parameter_file, const struct phys_const* phys_const, + const struct unit_system* us, const struct space* s, + struct external_potential* potential) { potential->amplitude = parser_get_param_double(parameter_file, "SineWavePotential:amplitude"); diff --git a/src/serial_io.c b/src/serial_io.c index 136097f0e7ddd87c1e8b2f265c8d374af2ec84fe..4074f9bd54754f4b50a0e62a6a54089efb4d5bfb 100644 --- a/src/serial_io.c +++ b/src/serial_io.c @@ -883,8 +883,8 @@ void write_output_serial(struct engine* e, const char* baseName, H5Gclose(h_grp); /* Print the runtime unused parameters */ - h_grp = - H5Gcreate(h_file, "/UnusedParameters", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + h_grp = H5Gcreate(h_file, "/UnusedParameters", H5P_DEFAULT, H5P_DEFAULT, + H5P_DEFAULT); if (h_grp < 0) error("Error while creating parameters group"); parser_write_params_to_hdf5(e->parameter_file, h_grp, 0); H5Gclose(h_grp); diff --git a/src/single_io.c b/src/single_io.c index 31aa40b3999aa6a46a1b0f22339070b24860fe57..975487a1d954e0144f4675f4b90b7cd3b70f3a13 100644 --- a/src/single_io.c +++ b/src/single_io.c @@ -736,8 +736,8 @@ void write_output_single(struct engine* e, const char* baseName, H5Gclose(h_grp); /* Print the runtime unused parameters */ - h_grp = - H5Gcreate(h_file, "/UnusedParameters", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + h_grp = H5Gcreate(h_file, "/UnusedParameters", H5P_DEFAULT, H5P_DEFAULT, + H5P_DEFAULT); if (h_grp < 0) error("Error while creating parameters group"); parser_write_params_to_hdf5(e->parameter_file, h_grp, 0); H5Gclose(h_grp); diff --git a/src/units.c b/src/units.c index af11d7de404c9a2060bd533ab4b8c4ecb666ecfa..48f0a3aee6e348b5df24ac41b308aebf6f70224a 100644 --- a/src/units.c +++ b/src/units.c @@ -77,8 +77,7 @@ void units_init(struct unit_system* us, double U_M_in_cgs, double U_L_in_cgs, * @param params The parsed parameter file. * @param category The section of the parameter file to read from. */ -void units_init_from_params(struct unit_system* us, - struct swift_params* params, +void units_init_from_params(struct unit_system* us, struct swift_params* params, const char* category) { char buffer[200]; @@ -104,9 +103,8 @@ void units_init_from_params(struct unit_system* us, * @param category The section of the parameter file to read from. * @param def The default unit system to copy from if required. */ -void units_init_default(struct unit_system* us, - struct swift_params* params, const char* category, - const struct unit_system* def) { +void units_init_default(struct unit_system* us, struct swift_params* params, + const char* category, const struct unit_system* def) { if (!def) error("Default unit_system not allocated"); diff --git a/src/units.h b/src/units.h index 1f0ef3cbd738176a82d61500e81f32bf8f02cf94..829a1ce542500308cbc64a2463545fbd23921eef 100644 --- a/src/units.h +++ b/src/units.h @@ -100,9 +100,8 @@ void units_init(struct unit_system* us, double U_M_in_cgs, double U_L_in_cgs, double U_t_in_cgs, double U_C_in_cgs, double U_T_in_cgs); void units_init_from_params(struct unit_system*, struct swift_params*, const char* category); -void units_init_default(struct unit_system* us, - struct swift_params* params, const char* category, - const struct unit_system* def); +void units_init_default(struct unit_system* us, struct swift_params* params, + const char* category, const struct unit_system* def); int units_are_equal(const struct unit_system* a, const struct unit_system* b);