F90_NONE Removal (MGMC tallying optimization) #2785
Merged
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 fixes a small issue in multigroup mode when tallying with an energy filter. The code in question is:
If we are in multigroup mode and the bins match the XS group structure, then we should be taking the first branch. However, as the groups use 0 based indexing (and
F90_NONE
is defined as 0) if the particle is at group 0 then it doesn't follow the intended path. Instead, it takes the more expensive continuous energy branch. Thankfully in MG mode the energy gets set to the average of the bin when the particle begins life and when it changes energy, so the correct bin is found, but it would be faster to always take the first path if possible.The fix is easy -- we can just change
F90_NONE
toC_NONE
(defined as -1), and ensure the particle gets initialized with this value, so that the first branch is always taken in MG mode when the bins match the group structure. This has the added bonus of checking off a "TODO" item from the code comments. As this was the only place thatF90_NONE
was still being used, we were able to delete it.Checklist