mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
fix wwinp reader
This commit is contained in:
parent
46045588f5
commit
9c13e85dc2
1 changed files with 7 additions and 4 deletions
|
|
@ -560,10 +560,13 @@ def wwinp_to_wws(path):
|
|||
end_idx = start_idx + (nfx * nfy * nfz) * nt_i * ne_i
|
||||
|
||||
# read values and reshape according to ordering
|
||||
# slowest to fastest: z, y, x, e
|
||||
ww_values = ww_data[start_idx:end_idx].reshape(nfz, nfy, nfx, ne_i)
|
||||
# swap z and x axes for correct shape and (ijk, e) mesh indexing
|
||||
ww_values = np.swapaxes(ww_values, 2, 0)
|
||||
# slowest to fastest: t, e, z, y, x
|
||||
# reorder with transpose since our ordering is x, y, z, e, t
|
||||
ww_shape = (nt_i, ne_i, nfz, nfy, nfx)
|
||||
ww_values = ww_data[start_idx:end_idx].reshape(ww_shape).T
|
||||
# Only use first time bin since we don't support time dependent weight
|
||||
# windows yet.
|
||||
ww_values = ww_values[:, :, :, :, 0]
|
||||
start_idx = end_idx
|
||||
|
||||
# create a weight window object
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue