diff --git a/configure.ac b/configure.ac index 13e0ca70bbfec67569fccfefcca327776ff74bab..f0a9acdaf027b36637ebf7975b8a808ff4e82d6e 100644 --- a/configure.ac +++ b/configure.ac @@ -1185,6 +1185,7 @@ with_subgrid_cooling=none with_subgrid_chemistry=none with_subgrid_tracers=none with_subgrid_hydro=none +with_subgrid_entropy_floor=none with_subgrid_stars=none with_subgrid_star_formation=none with_subgrid_feedback=none @@ -1200,6 +1201,7 @@ case "$with_subgrid" in with_subgrid_chemistry=GEAR with_subgrid_tracers=none with_subgrid_hydro=gadget2 + with_subgrid_entropy_floor=none with_subgrid_stars=GEAR with_subgrid_star_formation=none with_subgrid_feedback=thermal @@ -1209,6 +1211,7 @@ case "$with_subgrid" in with_subgrid_chemistry=EAGLE with_subgrid_tracers=EAGLE with_subgrid_hydro=gadget2 + with_subgrid_entropy_floor=EAGLE with_subgrid_stars=EAGLE with_subgrid_star_formation=EAGLE with_subgrid_feedback=none @@ -1684,6 +1687,34 @@ case "$with_potential" in ;; esac +# Entropy formation +AC_ARG_WITH([entropy-floor], + [AS_HELP_STRING([--with-entropy-floor=<floor>], + [entropy floor @<:@none, EAGLE, default: none@:>@] + )], + [with_entropy_floor="$withval"], + [with_entropy_floor="none"] +) +if test "$with_subgrid" != "none"; then + if test "$with_entropy_floor" != "none"; then + AC_MSG_ERROR([Cannot provide with-subgrid and with-entropy-floor together]) + else + with_entropy_floor="$with_subgrid_entropy_floor" + fi +fi + +case "$with_entropy_floor" in + none) + AC_DEFINE([ENTROPY_FLOOR_NONE], [1], [No entropy floor]) + ;; + EAGLE) + AC_DEFINE([ENTROPY_FLOOR_EAGLE], [1], [EAGLE entropy floor]) + ;; + *) + AC_MSG_ERROR([Unknown entropy floor model]) + ;; +esac + # Star formation AC_ARG_WITH([star-formation], [AS_HELP_STRING([--with-star-formation=<sfm>], @@ -1803,6 +1834,7 @@ AC_MSG_RESULT([ Make gravity glass : $gravity_glass_making External potential : $with_potential + Entropy floor : $with_entropy_floor Cooling function : $with_cooling Chemistry : $with_chemistry Tracers : $with_tracers diff --git a/src/Makefile.am b/src/Makefile.am index 47fe6ad1e00af2639d2caf0e26bd870b228d915b..2c216bb91260013910fc02e92c3db461d7aa64e3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -44,7 +44,7 @@ include_HEADERS = space.h runner.h queue.h task.h lock.h cell.h part.h const.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 starformation.h version.h \ hydro_properties.h riemann.h threadpool.h cooling_io.h cooling.h cooling_struct.h \ - statistics.h memswap.h cache.h runner_doiact_vec.h profiler.h \ + statistics.h memswap.h cache.h runner_doiact_vec.h profiler.h entropy_floor.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 space_getsid.h utilities.h \ @@ -165,6 +165,8 @@ nobase_noinst_HEADERS = align.h approx_math.h atomic.h barrier.h cycle.h error.h chemistry/EAGLE/chemistry_io.h \ chemistry/EAGLE/chemistry_struct.h\ chemistry/EAGLE/chemistry_iact.h \ + entropy_floor/none/entropy_floor.h \ + entropy_floor/EAGLE/entropy_floor.h \ tracers/none/tracers.h tracers/none/tracers_struct.h \ tracers/none/tracers_io.h \ tracers/EAGLE/tracers.h tracers/EAGLE/tracers_struct.h \ diff --git a/src/entropy_floor.h b/src/entropy_floor.h new file mode 100644 index 0000000000000000000000000000000000000000..c03f2ff5db714d984e2a7d851546751cbb6d3139 --- /dev/null +++ b/src/entropy_floor.h @@ -0,0 +1,38 @@ +/******************************************************************************* + * This file is part of SWIFT. + * Copyright (c) 2019 Matthieu Schaller (schaller@strw.leidenuniv.nl) + * + * 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_ENTROPY_FLOOR_H +#define SWIFT_ENTROPY_FLOOR_H + +/** + * @file src/entropy_floor.h + * @brief Branches between the different entropy floor models + */ + +/* Config parameters. */ +#include "../config.h" + +/* Import the right entropy floor definition */ +#if defined(ENTROPY_FLOOR_NONE) +#include "./entropy_floor/none/entropy_floor.h" +#elif defined(ENTROPY_FLOOR_EAGLE) +#include "./entropy_floor/EAGLE/entropy_floor.h" +#endif + +#endif /* SWIFT_ENTROPY_FLOOR_H */ + diff --git a/src/entropy_floor/EAGLE/entropy_floor.h b/src/entropy_floor/EAGLE/entropy_floor.h new file mode 100644 index 0000000000000000000000000000000000000000..0260eb85090fda03735429f7797a563642c13f46 --- /dev/null +++ b/src/entropy_floor/EAGLE/entropy_floor.h @@ -0,0 +1,28 @@ +/******************************************************************************* + * This file is part of SWIFT. + * Copyright (c) 2019 Matthieu Schaller (schaller@strw.leidenuniv.nl) + * + * 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_ENTROPY_FLOOR_EAGLE_H +#define SWIFT_ENTROPY_FLOOR_EAGLE_H + +/** + * @file src/entropy_floor/EAGLE/entropy_floor.h + * @brief Entropy floor used in the EAGLE model + */ + + +#endif /* SWIFT_ENTROPY_FLOOR_EAGLE_H */ diff --git a/src/entropy_floor/none/entropy_floor.h b/src/entropy_floor/none/entropy_floor.h new file mode 100644 index 0000000000000000000000000000000000000000..69412a44763e95e3413f9f711c9e2d826c580ab0 --- /dev/null +++ b/src/entropy_floor/none/entropy_floor.h @@ -0,0 +1,29 @@ +/******************************************************************************* + * This file is part of SWIFT. + * Copyright (c) 2019 Matthieu Schaller (schaller@strw.leidenuniv.nl) + * + * 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_ENTROPY_FLOOR_NONE_H +#define SWIFT_ENTROPY_FLOOR_NONE_H + +/** + * @file src/entropy_floor/none/entropy_floor.h + * @brief Empty functions used for simulations without entropy + * floors. + */ + + +#endif /* SWIFT_ENTROPY_FLOOR_NONE_H */