Merge pull request #2145 from paulromano/universe-plot-mg-fix

Check for macroscopic data in materials when running Universe.plot
This commit is contained in:
Patrick Shriwise 2022-08-06 11:32:01 -05:00 committed by GitHub
commit 3f06b97400
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -334,6 +334,13 @@ class Universe(UniverseBase):
if seed is not None:
model.settings.seed = seed
# Determine whether any materials contains macroscopic data and if
# so, set energy mode accordingly
for mat in self.get_all_materials().values():
if mat._macroscopic is not None:
model.settings.energy_mode = 'multi-group'
break
# Create plot object matching passed arguments
plot = openmc.Plot()
plot.origin = origin