diff --git a/src/cooling/EAGLE/cooling.h b/src/cooling/EAGLE/cooling.h index 62d1cc9b72681fe96c901185a10efe5523b206e3..a1e1d0889e95bd26647d673f9b4a5c290f5301ac 100644 --- a/src/cooling/EAGLE/cooling.h +++ b/src/cooling/EAGLE/cooling.h @@ -29,6 +29,7 @@ #include <math.h> /* Local includes. */ +#include "cooling_io.h" #include "error.h" #include "hydro.h" #include "io_properties.h" @@ -37,18 +38,6 @@ #include "physical_constants.h" #include "units.h" -#ifdef HAVE_HDF5 - -/** - * @brief Writes the current model of SPH to the file - * @param h_grpsph The HDF5 group in which to write - */ -__attribute__((always_inline)) INLINE static void cooling_write_flavour( - hid_t h_grpsph) { - - io_write_attribute_s(h_grpsph, "Cooling Model", "EAGLE"); -} -#endif /** * @brief Apply the cooling function to a particle. diff --git a/src/cooling/EAGLE/cooling_io.h b/src/cooling/EAGLE/cooling_io.h new file mode 100644 index 0000000000000000000000000000000000000000..b3eea3c6ed94bae6a96a58078f4c7244801a47bc --- /dev/null +++ b/src/cooling/EAGLE/cooling_io.h @@ -0,0 +1,52 @@ +/******************************************************************************* + * This file is part of SWIFT. + * Copyright (c) 2017 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_EAGLE_IO_H +#define SWIFT_COOLING_EAGLE_IO_H + +#include "io_properties.h" + +#ifdef HAVE_HDF5 + +/** + * @brief Writes the current model of SPH to the file + * @param h_grpsph The HDF5 group in which to write + */ +__attribute__((always_inline)) INLINE static void cooling_write_flavour( + hid_t h_grpsph) { + + io_write_attribute_s(h_grpsph, "Cooling Model", "EAGLE"); +} +#endif + +/** + * @brief Specifies which particle fields to write to a dataset + * + * @param parts The particle array. + * @param list The list of i/o properties to write. + * @param cooling The #cooling_function_data + * + * @return Returns the number of fields to write. + */ +__attribute__((always_inline)) INLINE static int cooling_write_particles( + const struct xpart* xparts, struct io_props* list, + const struct cooling_function_data *cooling) { + return 0; +} + +#endif // SWIFT_COOLING_EAGLE_IO_H diff --git a/src/cooling/const_du/cooling.h b/src/cooling/const_du/cooling.h index 25aa974e47b277d0dfcc21077e5041a49e8168c8..6a3e5ff86507124248e318d8ec39d7c869c87021 100644 --- a/src/cooling/const_du/cooling.h +++ b/src/cooling/const_du/cooling.h @@ -35,6 +35,7 @@ /* Local includes. */ #include "const.h" +#include "cooling_io.h" #include "cooling_struct.h" #include "error.h" #include "hydro.h" @@ -44,18 +45,6 @@ #include "physical_constants.h" #include "units.h" -#ifdef HAVE_HDF5 - -/** - * @brief Writes the current model of SPH to the file - * @param h_grpsph The HDF5 group in which to write - */ -__attribute__((always_inline)) INLINE static void cooling_write_flavour( - hid_t h_grpsph) { - - io_write_attribute_s(h_grpsph, "Cooling Model", "Constant du/dt"); -} -#endif /** * @brief Apply the cooling function to a particle. diff --git a/src/cooling/const_du/cooling_io.h b/src/cooling/const_du/cooling_io.h new file mode 100644 index 0000000000000000000000000000000000000000..9043b9170b2152dfa9c86c6e00060bb989a56c03 --- /dev/null +++ b/src/cooling/const_du/cooling_io.h @@ -0,0 +1,54 @@ +/******************************************************************************* + * This file is part of SWIFT. + * Copyright (c) 2016 Matthieu Schaller (matthieu.schaller@durham.ac.uk) + * Richard Bower (r.g.bower@durham.ac.uk) + * Stefan Arridge (stefan.arridge@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_CONST_DU_IO_H +#define SWIFT_COOLING_CONST_DU_IO_H + +#include "io_properties.h" + +#ifdef HAVE_HDF5 + +/** + * @brief Writes the current model of SPH to the file + * @param h_grpsph The HDF5 group in which to write + */ +__attribute__((always_inline)) INLINE static void cooling_write_flavour( + hid_t h_grpsph) { + + io_write_attribute_s(h_grpsph, "Cooling Model", "Constant du/dt"); +} +#endif + +/** + * @brief Specifies which particle fields to write to a dataset + * + * @param parts The particle array. + * @param list The list of i/o properties to write. + * @param cooling The #cooling_function_data + * + * @return Returns the number of fields to write. + */ +__attribute__((always_inline)) INLINE static int cooling_write_particles( + const struct xpart* xparts, struct io_props* list, + const struct cooling_function_data *cooling) { + return 0; +} + +#endif // SWIFT_COOLING_CONST_DU_IO_H diff --git a/src/cooling/const_lambda/cooling.h b/src/cooling/const_lambda/cooling.h index a402b749300e64ef79253764c402d41f5a214d82..a973c1104c9bc65d5bb0fcaa3e7b24c4842582ce 100644 --- a/src/cooling/const_lambda/cooling.h +++ b/src/cooling/const_lambda/cooling.h @@ -29,6 +29,7 @@ /* Local includes. */ #include "const.h" +#include "cooling_io.h" #include "error.h" #include "hydro.h" #include "io_properties.h" @@ -37,18 +38,6 @@ #include "physical_constants.h" #include "units.h" -#ifdef HAVE_HDF5 - -/** - * @brief Writes the current model of SPH to the file - * @param h_grpsph The HDF5 group in which to write - */ -__attribute__((always_inline)) INLINE static void cooling_write_flavour( - hid_t h_grpsph) { - - io_write_attribute_s(h_grpsph, "Cooling Model", "Constant Lambda"); -} -#endif /** * @brief Calculates du/dt in code units for a particle. diff --git a/src/cooling/const_lambda/cooling_io.h b/src/cooling/const_lambda/cooling_io.h new file mode 100644 index 0000000000000000000000000000000000000000..04700a128afab7574a29aaaa2b3631d4a3238f82 --- /dev/null +++ b/src/cooling/const_lambda/cooling_io.h @@ -0,0 +1,56 @@ +/******************************************************************************* + * This file is part of SWIFT. + * Copyright (c) 2016 Tom Theuns (tom.theuns@durham.ac.uk) + * Matthieu Schaller (matthieu.schaller@durham.ac.uk) + * Richard Bower (r.g.bower@durham.ac.uk) + * Stefan Arridge (stefan.arridge@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_CONST_LAMBDA_IO_H +#define SWIFT_COOLING_CONST_LAMBDA_IO_H + +#include "io_properties.h" + +#ifdef HAVE_HDF5 + +/** + * @brief Writes the current model of SPH to the file + * @param h_grpsph The HDF5 group in which to write + */ +__attribute__((always_inline)) INLINE static void cooling_write_flavour( + hid_t h_grpsph) { + + io_write_attribute_s(h_grpsph, "Cooling Model", "Constant Lambda"); +} +#endif + +/** + * @brief Specifies which particle fields to write to a dataset + * + * @param parts The particle array. + * @param list The list of i/o properties to write. + * @param cooling The #cooling_function_data + * + * @return Returns the number of fields to write. + */ +__attribute__((always_inline)) INLINE static int cooling_write_particles( + const struct xpart* xparts, struct io_props* list, + const struct cooling_function_data *cooling) { + return 0; +} + +#endif // SWIFT_COOLING_CONST_LAMBDA_IO_H diff --git a/src/cooling/none/cooling.h b/src/cooling/none/cooling.h index a1cc6491115a38d6971a57603fef413c35b52027..48e01c3b3109782fb77741c8a6446d26ddd01aa3 100644 --- a/src/cooling/none/cooling.h +++ b/src/cooling/none/cooling.h @@ -29,6 +29,7 @@ #include <math.h> /* Local includes. */ +#include "cooling_io.h" #include "error.h" #include "hydro.h" #include "io_properties.h" @@ -37,18 +38,6 @@ #include "physical_constants.h" #include "units.h" -#ifdef HAVE_HDF5 - -/** - * @brief Writes the current model of SPH to the file - * @param h_grpsph The HDF5 group in which to write - */ -__attribute__((always_inline)) INLINE static void cooling_write_flavour( - hid_t h_grpsph) { - - io_write_attribute_s(h_grpsph, "Cooling Model", "None"); -} -#endif /** * @brief Apply the cooling function to a particle. diff --git a/src/cooling/none/cooling_io.h b/src/cooling/none/cooling_io.h new file mode 100644 index 0000000000000000000000000000000000000000..1d13808c1374a150494ee38a638834233f400e1b --- /dev/null +++ b/src/cooling/none/cooling_io.h @@ -0,0 +1,52 @@ +/******************************************************************************* + * This file is part of SWIFT. + * Copyright (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_NONE_IO_H +#define SWIFT_COOLING_NONE_IO_H + +#include "io_properties.h" + +#ifdef HAVE_HDF5 + +/** + * @brief Writes the current model of SPH to the file + * @param h_grpsph The HDF5 group in which to write + */ +__attribute__((always_inline)) INLINE static void cooling_write_flavour( + hid_t h_grpsph) { + + io_write_attribute_s(h_grpsph, "Cooling Model", "None"); +} +#endif + +/** + * @brief Specifies which particle fields to write to a dataset + * + * @param parts The particle array. + * @param list The list of i/o properties to write. + * @param cooling The #cooling_function_data + * + * @return Returns the number of fields to write. + */ +__attribute__((always_inline)) INLINE static int cooling_write_particles( + const struct xpart* xparts, struct io_props* list, + const struct cooling_function_data *cooling) { + return 0; +} + +#endif // SWIFT_COOLING_NONE_IO_H