Skip to content

Account for proton PDG number in ParticleType::is_nucleus - #4056

Merged
nuclearkevin merged 2 commits into
openmc-dev:developfrom
paulromano:pdg-proton-fix
Aug 7, 2026
Merged

Account for proton PDG number in ParticleType::is_nucleus#4056
nuclearkevin merged 2 commits into
openmc-dev:developfrom
paulromano:pdg-proton-fix

Conversation

@paulromano

Copy link
Copy Markdown
Contributor

Description

The ParticleType::is_nucleus method currently only checks for PDG numbers >= 1000000000, which misses out on H1 because a proton has the dedicated PDG number 2212. This PR fixes that.

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 18) 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)

@nuclearkevin nuclearkevin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@nuclearkevin
nuclearkevin merged commit 70930c4 into openmc-dev:develop Aug 7, 2026
17 checks passed
@paulromano
paulromano deleted the pdg-proton-fix branch August 7, 2026 22:21
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