Commit cb38bd49 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Print the dimension information to the HDF5 header group. Allows restart from a snapshot.

parent 49e93734
......@@ -677,6 +677,8 @@ void write_output_parallel(struct engine* e, const char* baseName,
writeAttribute(h_grp, "BoxSize", DOUBLE, e->s->dim, 3);
double dblTime = e->time;
writeAttribute(h_grp, "Time", DOUBLE, &dblTime, 1);
int dimension = (int)hydro_dimension;
writeAttribute(h_grp, "Dimension", INT, &dimension, 1);
/* GADGET-2 legacy values */
/* Number of particles of each type */
......
......@@ -739,6 +739,8 @@ void write_output_serial(struct engine* e, const char* baseName,
writeAttribute(h_grp, "BoxSize", DOUBLE, e->s->dim, 3);
double dblTime = e->time;
writeAttribute(h_grp, "Time", DOUBLE, &dblTime, 1);
int dimension = (int)hydro_dimension;
writeAttribute(h_grp, "Dimension", INT, &dimension, 1);
/* GADGET-2 legacy values */
/* Number of particles of each type */
......
......@@ -592,6 +592,8 @@ void write_output_single(struct engine* e, const char* baseName,
writeAttribute(h_grp, "BoxSize", DOUBLE, e->s->dim, 3);
double dblTime = e->time;
writeAttribute(h_grp, "Time", DOUBLE, &dblTime, 1);
int dimension = (int)hydro_dimension;
writeAttribute(h_grp, "Dimension", INT, &dimension, 1);
/* GADGET-2 legacy values */
/* Number of particles of each type */
......
Supports Markdown
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