From 71ab62e541a10e6837747eceb45d53e29c937d32 Mon Sep 17 00:00:00 2001 From: Mladen Ivkovic <mladen.ivkovic@epfl.ch> Date: Wed, 26 Aug 2020 20:11:46 +0100 Subject: [PATCH] created rt header files --- src/Makefile.am | 1 + src/rt.h | 41 +++++++++++++++++++++++++++++++++++++++++ src/rt/M1closure/rt.h | 32 ++++++++++++++++++++++++++++++++ src/rt/debug/rt.h | 32 ++++++++++++++++++++++++++++++++ src/rt/none/rt.h | 32 ++++++++++++++++++++++++++++++++ src/swift.h | 1 + 6 files changed, 139 insertions(+) create mode 100644 src/rt.h create mode 100644 src/rt/M1closure/rt.h create mode 100644 src/rt/debug/rt.h create mode 100644 src/rt/none/rt.h diff --git a/src/Makefile.am b/src/Makefile.am index b813c42bd0..0084331103 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -208,6 +208,7 @@ nobase_noinst_HEADERS = align.h approx_math.h atomic.h barrier.h cycle.h error.h riemann/riemann_hllc.h riemann/riemann_trrs.h \ riemann/riemann_exact.h riemann/riemann_vacuum.h \ riemann/riemann_checks.h \ + rt.h rt/none/rt.h rt/debug/rt.h rt/M1closure/rt.h \ stars.h stars_io.h \ stars/Default/stars.h stars/Default/stars_iact.h stars/Default/stars_io.h \ stars/Default/stars_debug.h stars/Default/stars_part.h stars/Default/stars_logger.h \ diff --git a/src/rt.h b/src/rt.h new file mode 100644 index 0000000000..f318542f75 --- /dev/null +++ b/src/rt.h @@ -0,0 +1,41 @@ +/******************************************************************************* + * This file is part of SWIFT. + * Copyright (c) 2020 Mladen Ivkovic (mladen.ivkovic@hotmail.com) + * + * 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_RT_H +#define SWIFT_RT_H + +/** + * @file src/rt.h + * @brief Branches between the different radiative transfer schemes. + */ + +/* Config parameters. */ +#include "../config.h" + +/* Import the right cooling definition */ +#if defined(RT_NONE) +#include "./rt/none/rt.h" +#elif defined(RT_DEBUG) +#include "./rt/debug/rt.h" +#elif defined(RT_M1) +#include "./rt/M1closure/rt.h" +#else +#error "Invalid choice of radiation scheme" +#endif + +#endif /* SWIFT_RT_H */ diff --git a/src/rt/M1closure/rt.h b/src/rt/M1closure/rt.h new file mode 100644 index 0000000000..5a9f2e3e8d --- /dev/null +++ b/src/rt/M1closure/rt.h @@ -0,0 +1,32 @@ +/******************************************************************************* + * This file is part of SWIFT. + * Copyright (c) 2020 Mladen Ivkovic (mladen.ivkovic@hotmail.com) + * + * 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_RT_M1_H +#define SWIFT_RT_M1_H + +/** + * @file src/rt/M1closure/rt.h + * @brief Main header file for the M1 Closure radiative transfer scheme. + */ + +/** + * @brief Dummy function to test whether inclusions work properly. + */ +void rt_dummy_function(void) { message("Called M1 closure RT scheme."); } + +#endif /* SWIFT_RT_M1_H */ diff --git a/src/rt/debug/rt.h b/src/rt/debug/rt.h new file mode 100644 index 0000000000..230bc458ad --- /dev/null +++ b/src/rt/debug/rt.h @@ -0,0 +1,32 @@ +/******************************************************************************* + * This file is part of SWIFT. + * Copyright (c) 2020 Mladen Ivkovic (mladen.ivkovic@hotmail.com) + * + * 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_RT_DEBUG_H +#define SWIFT_RT_DEBUG_H + +/** + * @file src/rt/debug/rt.h + * @brief Main header file for the debug radiative transfer scheme. + */ + +/** + * @brief Dummy function to test whether inclusions work properly. + */ +void rt_dummy_function(void) { message("Called debug RT scheme."); } + +#endif /* SWIFT_RT_DEBUG_H */ diff --git a/src/rt/none/rt.h b/src/rt/none/rt.h new file mode 100644 index 0000000000..f35052adb1 --- /dev/null +++ b/src/rt/none/rt.h @@ -0,0 +1,32 @@ +/******************************************************************************* + * This file is part of SWIFT. + * Copyright (c) 2020 Mladen Ivkovic (mladen.ivkovic@hotmail.com) + * + * 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_RT_NONE_H +#define SWIFT_RT_NONE_H + +/** + * @file src/rt/debug/rt.h + * @brief Main header file for no radiative transfer scheme. + */ + +/** + * @brief Dummy function to test whether inclusions work properly. + */ +void rt_dummy_function(void) { message("Called no RT scheme."); } + +#endif /* SWIFT_RT_NONE_H */ diff --git a/src/swift.h b/src/swift.h index ad16acf375..4237bfab32 100644 --- a/src/swift.h +++ b/src/swift.h @@ -75,6 +75,7 @@ #include "queue.h" #include "random.h" #include "restart.h" +#include "rt.h" #include "runner.h" #include "scheduler.h" #include "serial_io.h" -- GitLab