diff --git a/src/gravity/Default/gravity.h b/src/gravity/Default/gravity.h index 0462846716df9a7e20c59577a08e880ee9115020..6fcc6625caa5b67865ec5ccfaba8a393d629bea5 100644 --- a/src/gravity/Default/gravity.h +++ b/src/gravity/Default/gravity.h @@ -82,11 +82,10 @@ __attribute__((always_inline)) * @param phys_const The physical constants in internal units. * @param gp The particle to act upon. */ -__attribute__((always_inline)) INLINE static void external_gravity( - const struct phys_const* const phys_const, struct gpart* gp) { +__attribute__((always_inline)) INLINE static void external_gravity(const struct external_potential* potential, const struct phys_const* const phys_const, struct gpart* gp) { #ifdef EXTERNAL_POTENTIAL_POINTMASS - external_gravity_pointmass(phys_const, gp); + external_gravity_pointmass(potential, phys_const, gp); #endif } diff --git a/src/potentials.h b/src/potentials.h index f753557bc49df7af8bf74a7ef39a6868998a2f96..48c5a4d76424b69e1c5c78c73b6e59fa17461bff 100644 --- a/src/potentials.h +++ b/src/potentials.h @@ -25,6 +25,7 @@ #include "../config.h" /* Local includes. */ +#include "error.h" #include "physical_constants_cgs.h" #include "physical_constants.h" #include "units.h" @@ -85,8 +86,13 @@ __attribute__((always_inline)) * @param phys_cont The physical constants in internal units. * @param gp Pointer to the g-particle data. */ -__attribute__((always_inline)) INLINE static void external_gravity_pointmass( - const struct phys_const* const phys_const, struct gpart* g) { +__attribute__((always_inline)) INLINE static void external_gravity_pointmass(const struct external_potential* potential, const struct phys_const* const phys_const, struct gpart* g) { + + + /* message(" (x,y,z) = (%e, %e, %e), M= %e", potential->point_mass.x, */ + /* potential->point_mass.y, potential->point_mass.z, */ + /* potential->point_mass.mass); */ + /* exit(-1); */ const double G_newton = phys_const->newton_gravity; const float dx = g->x[0] - External_Potential_X; diff --git a/src/runner.c b/src/runner.c index 205287efe7bbca5bd23950d8a02cb46886025529..ce5294ca309dede7f7c07d84da6f617f933f514c 100644 --- a/src/runner.c +++ b/src/runner.c @@ -120,10 +120,6 @@ void runner_dograv_external(struct runner *r, struct cell *c) { /* CentreOfPotential[1] = 0.5 * s->dim[1]; */ /* CentreOfPotential[2] = 0.5 * s->dim[2]; */ - message(" (x,y,z) = (%e, %e, %e), M= %e", r->e->potential->point_mass.x, - r->e->potential->point_mass.y, r->e->potential->point_mass.z, - r->e->potential->point_mass.mass); - exit(-1); /* Recurse? */ if (c->split) { @@ -145,7 +141,7 @@ void runner_dograv_external(struct runner *r, struct cell *c) { if (g->ti_end <= ti_current) { // external_gravity_pointmass(e->physical_constants, // potential_constants, g); - external_gravity_pointmass(r->e->physical_constants, g); + external_gravity(r->e->potential, r->e->physical_constants, g); /* check for energy and angular momentum conservation - begin by * synchronizing velocity*/