Thanks @paulromano
With my statepoint.400.h5 file, when I try to run
with openmc.lib.run_in_memory():
for row, y in enumerate(np.linspace(ymin, ymax, resolution[0])):
for col, x in enumerate(np.linspace(xmin, xmax, resolution[1])):
try:
# For each (x, y, z) point, determine the cell and distribcell index
cell, distribcell_index = openmc.lib.find_cell((x, y, 0.))
except openmc.exceptions.GeometryError:
# If a point appears outside the geometry, you'll get a GeometryError exception.
# These lines catch the exception and continue on
continue
if cell.id == fuel_cell_f.id:
# When the cell ID matches, we set the corresponding pixel in the image using the
# distribcell index. Note that we're taking advantage of the fact that the i-th element
# in the flux array corresponds to the i-th distribcell instance.
img[row, col] = flux[distribcell_index]
code, I got
The kernel appears to have died. It will restart automatically.
Now start from the beginning and import statepoint file gives
sp = openmc.StatePoint('statepoint.400.h5')
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-2-820df5b6e8f5> in <module>
----> 1 sp = openmc.StatePoint('statepoint.400.h5')
~/anaconda3/envs/openmc-dev/lib/python3.9/site-packages/openmc/statepoint.py in __init__(self, filepath, autolink)
141 path_summary = os.path.join(os.path.dirname(filename), 'summary.h5')
142 if os.path.exists(path_summary):
--> 143 su = openmc.Summary(path_summary)
144 self.link_with_summary(su)
145
~/anaconda3/envs/openmc-dev/lib/python3.9/site-packages/openmc/summary.py in __init__(self, filename)
38 raise ValueError(msg)
39
---> 40 self._f = h5py.File(filename, 'r')
41 cv.check_filetype_version(self._f, 'summary', _VERSION_SUMMARY)
42
~/anaconda3/envs/openmc-dev/lib/python3.9/site-packages/h5py/_hl/files.py in __init__(self, name, mode, driver, libver, userblock_size, swmr, rdcc_nslots, rdcc_nbytes, rdcc_w0, track_order, fs_strategy, fs_persist, fs_threshold, **kwds)
422 with phil:
423 fapl = make_fapl(driver, libver, rdcc_nslots, rdcc_nbytes, rdcc_w0, **kwds)
--> 424 fid = make_fid(name, mode, userblock_size,
425 fapl, fcpl=make_fcpl(track_order=track_order, fs_strategy=fs_strategy,
426 fs_persist=fs_persist, fs_threshold=fs_threshold),
~/anaconda3/envs/openmc-dev/lib/python3.9/site-packages/h5py/_hl/files.py in make_fid(name, mode, userblock_size, fapl, fcpl, swmr)
188 if swmr and swmr_support:
189 flags |= h5f.ACC_SWMR_READ
--> 190 fid = h5f.open(name, flags, fapl=fapl)
191 elif mode == 'r+':
192 fid = h5f.open(name, h5f.ACC_RDWR, fapl=fapl)
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
h5py/h5f.pyx in h5py.h5f.open()
OSError: Unable to open file (file signature not found)
I have already tried a number of times but the same error comes again and again. How do I solve this problem?