Skip to content

Conversation

@GuySten
Copy link
Contributor

@GuySten GuySten commented Aug 22, 2025

Description

This PR simplifiy event advance by using particle.move_distance.

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 requested review from paulromano and pshriwise and removed request for pshriwise August 22, 2025 04:28
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.

Thanks for another improvement @GuySten! Just one tiny question.

std::min({boundary().distance(), collision_distance(), distance_cutoff});

// Advance particle in space and time
// Short-term solution until the surface source is revised and we can use
Copy link
Contributor

Choose a reason for hiding this comment

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

To close the loop here, do we know if there is an issue or PR related to this comment we can cite in this PR that resolved the surface source problem?

Copy link
Contributor Author

@GuySten GuySten Aug 22, 2025

Choose a reason for hiding this comment

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

This comment was added in #2631. You can read the discussion there but it was not clear to me what the problem was or why now it's working.

Copy link
Contributor

Choose a reason for hiding this comment

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

Me either, but the behavior should be equivalent so I won't let it hold up this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe the intent was to include time updates inside move_distance. @cfichtlscherer, can you provide some extra info here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, can't remember why we had it in a loop, but looks good for me.

Copy link
Contributor

Choose a reason for hiding this comment

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

There was a surface source test that was failing when the change to use move_distance was made. It was unclear at the time why -- probably some weirdness with how the compiler was optimizing code resulting in slightly different numeric results. Whatever the reason was, there have evidently been enough changes (compilers, tests, implementation, underlying libraries) that it is no longer affected as evidenced by the tests on this PR passing.

Here was my original comment about it:
#2454 (comment)

@pshriwise pshriwise merged commit d1df80a into openmc-dev:develop Aug 22, 2025
15 checks passed
@GuySten GuySten deleted the move_distance branch August 24, 2025 05:19
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.

4 participants