From cb40e538b871ffc56e9d72ea09ca31a852270fae Mon Sep 17 00:00:00 2001 From: Folkert Nobels <nobels@strw.leidenuniv.nl> Date: Mon, 17 Dec 2018 14:27:31 +0100 Subject: [PATCH] Update star formation properties copying --- src/runner.c | 3 ++- src/starformation/schaye08/starformation.h | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/runner.c b/src/runner.c index 7371f43294..15e594101b 100644 --- a/src/runner.c +++ b/src/runner.c @@ -470,6 +470,7 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) { const int count = c->hydro.count; struct part *restrict parts = c->hydro.parts; struct xpart *restrict xparts = c->hydro.xparts; + const int with_cosmology = (e->policy & engine_policy_cosmology); TIMER_TIC; @@ -493,7 +494,7 @@ 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(starform, p, xp, constants, cosmo) ) { - star_formation_copy_properties(e, c, p, xp, starform, constants, cosmo); + 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 8c4e017944..3003fb1c20 100644 --- a/src/starformation/schaye08/starformation.h +++ b/src/starformation/schaye08/starformation.h @@ -217,12 +217,17 @@ 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, 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) { struct spart *sp = cell_convert_part_to_spart(e, c, p, xp); sp->mass = p->mass; sp->mass_init = p->mass; - sp->age = cosmo->a; + if (with_cosmology) { + sp->age = cosmo->a; + } else { + sp->age = cosmo->a; + } message("Copy Properties"); } -- GitLab