Update openmc/mesh.py

Co-authored-by: Ethan Peterson <ethan.peterson@mit.edu>
This commit is contained in:
Rémi Delaporte-Mathurin 2023-02-27 16:23:45 -05:00 committed by GitHub
parent 972e1c12ec
commit 308be3f1ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1334,14 +1334,10 @@ class CylindricalMesh(StructuredMesh):
)
pts_cartesian = np.empty_like(pts_cylindrical)
r, phi = pts_cylindrical[:, 0], pts_cylindrical[:, 1]
pts_cartesian[:, 0] = r * np.cos(phi)
pts_cartesian[:, 1] = r * np.sin(phi)
# offset with origin
pts_cartesian[:, 0] += pts_cartesian[:, 0]
pts_cartesian[:, 1] += pts_cartesian[:, 1]
pts_cartesian[:, 2] += pts_cartesian[:, 2]
pts_cartesian[:, 0] = r * np.cos(phi) + self.origin[0]
pts_cartesian[:, 1] = r * np.sin(phi) + self.origin[1]
pts_cartesian[:, 2] += self.origin[2]
return super().write_data_to_vtk(
points=pts_cartesian,
filename=filename,