Skip to content

Commit

Permalink
adding add_volume_groups method
Browse files Browse the repository at this point in the history
  • Loading branch information
eepeterson committed Feb 9, 2024
1 parent 38aeb4a commit d3a8663
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions dagmc/dagnav.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,25 @@ def geom_dimension_tag(self):
create_if_missing=True,
)

def add_volume_groups(self, group_map):
"""Adds groups of volumes to the model.
Parameters
----------
group_map : dict
A dictionary mapping group names to a 2-tuple of (int, list) whose
first element is the group ID and the second element is a list of
volume IDs or Volume objects in the group.
"""
for group_name, (group_id, volumes) in group_map.items():
group = Group.create(self, name=group_name, group_id=group_id)

for volume in volumes:
if isinstance(volume, Volume):
group.add_set(volume)
else:
group.add_set(self.volumes[volume])


class DAGSet:
"""
Expand Down

0 comments on commit d3a8663

Please sign in to comment.