Commit aace4f75 authored by Loic Hausammann's avatar Loic Hausammann
Browse files

Add hydro density iact for star formation

parent 08c2e811
......@@ -62,6 +62,7 @@
#include "space.h"
#include "space_getsid.h"
#include "star_formation.h"
#include "star_formation_iact.h"
#include "stars.h"
#include "task.h"
#include "timers.h"
......@@ -1231,6 +1232,7 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) {
const struct hydro_space *hs = &s->hs;
const struct cosmology *cosmo = e->cosmology;
const struct chemistry_global_data *chemistry = e->chemistry;
const struct star_formation *star_formation = e->star_formation;
const float hydro_h_max = e->hydro_properties->h_max;
const float hydro_h_min = e->hydro_properties->h_min;
const float eps = e->hydro_properties->h_tolerance;
......@@ -1314,6 +1316,7 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) {
/* Finish the density calculation */
hydro_end_density(p, cosmo);
chemistry_end_density(p, chemistry, cosmo);
star_formation_end_density(p, star_formation, cosmo);
/* Compute one step of the Newton-Raphson scheme */
const float n_sum = p->density.wcount * h_old_dim;
......@@ -1455,6 +1458,7 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) {
/* Re-initialise everything */
hydro_init_part(p, hs);
chemistry_init_part(p, chemistry);
star_formation_init_part(p, star_formation);
/* Off we go ! */
continue;
......@@ -1473,6 +1477,7 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) {
if (has_no_neighbours) {
hydro_part_has_no_neighbours(p, xp, cosmo);
chemistry_part_has_no_neighbours(p, xp, chemistry, cosmo);
star_formation_part_has_no_neighbours(p, xp, star_formation, cosmo);
}
}
}
......
......@@ -213,6 +213,7 @@ void DOPAIR1_NAIVE(struct runner *r, struct cell *restrict ci,
IACT_NONSYM(r2, dx, hi, hj, pi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hi, hj, pi, pj, a, H);
runner_iact_nonsym_star_formation(r2, dx, hi, hj, pi, pj, a, H);
#endif
}
if (r2 < hjg2 && pj_active) {
......@@ -224,6 +225,7 @@ void DOPAIR1_NAIVE(struct runner *r, struct cell *restrict ci,
IACT_NONSYM(r2, dx, hj, hi, pj, pi, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hj, hi, pj, pi, a, H);
runner_iact_nonsym_star_formation(r2, dx, hj, hi, pj, pi, a, H);
#endif
}
......@@ -323,12 +325,14 @@ void DOPAIR2_NAIVE(struct runner *r, struct cell *restrict ci,
IACT(r2, dx, hi, hj, pi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_chemistry(r2, dx, hi, hj, pi, pj, a, H);
runner_iact_star_formation(r2, dx, hi, hj, pi, pj, a, H);
#endif
} else if (pi_active) {
IACT_NONSYM(r2, dx, hi, hj, pi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hi, hj, pi, pj, a, H);
runner_iact_nonsym_star_formation(r2, dx, hi, hj, pi, pj, a, H);
#endif
} else if (pj_active) {
......@@ -339,6 +343,7 @@ void DOPAIR2_NAIVE(struct runner *r, struct cell *restrict ci,
IACT_NONSYM(r2, dx, hj, hi, pj, pi, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hj, hi, pj, pi, a, H);
runner_iact_nonsym_star_formation(r2, dx, hj, hi, pj, pi, a, H);
#endif
}
}
......@@ -426,12 +431,14 @@ void DOSELF1_NAIVE(struct runner *r, struct cell *restrict c) {
IACT(r2, dx, hi, hj, pi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_chemistry(r2, dx, hi, hj, pi, pj, a, H);
runner_iact_star_formation(r2, dx, hi, hj, pi, pj, a, H);
#endif
} else if (doi) {
IACT_NONSYM(r2, dx, hi, hj, pi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hi, hj, pi, pj, a, H);
runner_iact_nonsym_star_formation(r2, dx, hi, hj, pi, pj, a, H);
#endif
} else if (doj) {
......@@ -442,6 +449,7 @@ void DOSELF1_NAIVE(struct runner *r, struct cell *restrict c) {
IACT_NONSYM(r2, dx, hj, hi, pj, pi, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hj, hi, pj, pi, a, H);
runner_iact_nonsym_star_formation(r2, dx, hj, hi, pj, pi, a, H);
#endif
}
} /* loop over the parts in cj. */
......@@ -528,12 +536,14 @@ void DOSELF2_NAIVE(struct runner *r, struct cell *restrict c) {
IACT(r2, dx, hi, hj, pi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_chemistry(r2, dx, hi, hj, pi, pj, a, H);
runner_iact_star_formation(r2, dx, hi, hj, pi, pj, a, H);
#endif
} else if (doi) {
IACT_NONSYM(r2, dx, hi, hj, pi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hi, hj, pi, pj, a, H);
runner_iact_nonsym_star_formation(r2, dx, hi, hj, pi, pj, a, H);
#endif
} else if (doj) {
......@@ -544,6 +554,7 @@ void DOSELF2_NAIVE(struct runner *r, struct cell *restrict c) {
IACT_NONSYM(r2, dx, hj, hi, pj, pi, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hj, hi, pj, pi, a, H);
runner_iact_nonsym_star_formation(r2, dx, hj, hi, pj, pi, a, H);
#endif
}
} /* loop over the parts in cj. */
......@@ -629,6 +640,7 @@ void DOPAIR_SUBSET_NAIVE(struct runner *r, struct cell *restrict ci,
IACT_NONSYM(r2, dx, hi, pj->h, pi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hi, pj->h, pi, pj, a, H);
runner_iact_nonsym_star_formation(r2, dx, hi, pj->h, pi, pj, a, H);
#endif
}
} /* loop over the parts in cj. */
......@@ -721,6 +733,7 @@ void DOPAIR_SUBSET(struct runner *r, struct cell *restrict ci,
IACT_NONSYM(r2, dx, hi, hj, pi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hi, hj, pi, pj, a, H);
runner_iact_nonsym_star_formation(r2, dx, hi, hj, pi, pj, a, H);
#endif
}
} /* loop over the parts in cj. */
......@@ -776,6 +789,7 @@ void DOPAIR_SUBSET(struct runner *r, struct cell *restrict ci,
IACT_NONSYM(r2, dx, hi, hj, pi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hi, hj, pi, pj, a, H);
runner_iact_nonsym_star_formation(r2, dx, hi, hj, pi, pj, a, H);
#endif
}
} /* loop over the parts in cj. */
......@@ -915,6 +929,7 @@ void DOSELF_SUBSET(struct runner *r, struct cell *restrict ci,
IACT_NONSYM(r2, dx, hi, hj, pi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hi, hj, pi, pj, a, H);
runner_iact_nonsym_star_formation(r2, dx, hi, hj, pi, pj, a, H);
#endif
}
} /* loop over the parts in cj. */
......@@ -1078,6 +1093,7 @@ void DOPAIR1(struct runner *r, struct cell *ci, struct cell *cj, const int sid,
IACT_NONSYM(r2, dx, hi, hj, pi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hi, hj, pi, pj, a, H);
runner_iact_nonsym_star_formation(r2, dx, hi, hj, pi, pj, a, H);
#endif
}
} /* loop over the parts in cj. */
......@@ -1165,6 +1181,7 @@ void DOPAIR1(struct runner *r, struct cell *ci, struct cell *cj, const int sid,
IACT_NONSYM(r2, dx, hj, hi, pj, pi, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hj, hi, pj, pi, a, H);
runner_iact_nonsym_star_formation(r2, dx, hj, hi, pj, pi, a, H);
#endif
}
} /* loop over the parts in ci. */
......@@ -1451,6 +1468,7 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj, const int sid,
IACT_NONSYM(r2, dx, hj, hi, pj, pi, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hj, hi, pj, pi, a, H);
runner_iact_nonsym_star_formation(r2, dx, hj, hi, pj, pi, a, H);
#endif
}
} /* loop over the active parts in cj. */
......@@ -1520,11 +1538,13 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj, const int sid,
IACT(r2, dx, hi, hj, pi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_chemistry(r2, dx, hi, hj, pi, pj, a, H);
runner_iact_star_formation(r2, dx, hi, hj, pi, pj, a, H);
#endif
} else {
IACT_NONSYM(r2, dx, hi, hj, pi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hi, hj, pi, pj, a, H);
runner_iact_nonsym_star_formation(r2, dx, hi, hj, pi, pj, a, H);
#endif
}
}
......@@ -1619,6 +1639,7 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj, const int sid,
IACT_NONSYM(r2, dx, hi, hj, pi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hi, hj, pi, pj, a, H);
runner_iact_nonsym_star_formation(r2, dx, hi, hj, pi, pj, a, H);
#endif
}
} /* loop over the active parts in ci. */
......@@ -1691,11 +1712,13 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj, const int sid,
IACT(r2, dx, hj, hi, pj, pi, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_chemistry(r2, dx, hj, hi, pj, pi, a, H);
runner_iact_star_formation(r2, dx, hj, hi, pj, pi, a, H);
#endif
} else {
IACT_NONSYM(r2, dx, hj, hi, pj, pi, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hj, hi, pj, pi, a, H);
runner_iact_nonsym_star_formation(r2, dx, hj, hi, pj, pi, a, H);
#endif
}
}
......@@ -1881,6 +1904,7 @@ void DOSELF1(struct runner *r, struct cell *restrict c) {
IACT_NONSYM(r2, dx, hj, hi, pj, pi, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hj, hi, pj, pi, a, H);
runner_iact_nonsym_star_formation(r2, dx, hj, hi, pj, pi, a, H);
#endif
}
} /* loop over all other particles. */
......@@ -1932,12 +1956,14 @@ void DOSELF1(struct runner *r, struct cell *restrict c) {
IACT(r2, dx, hi, hj, pi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_chemistry(r2, dx, hi, hj, pi, pj, a, H);
runner_iact_star_formation(r2, dx, hi, hj, pi, pj, a, H);
#endif
} else if (doi) {
IACT_NONSYM(r2, dx, hi, hj, pi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hi, hj, pi, pj, a, H);
runner_iact_nonsym_star_formation(r2, dx, hi, hj, pi, pj, a, H);
#endif
} else if (doj) {
......@@ -1947,6 +1973,7 @@ void DOSELF1(struct runner *r, struct cell *restrict c) {
IACT_NONSYM(r2, dx, hj, hi, pj, pi, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hj, hi, pj, pi, a, H);
runner_iact_nonsym_star_formation(r2, dx, hj, hi, pj, pi, a, H);
#endif
}
}
......@@ -2070,6 +2097,7 @@ void DOSELF2(struct runner *r, struct cell *restrict c) {
IACT_NONSYM(r2, dx, hj, hi, pj, pi, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hj, hi, pj, pi, a, H);
runner_iact_nonsym_star_formation(r2, dx, hj, hi, pj, pi, a, H);
#endif
}
} /* loop over all other particles. */
......@@ -2116,11 +2144,13 @@ void DOSELF2(struct runner *r, struct cell *restrict c) {
IACT(r2, dx, hi, hj, pi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_chemistry(r2, dx, hi, hj, pi, pj, a, H);
runner_iact_star_formation(r2, dx, hi, hj, pi, pj, a, H);
#endif
} else {
IACT_NONSYM(r2, dx, hi, hj, pi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_chemistry(r2, dx, hi, hj, pi, pj, a, H);
runner_iact_nonsym_star_formation(r2, dx, hi, hj, pi, pj, a, H);
#endif
}
}
......
......@@ -626,4 +626,61 @@ INLINE static void starformation_print_backend(
starform->max_gas_density_HpCM3);
}
/**
* @brief Finishes the density calculation.
*
* @param p The particle to act upon
* @param cd The global star_formation information.
* @param cosmo The current cosmological model.
*/
__attribute__((always_inline)) INLINE static void star_formation_end_density(
struct part* restrict p, const struct star_formation* cd,
const struct cosmology* cosmo) {}
/**
* @brief Sets all particle fields to sensible values when the #part has 0 ngbs.
*
* @param p The particle to act upon
* @param xp The extended particle data to act upon
* @param cd #star_formation containing star_formation informations.
* @param cosmo The current cosmological model.
*/
__attribute__((always_inline)) INLINE static void
star_formation_part_has_no_neighbours(struct part* restrict p,
struct xpart* restrict xp,
const struct star_formation* cd,
const struct cosmology* cosmo) {}
/**
* @brief Sets the star_formation properties of the (x-)particles to a valid start
* state.
*
* Nothing to do here.
*
* @param phys_const The physical constant in internal units.
* @param us The unit system.
* @param cosmo The current cosmological model.
* @param data The global star_formation information used for this run.
* @param p Pointer to the particle data.
* @param xp Pointer to the extended particle data.
*/
__attribute__((always_inline)) INLINE static void star_formation_first_init_part(
const struct phys_const* restrict phys_const,
const struct unit_system* restrict us,
const struct cosmology* restrict cosmo,
const struct star_formation* data, const struct part* restrict p,
struct xpart* restrict xp) {}
/**
* @brief Sets the star_formation properties of the (x-)particles to a valid start
* state.
*
* Nothing to do here.
*
* @param p Pointer to the particle data.
* @param data The global star_formation information.
*/
__attribute__((always_inline)) INLINE static void star_formation_init_part(
struct part* restrict p, const struct star_formation* data) {}
#endif /* SWIFT_EAGLE_STAR_FORMATION_H */
/*******************************************************************************
*
* 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_STAR_FORMATION_IACT_H
#define SWIFT_EAGLE_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) {}
/**
* @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) {}
#endif /* SWIFT_EAGLE_STAR_FORMATION_IACT_H */
/*******************************************************************************
* This file is part of SWIFT.
* Copyright (c) 2018 Folkert Nobels (nobels@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_GEAR_STAR_FORMATION_H
#define SWIFT_GEAR_STAR_FORMATION_H
/* Local includes */
#include "cosmology.h"
#include "error.h"
#include "hydro_properties.h"
#include "parser.h"
#include "part.h"
#include "physical_constants.h"
#include "units.h"
/**
* @brief Calculate if the gas has the potential of becoming
* a star.
*
* No star formation should occur, so return 0.
*
* @param starform the star formation law properties to use.
* @param p the gas particles.
* @param xp the additional properties of the gas particles.
* @param phys_const the physical constants in internal units.
* @param cosmo the cosmological parameters and properties.
* @param hydro_props The properties of the hydro scheme.
* @param us The internal system of units.
* @param cooling The cooling data struct.
*
*/
INLINE static int star_formation_is_star_forming(
const struct part* restrict p, const struct xpart* restrict xp,
const struct star_formation* starform, const struct phys_const* phys_const,
const struct cosmology* cosmo,
const struct hydro_props* restrict hydro_props,
const struct unit_system* restrict us,
const struct cooling_function_data* restrict cooling) {
return 0;
}
/**
* @brief Compute the star-formation rate of a given particle and store
* it into the #xpart.
*
* Nothing to do here.
*
* @param p #part.
* @param xp the #xpart.
* @param starform the star formation law properties to use
* @param phys_const the physical constants in internal units.
* @param cosmo the cosmological parameters and properties.
* @param dt_star The time-step of this particle.
*/
INLINE static void star_formation_compute_SFR(
const struct part* restrict p, struct xpart* restrict xp,
const struct star_formation* starform, const struct phys_const* phys_const,
const struct cosmology* cosmo, const double dt_star) {}
/**
* @brief Decides whether a particle should be converted into a
* star or not.
*
* No SF should occur, so return 0.
*
* @param p The #part.
* @param xp The #xpart.
* @param starform The properties of the star formation model.
* @param e The #engine (for random numbers).
* @param dt_star The time-step of this particle
* @return 1 if a conversion should be done, 0 otherwise.
*/
INLINE static int star_formation_should_convert_to_star(
const struct part* p, const struct xpart* xp,
const struct star_formation* starform, const struct engine* e,
const double dt_star) {
return 0;
}
/**
* @brief Update the SF properties of a particle that is not star forming.
*
* Nothing to do here.
*
* @param p The #part.
* @param xp The #xpart.
* @param e The #engine.
* @param starform The properties of the star formation model.
* @param with_cosmology Are we running with cosmology switched on?
*/
INLINE static void star_formation_update_part_not_SFR(
struct part* p, struct xpart* xp, const struct engine* e,
const struct star_formation* starform, const int with_cosmology) {}
/**
* @brief Copies the properties of the gas particle over to the
* star particle.
*
* Nothing to do here.
*
* @param e The #engine
* @param p the gas particles.
* @param xp the additional properties of the gas particles.
* @param sp the new created star particle with its properties.
* @param starform the star formation law properties to use.
* @param phys_const the physical constants in internal units.
* @param cosmo the cosmological parameters and properties.
* @param with_cosmology if we run with cosmology.
*/
INLINE static void star_formation_copy_properties(
const struct part* p, const struct xpart* xp, struct spart* sp,
const struct engine* e, const struct star_formation* starform,
const struct cosmology* cosmo, const int with_cosmology) {}
/**
* @brief initialization of the star formation law
*
* @param parameter_file The parsed parameter file
* @param phys_const Physical constants in internal units
* @param us The current internal system of units
* @param starform the star formation law properties to initialize
*
*/
INLINE static void starformation_init_backend(
struct swift_params* parameter_file, const struct phys_const* phys_const,
const struct unit_system* us, const struct hydro_props* hydro_props,
const struct star_formation* starform) {}
/**
* @brief Prints the used parameters of the star formation law
*
* @param starform the star formation law properties.
*/
INLINE static void starformation_print_backend(
const struct star_formation* starform) {
message("Star formation law is 'GEAR'");
}
/**
* @brief Finishes the density calculation.
*
* @param p The particle to act upon
* @param cd The global star_formation information.
* @param cosmo The current cosmological model.
*/
__attribute__((always_inline)) INLINE static void star_formation_end_density(
struct part* restrict p, const struct star_formation* cd,
const struct cosmology* cosmo) {}
/**
* @brief Sets all particle fields to sensible values when the #part has 0 ngbs.
*
* @param p The particle to act upon
* @param xp The extended particle data to act upon
* @param cd #star_formation containing star_formation informations.
* @param cosmo The current cosmological model.
*/
__attribute__((always_inline)) INLINE static void
star_formation_part_has_no_neighbours(struct part* restrict p,
struct xpart* restrict xp,
const struct star_formation* cd,
const struct cosmology* cosmo) {}
/**
* @brief Sets the star_formation properties of the (x-)particles to a valid start
* state.
*
* Nothing to do here.
*
* @param phys_const The physical constant in internal units.
* @param us The unit system.
* @param cosmo The current cosmological model.
* @param data The global star_formation information used for this run.
* @param p Pointer to the particle data.
* @param xp Pointer to the extended particle data.
*/
__attribute__((always_inline)) INLINE static void star_formation_first_init_part(
const struct phys_const* restrict phys_const,
const struct unit_system* restrict us,
const struct cosmology* restrict cosmo,
const struct star_formation* data, const struct part* restrict p,
struct xpart* restrict xp) {}
/**
* @brief Sets the star_formation properties of the (x-)particles to a valid start
* state.
*
* Nothing to do here.
*
* @param p Pointer to the particle data.
* @param data The global star_formation information.
*/
__attribute__((always_inline)) INLINE static void star_formation_init_part(
struct part* restrict p, const struct star_formation* data) {}
#endif /* SWIFT_GEAR_STAR_FORMATION_H */
/*******************************************************************************
*
* 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/>.
*