From 2f9f500542fef29ddf5ec1b408e9fd1e10c37f03 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Mon, 27 Feb 2023 16:10:27 -0500 Subject: [PATCH] removed check and always offset origin --- openmc/mesh.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index 06f0246768..2c74c7bfad 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1337,10 +1337,9 @@ class CylindricalMesh(StructuredMesh): pts_cartesian[:, 1] = r * np.sin(phi) # offset with origin - if any([coord != 0 for coord in self.origin]): - pts_cartesian[:, 0] = pts_cartesian[:, 0] + self.origin[0] - pts_cartesian[:, 1] = pts_cartesian[:, 1] + self.origin[1] - pts_cartesian[:, 2] = pts_cartesian[:, 2] + self.origin[2] + pts_cartesian[:, 0] += pts_cartesian[:, 0] + pts_cartesian[:, 1] += pts_cartesian[:, 1] + pts_cartesian[:, 2] += pts_cartesian[:, 2] return super().write_data_to_vtk( points=pts_cartesian, @@ -1598,10 +1597,9 @@ class SphericalMesh(StructuredMesh): pts_cartesian[:, 2] = r * np.cos(phi) # offset with origin - if any([coord != 0 for coord in self.origin]): - pts_cartesian[:, 0] = pts_cartesian[:, 0] + self.origin[0] - pts_cartesian[:, 1] = pts_cartesian[:, 1] + self.origin[1] - pts_cartesian[:, 2] = pts_cartesian[:, 2] + self.origin[2] + pts_cartesian[:, 0] += self.origin[0] + pts_cartesian[:, 1] += self.origin[1] + pts_cartesian[:, 2] += self.origin[2] return super().write_data_to_vtk( points=pts_cartesian,