diff --git a/src/runner.c b/src/runner.c index 732f4981935a4914499397216266efbdc0a51471..b99ab57f2d377e904a2c25921d160e0effb0cd60 100644 --- a/src/runner.c +++ b/src/runner.c @@ -472,6 +472,9 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) { struct part *restrict parts = c->hydro.parts; struct xpart *restrict xparts = c->hydro.xparts; const int with_cosmology = (e->policy & engine_policy_cosmology); + const struct hydro_props *restrict hydro_props = e->hydro_properties; + const struct unit_system *restrict us = e->internal_units; + struct cooling_function_data *restrict cooling = e->cooling_func; TIMER_TIC; @@ -494,7 +497,7 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) { if (part_is_active(p, e)) { //const float rho = hydro_get_physical_density(p, cosmo); - if (star_formation_convert_to_star(starform, p, xp, constants, cosmo) ) { + if (star_formation_convert_to_star(starform, p, xp, constants, cosmo, hydro_props, us, cooling) ) { star_formation_copy_properties(e, c, p, xp, starform, constants, cosmo, with_cosmology); //struct spart *sp = cell_conert_part_to_spart(c, p, ...); } diff --git a/src/starformation/schaye08/starformation.h b/src/starformation/schaye08/starformation.h index 23f1285c18dedd0f89eee3cac5b485c821c659f3..4ba8360c6c4fab03af15d83f1cf81ca99511fd75 100644 --- a/src/starformation/schaye08/starformation.h +++ b/src/starformation/schaye08/starformation.h @@ -124,7 +124,9 @@ struct star_formation { INLINE static int star_formation_potential_to_become_star( 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 cosmology* cosmo, const struct hydro_props *restrict hydro_props, + const struct unit_system *restrict us, + const struct cooling_function_data *restrict cooling){ /* Read the critical overdensity factor and the critical density of * the universe to determine the critical density to form stars*/ @@ -192,9 +194,11 @@ INLINE static int star_formation_potential_to_become_star( INLINE static int star_formation_convert_to_star( 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 cosmology* cosmo, const struct hydro_props *restrict hydro_props, + const struct unit_system *restrict us, + const struct cooling_function_data *restrict cooling) { - if (star_formation_potential_to_become_star(starform, p, xp, phys_const, cosmo)){ + if (star_formation_potential_to_become_star(starform, p, xp, phys_const, cosmo, hydro_props, us, cooling)){ /* Get the pressure */ const double pressure = starform->EOS_pressure_norm * pow(p->rho/starform->EOS_den0, starform->polytropic_index);