Create compatability with lattice cells

Previously, create_mg_mode assigned a new material to all cells in the geometry.
However, in certain cases, cells are filled with a lattice instead of a material.
Therefore, checking if a cell if filled with a material determines whether it is
appropriate to assign it a new multi group material or not.
This commit is contained in:
Miriam 2020-08-25 03:08:44 +00:00
parent 60c3a9dc4e
commit f76c58f62e

View file

@ -1402,12 +1402,12 @@ class Library:
if self.domain_type == 'material':
# Fill all appropriate Cells with new Material
for cell in all_cells:
if cell.fill.id == domain.id:
if isinstance(cell.fill, openmc.Material) and cell.fill.id == domain.id:
cell.fill = material
elif self.domain_type == 'cell':
for cell in all_cells:
if cell.id == domain.id:
if isinstance(cell.fill, openmc.Material) and cell.id == domain.id:
cell.fill = material
return mgxs_file, materials, geometry