Commit 18e02b1f authored by Folkert Nobels's avatar Folkert Nobels
Browse files

Place the creation of the star particle in the runner.c instead of in the starformation.h file

parent 5b550cd9
......@@ -499,7 +499,10 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
// const float rho = hydro_get_physical_density(p, cosmo);
if (star_formation_convert_to_star(e, starform, p, xp, constants, cosmo,
hydro_props, us, cooling)) {
star_formation_copy_properties(e, c, p, xp, starform, constants,
/* Convert your particle to a star */
struct spart* sp = cell_convert_part_to_spart(e, c, p, xp);
star_formation_copy_properties(e, p, xp, sp, starform, constants,
cosmo, with_cosmology);
// struct spart *sp = cell_conert_part_to_spart(c, p, ...);
}
......
......@@ -37,20 +37,25 @@
struct star_formation {};
/**
* @brief Calculate if the gas has the potential of becoming
* a star.
* @brief Calculates if the gas particle gets converted
*
* @param the #engine
* @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 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_convert_to_star(
const struct star_formation* starform, struct part* restrict p,
const struct xpart* restrict xp, const struct phys_const* const phys_const,
const struct cosmology* cosmo) {
struct engine* e, const struct star_formation* starform,
const struct part* restrict p, const struct xpart* restrict xp,
const struct phys_const* 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;
}
......@@ -65,9 +70,10 @@ INLINE static int star_formation_convert_to_star(
*
*/
INLINE static void star_formation_copy_properties(
struct engine* e, struct cell* c, struct part* p, struct xpart* xp,
struct engine* e, struct part* p, struct xpart* xp, struct spart* sp,
const struct star_formation* starform,
const struct phys_const* const phys_const, const struct cosmology* cosmo) {}
const struct phys_const* const phys_const, const struct cosmology* cosmo,
int with_cosmology) {}
/**
* @brief initialization of the star formation law
......
......@@ -253,23 +253,20 @@ INLINE static int star_formation_convert_to_star(
* star particle
*
* @param e The #engine
* @param c The #cell
* @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(
struct engine* e, struct cell* c, struct part* p, struct xpart* xp,
struct engine* e, struct part* p, struct xpart* xp, struct spart* sp,
const struct star_formation* starform,
const struct phys_const* const phys_const, const struct cosmology* cosmo,
int with_cosmology) {
/* Convert your particle to a star */
struct spart* sp = cell_convert_part_to_spart(e, c, p, xp);
/* Store the current mass */
sp->mass = p->mass;
......
Supports Markdown
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