From eca7919127842788bf7ff090549b9dc5c4649fa5 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sat, 8 Jan 2022 15:19:33 -0600 Subject: [PATCH] Add WeightWindows to API docs --- docs/source/pythonapi/base.rst | 1 + openmc/settings.py | 2 +- openmc/weight_windows.py | 21 +++++++++++++++++++-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/docs/source/pythonapi/base.rst b/docs/source/pythonapi/base.rst index 2dea91bb0..ff849b92c 100644 --- a/docs/source/pythonapi/base.rst +++ b/docs/source/pythonapi/base.rst @@ -24,6 +24,7 @@ Simulation Settings openmc.Source openmc.SourceParticle openmc.VolumeCalculation + openmc.WeightWindows openmc.Settings The following function can be used for generating a source file: diff --git a/openmc/settings.py b/openmc/settings.py index 99671e552..44715f980 100644 --- a/openmc/settings.py +++ b/openmc/settings.py @@ -201,7 +201,7 @@ class Settings: described in :ref:`verbosity`. volume_calculations : VolumeCalculation or iterable of VolumeCalculation Stochastic volume calculation specifications - weight_windows : iterable of openmc.WeightWindows + weight_windows : WeightWindows iterable of WeightWindows Weight windows to use for variance reduction .. versionadded:: 0.13 diff --git a/openmc/weight_windows.py b/openmc/weight_windows.py index 36fc039c5..0a1090ec2 100644 --- a/openmc/weight_windows.py +++ b/openmc/weight_windows.py @@ -13,8 +13,20 @@ from .mixin import IDManagerMixin class WeightWindows(IDManagerMixin): - """ A class to handle the creation of a set of specific weight window - paramaters - a variance reduction class may have several of these + """Mesh-based weight windows + + This class enables you to specify weight window parameters that are used in + a simulation. Multiple sets of weight windows can be defined for different + meshes and different particles. An iterable of :class:`WeightWindows` + instances can be assigned to the :attr:`~openmc.Settings.weight_windows` + attribute, which is then exported to XML. + + Weight window lower/upper bounds are to be specified for each combination of + a mesh element and an energy bin. Thus the total number of bounds should be + equal to the product of the number of mesh bins and the number of energy + bins. + + .. versionadded:: 0.13 Parameters ---------- @@ -68,6 +80,11 @@ class WeightWindows(IDManagerMixin): Maximum allowable number of particles when splitting weight_cutoff : float Threshold below which particles will be terminated + + See Also + -------- + openmc.Settings + """ next_id = 1 used_ids = set()