diff --git a/src/chemistry.h b/src/chemistry.h index 96745c805a77f1ea384179d18a94bff84a642c17..25de507d60d8aa4bbb9cc4f0f6499dc52aeb93d4 100644 --- a/src/chemistry.h +++ b/src/chemistry.h @@ -37,7 +37,7 @@ #include "./chemistry/gear/chemistry_iact.h" #elif defined(CHEMISTRY_EAGLE) #include "./chemistry/EAGLE/chemistry.h" -/* #include "./chemistry/EAGLE/chemistry_iact.h" */ +#include "./chemistry/EAGLE/chemistry_iact.h" #else #error "Invalid choice of chemistry function." #endif diff --git a/src/chemistry/EAGLE/chemistry.h b/src/chemistry/EAGLE/chemistry.h index df0a4599a0f81eaf619b078b86c0ade4e1eba7b8..0ee4d2a2bfc54b1fe4b9b64f321cc23862841952 100644 --- a/src/chemistry/EAGLE/chemistry.h +++ b/src/chemistry/EAGLE/chemistry.h @@ -50,6 +50,32 @@ chemistry_get_element_name(enum chemistry_element elem) { return chemistry_element_names[elem]; } +/** + * @brief Prepares a particle for the smooth metal calculation. + * + * Zeroes all the relevant arrays in preparation for the sums taking place in + * the various smooth metallicity tasks + * + * @param p The particle to act upon + * @param cd #chemistry_data containing chemistry informations. + */ +__attribute__((always_inline)) INLINE static void chemistry_init_part( + struct part* restrict p, const struct chemistry_data* cd) {} + +/** + * @brief Finishes the smooth metal calculation. + * + * Multiplies the smoothed metallicity and number of neighbours by the + * appropiate constants and add the self-contribution term. + * + * This function requires the #hydro_end_density to have been called. + * + * @param p The particle to act upon. + * @param cd #chemistry_data containing chemistry informations. + */ +__attribute__((always_inline)) INLINE static void chemistry_end_density( + struct part* restrict p, const struct chemistry_data* cd) {} + /** * @brief Sets the chemistry properties of the (x-)particles to a valid start * state. diff --git a/src/chemistry/EAGLE/chemistry_iact.h b/src/chemistry/EAGLE/chemistry_iact.h index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..afdbbe3e4d98aee4407b5a97886672c156937b1c 100644 --- a/src/chemistry/EAGLE/chemistry_iact.h +++ b/src/chemistry/EAGLE/chemistry_iact.h @@ -0,0 +1,61 @@ +/******************************************************************************* + * This file is part of SWIFT. + * Copyright (c) 2018 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_EAGLE_CHEMISTRY_IACT_H +#define SWIFT_EAGLE_CHEMISTRY_IACT_H + +/** + * @file EAGLE/chemistry_iact.h + * @brief Smooth metal interaction functions following the EAGLE model. + */ + +#include "chemistry_struct.h" + +/** + * @brief Do chemistry computation after the runner_iact_density (symmetric + * version) + * + * @param r2 Distance squared between particles + * @param dx Distance between particles + * @param hi Smoothing length of i + * @param hj Smoothing length of j + * @param pi #part i + * @param pj #part j + * @param chem_data Chemistry informations + */ +__attribute__((always_inline)) INLINE static void runner_iact_chemistry( + float r2, float *dx, float hi, float hj, struct part *pi, struct part *pj, + const struct chemistry_data *chem_data) {} + +/** + * @brief Do chemistry computation after the runner_iact_density (non-symmetric + * version) + * + * @param r2 Distance squared between particles + * @param dx Distance between particles + * @param hi Smoothing length of i + * @param hj Smoothing length of j + * @param pi #part i + * @param pj #part j + * @param chem_data Chemistry informations + */ +__attribute__((always_inline)) INLINE static void runner_iact_nonsym_chemistry( + float r2, float *dx, float hi, float hj, struct part *pi, + const struct part *pj, const struct chemistry_data *chem_data) {} + +#endif /* SWIFT_EAGLE_CHEMISTRY_IACT_H */ diff --git a/src/chemistry/gear/chemistry.h b/src/chemistry/gear/chemistry.h index 02a65147202942300889f3926e21976fdb15b02e..4e17be96d0017419d10d6c2cda9835316e512360 100644 --- a/src/chemistry/gear/chemistry.h +++ b/src/chemistry/gear/chemistry.h @@ -97,8 +97,7 @@ __attribute__((always_inline)) INLINE static void chemistry_init_part( * @brief Finishes the smooth metal calculation. * * Multiplies the smoothed metallicity and number of neighbours by the - * appropiate constants - * and add the self-contribution term. + * appropiate constants and add the self-contribution term. * * This method requires the #hydro_end_density to have been computed. *