openmc-dev / openmc

OpenMC Monte Carlo Code
https://docs.openmc.org
Other
772 stars 500 forks source link

MeshSpatial sampling improvements #2406

Open gonuke opened 1 year ago

gonuke commented 1 year ago

The new MeshSpatial capability reimplements discrete sampling using a builtin lookup method on the CDF, forming its own CDF. This is a great place to use the new alias sampling capability within this class for better efficiency and to avoid round-off error issues in forming the CDF.

gonuke commented 1 year ago

The Discrete distribution can only return doubles. It may be necessary to template this on the independent variable.