Skip to content

Commit

Permalink
add dagmc fill materials to homogenized materials method (#3026)
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Romano <[email protected]>
  • Loading branch information
church89 and paulromano committed Jun 18, 2024
1 parent 97537d5 commit b0732cb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions openmc/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit b0732cb

Please sign in to comment.