From c61e735a706b3bd251010ec8fa888cda30ebb596 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Mon, 27 Feb 2023 16:10:55 -0500 Subject: [PATCH] empty_like instead of copy --- openmc/mesh.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index 2c74c7bfa..9bed9200c 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1331,7 +1331,7 @@ class CylindricalMesh(StructuredMesh): for r in self.r_grid ] ) - pts_cartesian = np.copy(pts_cylindrical) + 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) @@ -1590,7 +1590,7 @@ class SphericalMesh(StructuredMesh): for r in self.r_grid ] ) - pts_cartesian = np.copy(pts_spherical) + pts_cartesian = np.empty_like(pts_spherical) r, theta, phi = pts_spherical[:, 0], pts_spherical[:, 1], pts_spherical[:, 2] pts_cartesian[:, 0] = r * np.sin(phi) * np.cos(theta) pts_cartesian[:, 1] = r * np.sin(phi) * np.sin(theta)