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

Standardized function names

parent 1adff619
......@@ -280,21 +280,20 @@ int main(int argc, char *argv[]) {
struct UnitSystem us;
struct phys_const prog_const;
units_init(&us, params);
init_physical_constants(&us, &prog_const);
if (myrank == 0) {
phys_const_init(&us, &prog_const);
if (myrank == 0 && verbose > 0) {
message("Unit system: U_M = %e g.", us.UnitMass_in_cgs);
message("Unit system: U_L = %e cm.", us.UnitLength_in_cgs);
message("Unit system: U_t = %e s.", us.UnitTime_in_cgs);
message("Unit system: U_I = %e A.", us.UnitCurrent_in_cgs);
message("Unit system: U_T = %e K.", us.UnitTemperature_in_cgs);
print_physical_constants(&prog_const);
phys_const_print(&prog_const);
}
/* Initialise the external potential properties */
struct external_potential potential;
if (with_external_gravity) initPotentialProperties(params, &us, &potential);
if (with_external_gravity && myrank == 0)
printPotentialProperties(&potential);
if (with_external_gravity) potential_init(params, &us, &potential);
if (with_external_gravity && myrank == 0) potential_print(&potential);
/* Read particles and space information from (GADGET) ICs */
char ICfileName[200] = "";
......@@ -378,6 +377,7 @@ int main(int argc, char *argv[]) {
message("map_cellcheck picked up %i parts.", icount);
}
/* Verify the maximal depth of cells. */
if (talking && !dry_run) {
int data[2] = {s.maxdepth, 0};
space_map_cells_pre(&s, 0, &map_maxdepth, data);
......
......@@ -52,5 +52,5 @@ DomainDecomposition:
PointMass:
position_x: 50. # location of external point mass in internal units
position_y: 50.
position_z: 50.
position_z: 50.
mass: 1e10 # mass of external point mass in internal units
......@@ -34,8 +34,7 @@
* @param us The current internal system of units.
* @param internal_const The physical constants to initialize.
*/
void init_physical_constants(struct UnitSystem* us,
struct phys_const* internal_const) {
void phys_const_init(struct UnitSystem* us, struct phys_const* internal_const) {
/* Units are declared as {U_M, U_L, U_t, U_I, U_T} */
......@@ -102,18 +101,18 @@ void init_physical_constants(struct UnitSystem* us,
units_general_conversion_factor(us, dimension_length);
}
void print_physical_constants(struct phys_const* internal_const) {
void phys_const_print(struct phys_const* internal_const) {
message("%25s: %e", "Gravitational constant", internal_const->const_newton_G);
message("%25s: %e", "Speed of light", internal_const->const_speed_light_c);
message("%25s: %e", "Planck constant", internal_const->const_planck_h);
message("%25s: %e", "Boltzmann constant", internal_const->const_boltzmann_k);
message("%25s: %e", "Thomson cross-section",
message("%25s = %e", "Gravitational constant", internal_const->const_newton_G);
message("%25s = %e", "Speed of light", internal_const->const_speed_light_c);
message("%25s = %e", "Planck constant", internal_const->const_planck_h);
message("%25s = %e", "Boltzmann constant", internal_const->const_boltzmann_k);
message("%25s = %e", "Thomson cross-section",
internal_const->const_thomson_cross_section);
message("%25s: %e", "Electron-Volt", internal_const->const_electron_volt);
message("%25s: %e", "Year", internal_const->const_year);
message("%25s: %e", "Astronomical Unit",
message("%25s = %e", "Electron-Volt", internal_const->const_electron_volt);
message("%25s = %e", "Year", internal_const->const_year);
message("%25s = %e", "Astronomical Unit",
internal_const->const_astronomical_unit);
message("%25s: %e", "Parsec", internal_const->const_parsec);
message("%25s: %e", "Solar mass", internal_const->const_solar_mass);
message("%25s = %e", "Parsec", internal_const->const_parsec);
message("%25s = %e", "Solar mass", internal_const->const_solar_mass);
}
......@@ -78,9 +78,8 @@ struct phys_const {
double const_earth_mass;
};
void init_physical_constants(struct UnitSystem* us,
struct phys_const* internal_const);
void phys_const_init(struct UnitSystem* us, struct phys_const* internal_const);
void print_physical_constants(struct phys_const* internal_const);
void phys_const_print(struct phys_const* internal_const);
#endif /* SWIFT_PHYSICAL_CONSTANTS_H */
......@@ -32,9 +32,9 @@
* @param us The current internal system of units
* @param potential The external potential properties to initialize
*/
void initPotentialProperties(const struct swift_params* parameter_file,
struct UnitSystem* us,
struct external_potential* potential) {
void potential_init(const struct swift_params* parameter_file,
struct UnitSystem* us,
struct external_potential* potential) {
#ifdef EXTERNAL_POTENTIAL_POINTMASS
......@@ -55,7 +55,7 @@ void initPotentialProperties(const struct swift_params* parameter_file,
*
* @param potential The external potential properties.
*/
void printPotentialProperties(const struct external_potential* potential) {
void potential_print(const struct external_potential* potential) {
#ifdef EXTERNAL_POTENTIAL_POINTMASS
message("Point mass properties are (x,y,z) = (%e, %e, %e), M = %e",
......
......@@ -111,10 +111,10 @@ __attribute__((always_inline)) INLINE static void external_gravity_pointmass(
/* Now, some generic functions, defined in the source file */
void initPotentialProperties(const struct swift_params* parameter_file,
struct UnitSystem* us,
struct external_potential* potential);
void potential_init(const struct swift_params* parameter_file,
struct UnitSystem* us,
struct external_potential* potential);
void printPotentialProperties(const struct external_potential* potential);
void potential_print(const struct external_potential* potential);
#endif /* SWIFT_POTENTIALS_H */
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