Handle unbounded universe

This commit is contained in:
Paul Romano 2017-03-09 15:48:23 -06:00
parent 9dec183b53
commit f805fddb6b

View file

@ -113,8 +113,13 @@ class Universe(object):
@property
def bounding_box(self):
regions = [c.region for c in self.cells.values()]
return openmc.Union(*regions).bounding_box
regions = [c.region for c in self.cells.values()
if c.region is not None]
if regions:
return openmc.Union(*regions).bounding_box
else:
# Infinite bounding box
return openmc.Intersection().bounding_box
@id.setter
def id(self, universe_id):