diff --git a/examples/main.c b/examples/main.c index 4631a09aa115285ecfe56a9f819d3fc7baf59095..2059a8018ba5b51e65ef78a1c1e40027a55af671 100644 --- a/examples/main.c +++ b/examples/main.c @@ -264,7 +264,8 @@ int main(int argc, char *argv[]) { struct external_potential potential; units_init(&us, params); initPhysicalConstants(&us, &prog_const); - initPotentialProperties(params, &us, &potential); + if( with_external_gravity) + initPotentialProperties(params, &us, &potential); if (myrank == 0) { message("Unit system: U_M = %e g.", us.UnitMass_in_cgs); message("Unit system: U_L = %e cm.", us.UnitLength_in_cgs); @@ -280,7 +281,6 @@ int main(int argc, char *argv[]) { units_a_factor(&us, UNIT_CONV_ENTROPY), units_h_factor(&us, UNIT_CONV_ENTROPY)); message("Gravity constant = %e", prog_const.newton_gravity); - message("Point mass properties are (x,y,z) = (%e, %e, %e), M = %e", potential.point_mass.x, potential.point_mass.y, potential.point_mass.z, potential.point_mass.mass); } /* Prepare the domain decomposition scheme */ @@ -373,7 +373,6 @@ int main(int argc, char *argv[]) { message("%zi parts in %i cells.", s.nr_parts, s.tot_cells); message("%zi gparts in %i cells.", s.nr_gparts, s.tot_cells); message("maximum depth is %d.", s.maxdepth); - message("gparts[10].id = %lld.", gparts[10].id); // message( "cutoffs in [ %g %g ]." , s.h_min , s.h_max ); fflush(stdout); } diff --git a/src/potentials.c b/src/potentials.c index 772289e7b599276b4922ce12ec64629cfe8b9cc5..324dfcad74f5ecb74fe0ed6ba3c4ffbac81917eb 100644 --- a/src/potentials.c +++ b/src/potentials.c @@ -34,13 +34,11 @@ void initPotentialProperties(const struct swift_params * parameter_file, struct UnitSystem* us, struct external_potential* potential) { - message(" %e\t %e", PARSEC_IN_CGS, units_conversion_factor(us, UNIT_CONV_LENGTH)); - - potential->point_mass.x = parser_get_param_double(parameter_file, "PointMass:position_x"); potential->point_mass.y = parser_get_param_double(parameter_file, "PointMass:position_y"); potential->point_mass.z = parser_get_param_double(parameter_file, "PointMass:position_z"); potential->point_mass.mass = parser_get_param_double(parameter_file, "PointMass:mass"); + message("Point mass properties are (x,y,z) = (%e, %e, %e), M = %e", potential->point_mass.x, potential->point_mass.y, potential->point_mass.z, potential->point_mass.mass); /* potential->point_mass.x = */ /* 50000 * PARSEC_IN_CGS / units_conversion_factor(us, UNIT_CONV_LENGTH); */ diff --git a/src/potentials.h b/src/potentials.h index 318daeb8df8ed9d7d6e337f5a1f1d12c8da9fce5..e31ac207974669347541439479922d2347be163b 100644 --- a/src/potentials.h +++ b/src/potentials.h @@ -38,15 +38,15 @@ struct external_potential { } point_mass; }; -/* Properties of Point Mass */ +/* Include exteral pointmass potential */ #ifdef EXTERNAL_POTENTIAL_POINTMASS -#define const_unit_length_in_cgs (1e3 * PARSEC_IN_CGS) -#define const_unit_mass_in_cgs (SOLAR_MASS_IN_CGS) -#define External_Potential_X (50000 * PARSEC_IN_CGS / const_unit_length_in_cgs) -#define External_Potential_Y (50000 * PARSEC_IN_CGS / const_unit_length_in_cgs) -#define External_Potential_Z (50000 * PARSEC_IN_CGS / const_unit_length_in_cgs) -#define External_Potential_Mass \ - (1e10 * SOLAR_MASS_IN_CGS / const_unit_mass_in_cgs) +/* #define const_unit_length_in_cgs (1e3 * PARSEC_IN_CGS) */ +/* #define const_unit_mass_in_cgs (SOLAR_MASS_IN_CGS) */ +/* #define External_Potential_X (50000 * PARSEC_IN_CGS / const_unit_length_in_cgs) */ +/* #define External_Potential_Y (50000 * PARSEC_IN_CGS / const_unit_length_in_cgs) */ +/* #define External_Potential_Z (50000 * PARSEC_IN_CGS / const_unit_length_in_cgs) */ +/* #define External_Potential_Mass \ */ +/* (1e10 * SOLAR_MASS_IN_CGS / const_unit_mass_in_cgs) */ /** * @brief Computes the time-step due to the acceleration from a point mass @@ -115,7 +115,7 @@ __attribute__((always_inline)) INLINE static void external_gravity_pointmass(con * @param us The current internal system of units * @param potential The external potential properties to initialize */ -void initPotentialProperties(const struct swift_params * paramter_file, +void initPotentialProperties(const struct swift_params * parameter_file, struct UnitSystem* us, struct external_potential* potential); diff --git a/src/runner.c b/src/runner.c index af1a489b074821fe51ee30b464d24551ca2051c2..aab2ad01697e6655c45768ceb6e45cad66229888 100644 --- a/src/runner.c +++ b/src/runner.c @@ -176,8 +176,8 @@ void runner_dograv_external(struct runner *r, struct cell *c) { // g->x[1], vx, vy); message("%f\t %f %f %f %f %f %f %f %f %f %f %f %f %f\n", r->e->time, g->tx, g->tv, dt, v2, fg, fga, dr, E, L[2], g->x[0], g->x[1], vx, vy); - message(" G=%e M=%e\n", r->e->physical_constants->newton_gravity, r->e->potential->point_mass.mass); - exit(-1); + /* message(" G=%e M=%e\n", r->e->physical_constants->newton_gravity, r->e->potential->point_mass.mass); */ + /* exit(-1); */ } } }