From 53edae4c7e8824b4a3a5dbd03f48a01b9dbeb08b Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Thu, 3 Sep 2015 07:31:33 -0700 Subject: [PATCH] Updated openmc-plot-mesh-tally to include if-else for 2D vs. 3D meshes --- scripts/openmc-plot-mesh-tally | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/openmc-plot-mesh-tally b/scripts/openmc-plot-mesh-tally index d9bca6377c..f925b413a3 100755 --- a/scripts/openmc-plot-mesh-tally +++ b/scripts/openmc-plot-mesh-tally @@ -133,7 +133,11 @@ class MeshPlotter(tk.Frame): self.mesh = selectedTally.filters_by_name['mesh'].mesh # Get mesh dimensions - self.nx, self.ny, self.nz = self.mesh.dimension + if len(self.mesh.dimension) == 2: + self.nx, self.ny = self.mesh.dimension + self.nz = 1 + else: + self.nx, self.ny, self.nz = self.mesh.dimension # Repopulate comboboxes baesd on current basis selection text = self.basisBox.get()