Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add material property to Volume class #2

Merged
merged 3 commits into from
Jan 17, 2024

Conversation

paulromano
Copy link
Contributor

This PR implements a new material property on the Volume class that gives users an easy way to change the material assigned to a volume without having to manually mess around with the associated groups.

Copy link
Member

@pshriwise pshriwise left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very small comments here. Thanks a ton for the contribution @paulromano!

dagmc/dagnav.py Outdated

if not existing_group:
# Create new group, add name/category tags, add entity
new_group = Group.create(self.model, name=f"mat:{name}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably provide a new Group ID here as well. They don't technically have an impact but it would make the new set complete.

dagmc/dagnav.py Outdated
@@ -238,13 +272,16 @@ def _get_triangle_sets(self):

class Group(DAGSet):

def __contains__(self, ent_set: DAGSet):
return any(vol.handle == ent_set.handle for vol in self.get_volumes().values())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this. Really slick. :)

It should probably account for groups that hold surfaces too though, which can be stored in groups representing boundary conditions.

pyproject.toml Show resolved Hide resolved
@pshriwise pshriwise merged commit edbafce into svalinn:main Jan 17, 2024
1 check passed
@paulromano paulromano deleted the volume-material branch January 18, 2024 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants