mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-25 04:25:29 -04:00
Fix Resetting of Auto IDs When Generating MGXS (#3437)
This commit is contained in:
parent
f81962c960
commit
aeb1052c19
1 changed files with 1 additions and 4 deletions
|
|
@ -1552,7 +1552,6 @@ class Model:
|
|||
"if a material has a k-infinity > 1.0.")
|
||||
mgxs_sets = []
|
||||
for material in self.materials:
|
||||
openmc.reset_auto_ids()
|
||||
model = openmc.Model()
|
||||
|
||||
# Set materials on the model
|
||||
|
|
@ -1749,7 +1748,6 @@ class Model:
|
|||
directory : str
|
||||
Directory to run the simulation in, so as to contain XML files.
|
||||
"""
|
||||
openmc.reset_auto_ids()
|
||||
model = openmc.Model()
|
||||
model.materials = self.materials
|
||||
|
||||
|
|
@ -1861,7 +1859,6 @@ class Model:
|
|||
directory : PathLike
|
||||
Directory to run the simulation in, so as to contain XML files.
|
||||
"""
|
||||
openmc.reset_auto_ids()
|
||||
model = copy.deepcopy(self)
|
||||
model.tallies = openmc.Tallies()
|
||||
|
||||
|
|
@ -1973,7 +1970,7 @@ class Model:
|
|||
# Make sure all materials have a name, and that the name is a valid HDF5
|
||||
# dataset name
|
||||
for material in self.materials:
|
||||
if material.name is None:
|
||||
if not material.name or not material.name.strip():
|
||||
material.name = f"material {material.id}"
|
||||
material.name = re.sub(r'[^a-zA-Z0-9]', '_', material.name)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue