Skip to content

Commit

Permalink
Enforce lower_left in lattice geometry (openmc-dev#2982)
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Romano <[email protected]>
  • Loading branch information
2 people authored and church89 committed Jul 18, 2024
1 parent aca99ec commit a7f2182
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions openmc/lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit a7f2182

Please sign in to comment.