mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Update openmc/mesh.py
Co-authored-by: Ethan Peterson <ethan.peterson@mit.edu>
This commit is contained in:
parent
972e1c12ec
commit
308be3f1ea
1 changed files with 4 additions and 8 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue