From 10e34b094c399d04ef8e7124454d3eea66951548 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Thu, 29 Apr 2021 10:07:35 -0500 Subject: [PATCH] Adding dimenson parameter to the RectilinearMesh class. --- openmc/mesh.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openmc/mesh.py b/openmc/mesh.py index 459b48a694..16e25cddc4 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -471,6 +471,8 @@ class RectilinearMesh(MeshBase): Unique identifier for the mesh name : str Name of the mesh + dimension : Iterable of int + The number of mesh cells in each direction. n_dimension : int Number of mesh dimensions (always 3 for a RectilinearMesh). x_grid : Iterable of float @@ -492,6 +494,12 @@ class RectilinearMesh(MeshBase): self._y_grid = None self._z_grid = None + @property + def dimension(self): + return (len(self.x_grid) - 1, + len(self.y_grid) - 1, + len(self.z_grid) - 1) + @property def n_dimension(self): return 3