diff --git a/openmc/mesh.py b/openmc/mesh.py index 79ab7fd5a..3936572f9 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1322,7 +1322,7 @@ class CylindricalMesh(StructuredMesh): pts_cartesian[:, 1] = r * np.sin(phi) # offset with origin - if self.origin != [0.0, 0.0, 0.0]: + if any(self.origin != (0.0, 0.0, 0.0)): 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] @@ -1375,7 +1375,7 @@ class SphericalMesh(StructuredMesh): self._r_grid = None self._theta_grid = [0, pi] self._phi_grid = [0, 2*pi] - self._origin = [0., 0., 0.] + self._origin = (0., 0., 0.) @property def dimension(self): @@ -1577,7 +1577,7 @@ class SphericalMesh(StructuredMesh): pts_cartesian[:, 2] = r * np.cos(phi) # offset with origin - if self.origin != [0.0, 0.0, 0.0]: + if any(self.origin != (0.0, 0.0, 0.0)): 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] diff --git a/src/mesh.cpp b/src/mesh.cpp index 3849f4d03..82644db08 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -1213,9 +1213,7 @@ StructuredMesh::MeshIndex SphericalMesh::get_indices( mapped_r[0] = r.norm(); - mapped_r[0] += origin_[0]; - mapped_r[1] += origin_[1]; - mapped_r[2] += origin_[2]; + mapped_r -= origin_; if (mapped_r[0] < FP_PRECISION) { mapped_r[1] = 0.0; diff --git a/tests/unit_tests/test_deplete_activation.py b/tests/unit_tests/test_deplete_activation.py index 2dc911c86..64167c8af 100644 --- a/tests/unit_tests/test_deplete_activation.py +++ b/tests/unit_tests/test_deplete_activation.py @@ -53,7 +53,6 @@ def test_activation(run_in_tmpdir, model, reaction_rate_mode, reaction_rate_opts # Determine (n.gamma) reaction rate using initial run sp = model.run() with openmc.StatePoint(sp) as sp: - print(sp.tallies) tally = sp.get_tally(name='activation tally') capture_rate = tally.mean.flat[0]