diff --git a/src/chemistry/gear/chemistry.h b/src/chemistry/gear/chemistry.h index db34a9f4d5b71d3dddc235f2bdd0b246e9703aa7..34a0a8e6abbad1e46909c970fe3e6af27b0f415e 100644 --- a/src/chemistry/gear/chemistry.h +++ b/src/chemistry/gear/chemistry.h @@ -43,7 +43,6 @@ __attribute__((always_inline)) INLINE static const char* chemistry_get_element_name(enum chemistry_element elem) { - /* Warning: in the I/O, expect string < 20 */ static const char* chemistry_element_names[chemistry_element_count] = { "Oxygen", "Magnesium", "Sulfur", "Iron", "Zinc", "Strontium", "Yttrium", "Barium", diff --git a/src/chemistry/gear/chemistry_iact.h b/src/chemistry/gear/chemistry_iact.h index 9e1f6729dcc45231c400a23e25ba1f52c4011542..3e8b913098976f1381377f1711a765023ff9b5eb 100644 --- a/src/chemistry/gear/chemistry_iact.h +++ b/src/chemistry/gear/chemistry_iact.h @@ -32,7 +32,15 @@ #include "chemistry_struct.h" /** - * @brief Smooth metalicity + * @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, @@ -67,7 +75,15 @@ const struct chemistry_data *chem_data) { } /** - * @brief Non symmetric smooth metalicity + * @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, diff --git a/src/chemistry/none/chemistry.h b/src/chemistry/none/chemistry.h index ec183f7701dd6da0bcea12eff23cad2ee30ab97e..0e787d34918a7de2801ad7d26907726328b651a7 100644 --- a/src/chemistry/none/chemistry.h +++ b/src/chemistry/none/chemistry.h @@ -37,6 +37,18 @@ #include "physical_constants.h" #include "units.h" +/** + * @brief Return a string containing the name of a given #chemistry_element. + */ +__attribute__((always_inline)) INLINE static const char* +chemistry_get_element_name(enum chemistry_element elem) { + + static const char* chemistry_element_names[chemistry_element_count] = { + }; + + return chemistry_element_names[elem]; +} + /** * @brief Sets the chemistry properties of the (x-)particles to a valid start * state. @@ -75,4 +87,27 @@ static INLINE void chemistry_print_backend(const struct chemistry_data* data) { message("Chemistry function is 'No chemistry'."); } +/** + * @brief Finishes the density calculation. + * + * @param p The particle to act upon + */ +__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. + * + * Nothing to do here. + * + * @param p Pointer to the particle data. + * @param xp Pointer to the extended particle data. + * @param data The global chemistry information. + */ +__attribute__((always_inline)) INLINE static void chemistry_first_init_part( + struct part* restrict p, struct xpart* restrict xp, + const struct chemistry_data* data) {} + #endif /* SWIFT_CHEMISTRY_NONE_H */ diff --git a/src/chemistry/none/chemistry_iact.h b/src/chemistry/none/chemistry_iact.h new file mode 100644 index 0000000000000000000000000000000000000000..24d5bcb78b5defd73a0f7f9f2c3f082a3de79dd1 --- /dev/null +++ b/src/chemistry/none/chemistry_iact.h @@ -0,0 +1,64 @@ +/******************************************************************************* + * This file is part of SWIFT. + * Copyright (c) 2012 Pedro Gonnet (pedro.gonnet@durham.ac.uk) + * 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_NONE_CHEMISTRY_IACT_H +#define SWIFT_NONE_CHEMISTRY_IACT_H + +/** + * @file none/chemistry_iact.h + * @brief Density computation + */ + +#include "cache.h" +#include "minmax.h" +#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_NONE_CHEMISTRY_IACT_H */