From a7f2182b4ecee666245bb49f559c12ab503bae5a Mon Sep 17 00:00:00 2001 From: kmeag <143649668+kmeag@users.noreply.github.com> Date: Mon, 10 Jun 2024 15:54:59 -0400 Subject: [PATCH] Enforce lower_left in lattice geometry (#2982) Co-authored-by: Paul Romano --- openmc/lattice.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openmc/lattice.py b/openmc/lattice.py index f7f9da8ea8e..51806856051 100644 --- a/openmc/lattice.py +++ b/openmc/lattice.py @@ -884,6 +884,10 @@ def create_xml_subelement(self, xml_element, memo=None): dimension = ET.SubElement(lattice_subelement, "dimension") dimension.text = ' '.join(map(str, self.shape)) + # Make sure lower_left has been specified + if self.lower_left is None: + raise ValueError(f"Lattice {self.id} does not have lower_left specified.") + # Export Lattice lower left lower_left = ET.SubElement(lattice_subelement, "lower_left") lower_left.text = ' '.join(map(str, self._lower_left))