added grid spacing and origin to hdf5 saveField method
This commit is contained in:
parent
a0643f951b
commit
abd7b0c4f5
|
|
@ -417,6 +417,11 @@ class ibmppp:
|
||||||
ioflag = 'a'
|
ioflag = 'a'
|
||||||
else:
|
else:
|
||||||
ioflag = 'w'
|
ioflag = 'w'
|
||||||
|
# get information about origin and grid spacing
|
||||||
|
delta = [self.__dx[key], self.__dx[key], self.__dx[key]]
|
||||||
|
origin = [self.grid[key][0][ib-1]-nghx*dx, \
|
||||||
|
self.grid[key][1][jb-1]-nghy*dx, \
|
||||||
|
self.grid[key][2][kb-1]-nghz*dx]
|
||||||
# Open the file and write data, then close it because we are done
|
# Open the file and write data, then close it because we are done
|
||||||
fid = h5py.File(file_chunk,ioflag)
|
fid = h5py.File(file_chunk,ioflag)
|
||||||
if not append:
|
if not append:
|
||||||
|
|
@ -427,6 +432,8 @@ class ibmppp:
|
||||||
fid.create_dataset('nxproc',data=self.__nxp)
|
fid.create_dataset('nxproc',data=self.__nxp)
|
||||||
fid.create_dataset('nyproc',data=self.__nyp)
|
fid.create_dataset('nyproc',data=self.__nyp)
|
||||||
fid.create_dataset('nzproc',data=self.__nzp)
|
fid.create_dataset('nzproc',data=self.__nzp)
|
||||||
|
fid.create_dataset('origin',data=origin)
|
||||||
|
fid.create_dataset('delta',data=delta)
|
||||||
gid = fid.create_group('/'+key)
|
gid = fid.create_group('/'+key)
|
||||||
gid.create_dataset('ib',data=self.__localChunkBounds[key][0])
|
gid.create_dataset('ib',data=self.__localChunkBounds[key][0])
|
||||||
gid.create_dataset('ie',data=self.__localChunkBounds[key][1])
|
gid.create_dataset('ie',data=self.__localChunkBounds[key][1])
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue