openmc
openmc copied to clipboard
Add PointCloud spatial distribution
Description
Allows users to define a list of points in space, each with a different relative intensity, to be sampled discretely. This is a valid SpatialDistribution and can be used anywhere that a SpatialDistribution is valid.
Fixes #3159
Checklist
- [x] I have performed a self-review of my own code
- [x] I have run clang-format (version 15) on any C++ source files (if applicable)
- [x] I have followed the style guidelines for Python source files (if applicable)
- [x] I have made corresponding changes to the documentation (if applicable)
- [x] I have added tests that prove my fix is effective or that my feature works (if applicable)
We have a user who has an existing approximation of a volumetric source by a high density list of isotropic point sources. They want to use that source for comparison to other simulations.
While it may have been elegant to add an istream operator for Position the version I added did not round-trip with the existing ostream operator and it is more convenient in XML to not use the verbose ostream format.
Thus, I've relied on just reading a list of doubles and packing them into Position in the reader.
Pinging @paulromano to see if this can move forward?
All looks good to me - thanks @paulromano