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

Fix triggers #2344

Merged
merged 2 commits into from
Jan 10, 2023
Merged

Fix triggers #2344

merged 2 commits into from
Jan 10, 2023

Conversation

pshriwise
Copy link
Contributor

@pshriwise pshriwise commented Jan 5, 2023

This PR resolves #2342 and #2343.

For #2342, The loop over tally scores in check_tally_trigger has been removed -- only the score index on the trigger is checked. A test was added ensuring that the addition of unrelated scores on a tally doesn't influence the number of batches needed to satisfy a tally trigger.

For #2343, the get_tally_uncertainty function returns an invalid result for a tally value if the mean is zero. This invalid result prompts the check_tally_trigger function to set the outgoing uncertainty-to-trigger threshold ratio value to infinity and exit early (no other tally result will produce a larger ratio, so we can do this safely). A ratio of infinity is used to trigger a different output to the console to indicate that the reason the trigger is unsatisfied is there was no contribution for the specified score.

Update: Adding a link to a CI run on my fork that contains only the first commit from this PR that adds the tests https://github.com/pshriwise/openmc/actions/runs/3850717720/jobs/6561182511

@pshriwise pshriwise requested a review from aprilnovak January 6, 2023 00:05
@aprilnovak
Copy link
Contributor

This fixes the issue I was seeing - thanks for this really thorough fix!

@aprilnovak aprilnovak merged commit ee0fcd3 into openmc-dev:develop Jan 10, 2023
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.

Tally triggers evaluated with incorrect score
2 participants