Skip to content
Snippets Groups Projects
Commit 37aa9599 authored by Folkert Nobels's avatar Folkert Nobels
Browse files

Update star formation properties copying

parent 2b15b529
Branches
Tags
1 merge request!705Star formation following Schaye08
......@@ -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, ...);
//
......
......@@ -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");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment