diff --git a/docs/source/pythonapi/base.rst b/docs/source/pythonapi/base.rst
index d0e7d2439..2a9d0876c 100644
--- a/docs/source/pythonapi/base.rst
+++ b/docs/source/pythonapi/base.rst
@@ -37,7 +37,6 @@ Simulation Settings
openmc.read_source_file
openmc.write_source_file
- openmc.wwinp_to_wws
Material Specification
----------------------
@@ -259,8 +258,16 @@ Variance Reduction
:template: myclass
openmc.WeightWindows
+ openmc.WeightWindowsList
openmc.WeightWindowGenerator
+
+.. autosummary::
+ :toctree: generated
+ :nosignatures:
+ :template: myfunction.rst
+
openmc.hdf5_to_wws
+ openmc.wwinp_to_wws
Coarse Mesh Finite Difference Acceleration
diff --git a/docs/source/usersguide/variance_reduction.rst b/docs/source/usersguide/variance_reduction.rst
index 3256fa35f..369e33e2d 100644
--- a/docs/source/usersguide/variance_reduction.rst
+++ b/docs/source/usersguide/variance_reduction.rst
@@ -162,7 +162,7 @@ solver, the Python input just needs to load the h5 file::
settings.weight_window_checkpoints = {'collision': True, 'surface': True}
settings.survival_biasing = False
- settings.weight_windows = openmc.hdf5_to_wws('weight_windows.h5')
+ settings.weight_windows = openmc.WeightWindowsList.from_hdf5('weight_windows.h5')
settings.weight_windows_on = True
The :class:`~openmc.WeightWindowGenerator` instance is not needed to load an
diff --git a/openmc/settings.py b/openmc/settings.py
index bd3a89e11..36eaec6cb 100644
--- a/openmc/settings.py
+++ b/openmc/settings.py
@@ -16,7 +16,7 @@ from .mesh import _read_meshes, RegularMesh, MeshBase
from .source import SourceBase, MeshSource, IndependentSource
from .utility_funcs import input_path
from .volume import VolumeCalculation
-from .weight_windows import WeightWindows, WeightWindowGenerator
+from .weight_windows import WeightWindows, WeightWindowGenerator, WeightWindowsList
class RunMode(Enum):
@@ -313,7 +313,7 @@ class Settings:
described in :ref:`verbosity`.
volume_calculations : VolumeCalculation or iterable of VolumeCalculation
Stochastic volume calculation specifications
- weight_windows : WeightWindows or iterable of WeightWindows
+ weight_windows : WeightWindowsList
Weight windows to use for variance reduction
.. versionadded:: 0.13
@@ -424,7 +424,7 @@ class Settings:
self._max_particles_in_flight = None
self._max_particle_events = None
self._write_initial_source = None
- self._weight_windows = cv.CheckedList(WeightWindows, 'weight windows')
+ self._weight_windows = WeightWindowsList()
self._weight_window_generators = cv.CheckedList(WeightWindowGenerator, 'weight window generators')
self._weight_windows_on = None
self._weight_windows_file = None
@@ -1095,14 +1095,14 @@ class Settings:
self._write_initial_source = value
@property
- def weight_windows(self) -> list[WeightWindows]:
+ def weight_windows(self) -> WeightWindowsList:
return self._weight_windows
@weight_windows.setter
- def weight_windows(self, value: WeightWindows | Iterable[WeightWindows]):
- if not isinstance(value, MutableSequence):
+ def weight_windows(self, value: WeightWindows | Sequence[WeightWindows]):
+ if not isinstance(value, Sequence):
value = [value]
- self._weight_windows = cv.CheckedList(WeightWindows, 'weight windows', value)
+ self._weight_windows = WeightWindowsList(value)
@property
def weight_windows_on(self) -> bool:
diff --git a/openmc/weight_windows.py b/openmc/weight_windows.py
index d52b81925..1b44747d5 100644
--- a/openmc/weight_windows.py
+++ b/openmc/weight_windows.py
@@ -1,6 +1,8 @@
from __future__ import annotations
from numbers import Real, Integral
from collections.abc import Iterable, Sequence
+from pathlib import Path
+from typing import Self
import warnings
import lxml.etree as ET
@@ -14,6 +16,7 @@ import openmc.checkvalue as cv
from openmc.checkvalue import PathLike
from ._xml import get_text, clean_indentation
from .mixin import IDManagerMixin
+from .utility_funcs import change_directory
class WeightWindows(IDManagerMixin):
@@ -90,7 +93,7 @@ class WeightWindows(IDManagerMixin):
survival_ratio : float
Ratio of the survival weight to the lower weight window bound for
rouletting
- max_lower_bound_ratio: float
+ max_lower_bound_ratio : float
Maximum allowed ratio of a particle's weight to the weight window's
lower bound. (Default: 1.0)
max_split : int
@@ -114,7 +117,7 @@ class WeightWindows(IDManagerMixin):
upper_bound_ratio: float | None = None,
energy_bounds: Iterable[Real] | None = None,
particle_type: str = 'neutron',
- survival_ratio: float = 3,
+ survival_ratio: float = 3.0,
max_lower_bound_ratio: float | None = None,
max_split: int = 10,
weight_cutoff: float = 1.e-38,
@@ -354,7 +357,7 @@ class WeightWindows(IDManagerMixin):
return element
@classmethod
- def from_xml_element(cls, elem: ET.Element, meshes: dict[int, MeshBase]) -> WeightWindows:
+ def from_xml_element(cls, elem: ET.Element, meshes: dict[int, MeshBase]) -> Self:
"""Generate weight window settings from an XML element
Parameters
@@ -408,7 +411,7 @@ class WeightWindows(IDManagerMixin):
)
@classmethod
- def from_hdf5(cls, group: h5py.Group, meshes: dict[int, MeshBase]) -> WeightWindows:
+ def from_hdf5(cls, group: h5py.Group, meshes: dict[int, MeshBase]) -> Self:
"""Create weight windows from HDF5 group
Parameters
@@ -458,7 +461,7 @@ class WeightWindows(IDManagerMixin):
)
-def wwinp_to_wws(path: PathLike) -> list[WeightWindows]:
+def wwinp_to_wws(path: PathLike) -> WeightWindowsList:
"""Create WeightWindows instances from a wwinp file
.. versionadded:: 0.13.1
@@ -470,190 +473,13 @@ def wwinp_to_wws(path: PathLike) -> list[WeightWindows]:
Returns
-------
- list of openmc.WeightWindows
+ WeightWindowsList
"""
-
- with open(path) as wwinp:
- # BLOCK 1
- header = wwinp.readline().split(None, 4)
- # read file type, time-dependence, number of
- # particles, mesh type and problem identifier
- _if, iv, ni, nr = [int(x) for x in header[:4]]
-
- # header value checks
- if _if != 1:
- raise ValueError(f'Found incorrect file type, if: {_if}')
-
- if iv > 1:
- # read number of time bins for each particle, 'nt(1...ni)'
- nt = np.fromstring(wwinp.readline(), sep=' ', dtype=int)
-
- # raise error if time bins are present for now
- raise ValueError('Time-dependent weight windows '
- 'are not yet supported')
- else:
- nt = ni * [1]
-
- # read number of energy bins for each particle, 'ne(1...ni)'
- ne = np.fromstring(wwinp.readline(), sep=' ', dtype=int)
-
- # read coarse mesh dimensions and lower left corner
- mesh_description = np.fromstring(wwinp.readline(), sep=' ')
- nfx, nfy, nfz = mesh_description[:3].astype(int)
- xyz0 = mesh_description[3:]
-
- # read cylindrical and spherical mesh vectors if present
- if nr == 16:
- # read number of coarse bins
- line_arr = np.fromstring(wwinp.readline(), sep=' ')
- ncx, ncy, ncz = line_arr[:3].astype(int)
- # read polar vector (x1, y1, z1)
- xyz1 = line_arr[3:]
- # read azimuthal vector (x2, y2, z2)
- line_arr = np.fromstring(wwinp.readline(), sep=' ')
- xyz2 = line_arr[:3]
-
- # Get polar and azimuthal axes
- polar_axis = xyz1 - xyz0
- azimuthal_axis = xyz2 - xyz0
-
- # Check for polar axis other than (0, 0, 1)
- norm = np.linalg.norm(polar_axis)
- if not np.isclose(polar_axis[2]/norm, 1.0):
- raise NotImplementedError('Polar axis not aligned to z-axis not supported')
-
- # Check for azimuthal axis other than (1, 0, 0)
- norm = np.linalg.norm(azimuthal_axis)
- if not np.isclose(azimuthal_axis[0]/norm, 1.0):
- raise NotImplementedError('Azimuthal axis not aligned to x-axis not supported')
-
- # read geometry type
- nwg = int(line_arr[-1])
-
- elif nr == 10:
- # read rectilinear data:
- # number of coarse mesh bins and mesh type
- ncx, ncy, ncz, nwg = \
- np.fromstring(wwinp.readline(), sep=' ').astype(int)
- else:
- raise RuntimeError(f'Invalid mesh description (nr) found: {nr}')
-
- # read BLOCK 2 and BLOCK 3 data into a single array
- ww_data = np.fromstring(wwinp.read(), sep=' ')
-
- # extract mesh data from the ww_data array
- start_idx = 0
-
- # first values in the mesh definition arrays are the first
- # coordinate of the grid
- end_idx = start_idx + 1 + 3 * ncx
- i0, i_vals = ww_data[start_idx], ww_data[start_idx+1:end_idx]
- start_idx = end_idx
-
- end_idx = start_idx + 1 + 3 * ncy
- j0, j_vals = ww_data[start_idx], ww_data[start_idx+1:end_idx]
- start_idx = end_idx
-
- end_idx = start_idx + 1 + 3 * ncz
- k0, k_vals = ww_data[start_idx], ww_data[start_idx+1:end_idx]
- start_idx = end_idx
-
- # mesh consistency checks
- if nr == 16 and nwg == 1 or nr == 10 and nwg != 1:
- raise ValueError(f'Mesh description in header ({nr}) '
- f'does not match the mesh type ({nwg})')
-
- if nr == 10 and (xyz0 != (i0, j0, k0)).any():
- raise ValueError(f'Mesh origin in the header ({xyz0}) '
- f' does not match the origin in the mesh '
- f' description ({i0, j0, k0})')
-
- # create openmc mesh object
- grids = []
- mesh_definition = [(i0, i_vals, nfx), (j0, j_vals, nfy), (k0, k_vals, nfz)]
- for grid0, grid_vals, n_pnts in mesh_definition:
- # file spec checks for the mesh definition
- if (grid_vals[2::3] != 1.0).any():
- raise ValueError('One or more mesh ratio value, qx, '
- 'is not equal to one')
-
- s = int(grid_vals[::3].sum())
- if s != n_pnts:
- raise ValueError(f'Sum of the fine bin entries, {s}, does '
- f'not match the number of fine bins, {n_pnts}')
-
- # extend the grid based on the next coarse bin endpoint, px
- # and the number of fine bins in the coarse bin, sx
- intervals = grid_vals.reshape(-1, 3)
- coords = [grid0]
- for sx, px, qx in intervals:
- coords += np.linspace(coords[-1], px, int(sx + 1)).tolist()[1:]
-
- grids.append(np.array(coords))
-
- if nwg == 1:
- mesh = RectilinearMesh()
- mesh.x_grid, mesh.y_grid, mesh.z_grid = grids
- elif nwg == 2:
- mesh = CylindricalMesh(
- r_grid=grids[0],
- z_grid=grids[1],
- phi_grid=grids[2],
- origin = xyz0,
- )
- elif nwg == 3:
- mesh = SphericalMesh(
- r_grid=grids[0],
- theta_grid=grids[1],
- phi_grid=grids[2],
- origin = xyz0
- )
-
- # extract weight window values from array
- wws = []
- for ne_i, nt_i, particle_type in zip(ne, nt, ('neutron', 'photon')):
- # no information to read for this particle if
- # either the energy bins or time bins are empty
- if ne_i == 0 or nt_i == 0:
- continue
-
- if iv > 1:
- # time bins are parsed but unused for now
- end_idx = start_idx + nt_i
- time_bounds = ww_data[start_idx:end_idx]
- np.insert(time_bounds, (0,), (0.0,))
- start_idx = end_idx
-
- # read energy boundaries
- end_idx = start_idx + ne_i
- energy_bounds = np.insert(ww_data[start_idx:end_idx], (0,), (0.0,))
- # convert from MeV to eV
- energy_bounds *= 1e6
- start_idx = end_idx
-
- # read weight window values
- end_idx = start_idx + (nfx * nfy * nfz) * nt_i * ne_i
-
- # read values and reshape according to ordering
- # slowest to fastest: t, e, z, y, x
- # reorder with transpose since our ordering is x, y, z, e, t
- ww_shape = (nt_i, ne_i, nfz, nfy, nfx)
- ww_values = ww_data[start_idx:end_idx].reshape(ww_shape).T
- # Only use first time bin since we don't support time dependent weight
- # windows yet.
- ww_values = ww_values[:, :, :, :, 0]
- start_idx = end_idx
-
- # create a weight window object
- ww = WeightWindows(id=None,
- mesh=mesh,
- lower_ww_bounds=ww_values,
- upper_bound_ratio=5.0,
- energy_bounds=energy_bounds,
- particle_type=particle_type)
- wws.append(ww)
-
- return wws
+ warnings.warn(
+ "This function is deprecated in favor of 'WeightWindowsList.from_wwinp'",
+ FutureWarning
+ )
+ return WeightWindowsList.from_wwinp(path)
class WeightWindowGenerator:
@@ -886,7 +712,7 @@ class WeightWindowGenerator:
return element
@classmethod
- def from_xml_element(cls, elem: ET.Element, meshes: dict) -> WeightWindowGenerator:
+ def from_xml_element(cls, elem: ET.Element, meshes: dict) -> Self:
"""
Create a weight window generation object from an XML element
@@ -929,8 +755,8 @@ class WeightWindowGenerator:
return wwg
-def hdf5_to_wws(path='weight_windows.h5'):
- """Create WeightWindows instances from a weight windows HDF5 file
+def hdf5_to_wws(path='weight_windows.h5') -> WeightWindowsList:
+ """Create a WeightWindowsList from a weight windows HDF5 file
.. versionadded:: 0.14.0
@@ -941,13 +767,284 @@ def hdf5_to_wws(path='weight_windows.h5'):
Returns
-------
- list of openmc.WeightWindows
+ WeightWindowsList
"""
+ warnings.warn(
+ "This function is deprecated in favor of 'WeightWindowsList.from_hdf5'",
+ FutureWarning
+ )
+ return WeightWindowsList.from_hdf5(path)
- with h5py.File(path) as h5_file:
- # read in all of the meshes in the mesh node
- meshes = {}
- for mesh_group in h5_file['meshes']:
- mesh = MeshBase.from_hdf5(h5_file['meshes'][mesh_group])
- meshes[mesh.id] = mesh
- return [WeightWindows.from_hdf5(ww, meshes) for ww in h5_file['weight_windows'].values()]
+
+class WeightWindowsList(list):
+ """A list of WeightWindows objects.
+
+ .. versionadded:: 0.15.3
+
+ Parameters
+ ----------
+ iterable : iterable of openmc.WeightWindows
+ An iterable of WeightWindows objects to initialize the list with
+
+ """
+ def __init__(self, iterable: Iterable[WeightWindows] = ()):
+ super().__init__(iterable)
+
+ @classmethod
+ def from_hdf5(cls, path: PathLike = 'weight_windows.h5') -> Self:
+ """Create WeightWindowsList from a weight windows HDF5 file.
+
+ Parameters
+ ----------
+ path : PathLike
+ Path to the weight windows hdf5 file
+
+ Returns
+ -------
+ WeightWindowsList
+ A list of WeightWindows objects read from the file
+ """
+
+ with h5py.File(path) as h5_file:
+ # read in all of the meshes in the mesh node
+ meshes = {}
+ for mesh_group in h5_file['meshes']:
+ mesh = MeshBase.from_hdf5(h5_file['meshes'][mesh_group])
+ meshes[mesh.id] = mesh
+ wws = [
+ WeightWindows.from_hdf5(ww, meshes)
+ for ww in h5_file['weight_windows'].values()
+ ]
+
+ return cls(wws)
+
+ @classmethod
+ def from_wwinp(cls, path: PathLike) -> Self:
+ """Create WeightWindowsList from a wwinp file.
+
+ Parameters
+ ----------
+ path : PathLike
+ Path to the wwinp file
+
+ Returns
+ -------
+ WeightWindowsList
+ A list of WeightWindows objects read from the file
+ """
+
+ with open(path) as wwinp:
+ # BLOCK 1
+ header = wwinp.readline().split(None, 4)
+ # read file type, time-dependence, number of
+ # particles, mesh type and problem identifier
+ _if, iv, ni, nr = [int(x) for x in header[:4]]
+
+ # header value checks
+ if _if != 1:
+ raise ValueError(f'Found incorrect file type, if: {_if}')
+
+ if iv > 1:
+ # read number of time bins for each particle, 'nt(1...ni)'
+ nt = np.fromstring(wwinp.readline(), sep=' ', dtype=int)
+
+ # raise error if time bins are present for now
+ raise ValueError('Time-dependent weight windows '
+ 'are not yet supported')
+ else:
+ nt = ni * [1]
+
+ # read number of energy bins for each particle, 'ne(1...ni)'
+ ne = np.fromstring(wwinp.readline(), sep=' ', dtype=int)
+
+ # read coarse mesh dimensions and lower left corner
+ mesh_description = np.fromstring(wwinp.readline(), sep=' ')
+ nfx, nfy, nfz = mesh_description[:3].astype(int)
+ xyz0 = mesh_description[3:]
+
+ # read cylindrical and spherical mesh vectors if present
+ if nr == 16:
+ # read number of coarse bins
+ line_arr = np.fromstring(wwinp.readline(), sep=' ')
+ ncx, ncy, ncz = line_arr[:3].astype(int)
+ # read polar vector (x1, y1, z1)
+ xyz1 = line_arr[3:]
+ # read azimuthal vector (x2, y2, z2)
+ line_arr = np.fromstring(wwinp.readline(), sep=' ')
+ xyz2 = line_arr[:3]
+
+ # Get polar and azimuthal axes
+ polar_axis = xyz1 - xyz0
+ azimuthal_axis = xyz2 - xyz0
+
+ # Check for polar axis other than (0, 0, 1)
+ norm = np.linalg.norm(polar_axis)
+ if not np.isclose(polar_axis[2]/norm, 1.0):
+ raise NotImplementedError('Polar axis not aligned to z-axis not supported')
+
+ # Check for azimuthal axis other than (1, 0, 0)
+ norm = np.linalg.norm(azimuthal_axis)
+ if not np.isclose(azimuthal_axis[0]/norm, 1.0):
+ raise NotImplementedError('Azimuthal axis not aligned to x-axis not supported')
+
+ # read geometry type
+ nwg = int(line_arr[-1])
+
+ elif nr == 10:
+ # read rectilinear data:
+ # number of coarse mesh bins and mesh type
+ ncx, ncy, ncz, nwg = \
+ np.fromstring(wwinp.readline(), sep=' ').astype(int)
+ else:
+ raise RuntimeError(f'Invalid mesh description (nr) found: {nr}')
+
+ # read BLOCK 2 and BLOCK 3 data into a single array
+ ww_data = np.fromstring(wwinp.read(), sep=' ')
+
+ # extract mesh data from the ww_data array
+ start_idx = 0
+
+ # first values in the mesh definition arrays are the first
+ # coordinate of the grid
+ end_idx = start_idx + 1 + 3 * ncx
+ i0, i_vals = ww_data[start_idx], ww_data[start_idx+1:end_idx]
+ start_idx = end_idx
+
+ end_idx = start_idx + 1 + 3 * ncy
+ j0, j_vals = ww_data[start_idx], ww_data[start_idx+1:end_idx]
+ start_idx = end_idx
+
+ end_idx = start_idx + 1 + 3 * ncz
+ k0, k_vals = ww_data[start_idx], ww_data[start_idx+1:end_idx]
+ start_idx = end_idx
+
+ # mesh consistency checks
+ if nr == 16 and nwg == 1 or nr == 10 and nwg != 1:
+ raise ValueError(f'Mesh description in header ({nr}) '
+ f'does not match the mesh type ({nwg})')
+
+ if nr == 10 and (xyz0 != (i0, j0, k0)).any():
+ raise ValueError(f'Mesh origin in the header ({xyz0}) '
+ f' does not match the origin in the mesh '
+ f' description ({i0, j0, k0})')
+
+ # create openmc mesh object
+ grids = []
+ mesh_definition = [(i0, i_vals, nfx), (j0, j_vals, nfy), (k0, k_vals, nfz)]
+ for grid0, grid_vals, n_pnts in mesh_definition:
+ # file spec checks for the mesh definition
+ if (grid_vals[2::3] != 1.0).any():
+ raise ValueError('One or more mesh ratio value, qx, '
+ 'is not equal to one')
+
+ s = int(grid_vals[::3].sum())
+ if s != n_pnts:
+ raise ValueError(f'Sum of the fine bin entries, {s}, does '
+ f'not match the number of fine bins, {n_pnts}')
+
+ # extend the grid based on the next coarse bin endpoint, px
+ # and the number of fine bins in the coarse bin, sx
+ intervals = grid_vals.reshape(-1, 3)
+ coords = [grid0]
+ for sx, px, qx in intervals:
+ coords += np.linspace(coords[-1], px, int(sx + 1)).tolist()[1:]
+
+ grids.append(np.array(coords))
+
+ if nwg == 1:
+ mesh = RectilinearMesh()
+ mesh.x_grid, mesh.y_grid, mesh.z_grid = grids
+ elif nwg == 2:
+ mesh = CylindricalMesh(
+ r_grid=grids[0],
+ z_grid=grids[1],
+ phi_grid=grids[2],
+ origin = xyz0,
+ )
+ elif nwg == 3:
+ mesh = SphericalMesh(
+ r_grid=grids[0],
+ theta_grid=grids[1],
+ phi_grid=grids[2],
+ origin = xyz0
+ )
+
+ # extract weight window values from array
+ wws = cls()
+ for ne_i, nt_i, particle_type in zip(ne, nt, ('neutron', 'photon')):
+ # no information to read for this particle if
+ # either the energy bins or time bins are empty
+ if ne_i == 0 or nt_i == 0:
+ continue
+
+ if iv > 1:
+ # time bins are parsed but unused for now
+ end_idx = start_idx + nt_i
+ time_bounds = ww_data[start_idx:end_idx]
+ np.insert(time_bounds, (0,), (0.0,))
+ start_idx = end_idx
+
+ # read energy boundaries
+ end_idx = start_idx + ne_i
+ energy_bounds = np.insert(ww_data[start_idx:end_idx], (0,), (0.0,))
+ # convert from MeV to eV
+ energy_bounds *= 1e6
+ start_idx = end_idx
+
+ # read weight window values
+ end_idx = start_idx + (nfx * nfy * nfz) * nt_i * ne_i
+
+ # read values and reshape according to ordering
+ # slowest to fastest: t, e, z, y, x
+ # reorder with transpose since our ordering is x, y, z, e, t
+ ww_shape = (nt_i, ne_i, nfz, nfy, nfx)
+ ww_values = ww_data[start_idx:end_idx].reshape(ww_shape).T
+ # Only use first time bin since we don't support time dependent weight
+ # windows yet.
+ ww_values = ww_values[:, :, :, :, 0]
+ start_idx = end_idx
+
+ # create a weight window object
+ ww = WeightWindows(id=None,
+ mesh=mesh,
+ lower_ww_bounds=ww_values,
+ upper_bound_ratio=5.0,
+ energy_bounds=energy_bounds,
+ particle_type=particle_type)
+ wws.append(ww)
+
+ return wws
+
+ def export_to_hdf5(self, path: PathLike = 'weight_windows.h5', **init_kwargs):
+ """Write weight windows to an HDF5 file.
+
+ Parameters
+ ----------
+ path : PathLike
+ Path to the file to write weight windows to
+ **init_kwargs
+ Keyword arguments passed to :func:`openmc.lib.init`
+
+ """
+ import openmc.lib
+ cv.check_type('path', path, PathLike)
+
+ # Create a temporary model with the weight windows
+ model = openmc.Model()
+ sph = openmc.Sphere(boundary_type='vacuum')
+ cell = openmc.Cell(region=-sph)
+ model.geometry = openmc.Geometry([cell])
+ model.settings.weight_windows = self
+ model.settings.particles = 100
+ model.settings.batches = 1
+
+ # Get absolute path before moving to temporary directory
+ path = Path(path).resolve()
+
+ with change_directory(tmpdir=True):
+ # Write the model to an XML file
+ model.export_to_model_xml()
+
+ # Load the model with openmc.lib and then export it to an HDF5 file
+ with openmc.lib.run_in_memory(**init_kwargs):
+ openmc.lib.export_weight_windows(path)
diff --git a/tests/regression_tests/weightwindows/inputs_true.dat b/tests/regression_tests/weightwindows/inputs_true.dat
index dcc41ae84..91fec4af9 100644
--- a/tests/regression_tests/weightwindows/inputs_true.dat
+++ b/tests/regression_tests/weightwindows/inputs_true.dat
@@ -49,7 +49,7 @@
0.0 0.5 20000000.0
-1.0 0.007673145137236567 6.542700644645627e-07 0.0017541380096893788 0.0007245451610090619 7.476545089278482e-06 2.253382683081525e-06 2.1040609012865134e-05 0.08285899874014539 -1.0 1.0262431550731535e-13 3.3164825349503764e-16 0.0064803314120165335 3.5981031766416143e-06 -1.0 1.6205064883026195e-11 1.7770136411255912e-05 0.0001670700632870335 4.323138781337963e-05 -1.0 -1.0 6.922231352729155e-05 0.06550426960512012 -1.0 2.5639656866250453e-06 1.4508262073256659e-13 -1.0 -1.0 0.0009127050763987511 3.8523247550378815e-12 -1.0 0.0008175033526488423 -1.0 0.015148978428271613 2.5157355790201773e-07 2.1612150425221703e-06 1.3181562352445092e-10 2.9282097947816224e-05 2.762955748645507e-05 2.936268747135548e-14 1.6859219614058024e-19 3.937160538176268e-07 2.6011787393916806e-06 0.001570829313580841 -1.0 1.7041669224797384e-09 1.6421491993751715e-11 0.4899999304038166 6.948292975998466e-07 -1.0 -1.0 0.08657573566388353 0.006639379668946672 1.681305446488884e-11 2.2487617828938326e-05 4.109066205029878e-05 0.08288806458368345 -1.0 0.007385384405891666 -1.0 -1.0 1.008394964750947e-06 6.655926357459275e-08 0.0016279794552427574 1.4825219199133353e-12 -1.0 1.93847081892941e-05 1.284759166582202e-05 5.1161740516205715e-05 2.5447281241730366e-07 3.853097455417877e-06 -1.0 8.887234042637684e-05 0.01621821782442112 -1.0 1.8747824667478637e-14 5.97653814110781e-06 -1.0 -1.0 1.2296747260635405e-06 -1.0 -1.0 7.754700849337902e-06 7.091263906557291e-05 3.2799045883372075e-06 0.00020573181450240786 5.6949597066784976e-05 1.271128669411295e-07 0.0010019432401508087 -1.0 -1.0 6.848642863465585e-07 5.783974359937857e-06 2.380955631371226e-06 4.756872959630257e-05 2.1360401784344975e-18 0.00046029617115127556 1.0092905083158804e-11 0.08095280568305474 3.89841667138598e-08 4.354946981329799e-05 -1.0 0.5 0.0015447823995470042 -1.0 -1.0 0.001959411999677113 0.48573842213878143 -1.0 7.962899789920809e-06 5.619835883512353e-14 0.0835648710074336 2.7207433165796702e-11 0.00027464244062887683 4.076762579823379e-17 2.124999182004655e-05 8.037131813528501e-07 8.846493399850663e-06 1.080711295768551e-05 -1.0 -1.0 0.0010737081832502356 2.679340942769232e-06 2.1648918040467363e-05 0.0002668579837809081 1.3455341306162382e-05 2.5629068330446215e-05 1.3228013765525015e-05 -1.0 -1.0 7.002861620919232e-08 1.5172912057312398e-14 -1.0 7.989579285134734e-06 2.639268952045579e-10 -1.0 0.013330619853379314 0.00021534568699157805 2.4469456008493614e-09 8.211982683649991e-09 1.951356547084204e-15 0.00016419031150495913 5.985108617124989e-06 1.28584557092134e-05 1.5476769237571295e-14 5.5379154134462336e-08 0.0016637126543321873 2.499931357628383e-07 8.020767115181574e-07 2.7697233171399416e-13 -1.0 0.007197662162700777 -1.0 0.0833931797381589 2.8226276944532696e-05 3.353295403842037e-05 5.504813693036933e-12 0.007136750029575816 0.08636569925236791 -1.0 -1.0 6.315154082213375e-07 0.4877856021170283 -1.0 3.7051518220083886e-06 -1.0 0.0017950613169359904 7.84289689494925e-06 9.041149893307806e-07 -1.0 8.48176145671274e-10 9.03108551826469e-05 3.634644995026692e-05 2.0295213621716706e-09 1.0305672698745657e-11 1.5550455959178486e-06 0.01664109232689093 8.533030345699353e-17 0.0009252532821720597 -1.0 7.695031155172816e-14 0.0007151459162818186 -1.0 -1.0 5.182269672663266e-10 3.0160758454323657e-07 -1.0 0.06539005235506369 3.452537179033895e-05 -1.0 -1.0 3.855884234344845e-06 0.00017699858357744463 2.594951085377588e-06 1.1333627604823673e-09 -1.0 2.4306375693722205e-06 0.0063790654507599135 2.2060992580622125e-11 -1.0 -1.0 0.0848872967381878 3.932389299316285e-06 1.2911827198500372e-08 1.957092814065688e-05 0.0007213722022489493 0.0018327593437608 1.6699254277734109e-06 0.007188410694198128 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0
-10.0 0.07673145137236567 6.5427006446456266e-06 0.017541380096893787 0.0072454516100906195 7.476545089278483e-05 2.253382683081525e-05 0.00021040609012865135 0.828589987401454 -10.0 1.0262431550731535e-12 3.3164825349503764e-15 0.06480331412016534 3.5981031766416144e-05 -10.0 1.6205064883026195e-10 0.0001777013641125591 0.001670700632870335 0.0004323138781337963 -10.0 -10.0 0.0006922231352729155 0.6550426960512012 -10.0 2.5639656866250452e-05 1.4508262073256658e-12 -10.0 -10.0 0.009127050763987512 3.852324755037882e-11 -10.0 0.008175033526488424 -10.0 0.15148978428271614 2.515735579020177e-06 2.1612150425221703e-05 1.3181562352445092e-09 0.00029282097947816227 0.0002762955748645507 2.9362687471355483e-13 1.6859219614058023e-18 3.937160538176268e-06 2.6011787393916804e-05 0.015708293135808408 -10.0 1.7041669224797384e-08 1.6421491993751715e-10 4.899999304038166 6.948292975998466e-06 -10.0 -10.0 0.8657573566388354 0.06639379668946672 1.681305446488884e-10 0.00022487617828938325 0.0004109066205029878 0.8288806458368345 -10.0 0.07385384405891665 -10.0 -10.0 1.0083949647509469e-05 6.655926357459275e-07 0.016279794552427576 1.4825219199133352e-11 -10.0 0.000193847081892941 0.0001284759166582202 0.0005116174051620571 2.5447281241730365e-06 3.853097455417877e-05 -10.0 0.0008887234042637684 0.16218217824421122 -10.0 1.8747824667478637e-13 5.97653814110781e-05 -10.0 -10.0 1.2296747260635405e-05 -10.0 -10.0 7.754700849337902e-05 0.0007091263906557291 3.2799045883372076e-05 0.0020573181450240785 0.0005694959706678497 1.271128669411295e-06 0.010019432401508087 -10.0 -10.0 6.848642863465585e-06 5.7839743599378564e-05 2.380955631371226e-05 0.0004756872959630257 2.1360401784344976e-17 0.004602961711512756 1.0092905083158804e-10 0.8095280568305474 3.89841667138598e-07 0.00043549469813297995 -10.0 5.0 0.015447823995470043 -10.0 -10.0 0.01959411999677113 4.8573842213878144 -10.0 7.96289978992081e-05 5.619835883512353e-13 0.8356487100743359 2.7207433165796704e-10 0.002746424406288768 4.076762579823379e-16 0.00021249991820046548 8.037131813528501e-06 8.846493399850663e-05 0.0001080711295768551 -10.0 -10.0 0.010737081832502356 2.679340942769232e-05 0.00021648918040467362 0.0026685798378090807 0.00013455341306162382 0.00025629068330446217 0.00013228013765525016 -10.0 -10.0 7.002861620919232e-07 1.51729120573124e-13 -10.0 7.989579285134734e-05 2.639268952045579e-09 -10.0 0.13330619853379314 0.0021534568699157807 2.4469456008493615e-08 8.211982683649991e-08 1.951356547084204e-14 0.0016419031150495913 5.985108617124989e-05 0.000128584557092134 1.5476769237571296e-13 5.537915413446234e-07 0.016637126543321872 2.499931357628383e-06 8.020767115181574e-06 2.7697233171399415e-12 -10.0 0.07197662162700777 -10.0 0.8339317973815891 0.000282262769445327 0.00033532954038420373 5.504813693036933e-11 0.07136750029575815 0.8636569925236791 -10.0 -10.0 6.3151540822133754e-06 4.877856021170283 -10.0 3.7051518220083885e-05 -10.0 0.017950613169359905 7.84289689494925e-05 9.041149893307805e-06 -10.0 8.48176145671274e-09 0.000903108551826469 0.0003634644995026692 2.0295213621716707e-08 1.0305672698745658e-10 1.5550455959178486e-05 0.1664109232689093 8.533030345699353e-16 0.009252532821720597 -10.0 7.695031155172816e-13 0.007151459162818186 -10.0 -10.0 5.182269672663266e-09 3.0160758454323656e-06 -10.0 0.6539005235506369 0.0003452537179033895 -10.0 -10.0 3.855884234344845e-05 0.0017699858357744464 2.594951085377588e-05 1.1333627604823672e-08 -10.0 2.4306375693722206e-05 0.06379065450759913 2.2060992580622125e-10 -10.0 -10.0 0.848872967381878 3.9323892993162844e-05 1.2911827198500372e-07 0.0001957092814065688 0.0072137220224894934 0.018327593437608 1.669925427773411e-05 0.07188410694198127 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0
- 3
+ 3.0
1.5
10
1e-38
@@ -65,7 +65,7 @@
0.0 0.5 20000000.0
-1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 0.06827568359008944 0.00017329528628152923 0.018541112907970003 0.011113024641218336 8.76041935303527e-05 8.168081568291806e-05 0.00046693784586018913 0.4952432605379829 2.2512327083641865e-10 4.6258592060517866e-07 2.7044817176109556e-05 0.054902816619122045 0.00014126153603265097 8.304845400451923e-08 2.2950716170641463e-05 0.0001335621430311088 0.003432919201293737 0.0005197081842709918 5.726152701849347e-16 -1.0 0.0013332554437480327 0.4346984808472855 7.691527781829036e-17 0.00011042047857307253 3.0571050855707084e-06 -1.0 4.986698316296507e-06 0.011128424196387618 1.3106335518133802e-05 5.447493368067179e-10 0.011440381012864086 4.670673837764874e-08 0.12364069326350118 0.00012558879474108074 3.136829920007009e-05 2.34750482787598e-05 0.001537590300149361 0.0017693279949094218 6.717625881826167e-05 4.587143797469485e-08 2.6211239246796104e-05 0.00030002326388383244 0.01729816946709781 4.5757238372058234e-11 6.92296299242814e-05 3.792209399652396e-06 -1.0 9.256616392487858e-05 8.541606727879512e-07 -1.0 0.49317081643076643 0.05500108683629957 1.298062961617927e-05 0.0006870228272606287 0.0008231482263927564 0.5 3.419181071650816e-06 0.06433819434431046 6.574706543646946e-16 4.0404626147344e-13 0.0003782322077390033 0.00012637534695610975 0.017602971074583987 1.0044390728858277e-05 -1.0 0.0008787411098754915 0.00023686818807101741 0.0009304497896205121 6.949587369646497e-05 0.00012918433677593975 2.0707648529746894e-06 0.0023295401596005313 0.11819165666519223 -1.0 2.1606550732170693e-05 0.00022057970761624768 -1.0 1.0325207105027347e-08 0.0002029396545382813 2.1234980618763222e-13 -1.0 0.00024175998138228048 0.001178616843705956 0.0001399807456616496 0.0038811025614225057 0.0011076796092102186 0.00010814452764860558 0.010955637485319249 -1.0 9.382800796426366e-17 5.098747893974248e-05 0.00027052054298385255 0.00021305826462238593 0.000808100901275472 4.233410073487772e-06 0.0051513292132259495 8.616027294555462e-07 0.4873897581604287 2.9093345975075226e-05 0.000469589568463265 -1.0 -1.0 0.017802624844035688 1.3116807133030035e-15 2.617878055106949e-16 0.01884234453311008 -1.0 2.027381220364608e-16 0.0004299195570308035 1.4628847959717225e-05 0.4899952354672477 2.774067049392004e-07 0.004441328419270369 4.279460329782799e-09 0.0012297303081805393 0.0002792896409558745 0.0006934466049804711 8.370896020975689e-05 3.8270536025799805e-15 -1.0 0.01208261392046878 0.0001497958445994315 0.0015016500045374082 0.005384625561469684 0.00025519632243117644 0.0011028020390507682 0.0002362355168421952 -1.0 -1.0 8.862760180332873e-05 1.3806577785135177e-06 -1.0 0.0001319677450153934 2.6866894852481906e-05 -1.0 0.11510120013926417 0.002672923773363389 1.2257360246712472e-05 8.544159282151438e-05 2.777791741571174e-05 0.0014957033281168012 0.0003257646134837451 0.0008919466185572302 1.2907171695294846e-13 4.6842350882367666e-05 0.01721806295736377 0.00025106741008066317 0.00022234471595443313 2.101790478097517e-09 5.752120832330886e-11 0.06428782790571179 3.2478301680021854e-08 0.4903495510314233 0.001146714816952061 0.0004777967757842694 1.0882011018684852e-06 0.05708498338352203 0.4981497862127628 -1.0 3.2790914744011534e-06 0.00010077009726691265 -1.0 2.210707325798542e-07 4.3166052799897375e-05 -1.0 0.01825795827020865 0.0003182108781955478 3.8561696337086434e-05 1.0995322456277382e-06 9.53380658669839e-06 0.001550036616828061 0.0012648333883989995 5.272021975060514e-06 1.9257248009114363e-05 0.00016757997590048827 0.11891251244906934 5.515522196186723e-06 0.01102706140784316 9.904481358675478e-13 3.520674728719278e-05 0.011294708566804167 7.239087311622819e-08 -1.0 3.5740607788414942e-06 0.00035983547999740665 1.0588257623722672e-07 0.42372713683725016 0.0011273340972061078 8.582011716859219e-15 1.1514579117272292e-10 0.00043130977711323417 0.0027847329307350423 0.00017287873387910357 6.401055165502384e-06 1.722191123879782e-08 0.00020848309220162036 0.05639071613735579 1.8064550990294753e-05 1.289814511028015e-06 1.078687446476881e-14 0.4897735047310072 0.0002981891705231209 0.00016079768514218546 9.332371598523186e-05 0.011724714376848187 0.019040707071165303 0.00014242053195529864 0.06684484191345574 -1.0
-10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 -10.0 0.6827568359008944 0.0017329528628152924 0.18541112907970003 0.11113024641218336 0.0008760419353035269 0.0008168081568291806 0.004669378458601891 4.952432605379829 2.2512327083641864e-09 4.625859206051786e-06 0.00027044817176109554 0.5490281661912204 0.0014126153603265096 8.304845400451923e-07 0.00022950716170641464 0.001335621430311088 0.03432919201293737 0.0051970818427099184 5.726152701849347e-15 -10.0 0.013332554437480326 4.346984808472855 7.6915277818290365e-16 0.0011042047857307254 3.0571050855707086e-05 -10.0 4.986698316296507e-05 0.11128424196387618 0.000131063355181338 5.447493368067179e-09 0.11440381012864086 4.670673837764874e-07 1.2364069326350118 0.0012558879474108074 0.0003136829920007009 0.000234750482787598 0.01537590300149361 0.01769327994909422 0.0006717625881826168 4.587143797469485e-07 0.000262112392467961 0.0030002326388383245 0.1729816946709781 4.5757238372058235e-10 0.0006922962992428139 3.792209399652396e-05 -10.0 0.0009256616392487858 8.541606727879512e-06 -10.0 4.931708164307665 0.5500108683629957 0.00012980629616179268 0.006870228272606287 0.008231482263927564 5.0 3.419181071650816e-05 0.6433819434431045 6.574706543646946e-15 4.0404626147344005e-12 0.003782322077390033 0.0012637534695610975 0.17602971074583987 0.00010044390728858278 -10.0 0.008787411098754914 0.002368681880710174 0.00930449789620512 0.0006949587369646498 0.0012918433677593976 2.0707648529746893e-05 0.023295401596005315 1.1819165666519222 -10.0 0.00021606550732170693 0.0022057970761624767 -10.0 1.0325207105027347e-07 0.0020293965453828133 2.123498061876322e-12 -10.0 0.0024175998138228046 0.01178616843705956 0.0013998074566164962 0.03881102561422506 0.011076796092102187 0.0010814452764860557 0.10955637485319249 -10.0 9.382800796426367e-16 0.0005098747893974248 0.0027052054298385255 0.0021305826462238594 0.00808100901275472 4.233410073487772e-05 0.0515132921322595 8.61602729455546e-06 4.873897581604287 0.0002909334597507523 0.0046958956846326495 -10.0 -10.0 0.1780262484403569 1.3116807133030034e-14 2.6178780551069492e-15 0.1884234453311008 -10.0 2.027381220364608e-15 0.004299195570308035 0.00014628847959717226 4.899952354672477 2.774067049392004e-06 0.04441328419270369 4.279460329782799e-08 0.012297303081805393 0.002792896409558745 0.006934466049804711 0.0008370896020975689 3.8270536025799805e-14 -10.0 0.1208261392046878 0.001497958445994315 0.015016500045374082 0.05384625561469684 0.0025519632243117644 0.011028020390507681 0.002362355168421952 -10.0 -10.0 0.0008862760180332873 1.3806577785135176e-05 -10.0 0.001319677450153934 0.00026866894852481903 -10.0 1.1510120013926417 0.026729237733633893 0.00012257360246712473 0.0008544159282151438 0.0002777791741571174 0.014957033281168012 0.0032576461348374514 0.008919466185572301 1.2907171695294846e-12 0.00046842350882367664 0.17218062957363772 0.0025106741008066318 0.0022234471595443312 2.101790478097517e-08 5.752120832330886e-10 0.6428782790571179 3.2478301680021856e-07 4.903495510314233 0.01146714816952061 0.004777967757842694 1.0882011018684853e-05 0.5708498338352204 4.981497862127628 -10.0 3.279091474401153e-05 0.0010077009726691265 -10.0 2.210707325798542e-06 0.00043166052799897375 -10.0 0.1825795827020865 0.0031821087819554777 0.00038561696337086434 1.0995322456277382e-05 9.53380658669839e-05 0.01550036616828061 0.012648333883989995 5.272021975060514e-05 0.00019257248009114364 0.0016757997590048828 1.1891251244906933 5.515522196186723e-05 0.1102706140784316 9.904481358675478e-12 0.0003520674728719278 0.11294708566804167 7.239087311622819e-07 -10.0 3.574060778841494e-05 0.0035983547999740664 1.0588257623722672e-06 4.237271368372502 0.011273340972061077 8.582011716859219e-14 1.151457911727229e-09 0.004313097771132342 0.027847329307350423 0.0017287873387910357 6.401055165502385e-05 1.722191123879782e-07 0.0020848309220162036 0.5639071613735579 0.00018064550990294753 1.289814511028015e-05 1.078687446476881e-13 4.897735047310072 0.002981891705231209 0.0016079768514218546 0.0009332371598523186 0.11724714376848187 0.19040707071165303 0.0014242053195529865 0.6684484191345574 -10.0
- 3
+ 3.0
1.5
10
1e-38
diff --git a/tests/unit_tests/weightwindows/test_ww_list.py b/tests/unit_tests/weightwindows/test_ww_list.py
new file mode 100644
index 000000000..d148f382a
--- /dev/null
+++ b/tests/unit_tests/weightwindows/test_ww_list.py
@@ -0,0 +1,23 @@
+import openmc
+
+
+def test_ww_roundtrip(request, run_in_tmpdir):
+ # Load weight windows from a wwinp file
+ wwinp_file = request.path.with_name('wwinp_n')
+ wws = openmc.WeightWindowsList.from_wwinp(wwinp_file)
+
+ # Roundtrip them, writing to HDF5 and reading back in
+ wws.export_to_hdf5('ww.h5')
+ wws_new = openmc.WeightWindowsList.from_hdf5('ww.h5')
+
+ # Check that the new weight windows are the same as the original
+ assert len(wws) == len(wws_new)
+ for ww, ww_new in zip(wws, wws_new):
+ assert ww.particle_type == ww_new.particle_type
+ assert (ww.lower_ww_bounds == ww_new.lower_ww_bounds).all()
+ assert (ww.upper_ww_bounds == ww_new.upper_ww_bounds).all()
+ assert ww.survival_ratio == ww_new.survival_ratio
+ assert ww.num_energy_bins == ww_new.num_energy_bins
+ assert ww.max_split == ww_new.max_split
+ assert ww.weight_cutoff == ww_new.weight_cutoff
+ assert ww.mesh.id == ww_new.mesh.id