mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Relax requirement on polar/azimuthal axis for wwinp conversion (#3307)
This commit is contained in:
parent
d96e6860e6
commit
06a88526cf
3 changed files with 15 additions and 5 deletions
|
|
@ -513,9 +513,19 @@ def wwinp_to_wws(path: PathLike) -> list[WeightWindows]:
|
|||
line_arr = np.fromstring(wwinp.readline(), sep=' ')
|
||||
xyz2 = line_arr[:3]
|
||||
|
||||
# oriented polar and azimuthal vectors aren't yet supported
|
||||
if np.count_nonzero(xyz1) or np.count_nonzero(xyz2):
|
||||
raise NotImplementedError('Custom sphere/cylinder orientations are not supported')
|
||||
# Get polar and azimuthal axes
|
||||
polar_axis = xyz1 - xyz0
|
||||
azimuthal_axis = xyz2 - xyz0
|
||||
|
||||
# Check for polar axis other than (0, 0, 1)
|
||||
norm = np.linalg.norm(polar_axis)
|
||||
if not np.isclose(polar_axis[2]/norm, 1.0):
|
||||
raise NotImplementedError('Polar axis not aligned to z-axis not supported')
|
||||
|
||||
# Check for azimuthal axis other than (1, 0, 0)
|
||||
norm = np.linalg.norm(azimuthal_axis)
|
||||
if not np.isclose(azimuthal_axis[0]/norm, 1.0):
|
||||
raise NotImplementedError('Azimuthal axis not aligned to x-axis not supported')
|
||||
|
||||
# read geometry type
|
||||
nwg = int(line_arr[-1])
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
1
|
||||
8.0000 7.0000 8.0000 0.0000 0.0000 -9.0001
|
||||
2.0000 2.0000 4.0000 0.0000 0.0000 0.0000
|
||||
0.0000 0.0000 0.0000 2.0000
|
||||
1.0000 0.0000 -9.0001 2.0000
|
||||
0.0000 3.0000 3.0200 1.0000 5.0000 6.0001
|
||||
1.0000
|
||||
0.0000 4.0000 8.0080 1.0000 3.0000 14.002
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
1
|
||||
8.0000 7.0000 8.0000 0.0000 0.0000 -9.0001
|
||||
2.0000 4.0000 4.0000 0.0000 0.0000 0.0000
|
||||
0.0000 0.0000 0.0000 3.0000
|
||||
1.0000 0.0000 -9.0001 3.0000
|
||||
0.0000 3.0000 3.0200 1.0000 5.0000 6.0001
|
||||
1.0000
|
||||
0.0000 2.0000 0.25000 1.0000 1.0000 0.50000
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue