Skip to content

Make MaterialFilter support void material#3767

Open
GuySten wants to merge 4 commits intoopenmc-dev:developfrom
GuySten:void-material
Open

Make MaterialFilter support void material#3767
GuySten wants to merge 4 commits intoopenmc-dev:developfrom
GuySten:void-material

Conversation

@GuySten
Copy link
Contributor

@GuySten GuySten commented Feb 4, 2026

Description

Currently it is not possible to automatically tally void regions.
This PR extend MaterialFilter to support void material.

This is done to simplify generation of multigroup xs data for random ray (#3723).

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 15) on any C++ source files (if applicable)
  • I have followed the style guidelines for Python source files (if applicable)
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

@GuySten GuySten changed the title make MaterialFilter support void material Make MaterialFilter support void material Feb 4, 2026
Comment on lines +31 to +42
tally1 = openmc.Tally()
tally1.filters = [cell_filter]
tally1.scores = ['flux']

tally2 = openmc.Tally()
tally2.filters = [material_filter]
tally2.scores = ['flux']

model.tallies.append(tally1)
model.tallies.append(tally2)

return model
Copy link
Contributor

Choose a reason for hiding this comment

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

Very nice design here for testing void material tallies :)

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