Commit 9ff194f4 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

When converting internal energy to entropy at startup, apply the correct cosmology factor.

parent 4517ef2b
......@@ -1081,23 +1081,6 @@ void cell_sanitize(struct cell *c, int treated) {
c->h_max = h_max;
}
/**
* @brief Converts hydro quantities to a valid state after the initial density
* calculation
*
* @param c Cell to act upon
* @param data Unused parameter
*/
void cell_convert_hydro(struct cell *c, void *data) {
struct part *p = c->parts;
struct xpart *xp = c->xparts;
for (int i = 0; i < c->count; ++i) {
hydro_convert_quantities(&p[i], &xp[i]);
}
}
/**
* @brief Cleans the links in a given cell.
*
......
......@@ -492,7 +492,6 @@ int cell_getsize(struct cell *c);
int cell_link_parts(struct cell *c, struct part *parts);
int cell_link_gparts(struct cell *c, struct gpart *gparts);
int cell_link_sparts(struct cell *c, struct spart *sparts);
void cell_convert_hydro(struct cell *c, void *data);
void cell_clean_links(struct cell *c, void *data);
void cell_make_multipoles(struct cell *c, integertime_t ti_current);
void cell_check_multipole(struct cell *c, void *data);
......
......@@ -2813,11 +2813,12 @@ void space_init_gparts(struct space *s, int verbose) {
void space_convert_quantities_mapper(void *restrict map_data, int count,
void *restrict extra_data) {
struct space *s = (struct space *)extra_data;
const struct cosmology *cosmo = s->e->cosmology;
struct part *restrict parts = (struct part *)map_data;
const ptrdiff_t index = parts - s->parts;
struct xpart *restrict xparts = s->xparts + index;
for (int k = 0; k < count; k++)
hydro_convert_quantities(&parts[k], &xparts[k]);
hydro_convert_quantities(&parts[k], &xparts[k], cosmo);
}
/**
......
Markdown is supported
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