Commit 7d92df9e authored by Matthieu Schaller's avatar Matthieu Schaller

Added the quick Lyman-alpha star formation model

parent acfb1d45
......@@ -210,6 +210,8 @@ nobase_noinst_HEADERS = align.h approx_math.h atomic.h barrier.h cycle.h error.h
potential/sine_wave/potential.h \
star_formation/none/star_formation.h star_formation/none/star_formation_struct.h \
star_formation/none/star_formation_io.h star_formation/none/star_formation_iact.h \
star_formation/QLA/star_formation.h star_formation/QLA/star_formation_struct.h \
star_formation/QLA/star_formation_io.h star_formation/QLA/star_formation_iact.h \
star_formation/EAGLE/star_formation.h star_formation/EAGLE/star_formation_struct.h \
star_formation/EAGLE/star_formation_io.h star_formation/EAGLE/star_formation_iact.h \
star_formation/GEAR/star_formation.h star_formation/GEAR/star_formation_struct.h \
......
......@@ -33,6 +33,8 @@
/* Import the right star formation law definition */
#if defined(STAR_FORMATION_NONE)
#include "./star_formation/none/star_formation.h"
#elif defined(STAR_FORMATION_QLA)
#include "./star_formation/QLA/star_formation.h"
#elif defined(STAR_FORMATION_EAGLE)
#include "./star_formation/EAGLE/star_formation.h"
#elif defined(STAR_FORMATION_GEAR)
......
This diff is collapsed.
/*******************************************************************************
* This file is part of SWIFT.
* Copyright (c) 2020 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_QLA_STAR_FORMATION_IACT_H
#define SWIFT_QLA_STAR_FORMATION_IACT_H
/**
* @file EAGLE/star_formation_iact.h
* @brief Density computation
*/
/**
* @brief do star_formation computation after the runner_iact_density (symmetric
* version)
*
* @param r2 Comoving square distance between the two particles.
* @param dx Comoving vector separating both particles (pi - pj).
* @param hi Comoving smoothing-length of particle i.
* @param hj Comoving smoothing-length of particle j.
* @param pi First particle.
* @param pj Second particle.
* @param a Current scale factor.
* @param H Current Hubble parameter.
*/
__attribute__((always_inline)) INLINE static void runner_iact_star_formation(
float r2, const float *dx, float hi, float hj, struct part *restrict pi,
struct part *restrict pj, float a, float H) {
/* Nothing to do here. We do not need to compute any quantity in the hydro
density loop for the QLA star formation model. */
}
/**
* @brief do star_formation computation after the runner_iact_density (non
* symmetric version)
*
* @param r2 Comoving square distance between the two particles.
* @param dx Comoving vector separating both particles (pi - pj).
* @param hi Comoving smoothing-length of particle i.
* @param hj Comoving smoothing-length of particle j.
* @param pi First particle.
* @param pj Second particle (not updated).
* @param a Current scale factor.
* @param H Current Hubble parameter.
*/
__attribute__((always_inline)) INLINE static void
runner_iact_nonsym_star_formation(float r2, const float *dx, float hi, float hj,
struct part *restrict pi,
const struct part *restrict pj, float a,
float H) {
/* Nothing to do here. We do not need to compute any quantity in the hydro
density loop for the QLA star formation model. */
}
#endif /* SWIFT_QLA_STAR_FORMATION_IACT_H */
/*******************************************************************************
* This file is part of SWIFT.
* Copyright (c) 2020 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_STAR_FORMATION_QLA_IO_H
#define SWIFT_STAR_FORMATION_QLA_IO_H
/* Config parameters. */
#include "../config.h"
/* Local includes */
#include "io_properties.h"
/**
* @brief Specifies which particle fields to write to a dataset
*
* @param parts The particle array.
* @param xparts The extended data particle array.
* @param list The list of i/o properties to write.
*
* @return Returns the number of fields to write.
*/
__attribute__((always_inline)) INLINE static int star_formation_write_particles(
const struct part* parts, const struct xpart* xparts,
struct io_props* list) {
/* No SF-related fields in the Quick Lyman-alpha model */
return 0;
}
#endif /* SWIFT_STAR_FORMATION_QLA_IO_H */
/*******************************************************************************
* This file is part of SWIFT.
* Copyright (c) 2020 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_QLA_STAR_FORMATION_STRUCT_H
#define SWIFT_QLA_STAR_FORMATION_STRUCT_H
/**
* @brief Star-formation-related properties stored in the extended particle
* data.
*/
struct star_formation_xpart_data {
char convert_to_star;
};
#endif /* SWIFT_QLA_STAR_FORMATION_STRUCT_H */
......@@ -31,6 +31,8 @@
/* Import the right star formation law definition */
#if defined(STAR_FORMATION_NONE)
#include "./star_formation/none/star_formation_iact.h"
#elif defined(STAR_FORMATION_QLA)
#include "./star_formation/QLA/star_formation_iact.h"
#elif defined(STAR_FORMATION_EAGLE)
#include "./star_formation/EAGLE/star_formation_iact.h"
#elif defined(STAR_FORMATION_GEAR)
......
......@@ -30,6 +30,8 @@
/* Import the right cooling definition */
#if defined(STAR_FORMATION_NONE)
#include "./star_formation/none/star_formation_io.h"
#elif defined(STAR_FORMATION_QLA)
#include "./star_formation/QLA/star_formation_io.h"
#elif defined(STAR_FORMATION_EAGLE)
#include "./star_formation/EAGLE/star_formation_io.h"
#elif defined(STAR_FORMATION_GEAR)
......
......@@ -30,6 +30,8 @@
/* Import the right SFH logger definition */
#if defined(STAR_FORMATION_NONE)
#include "./star_formation/none/star_formation_logger.h"
#elif defined(STAR_FORMATION_QLA)
#include "./star_formation/none/star_formation_logger.h"
#elif defined(STAR_FORMATION_EAGLE)
#include "./star_formation/EAGLE/star_formation_logger.h"
#elif defined(STAR_FORMATION_GEAR)
......
......@@ -30,6 +30,8 @@
/* Import the right SFH logger struct definition */
#if defined(STAR_FORMATION_NONE)
#include "./star_formation/none/star_formation_logger_struct.h"
#elif defined(STAR_FORMATION_QLA)
#include "./star_formation/none/star_formation_logger_struct.h"
#elif defined(STAR_FORMATION_EAGLE)
#include "./star_formation/EAGLE/star_formation_logger_struct.h"
#elif defined(STAR_FORMATION_GEAR)
......
......@@ -30,6 +30,8 @@
/* Import the right star formation definition */
#if defined(STAR_FORMATION_NONE)
#include "./star_formation/none/star_formation_struct.h"
#elif defined(STAR_FORMATION_QLA)
#include "./star_formation/QLA/star_formation_struct.h"
#elif defined(STAR_FORMATION_EAGLE)
#include "./star_formation/EAGLE/star_formation_struct.h"
#elif defined(STAR_FORMATION_GEAR)
......
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