diff --git a/openmc/mesh.py b/openmc/mesh.py index 215c9192336..5456abd1aed 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -211,6 +211,18 @@ def get_homogenized_materials( # Create homogenized material for each element materials = model.geometry.get_all_materials() + + # Account for materials in DAGMC universes + # TODO: This should really get incorporated in lower-level calls to + # get_all_materials, but right now it requires information from the + # Model object + for cell in model.geometry.get_all_cells().values(): + if isinstance(cell.fill, openmc.DAGMCUniverse): + names = cell.fill.material_names + materials.update({ + mat.id: mat for mat in model.materials if mat.name in names + }) + homogenized_materials = [] for mat_volume_list in mat_volume_by_element: material_ids, volumes = [list(x) for x in zip(*mat_volume_list)]