From 94ef0c40abe6f4a208aaaccad36c17ff486dd9b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Delaporte-Mathurin?= <40028739+RemDelaporteMathurin@users.noreply.github.com> Date: Wed, 29 Jun 2022 18:47:24 +0200 Subject: [PATCH] [skip ci] refactore upperright and lowerleft Co-authored-by: Paul Romano --- openmc/mesh.py | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index 73a49bfc19..7155b0ba04 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -714,21 +714,10 @@ class RegularMesh(StructuredMesh): the VTK object """ - x_vals = np.linspace( - self.lower_left[0], - self.upper_right[0], - num=self.dimension[0] + 1, - ) - y_vals = np.linspace( - self.lower_left[1], - self.upper_right[1], - num=self.dimension[1] + 1, - ) - z_vals = np.linspace( - self.lower_left[2], - self.upper_right[2], - num=self.dimension[2] + 1, - ) + ll, ur = self.lower_left, self.upper_right + x_vals = np.linspace(ll[0], ur[0], num=self.dimension[0] + 1) + y_vals = np.linspace(ll[1], ur[1], num=self.dimension[1] + 1) + z_vals = np.linspace(ll[2], ur[2], num=self.dimension[2] + 1) # create points pts_cartesian = np.array([[x, y, z] for z in z_vals for y in y_vals for x in x_vals])