diff --git a/examples/main.c b/examples/main.c index 590fe4d1071470ff04227032f6106b5643c6a574..052d425ea5e3fa8bdf8f13161478534716692175 100644 --- a/examples/main.c +++ b/examples/main.c @@ -45,25 +45,12 @@ /* Local headers. */ #include "swift.h" -#include "gravity/Default/potentials.h" /* Engine policy flags. */ #ifndef ENGINE_POLICY #define ENGINE_POLICY engine_policy_none #endif -#if defined(MINIMAL_SPH) || defined(GADGET2_SPH) || defined(DEFAULT_SPH) -#define ENGINE_HYDRO engine_policy_hydro -#else -#define ENGINE_HYDRO 0 -#endif - -#if defined(EXTERNAL_POTENTIAL) -#define ENGINE_EXTERNAL_GRAVITY engine_policy_external_gravity -#else -#define ENGINE_EXTERNAL_GRAVITY 0 -#endif - /** * @brief Main routine that loads a few particles and generates some output. * diff --git a/src/Makefile.am b/src/Makefile.am index 91a5a56bc73e5306959a9d34cc8f17a95ec70eb4..e817a8e996f55e9dc7876bbca8f927682f805d2d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -36,13 +36,13 @@ endif include_HEADERS = space.h runner.h queue.h task.h lock.h cell.h part.h const.h \ engine.h swift.h serial_io.h timers.h debug.h scheduler.h proxy.h parallel_io.h \ common_io.h single_io.h multipole.h map.h tools.h partition.h clocks.h parser.h \ - physical_constants.h physical_constants_cgs.h + physical_constants.h physical_constants_cgs.h potentials.h # Common source files AM_SOURCES = space.c runner.c queue.c task.c cell.c engine.c \ serial_io.c timers.c debug.c scheduler.c proxy.c parallel_io.c \ units.c common_io.c single_io.c multipole.c version.c map.c \ - kernel.c tools.c part.c partition.c clocks.c parser.c gravity/Default/potentials.c \ + kernel.c tools.c part.c partition.c clocks.c parser.c potentials.c \ physical_constants.c # Include files for distribution, not installation. diff --git a/src/engine.h b/src/engine.h index fc094adeae1947a47c7317298fa8d1bccb5a15de..389fb695ccb9e4a448b2ab09d87e201435eab07d 100644 --- a/src/engine.h +++ b/src/engine.h @@ -40,7 +40,7 @@ #include "task.h" #include "partition.h" #include "physical_constants.h" -#include "gravity/Default/potentials.h" +#include "potentials.h" /* Some constants. */ enum engine_policy { diff --git a/src/gravity/Default/potentials.c b/src/potentials.c similarity index 100% rename from src/gravity/Default/potentials.c rename to src/potentials.c diff --git a/src/gravity/Default/potentials.h b/src/potentials.h similarity index 96% rename from src/gravity/Default/potentials.h rename to src/potentials.h index 853ecb7aaf6d15d2443ca88805c22819b09eb63b..2cd9ec3d909ed9883f0a0b74bc6febd1b313f16c 100644 --- a/src/gravity/Default/potentials.h +++ b/src/potentials.h @@ -1,5 +1,6 @@ #ifndef SWIFT_POTENTIALS_H #define SWIFT_POTENTIALS_H + #include "physical_constants_cgs.h" #include "physical_constants.h" #include "units.h" @@ -22,8 +23,7 @@ struct external_potential{ #define External_Potential_Mass (1e10 * SOLAR_MASS_IN_CGS / const_unit_mass_in_cgs) -__attribute__((always_inline)) INLINE static float external_gravity_pointmass_timestep(const struct phys_const* phys_const, - struct gpart* g) { +__attribute__((always_inline)) INLINE static float external_gravity_pointmass_timestep(const struct phys_const* phys_const, struct gpart* g) { const double G_newton = phys_const->newton_gravity; /* Currently no limit is imposed */ diff --git a/src/swift.h b/src/swift.h index b91d020de5d6772162db654aa5d7eb18415f0754..4b570447345465684fc51bcd4ca96d07a4b7f518 100644 --- a/src/swift.h +++ b/src/swift.h @@ -41,6 +41,7 @@ #include "part.h" #include "partition.h" #include "physical_constants.h" +#include "potentials.h" #include "queue.h" #include "runner.h" #include "scheduler.h"