Implement angular PDF evaluation for angle-energy distributions#3550
Merged
GuySten merged 113 commits intoopenmc-dev:developfrom Mar 14, 2026
Merged
Implement angular PDF evaluation for angle-energy distributions#3550GuySten merged 113 commits intoopenmc-dev:developfrom
GuySten merged 113 commits intoopenmc-dev:developfrom
Conversation
GuySten
requested changes
Aug 27, 2025
Contributor
There was a problem hiding this comment.
Nice work @itay-space!
My review focus more on the code structure side of things.
I did not check the maths.
Co-authored-by: GuySten <62616591+GuySten@users.noreply.github.com>
Co-authored-by: GuySten <62616591+GuySten@users.noreply.github.com>
Co-authored-by: GuySten <62616591+GuySten@users.noreply.github.com>
Co-authored-by: GuySten <62616591+GuySten@users.noreply.github.com>
Co-authored-by: GuySten <62616591+GuySten@users.noreply.github.com>
Co-authored-by: GuySten <62616591+GuySten@users.noreply.github.com>
GuySten
reviewed
Aug 28, 2025
GuySten
requested changes
Aug 31, 2025
Co-authored-by: GuySten <62616591+GuySten@users.noreply.github.com>
GuySten
requested changes
Sep 1, 2025
GuySten
reviewed
Sep 1, 2025
Co-authored-by: GuySten <62616591+GuySten@users.noreply.github.com>
Removed unnecessary break statement in probability sampling logic.
Contributor
|
I've removed all dynamic allocations. @paulromano, this PR is ready for review again. |
Reconstructing the azimuth with acos(u.dot(v_ref_) / sqrt(1 - mu*mu)) loses the sign of the w_ref_ component, so directions at azimuth phi and 2π - phi collapse to the same value.
CoherentElasticAE::sample_energy_and_pdf returns zero whenever E_in > bragg_edges_.back(), but coherent elastic scattering is still valid above the highest Bragg edge; CoherentElasticXS::operator() continues to use the final cumulative structure factor there. Additionally, the call to bragg_edges_.slice(0, n) / factors_diff_.slice(0, n) is not valid for a 1-D Tensor. In the tensor API, slice(0, n) means two axis indices, not a range.
Contributor
|
@GuySten Thanks for the updates on this branch -- it was definitely looking much better. There were still a few issues that I found and fixed:
Let me know if you agree with the changes and if so, I think this is ready to merge! |
paulromano
approved these changes
Mar 13, 2026
Contributor
|
I agree with these changes. |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR is the first step in breaking down the point detector tally project into smaller, reviewable pieces, following the large PR #3109
and the paper Development and benchmarking of a point detector in OpenMC.
As suggested during the earlier discussion (thanks @GuySten, @gridley, @shimwell !), the natural starting point is to add the ability to correctly calculate PDFs on the C++ side.
Accordingly, this PR introduces the get_pdf implementations for the distribution classes. This is essentially a clean cut from the original large PR, with the goal of keeping the scope focused and review manageable.
We plan to follow up with tests and additional pieces of the point detector work in subsequent PRs.
Checklist