mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Python API now clears xml element trees before exporting to xml
This commit is contained in:
parent
19d821106c
commit
c2a29a607d
6 changed files with 219 additions and 167 deletions
File diff suppressed because one or more lines are too long
|
|
@ -208,6 +208,9 @@ class GeometryFile(object):
|
|||
# Clear OpenMC written IDs used to optimize XML generation
|
||||
openmc.universe.WRITTEN_IDS = {}
|
||||
|
||||
# Reset xml element tree
|
||||
self._geometry_file.clear()
|
||||
|
||||
root_universe = self.geometry.root_universe
|
||||
root_universe.create_xml_subelement(self._geometry_file)
|
||||
|
||||
|
|
|
|||
|
|
@ -581,6 +581,9 @@ class MaterialsFile(object):
|
|||
|
||||
"""
|
||||
|
||||
# Reset xml element tree
|
||||
self._materials_file.clear()
|
||||
|
||||
self._create_material_subelements()
|
||||
|
||||
# Clean the indentation in the file to be user-readable
|
||||
|
|
|
|||
|
|
@ -363,6 +363,9 @@ class PlotsFile(object):
|
|||
|
||||
"""
|
||||
|
||||
# Reset xml element tree
|
||||
self._plots_file.clear()
|
||||
|
||||
self._create_plot_subelements()
|
||||
|
||||
# Clean the indentation in the file to be user-readable
|
||||
|
|
|
|||
|
|
@ -1178,6 +1178,14 @@ class SettingsFile(object):
|
|||
|
||||
"""
|
||||
|
||||
# Reset xml element tree
|
||||
self._settings_file.clear()
|
||||
self._source_subelement = None
|
||||
self._trigger_subelement = None
|
||||
self._eigenvalue_subelement = None
|
||||
self._source_element = None
|
||||
|
||||
|
||||
self._create_eigenvalue_subelement()
|
||||
self._create_source_subelement()
|
||||
self._create_output_subelement()
|
||||
|
|
|
|||
|
|
@ -2715,6 +2715,9 @@ class TalliesFile(object):
|
|||
|
||||
"""
|
||||
|
||||
# Reset xml element tree
|
||||
self._tallies_file.clear()
|
||||
|
||||
self._create_mesh_subelements()
|
||||
self._create_tally_subelements()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue