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

Filter material from #2750

Merged
merged 13 commits into from
Nov 9, 2023
Merged

Conversation

bam241
Copy link
Contributor

@bam241 bam241 commented Oct 27, 2023

Description

This aims to implement MaterialFromFilter as described in #2719

I inspired myself from CellFromFilter. I as particule only stores history of cell they travelled through and not materials, I used visited cells to list materials seen previously any the materials.

The only cons is that distribcell might contains multiple materials so this detection would be wrong. As particule might have travelled through a distribcell but not seen the requested materials.

in Cell.h line 290-293

  //! \brief Material(s) within this cell.
  //!
  //! May be multiple materials for distribcell.
  vector<int32_t> material_;

If you have any recommandation on how to implement this better, I will be happy to comply. If there is none, I can throw an Error or a Warning, stating that some cell contains multiple material so it is not possible to accurately filter by MaterialFrom.

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)

This work is sponsored by First Light Fusion.

@bam241 bam241 marked this pull request as ready for review November 3, 2023 16:31
@bam241 bam241 requested a review from paulromano as a code owner November 3, 2023 16:31
Copy link
Contributor

@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.

Nice addition @bam241! Just a few small questions/comments from me.

include/openmc/particle_data.h Outdated Show resolved Hide resolved
include/openmc/tallies/filter_material.h Show resolved Hide resolved
tests/regression_tests/surface_tally/test.py Show resolved Hide resolved
Copy link
Contributor

@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.

This looks good to me. Thanks @bam241 for the new filter!

Copy link
Contributor

@paulromano paulromano left a comment

Choose a reason for hiding this comment

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

Nice work on this @bam241. Thanks for the addition!

@paulromano paulromano enabled auto-merge (squash) November 9, 2023 13:12
@paulromano paulromano merged commit a3695c7 into openmc-dev:develop Nov 9, 2023
church89 pushed a commit to openmsr/openmc that referenced this pull request Jul 18, 2024
Co-authored-by: Patrick Shriwise <[email protected]>
Co-authored-by: Paul Romano <[email protected]>
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.

3 participants