Adding reset before exporting a geometry.

This commit is contained in:
Patrick Shriwise 2019-01-31 10:30:38 -06:00
parent 4cccdbece4
commit e12f7c9041
2 changed files with 11 additions and 0 deletions

View file

@ -10,6 +10,7 @@ import openmc
import openmc._xml as xml
from openmc.checkvalue import check_type
from .geomtrack import ElementTracker
class Geometry(object):
"""Geometry representing a collection of surfaces, cells, and universes.
@ -87,6 +88,10 @@ class Geometry(object):
"""
# Create XML representation
et = ElementTracker()
et.reset()
root_element = ET.Element("geometry")
self.root_universe.create_xml_subelement(root_element)

View file

@ -29,6 +29,12 @@ class ElementTracker:
def add_universe(self, universe_id):
self.update("universe", universe_id)
def reset(self):
self.cells = set()
self.surfaces = set()
self.lattices = set()
self.universes = set()
instance = None
def __init__(self):