diff --git a/src/Makefile.am b/src/Makefile.am index 749664665aa1b52a50654f3e53b93d31d2173abe..e21cb6539d2b7ae360ea07c92c426e99342bc2ec 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -43,8 +43,8 @@ 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 potential.h version.h \ - hydro_properties.h riemann.h threadpool.h cooling.h cooling_struct.h sourceterms.h \ - sourceterms_struct.h statistics.h memswap.h cache.h runner_doiact_vec.h profiler.h \ + hydro_properties.h riemann.h threadpool.h cooling_io.h cooling.h cooling_struct.h \ + sourceterms.h sourceterms_struct.h statistics.h memswap.h cache.h runner_doiact_vec.h profiler.h \ dump.h logger.h active.h timeline.h xmf.h gravity_properties.h gravity_derivatives.h \ gravity_softened_derivatives.h vector_power.h collectgroup.h hydro_space.h sort_part.h \ chemistry.h chemistry_io.h chemistry_struct.h cosmology.h restart.h diff --git a/src/chemistry/none/chemistry.h b/src/chemistry/none/chemistry.h index 7a9189357c8e3530f2a684bf35b0e1f9bdafcc74..3ca51660ddfeead2b7ad0010979b719e59c4934e 100644 --- a/src/chemistry/none/chemistry.h +++ b/src/chemistry/none/chemistry.h @@ -92,9 +92,12 @@ __attribute__((always_inline)) INLINE static void chemistry_end_density( * * Nothing to do here. * + * @param phys_const The physical constant in internal units. + * @param us The unit system. + * @param cosmo The current cosmological model. + * @param data The global chemistry information used for this run. * @param p Pointer to the particle data. * @param xp Pointer to the extended particle data. - * @param data The global chemistry information used for this run. */ __attribute__((always_inline)) INLINE static void chemistry_first_init_part( const struct phys_const* restrict phys_const, diff --git a/src/cooling/EAGLE/cooling.h b/src/cooling/EAGLE/cooling.h index d0bea0ec76638768527fed4fcfe9766724cf2eb7..bdf3801887256cb97ae1d5b6a3095250764aa822 100644 --- a/src/cooling/EAGLE/cooling.h +++ b/src/cooling/EAGLE/cooling.h @@ -20,19 +20,20 @@ #define SWIFT_COOLING_EAGLE_H /** - * @file src/cooling/none/cooling.h - * @brief Empty infrastructure for the cases without cooling function + * @file src/cooling/EAGLE/cooling.h + * @brief EAGLE cooling function */ +/* Config parameters. */ +#include "../config.h" + /* Some standard headers. */ #include <float.h> #include <math.h> /* Local includes. */ -#include "cooling_io.h" #include "error.h" #include "hydro.h" -#include "io_properties.h" #include "parser.h" #include "part.h" #include "physical_constants.h" diff --git a/src/cooling/EAGLE/cooling_io.h b/src/cooling/EAGLE/cooling_io.h index 314c921dd23c94eb0e54f0a7a460e64e272d9cf1..d6ed4f122863be7b591b095b11803a3d2729f694 100644 --- a/src/cooling/EAGLE/cooling_io.h +++ b/src/cooling/EAGLE/cooling_io.h @@ -19,6 +19,10 @@ #ifndef SWIFT_COOLING_EAGLE_IO_H #define SWIFT_COOLING_EAGLE_IO_H +/* Config parameters. */ +#include "../config.h" + +/* Local includes */ #include "io_properties.h" #ifdef HAVE_HDF5 @@ -49,4 +53,4 @@ __attribute__((always_inline)) INLINE static int cooling_write_particles( return 0; } -#endif // SWIFT_COOLING_EAGLE_IO_H +#endif /* SWIFT_COOLING_EAGLE_IO_H */ diff --git a/src/cooling/const_du/cooling.h b/src/cooling/const_du/cooling.h index 95d90654d7c95ed9cde01230194c79fe1fdc3c99..ba8211174919419c37856dc1fcbdaa73b23e319e 100644 --- a/src/cooling/const_du/cooling.h +++ b/src/cooling/const_du/cooling.h @@ -30,16 +30,16 @@ * realistic functions. */ +/* Config parameters. */ +#include "../config.h" + /* Some standard headers. */ #include <math.h> /* Local includes. */ #include "const.h" -#include "cooling_io.h" -#include "cooling_struct.h" #include "error.h" #include "hydro.h" -#include "io_properties.h" #include "parser.h" #include "part.h" #include "physical_constants.h" diff --git a/src/cooling/const_du/cooling_io.h b/src/cooling/const_du/cooling_io.h index cc9347617fba1cb7c13196ba20368e236c46e7bc..52a943aca86e51665fd1841d7bcb8a100b046ed8 100644 --- a/src/cooling/const_du/cooling_io.h +++ b/src/cooling/const_du/cooling_io.h @@ -21,6 +21,10 @@ #ifndef SWIFT_COOLING_CONST_DU_IO_H #define SWIFT_COOLING_CONST_DU_IO_H +/* Config parameters. */ +#include "../config.h" + +/* Local includes */ #include "io_properties.h" #ifdef HAVE_HDF5 @@ -51,4 +55,4 @@ __attribute__((always_inline)) INLINE static int cooling_write_particles( return 0; } -#endif // SWIFT_COOLING_CONST_DU_IO_H +#endif /* SWIFT_COOLING_CONST_DU_IO_H */ diff --git a/src/cooling/const_lambda/cooling.h b/src/cooling/const_lambda/cooling.h index 5007880ad148733dd1703a950d963de271119507..43ca7ab75b0bce370d7405e52cea9b54335ae73c 100644 --- a/src/cooling/const_lambda/cooling.h +++ b/src/cooling/const_lambda/cooling.h @@ -23,16 +23,17 @@ #ifndef SWIFT_COOLING_CONST_LAMBDA_H #define SWIFT_COOLING_CONST_LAMBDA_H +/* Config parameters. */ +#include "../config.h" + /* Some standard headers. */ #include <float.h> #include <math.h> /* Local includes. */ #include "const.h" -#include "cooling_io.h" #include "error.h" #include "hydro.h" -#include "io_properties.h" #include "parser.h" #include "part.h" #include "physical_constants.h" diff --git a/src/cooling/const_lambda/cooling_io.h b/src/cooling/const_lambda/cooling_io.h index 49e87ca1d5a433fe45b91ffcb5deccb3f737355f..89c9471a291a4a6a5740a8c6c816913cbc6316a0 100644 --- a/src/cooling/const_lambda/cooling_io.h +++ b/src/cooling/const_lambda/cooling_io.h @@ -19,10 +19,13 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************/ - #ifndef SWIFT_COOLING_CONST_LAMBDA_IO_H #define SWIFT_COOLING_CONST_LAMBDA_IO_H +/* Config parameters. */ +#include "../config.h" + +/* Local includes */ #include "io_properties.h" #ifdef HAVE_HDF5 @@ -53,4 +56,4 @@ __attribute__((always_inline)) INLINE static int cooling_write_particles( return 0; } -#endif // SWIFT_COOLING_CONST_LAMBDA_IO_H +#endif /* SWIFT_COOLING_CONST_LAMBDA_IO_H */ diff --git a/src/cooling/grackle/cooling.h b/src/cooling/grackle/cooling.h index e0c25015ed6dcd29b25a027027a63c416848691d..dd59e9af1431681a8c5bdc1e5cb0c22053063651 100644 --- a/src/cooling/grackle/cooling.h +++ b/src/cooling/grackle/cooling.h @@ -20,22 +20,24 @@ #define SWIFT_COOLING_GRACKLE_H /** - * @file src/cooling/none/cooling.h - * @brief Empty infrastructure for the cases without cooling function + * @file src/cooling/grackle/cooling.h + * @brief Cooling using the GRACKLE 3.0 library. */ +/* Config parameters. */ +#include "../config.h" + /* Some standard headers. */ #include <float.h> -#include <grackle.h> #include <math.h> +/* The grackle library itself */ +#include <grackle.h> + /* Local includes. */ -#include "../config.h" #include "chemistry.h" -#include "cooling_io.h" #include "error.h" #include "hydro.h" -#include "io_properties.h" #include "parser.h" #include "part.h" #include "physical_constants.h" diff --git a/src/cooling/grackle/cooling_io.h b/src/cooling/grackle/cooling_io.h index ef7a8f27f94bd2c60d4f79f426f4e0c3c9be11a0..5a6edb8f1c559a7b495351e256559f251b97c1cf 100644 --- a/src/cooling/grackle/cooling_io.h +++ b/src/cooling/grackle/cooling_io.h @@ -19,7 +19,10 @@ #ifndef SWIFT_COOLING_GRACKLE_IO_H #define SWIFT_COOLING_GRACKLE_IO_H +/* Config parameters. */ #include "../config.h" + +/* Local includes */ #include "cooling_struct.h" #include "io_properties.h" @@ -163,4 +166,4 @@ __attribute__((always_inline)) INLINE static void cooling_read_parameters( parameter_file, "GrackleCooling:ConvergenceLimit", 1e-2); } -#endif // SWIFT_COOLING_GRACKLE_IO_H +#endif /* SWIFT_COOLING_GRACKLE_IO_H */ diff --git a/src/cooling/none/cooling.h b/src/cooling/none/cooling.h index 4da220c93fa5ae22c2cae951d4caf640de26a53b..5081c7cbe6c4b5168da082ead80687226f9d0c16 100644 --- a/src/cooling/none/cooling.h +++ b/src/cooling/none/cooling.h @@ -29,10 +29,8 @@ #include <math.h> /* Local includes. */ -#include "cooling_io.h" #include "error.h" #include "hydro.h" -#include "io_properties.h" #include "parser.h" #include "part.h" #include "physical_constants.h" @@ -84,9 +82,12 @@ __attribute__((always_inline)) INLINE static float cooling_timestep( * * Nothing to do here. * + * @param phys_const The physical constant in internal units. + * @param us The unit system. + * @param cosmo The current cosmological model. + * @param data The properties of the cooling function. * @param p Pointer to the particle data. * @param xp Pointer to the extended particle data. - * @param cooling The properties of the cooling function. */ __attribute__((always_inline)) INLINE static void cooling_first_init_part( const struct phys_const* restrict phys_const, diff --git a/src/cooling/none/cooling_io.h b/src/cooling/none/cooling_io.h index ef4bfae10a954ff8293ee029aa81023bf72d4aa5..e4c84f506bcd31ff95ededb5be889fbf9a27261b 100644 --- a/src/cooling/none/cooling_io.h +++ b/src/cooling/none/cooling_io.h @@ -19,6 +19,10 @@ #ifndef SWIFT_COOLING_NONE_IO_H #define SWIFT_COOLING_NONE_IO_H +/* Config parameters. */ +#include "../config.h" + +/* Local includes */ #include "io_properties.h" #ifdef HAVE_HDF5 @@ -37,7 +41,7 @@ __attribute__((always_inline)) INLINE static void cooling_write_flavour( /** * @brief Specifies which particle fields to write to a dataset * - * @param parts The particle array. + * @param xparts The extended particle array. * @param list The list of i/o properties to write. * @param cooling The #cooling_function_data * @@ -49,4 +53,4 @@ __attribute__((always_inline)) INLINE static int cooling_write_particles( return 0; } -#endif // SWIFT_COOLING_NONE_IO_H +#endif /* SWIFT_COOLING_NONE_IO_H */ diff --git a/src/cooling_io.h b/src/cooling_io.h new file mode 100644 index 0000000000000000000000000000000000000000..88eeae2cabdaa8a0909977b84a7dbcf03145d988 --- /dev/null +++ b/src/cooling_io.h @@ -0,0 +1,40 @@ +/******************************************************************************* + * This file is part of SWIFT. + * Coypright (c) 2016 Matthieu Schaller (matthieu.schaller@durham.ac.uk) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + ******************************************************************************/ +#ifndef SWIFT_COOLING_IO_H +#define SWIFT_COOLING_IO_H + +/* Config parameters. */ +#include "../config.h" + +/* Import the i/o routines of the right cooling definition */ +#if defined(COOLING_NONE) +#include "./cooling/none/cooling_io.h" +#elif defined(COOLING_CONST_DU) +#include "./cooling/const_du/cooling_io.h" +#elif defined(COOLING_CONST_LAMBDA) +#include "./cooling/const_lambda/cooling_io.h" +#elif defined(COOLING_GRACKLE) +#include "./cooling/grackle/cooling_io.h" +#elif defined(COOLING_EAGLE) +#include "./cooling/EAGLE/cooling_io.h" +#else +#error "Invalid choice of cooling function." +#endif + +#endif /* SWIFT_COOLING_IO_H */ diff --git a/src/parallel_io.c b/src/parallel_io.c index ced02a6dba9f4f772de37c9aef75df0435472f0a..b5741fb747a0cd8a2dd9ff1645d4a22ffa780869 100644 --- a/src/parallel_io.c +++ b/src/parallel_io.c @@ -38,7 +38,7 @@ /* Local includes. */ #include "chemistry_io.h" #include "common_io.h" -#include "cooling.h" +#include "cooling_io.h" #include "dimension.h" #include "engine.h" #include "error.h" diff --git a/src/serial_io.c b/src/serial_io.c index 3167c1681ef340c24868766fdcf983fcf0bbd021..fa48d0ac96e58f9dfc4e9d8c513197b6e91800e4 100644 --- a/src/serial_io.c +++ b/src/serial_io.c @@ -38,7 +38,7 @@ /* Local includes. */ #include "chemistry_io.h" #include "common_io.h" -#include "cooling.h" +#include "cooling_io.h" #include "dimension.h" #include "engine.h" #include "error.h" diff --git a/src/single_io.c b/src/single_io.c index 8b9ba65e4d07cb7ab1f4b0825849a201736d0238..73c7f5d946544ed61ebfae01a6ccd4708a8a5f3c 100644 --- a/src/single_io.c +++ b/src/single_io.c @@ -37,7 +37,7 @@ /* Local includes. */ #include "chemistry_io.h" #include "common_io.h" -#include "cooling.h" +#include "cooling_io.h" #include "dimension.h" #include "engine.h" #include "error.h"