Commit e7f6698b authored by Matthieu Schaller's avatar Matthieu Schaller

Added a file to switch the import of the i/o cooling to mimic what is done for the chemistry.

parent 09e54f42
......@@ -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
......
......@@ -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,
......
......@@ -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"
......
......@@ -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 */
......@@ -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"
......
......@@ -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 */
......@@ -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"
......
......@@ -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 */
......@@ -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"
......
......@@ -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 */
......@@ -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,
......
......@@ -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 */
/*******************************************************************************
* 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 */
......@@ -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"
......
......@@ -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"
......
......@@ -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"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment