Skip to content

Add truncated normal distribution support#3761

Open
paulromano wants to merge 6 commits intoopenmc-dev:developfrom
paulromano:truncated-normal
Open

Add truncated normal distribution support#3761
paulromano wants to merge 6 commits intoopenmc-dev:developfrom
paulromano:truncated-normal

Conversation

@paulromano
Copy link
Contributor

Description

This PR extends the Normal distribution class to support optional truncation bounds. Normal distributions are sometimes used for source sampling, but their infinite support makes them problematic for biased sampling. OpenMC currently does not let you use a normal distribution as a bias for another distribution with finite support because of the mismatched domains. Truncation allows the normal distribution to be restricted to match the support of the target distribution. A truncated normal is simply specified by passing one or both of the lower and upper arguments. Without these arguments, the untruncated behavior is preserved.

Thanks to @akoen for inspiration!

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)

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.

1 participant