diff --git a/examples/PertubedBox/makeIC.py b/examples/PertubedBox/makeIC.py index 8301b0f630e3c3dfc12b4c71583ba09a3995e6f3..fe32c6f10a0f836cfc351c87730fd6a32882bad8 100644 --- a/examples/PertubedBox/makeIC.py +++ b/examples/PertubedBox/makeIC.py @@ -77,6 +77,13 @@ file = h5py.File(fileName, 'w') # Header grp = file.create_group("/Header") grp.attrs["BoxSize"] = boxSize +grp.attrs["NumPart_Total"] = [numPart, 0, 0, 0, 0, 0] +grp.attrs["NumPart_Total_HighWord"] = [0, 0, 0, 0, 0, 0] +grp.attrs["NumPart_ThisFile"] = [numPart, 0, 0, 0, 0, 0] +grp.attrs["Time"] = 0.0 +grp.attrs["NumFilesPerSnapshot"] = 1 +grp.attrs["MassTable"] = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0] +grp.attrs["Flag_Entropy_ICs"] = [0, 0, 0, 0, 0, 0] grp.attrs["NumPart_Total"] = numPart #Runtime parameters @@ -87,9 +94,9 @@ grp.attrs["PeriodicBoundariesOn"] = periodic grp = file.create_group("/PartType0") ds = grp.create_dataset('Coordinates', (numPart, 3), 'd') ds[()] = coords -ds = grp.create_dataset('Velocity', (numPart, 3), 'f') +ds = grp.create_dataset('Velocities', (numPart, 3), 'f') ds[()] = v -ds = grp.create_dataset('Mass', (numPart,1), 'f') +ds = grp.create_dataset('Masses', (numPart,1), 'f') ds[()] = m ds = grp.create_dataset('SmoothingLength', (numPart,1), 'f') ds[()] = h diff --git a/examples/SedovBlast/makeIC.py b/examples/SedovBlast/makeIC.py index 723b70396b55e832d67dd134b2610d2e21bbff3b..ab61d60b2240eaf8c2524dedb6167b09db2211b2 100644 --- a/examples/SedovBlast/makeIC.py +++ b/examples/SedovBlast/makeIC.py @@ -63,7 +63,7 @@ for i in range(L): coords[index,0] = x coords[index,1] = y coords[index,2] = z - v[index,0] = 0.1 + v[index,0] = 0. v[index,1] = 0. v[index,2] = 0. m[index] = mass @@ -85,7 +85,13 @@ file = h5py.File(fileName, 'w') # Header grp = file.create_group("/Header") grp.attrs["BoxSize"] = boxSize -grp.attrs["NumPart_Total"] = numPart +grp.attrs["NumPart_Total"] = [numPart, 0, 0, 0, 0, 0] +grp.attrs["NumPart_Total_HighWord"] = [0, 0, 0, 0, 0, 0] +grp.attrs["NumPart_ThisFile"] = [numPart, 0, 0, 0, 0, 0] +grp.attrs["Time"] = 0.0 +grp.attrs["NumFilesPerSnapshot"] = 1 +grp.attrs["MassTable"] = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0] +grp.attrs["Flag_Entropy_ICs"] = [0, 0, 0, 0, 0, 0] #Runtime parameters grp = file.create_group("/RuntimePars") @@ -95,9 +101,9 @@ grp.attrs["PeriodicBoundariesOn"] = periodic grp = file.create_group("/PartType0") ds = grp.create_dataset('Coordinates', (numPart, 3), 'd') ds[()] = coords -ds = grp.create_dataset('Velocity', (numPart, 3), 'f') +ds = grp.create_dataset('Velocities', (numPart, 3), 'f') ds[()] = v -ds = grp.create_dataset('Mass', (numPart,1), 'f') +ds = grp.create_dataset('Masses', (numPart,1), 'f') ds[()] = m ds = grp.create_dataset('SmoothingLength', (numPart,1), 'f') ds[()] = h diff --git a/examples/UniformBox/makeIC.py b/examples/UniformBox/makeIC.py index e61106d30cd971fcf19fa18c1da883efdad00b1a..0fef11db624924bf543e880ed7d856a750b98865 100644 --- a/examples/UniformBox/makeIC.py +++ b/examples/UniformBox/makeIC.py @@ -75,7 +75,14 @@ file = h5py.File(fileName, 'w') # Header grp = file.create_group("/Header") grp.attrs["BoxSize"] = boxSize -grp.attrs["NumPart_Total"] = numPart +grp.attrs["NumPart_Total"] = [numPart, 0, 0, 0, 0, 0] +grp.attrs["NumPart_Total_HighWord"] = [0, 0, 0, 0, 0, 0] +grp.attrs["NumPart_ThisFile"] = [numPart, 0, 0, 0, 0, 0] +grp.attrs["Time"] = 0.0 +grp.attrs["NumFilesPerSnapshot"] = 1 +grp.attrs["MassTable"] = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0] +grp.attrs["Flag_Entropy_ICs"] = [0, 0, 0, 0, 0, 0] + #Runtime parameters grp = file.create_group("/RuntimePars") @@ -85,9 +92,9 @@ grp.attrs["PeriodicBoundariesOn"] = periodic grp = file.create_group("/PartType0") ds = grp.create_dataset('Coordinates', (numPart, 3), 'd') ds[()] = coords -ds = grp.create_dataset('Velocity', (numPart, 3), 'f') +ds = grp.create_dataset('Velocities', (numPart, 3), 'f') ds[()] = v -ds = grp.create_dataset('Mass', (numPart,1), 'f') +ds = grp.create_dataset('Masses', (numPart,1), 'f') ds[()] = m ds = grp.create_dataset('SmoothingLength', (numPart,1), 'f') ds[()] = h diff --git a/src/io.c b/src/io.c index c3ae9af8b128f409af5274fbaf32d9a58227b9d8..a6d3914411fb0db369f3ba545bc460cf02d58e44 100644 --- a/src/io.c +++ b/src/io.c @@ -331,8 +331,8 @@ void read_ic ( char* fileName, double dim[3], struct part **parts, int* N, int* /* Read arrays */ readArray(h_grp, "Coordinates", DOUBLE, *N, 3, *parts, x, COMPULSORY); - readArray(h_grp, "Velocity", FLOAT, *N, 3, *parts, v, COMPULSORY); - readArray(h_grp, "Mass", FLOAT, *N, 1, *parts, mass, COMPULSORY); + readArray(h_grp, "Velocities", FLOAT, *N, 3, *parts, v, COMPULSORY); + readArray(h_grp, "Masses", FLOAT, *N, 1, *parts, mass, COMPULSORY); readArray(h_grp, "SmoothingLength", FLOAT, *N, 1, *parts, h, COMPULSORY); readArray(h_grp, "InternalEnergy", FLOAT, *N, 1, *parts, u, COMPULSORY); readArray(h_grp, "ParticleIDs", ULONGLONG, *N, 1, *parts, id, COMPULSORY); @@ -598,8 +598,8 @@ void write_output ( char* fileName, double dim[3], struct part *parts, int N, i /* Write arrays */ writeArray(h_grp, fileName, xmfFile, "Coordinates", DOUBLE, N, 3, parts, x); - writeArray(h_grp, fileName, xmfFile, "Velocity", FLOAT, N, 3, parts, v); - writeArray(h_grp, fileName, xmfFile, "Mass", FLOAT, N, 1, parts, mass); + writeArray(h_grp, fileName, xmfFile, "Velocities", FLOAT, N, 3, parts, v); + writeArray(h_grp, fileName, xmfFile, "Masses", FLOAT, N, 1, parts, mass); writeArray(h_grp, fileName, xmfFile, "SmoothingLength", FLOAT, N, 1, parts, h); writeArray(h_grp, fileName, xmfFile, "InternalEnergy", FLOAT, N, 1, parts, u); writeArray(h_grp, fileName, xmfFile, "ParticleIDs", ULONGLONG, N, 1, parts, id);