Commit e57da2b0 authored by lhausamm's avatar lhausamm
Browse files

Add output for cooling

parent 5502ab44
...@@ -856,10 +856,13 @@ void prepare_file(struct engine* e, const char* baseName, long long N_total[6], ...@@ -856,10 +856,13 @@ void prepare_file(struct engine* e, const char* baseName, long long N_total[6],
const struct xpart* xparts = e->s->xparts; const struct xpart* xparts = e->s->xparts;
const struct gpart* gparts = e->s->gparts; const struct gpart* gparts = e->s->gparts;
const struct spart* sparts = e->s->sparts; const struct spart* sparts = e->s->sparts;
struct gpart* dmparts = NULL;
FILE* xmfFile = 0; FILE* xmfFile = 0;
int periodic = e->s->periodic; int periodic = e->s->periodic;
int numFiles = 1; int numFiles = 1;
const struct cooling_function_data *cooling = e->cooling_func;
/* First time, we need to create the XMF file */ /* First time, we need to create the XMF file */
if (e->snapshotOutputCount == 0) xmf_create_file(baseName); if (e->snapshotOutputCount == 0) xmf_create_file(baseName);
...@@ -1243,6 +1246,7 @@ void write_output_parallel(struct engine* e, const char* baseName, ...@@ -1243,6 +1246,7 @@ void write_output_parallel(struct engine* e, const char* baseName,
Nparticles = Ngas; Nparticles = Ngas;
hydro_write_particles(parts, xparts, list, &num_fields); hydro_write_particles(parts, xparts, list, &num_fields);
num_fields += chemistry_write_particles(parts, list + num_fields); num_fields += chemistry_write_particles(parts, list + num_fields);
num_fields += cooling_write_particles(xparts, list + num_fields, cooling);
break; break;
case swift_type_dark_matter: case swift_type_dark_matter:
......
...@@ -744,6 +744,7 @@ void write_output_serial(struct engine* e, const char* baseName, ...@@ -744,6 +744,7 @@ void write_output_serial(struct engine* e, const char* baseName,
const struct gpart* gparts = e->s->gparts; const struct gpart* gparts = e->s->gparts;
struct gpart* dmparts = NULL; struct gpart* dmparts = NULL;
const struct spart* sparts = e->s->sparts; const struct spart* sparts = e->s->sparts;
const struct cooling_function_data *cooling = e->cooling_func;
FILE* xmfFile = 0; FILE* xmfFile = 0;
/* Number of unassociated gparts */ /* Number of unassociated gparts */
...@@ -992,6 +993,8 @@ void write_output_serial(struct engine* e, const char* baseName, ...@@ -992,6 +993,8 @@ void write_output_serial(struct engine* e, const char* baseName,
Nparticles = Ngas; Nparticles = Ngas;
hydro_write_particles(parts, xparts, list, &num_fields); hydro_write_particles(parts, xparts, list, &num_fields);
num_fields += chemistry_write_particles(parts, list + num_fields); num_fields += chemistry_write_particles(parts, list + num_fields);
num_fields += cooling_write_particles(xparts, list + num_fields,
cooling);
break; break;
case swift_type_dark_matter: case swift_type_dark_matter:
......
...@@ -612,6 +612,7 @@ void write_output_single(struct engine* e, const char* baseName, ...@@ -612,6 +612,7 @@ void write_output_single(struct engine* e, const char* baseName,
const struct gpart* gparts = e->s->gparts; const struct gpart* gparts = e->s->gparts;
struct gpart* dmparts = NULL; struct gpart* dmparts = NULL;
const struct spart* sparts = e->s->sparts; const struct spart* sparts = e->s->sparts;
const struct cooling_function_data *cooling = e->cooling_func;
/* Number of unassociated gparts */ /* Number of unassociated gparts */
const size_t Ndm = Ntot > 0 ? Ntot - (Ngas + Nstars) : 0; const size_t Ndm = Ntot > 0 ? Ntot - (Ngas + Nstars) : 0;
...@@ -811,6 +812,8 @@ void write_output_single(struct engine* e, const char* baseName, ...@@ -811,6 +812,8 @@ void write_output_single(struct engine* e, const char* baseName,
N = Ngas; N = Ngas;
hydro_write_particles(parts, xparts, list, &num_fields); hydro_write_particles(parts, xparts, list, &num_fields);
num_fields += chemistry_write_particles(parts, list + num_fields); num_fields += chemistry_write_particles(parts, list + num_fields);
num_fields += cooling_write_particles(xparts, list + num_fields,
cooling);
break; break;
case swift_type_dark_matter: case swift_type_dark_matter:
......
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