From f76c58f62ef638dfbc24016f628747d267147fba Mon Sep 17 00:00:00 2001 From: Miriam Date: Tue, 25 Aug 2020 03:08:44 +0000 Subject: [PATCH] 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. --- openmc/mgxs/library.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmc/mgxs/library.py b/openmc/mgxs/library.py index e1c44c3527..99da0af55e 100644 --- a/openmc/mgxs/library.py +++ b/openmc/mgxs/library.py @@ -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