diff --git a/docs/source/io_formats/settings.rst b/docs/source/io_formats/settings.rst index 2a85ebc8a..1016fbaa3 100644 --- a/docs/source/io_formats/settings.rst +++ b/docs/source/io_formats/settings.rst @@ -449,24 +449,27 @@ attributes/sub-elements: *Default*: 1.0 + :type: + Indicator of source type. One of ``independent``, ``file``, or ``compiled``. + :particle: The source particle type, either ``neutron`` or ``photon``. *Default*: neutron :file: - If this attribute is given, it indicates that the source is to be read from - a binary source file whose path is given by the value of this element. Note, - the number of source sites needs to be the same as the number of particles - simulated in a fission source generation. + If this attribute is given, it indicates that the source type is ``file``, + meaning particles are to be read from a binary source file whose path is + given by the value of this element. *Default*: None :library: - If this attribute is given, it indicates that the source is to be - instantiated from an externally compiled source function. This source can be - as complex as is required to define the source for your problem. The library - has a few basic requirements: + If this attribute is given, it indicates that the source type is + ``compiled``, meaning that particles are instantiated from an externally + compiled source function. This source can be completely customized as needed + to define the source for your problem. The library has a few basic + requirements: * It must contain a class that inherits from ``openmc::Source``; * The class must implement a function called ``sample()``; @@ -476,14 +479,12 @@ attributes/sub-elements: More documentation on how to build sources can be found in :ref:`custom_source`. - *Default*: None - :parameters: - If this attribute is given, it provides the parameters to pass through to the - class generated using the ``library`` parameter . More documentation on how to - build parametrized sources can be found in :ref:`parameterized_custom_source`. - - *Default*: None + If this attribute is given, it indicated that the source type is + ``compiled``. Its value provides the parameters to pass through to the class + generated using the ``library`` parameter. More documentation on how to + build parametrized sources can be found in + :ref:`parameterized_custom_source`. :space: An element specifying the spatial distribution of source sites. This element diff --git a/examples/assembly/assembly.py b/examples/assembly/assembly.py index ec1bb7e9f..1355374f1 100644 --- a/examples/assembly/assembly.py +++ b/examples/assembly/assembly.py @@ -112,7 +112,7 @@ def assembly_model(): model.settings.batches = 150 model.settings.inactive = 50 model.settings.particles = 1000 - model.settings.source = openmc.Source(space=openmc.stats.Box( + model.settings.source = openmc.IndependentSource(space=openmc.stats.Box( (-pitch/2, -pitch/2, -1), (pitch/2, pitch/2, 1), only_fissionable=True diff --git a/examples/custom_source/build_xml.py b/examples/custom_source/build_xml.py index a0817d422..e9a9a0656 100644 --- a/examples/custom_source/build_xml.py +++ b/examples/custom_source/build_xml.py @@ -18,7 +18,7 @@ settings = openmc.Settings() settings.run_mode = 'fixed source' settings.batches = 10 settings.particles = 1000 -source = openmc.Source() +source = openmc.IndependentSource() source.library = 'build/libsource.so' settings.source = source settings.export_to_xml() diff --git a/examples/parameterized_custom_source/build_xml.py b/examples/parameterized_custom_source/build_xml.py index 5edb204df..3c67e244d 100644 --- a/examples/parameterized_custom_source/build_xml.py +++ b/examples/parameterized_custom_source/build_xml.py @@ -18,7 +18,7 @@ settings = openmc.Settings() settings.run_mode = 'fixed source' settings.batches = 10 settings.particles = 1000 -source = openmc.Source() +source = openmc.IndependentSource() source.library = 'build/libparameterized_source.so' source.parameters = 'radius=3.0, energy=14.08e6' settings.source = source diff --git a/include/openmc/source.h b/include/openmc/source.h index 96d659dcb..ad2aae562 100644 --- a/include/openmc/source.h +++ b/include/openmc/source.h @@ -115,26 +115,26 @@ private: //! Wrapper for custom sources that manages opening/closing shared library //============================================================================== -class CustomSourceWrapper : public Source { +class CompiledSourceWrapper : public Source { public: // Constructors, destructors - CustomSourceWrapper(std::string path, std::string parameters); - ~CustomSourceWrapper(); + CompiledSourceWrapper(std::string path, std::string parameters); + ~CompiledSourceWrapper(); // Defer implementation to custom source library SourceSite sample(uint64_t* seed) const override { - return custom_source_->sample(seed); + return compiled_source_->sample(seed); } - double strength() const override { return custom_source_->strength(); } + double strength() const override { return compiled_source_->strength(); } private: void* shared_library_; //!< library from dlopen - unique_ptr custom_source_; + unique_ptr compiled_source_; }; -typedef unique_ptr create_custom_source_t(std::string parameters); +typedef unique_ptr create_compiled_source_t(std::string parameters); //============================================================================== // Functions diff --git a/openmc/examples.py b/openmc/examples.py index 3b73d043f..cef86a47a 100644 --- a/openmc/examples.py +++ b/openmc/examples.py @@ -76,7 +76,7 @@ def pwr_pin_cell(): model.settings.batches = 10 model.settings.inactive = 5 model.settings.particles = 100 - model.settings.source = openmc.Source(space=openmc.stats.Box( + model.settings.source = openmc.IndependentSource(space=openmc.stats.Box( [-pitch/2, -pitch/2, -1], [pitch/2, pitch/2, 1], only_fissionable=True)) plot = openmc.Plot.from_geometry(model.geometry) @@ -415,7 +415,7 @@ def pwr_core(): model.settings.batches = 10 model.settings.inactive = 5 model.settings.particles = 100 - model.settings.source = openmc.Source(space=openmc.stats.Box( + model.settings.source = openmc.IndependentSource(space=openmc.stats.Box( [-160, -160, -183], [160, 160, 183])) plot = openmc.Plot() @@ -527,7 +527,7 @@ def pwr_assembly(): model.settings.batches = 10 model.settings.inactive = 5 model.settings.particles = 100 - model.settings.source = openmc.Source(space=openmc.stats.Box( + model.settings.source = openmc.IndependentSource(space=openmc.stats.Box( [-pitch/2, -pitch/2, -1], [pitch/2, pitch/2, 1], only_fissionable=True)) plot = openmc.Plot() @@ -629,7 +629,7 @@ def slab_mg(num_regions=1, mat_names=None, mgxslib_name='2g.h5'): INF = 1000. bounds = [0., -INF, -INF, rads[0], INF, INF] uniform_dist = openmc.stats.Box(bounds[:3], bounds[3:]) - settings_file.source = openmc.source.Source(space=uniform_dist) + settings_file.source = openmc.IndependentSource(space=uniform_dist) settings_file.output = {'summary': False} diff --git a/openmc/settings.py b/openmc/settings.py index fbbb0c719..7937cd2e7 100644 --- a/openmc/settings.py +++ b/openmc/settings.py @@ -13,8 +13,8 @@ import lxml.etree as ET import openmc.checkvalue as cv from openmc.stats.multivariate import MeshSpatial -from . import (RegularMesh, Source, VolumeCalculation, WeightWindows, - WeightWindowGenerator) +from . import (RegularMesh, SourceBase, IndependentSource, + VolumeCalculation, WeightWindows, WeightWindowGenerator) from ._xml import clean_indentation, get_text, reorder_attributes from openmc.checkvalue import PathLike from .mesh import _read_meshes @@ -150,7 +150,7 @@ class Settings: The type of calculation to perform (default is 'eigenvalue') seed : int Seed for the linear congruential pseudorandom number generator - source : Iterable of openmc.Source + source : Iterable of openmc.SourceBase Distribution of source sites in space, angle, and energy sourcepoint : dict Options for writing source points. Acceptable keys are: @@ -265,7 +265,7 @@ class Settings: self._max_order = None # Source subelement - self._source = cv.CheckedList(Source, 'source distributions') + self._source = cv.CheckedList(SourceBase, 'source distributions') self._confidence_intervals = None self._electron_treatment = None @@ -459,14 +459,14 @@ class Settings: self._max_order = max_order @property - def source(self) -> typing.List[Source]: + def source(self) -> typing.List[SourceBase]: return self._source @source.setter - def source(self, source: typing.Union[Source, typing.Iterable[Source]]): + def source(self, source: typing.Union[SourceBase, typing.Iterable[SourceBase]]): if not isinstance(source, MutableSequence): source = [source] - self._source = cv.CheckedList(Source, 'source distributions', source) + self._source = cv.CheckedList(SourceBase, 'source distributions', source) @property def confidence_intervals(self) -> bool: @@ -969,7 +969,7 @@ class Settings: if not isinstance(wwgs, MutableSequence): wwgs = [wwgs] self._weight_window_generators = cv.CheckedList(WeightWindowGenerator, 'weight window generators', wwgs) - + def _create_run_mode_subelement(self, root): elem = ET.SubElement(root, "run_mode") elem.text = self._run_mode.value @@ -1024,7 +1024,7 @@ class Settings: def _create_source_subelement(self, root): for source in self.source: root.append(source.to_xml_element()) - if isinstance(source.space, MeshSpatial): + if isinstance(source, IndependentSource) and isinstance(source.space, MeshSpatial): path = f"./mesh[@id='{source.space.mesh.id}']" if root.find(path) is None: root.append(source.space.mesh.to_xml_element()) @@ -1402,7 +1402,7 @@ class Settings: def _source_from_xml_element(self, root, meshes=None): for elem in root.findall('source'): - src = Source.from_xml_element(elem, meshes) + src = SourceBase.from_xml_element(elem, meshes) # add newly constructed source object to the list self.source.append(src) diff --git a/openmc/source.py b/openmc/source.py index 150830cc8..0e17938a8 100644 --- a/openmc/source.py +++ b/openmc/source.py @@ -1,3 +1,5 @@ +from __future__ import annotations +from abc import ABC, abstractmethod from collections.abc import Iterable from enum import IntEnum from numbers import Real @@ -16,9 +18,107 @@ from openmc.checkvalue import PathLike from openmc.stats.multivariate import UnitSphere, Spatial from openmc.stats.univariate import Univariate from ._xml import get_text +from .mesh import MeshBase -class Source: +class SourceBase(ABC): + """Base class for external sources + + Parameters + ---------- + strength : float + Strength of the source + + Attributes + ---------- + type : {'independent', 'file', 'compiled'} + Indicator of source type. + strength : float + Strength of the source + + """ + + def __init__(self, strength=1.0): + self.strength = strength + + @property + def strength(self): + return self._strength + + @strength.setter + def strength(self, strength): + cv.check_type('source strength', strength, Real) + cv.check_greater_than('source strength', strength, 0.0, True) + self._strength = strength + + @abstractmethod + def populate_xml_element(self, element): + """Add necessary source information to an XML element + + Returns + ------- + element : lxml.etree._Element + XML element containing source data + + """ + pass + + def to_xml_element(self) -> ET.Element: + """Return XML representation of the source + + Returns + ------- + element : xml.etree.ElementTree.Element + XML element containing source data + + """ + element = ET.Element("source") + element.set("type", self.type) + element.set("strength", str(self.strength)) + self.populate_xml_element(element) + return element + + @classmethod + def from_xml_element(cls, elem: ET.Element, meshes=None) -> openmc.SourceBase: + """Generate source from an XML element + + Parameters + ---------- + elem : lxml.etree._Element + XML element + meshes : dict + Dictionary with mesh IDs as keys and openmc.MeshBase instances as + values + + Returns + ------- + openmc.SourceBase + Source generated from XML element + + """ + source_type = get_text(elem, 'type') + + if source_type is None: + # attempt to determine source type based on attributes + # for backward compatibility + if get_text(elem, 'file') is not None: + return FileSource.from_xml_element(elem) + elif get_text(elem, 'library') is not None: + return CompiledSource.from_xml_element(elem) + else: + return IndependentSource.from_xml_element(elem) + else: + if source_type == 'independent': + return IndependentSource.from_xml_element(elem, meshes) + elif source_type == 'compiled': + return CompiledSource.from_xml_element(elem) + elif source_type == 'file': + return FileSource.from_xml_element(elem) + else: + raise ValueError(f'Source type {source_type} is not recognized') + + +class IndependentSource(SourceBase): """Distribution of phase space coordinates for source sites. Parameters @@ -31,14 +131,6 @@ class Source: Energy distribution of source sites time : openmc.stats.Univariate time distribution of source sites - filename : str - Source file from which sites should be sampled - library : str - Path to a custom source library - parameters : str - Parameters to be provided to the custom source library - - .. versionadded:: 0.12 strength : float Strength of the source particle : {'neutron', 'photon'} @@ -57,14 +149,13 @@ class Source: Energy distribution of source sites time : openmc.stats.Univariate or None time distribution of source sites - file : str or None - Source file from which sites should be sampled - library : str or None - Path to a custom source library - parameters : str - Parameters to be provided to the custom source library strength : float Strength of the source + type : str + Indicator of source type: 'independent' + + .. versionadded:: 0.13.4 + particle : {'neutron', 'photon'} Source particle type ids : Iterable of int @@ -80,20 +171,16 @@ class Source: angle: Optional[openmc.stats.UnitSphere] = None, energy: Optional[openmc.stats.Univariate] = None, time: Optional[openmc.stats.Univariate] = None, - filename: Optional[str] = None, - library: Optional[str] = None, - parameters: Optional[str] = None, strength: float = 1.0, particle: str = 'neutron', domains: Optional[Sequence[typing.Union[openmc.Cell, openmc.Material, openmc.Universe]]] = None ): + super().__init__(strength) + self._space = None self._angle = None self._energy = None self._time = None - self._file = None - self._library = None - self._parameters = None if space is not None: self.space = space @@ -103,12 +190,6 @@ class Source: self.energy = energy if time is not None: self.time = time - if filename is not None: - self.file = filename - if library is not None: - self.library = library - if parameters is not None: - self.parameters = parameters self.strength = strength self.particle = particle @@ -124,31 +205,25 @@ class Source: self.domain_ids = [d.id for d in domains] @property - def file(self): - return self._file + def type(self) -> str: + return 'independent' - @file.setter - def file(self, filename): - cv.check_type('source file', filename, str) - self._file = filename + def __getattr__(self, name): + cls_names = {'file': 'FileSource', 'library': 'CompiledSource', + 'parameters': 'CompiledSource'} + if name in cls_names: + raise AttributeError( + f'The "{name}" attribute has been deprecated on the ' + f'IndependentSource class. Please use the {cls_names[name]} class.') + else: + super().__getattribute__(name) - @property - def library(self): - return self._library - - @library.setter - def library(self, library_name): - cv.check_type('library', library_name, str) - self._library = library_name - - @property - def parameters(self): - return self._parameters - - @parameters.setter - def parameters(self, parameters_path): - cv.check_type('parameters', parameters_path, str) - self._parameters = parameters_path + def __setattr__(self, name, value): + if name in ('file', 'library', 'parameters'): + # Ensure proper AttributeError is thrown + getattr(self, name) + else: + super().__setattr__(name, value) @property def space(self): @@ -186,16 +261,6 @@ class Source: cv.check_type('time distribution', time, Univariate) self._time = time - @property - def strength(self): - return self._strength - - @strength.setter - def strength(self, strength): - cv.check_type('source strength', strength, Real) - cv.check_greater_than('source strength', strength, 0.0, True) - self._strength = strength - @property def particle(self): return self._particle @@ -223,25 +288,16 @@ class Source: cv.check_value('domain type', domain_type, ('cell', 'material', 'universe')) self._domain_type = domain_type - def to_xml_element(self) -> ET.Element: - """Return XML representation of the source - + def populate_xml_element(self, element): + """Add necessary source information to an XML element Returns ------- element : lxml.etree._Element XML element containing source data """ - element = ET.Element("source") - element.set("strength", str(self.strength)) - if self.particle != 'neutron': - element.set("particle", self.particle) - if self.file is not None: - element.set("file", self.file) - if self.library is not None: - element.set("library", self.library) - if self.parameters is not None: - element.set("parameters", self.parameters) + super().populate_xml_element(element) + element.set("particle", self.particle) if self.space is not None: element.append(self.space.to_xml_element()) if self.angle is not None: @@ -255,10 +311,9 @@ class Source: dt_elem.text = self.domain_type id_elem = ET.SubElement(element, "domain_ids") id_elem.text = ' '.join(str(uid) for uid in self.domain_ids) - return element @classmethod - def from_xml_element(cls, elem: ET.Element, meshes=None) -> 'openmc.Source': + def from_xml_element(cls, elem: ET.Element, meshes=None) -> 'openmc.SourceBase': """Generate source from an XML element Parameters @@ -306,14 +361,6 @@ class Source: if filename is not None: source.file = filename - library = get_text(elem, 'library') - if library is not None: - source.library = library - - parameters = get_text(elem, 'parameters') - if parameters is not None: - source.parameters = parameters - space = elem.find('space') if space is not None: source.space = Spatial.from_xml_element(space, meshes) @@ -333,6 +380,210 @@ class Source: return source +def Source(*args, **kwargs): + """ + A function for backward compatibility of sources. Will be removed in the + future. Please update to IndependentSource. + """ + warnings.warn("This class is deprecated in favor of 'IndependentSource'", FutureWarning) + return openmc.IndependentSource(*args, **kwargs) + + +class CompiledSource(SourceBase): + """A source based on a compiled shared library + + .. versionadded:: 0.13.4 + + Parameters + ---------- + library : str or None + Path to a compiled shared library + parameters : str + Parameters to be provided to the compiled shared library function + strength : float + Strength of the source + + Attributes + ---------- + library : str or None + Path to a compiled shared library + parameters : str + Parameters to be provided to the compiled shared library function + strength : float + Strength of the source + type : str + Indicator of source type: 'compiled' + + """ + def __init__(self, library: Optional[str] = None, parameters: Optional[str] = None, strength=1.0) -> None: + super().__init__(strength=strength) + + self._library = None + if library is not None: + self.library = library + + self._parameters = None + if parameters is not None: + self.parameters = parameters + + @property + def type(self) -> str: + return "compiled" + + @property + def library(self) -> str: + return self._library + + @library.setter + def library(self, library_name): + cv.check_type('library', library_name, str) + self._library = library_name + + @property + def parameters(self) -> str: + return self._parameters + + @parameters.setter + def parameters(self, parameters_path): + cv.check_type('parameters', parameters_path, str) + self._parameters = parameters_path + + def populate_xml_element(self, element): + """Add necessary compiled source information to an XML element + + Returns + ------- + element : lxml.etree._Element + XML element containing source data + + """ + super().populate_xml_element(element) + + element.set("library", self.library) + + if self.parameters is not None: + element.set("parameters", self.parameters) + + @classmethod + def from_xml_element(cls, elem: ET.Element, meshes=None) -> openmc.CompiledSource: + """Generate a compiled source from an XML element + + Parameters + ---------- + elem : lxml.etree._Element + XML element + meshes : dict + Dictionary with mesh IDs as keys and openmc.MeshBase instances as + values + + Returns + ------- + openmc.CompiledSource + Source generated from XML element + + """ + library = get_text(elem, 'library') + + source = cls(library) + + strength = get_text(elem, 'strength') + if strength is not None: + source.strength = float(strength) + + parameters = get_text(elem, 'parameters') + if parameters is not None: + source.parameters = parameters + + return source + + +class FileSource(SourceBase): + """A source based on particles stored in a file + + .. versionadded:: 0.13.4 + + Parameters + ---------- + path : str or pathlib.Path + Path to the source file from which sites should be sampled + strength : float + Strength of the source (default is 1.0) + + Attributes + ---------- + path : Pathlike + Source file from which sites should be sampled + strength : float + Strength of the source + type : str + Indicator of source type: 'file' + + """ + def __init__(self, path: Optional[PathLike] = None, strength=1.0) -> None: + super().__init__(strength=strength) + + self._path = None + + if path is not None: + self.path = path + + @property + def type(self) -> str: + return "file" + + @property + def path(self) -> PathLike: + return self._path + + @path.setter + def path(self, p: PathLike): + cv.check_type('source file', p, str) + self._path = p + + def populate_xml_element(self, element): + """Add necessary file source information to an XML element + + Returns + ------- + element : lxml.etree._Element + XML element containing source data + + """ + super().populate_xml_element(element) + + if self.path is not None: + element.set("file", self.path) + + @classmethod + def from_xml_element(cls, elem: ET.Element) -> openmc.FileSource: + """Generate file source from an XML element + + Parameters + ---------- + elem : lxml.etree._Element + XML element + meshes : dict + Dictionary with mesh IDs as keys and openmc.MeshBase instances as + values + + Returns + ------- + openmc.FileSource + Source generated from XML element + + """ + + filename = get_text(elem, 'file') + + source = cls(filename) + + strength = get_text(elem, 'strength') + if strength is not None: + source.strength = float(strength) + + return source + + class ParticleType(IntEnum): """ IntEnum class representing a particle type. Type diff --git a/src/settings.cpp b/src/settings.cpp index e16afbedc..1c039e9ba 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -458,7 +458,7 @@ void read_settings_xml(pugi::xml_node root) // Create custom source model::external_sources.push_back( - make_unique(path, parameters)); + make_unique(path, parameters)); } else { model::external_sources.push_back(make_unique(node)); } diff --git a/src/source.cpp b/src/source.cpp index 163c85676..817847b76 100644 --- a/src/source.cpp +++ b/src/source.cpp @@ -326,10 +326,10 @@ SourceSite FileSource::sample(uint64_t* seed) const } //============================================================================== -// CustomSourceWrapper implementation +// CompiledSourceWrapper implementation //============================================================================== -CustomSourceWrapper::CustomSourceWrapper( +CompiledSourceWrapper::CompiledSourceWrapper( std::string path, std::string parameters) { #ifdef HAS_DYNAMIC_LINKING @@ -343,7 +343,7 @@ CustomSourceWrapper::CustomSourceWrapper( dlerror(); // get the function to create the custom source from the library - auto create_custom_source = reinterpret_cast( + auto create_compiled_source = reinterpret_cast( dlsym(shared_library_, "openmc_create_source")); // check for any dlsym errors @@ -356,7 +356,7 @@ CustomSourceWrapper::CustomSourceWrapper( } // create a pointer to an instance of the custom source - custom_source_ = create_custom_source(parameters); + compiled_source_ = create_compiled_source(parameters); #else fatal_error("Custom source libraries have not yet been implemented for " @@ -364,11 +364,11 @@ CustomSourceWrapper::CustomSourceWrapper( #endif } -CustomSourceWrapper::~CustomSourceWrapper() +CompiledSourceWrapper::~CompiledSourceWrapper() { // Make sure custom source is cleared before closing shared library - if (custom_source_.get()) - custom_source_.reset(); + if (compiled_source_.get()) + compiled_source_.reset(); #ifdef HAS_DYNAMIC_LINKING dlclose(shared_library_); diff --git a/tests/regression_tests/adj_cell_rotation/inputs_true.dat b/tests/regression_tests/adj_cell_rotation/inputs_true.dat index 48774bb02..7e2a0cf62 100644 --- a/tests/regression_tests/adj_cell_rotation/inputs_true.dat +++ b/tests/regression_tests/adj_cell_rotation/inputs_true.dat @@ -29,7 +29,7 @@ 10000 10 5 - + -4.0 -4.0 -4.0 4.0 4.0 4.0 diff --git a/tests/regression_tests/adj_cell_rotation/test.py b/tests/regression_tests/adj_cell_rotation/test.py index 25aada5aa..9b867c18e 100644 --- a/tests/regression_tests/adj_cell_rotation/test.py +++ b/tests/regression_tests/adj_cell_rotation/test.py @@ -40,7 +40,7 @@ def model(): model.settings.inactive = 5 model.settings.batches = 10 source_box = openmc.stats.Box((-4., -4., -4.), (4., 4., 4.)) - model.settings.source = openmc.Source(space=source_box) + model.settings.source = openmc.IndependentSource(space=source_box) return model diff --git a/tests/regression_tests/asymmetric_lattice/inputs_true.dat b/tests/regression_tests/asymmetric_lattice/inputs_true.dat index 6a09b10a3..3977220da 100644 --- a/tests/regression_tests/asymmetric_lattice/inputs_true.dat +++ b/tests/regression_tests/asymmetric_lattice/inputs_true.dat @@ -208,7 +208,7 @@ 100 10 5 - + -32 -32 0 32 32 32 diff --git a/tests/regression_tests/asymmetric_lattice/test.py b/tests/regression_tests/asymmetric_lattice/test.py index 2197a1e7e..0d17a6c98 100644 --- a/tests/regression_tests/asymmetric_lattice/test.py +++ b/tests/regression_tests/asymmetric_lattice/test.py @@ -54,7 +54,7 @@ class AsymmetricLatticeTestHarness(PyAPITestHarness): self._model.tallies.append(tally) # Specify summary output and correct source sampling box - self._model.settings.source = openmc.Source(space=openmc.stats.Box( + self._model.settings.source = openmc.IndependentSource(space=openmc.stats.Box( [-32, -32, 0], [32, 32, 32], only_fissionable = True)) def _get_results(self, hash_output=True): diff --git a/tests/regression_tests/create_fission_neutrons/inputs_true.dat b/tests/regression_tests/create_fission_neutrons/inputs_true.dat index 8ee6f8b64..9e44a0224 100644 --- a/tests/regression_tests/create_fission_neutrons/inputs_true.dat +++ b/tests/regression_tests/create_fission_neutrons/inputs_true.dat @@ -20,7 +20,7 @@ fixed source 100 10 - + -1 -1 -1 1 1 1 diff --git a/tests/regression_tests/create_fission_neutrons/test.py b/tests/regression_tests/create_fission_neutrons/test.py index 82bfaafa6..0ca4a48b2 100755 --- a/tests/regression_tests/create_fission_neutrons/test.py +++ b/tests/regression_tests/create_fission_neutrons/test.py @@ -38,8 +38,8 @@ class CreateFissionNeutronsTestHarness(PyAPITestHarness): bounds = [-1, -1, -1, 1, 1, 1] uniform_dist = openmc.stats.Box(bounds[:3], bounds[3:]) watt_dist = openmc.stats.Watt() - settings_file.source = openmc.source.Source(space=uniform_dist, - energy=watt_dist) + settings_file.source = openmc.IndependentSource(space=uniform_dist, + energy=watt_dist) self._model.settings = settings_file # Create tallies diff --git a/tests/regression_tests/dagmc/external/inputs_true.dat b/tests/regression_tests/dagmc/external/inputs_true.dat index 7237f4d46..31f4c1f88 100644 --- a/tests/regression_tests/dagmc/external/inputs_true.dat +++ b/tests/regression_tests/dagmc/external/inputs_true.dat @@ -20,7 +20,7 @@ 100 5 0 - + -4 -4 -4 4 4 4 diff --git a/tests/regression_tests/dagmc/external/test.py b/tests/regression_tests/dagmc/external/test.py index 93123ae1e..7993772e8 100644 --- a/tests/regression_tests/dagmc/external/test.py +++ b/tests/regression_tests/dagmc/external/test.py @@ -65,7 +65,7 @@ def model(): model.settings.particles = 100 source_box = openmc.stats.Box([-4, -4, -4], [ 4, 4, 4]) - source = openmc.Source(space=source_box) + source = openmc.IndependentSource(space=source_box) model.settings.source = source model.settings.temperature['default'] = 293 diff --git a/tests/regression_tests/dagmc/legacy/inputs_true.dat b/tests/regression_tests/dagmc/legacy/inputs_true.dat index b6e5133a4..b06516cb1 100644 --- a/tests/regression_tests/dagmc/legacy/inputs_true.dat +++ b/tests/regression_tests/dagmc/legacy/inputs_true.dat @@ -20,7 +20,7 @@ 100 5 0 - + -4 -4 -4 4 4 4 diff --git a/tests/regression_tests/dagmc/legacy/test.py b/tests/regression_tests/dagmc/legacy/test.py index 36da44808..7e4e6e134 100644 --- a/tests/regression_tests/dagmc/legacy/test.py +++ b/tests/regression_tests/dagmc/legacy/test.py @@ -22,7 +22,7 @@ def model(): source_box = openmc.stats.Box([-4, -4, -4], [ 4, 4, 4]) - source = openmc.Source(space=source_box) + source = openmc.IndependentSource(space=source_box) model.settings.source = source diff --git a/tests/regression_tests/dagmc/refl/inputs_true.dat b/tests/regression_tests/dagmc/refl/inputs_true.dat index 126702e38..979eeb492 100644 --- a/tests/regression_tests/dagmc/refl/inputs_true.dat +++ b/tests/regression_tests/dagmc/refl/inputs_true.dat @@ -10,7 +10,7 @@ 100 5 0 - + -4 -4 -4 4 4 4 diff --git a/tests/regression_tests/dagmc/refl/test.py b/tests/regression_tests/dagmc/refl/test.py index 5b08f0c4a..03c1c407b 100644 --- a/tests/regression_tests/dagmc/refl/test.py +++ b/tests/regression_tests/dagmc/refl/test.py @@ -18,8 +18,8 @@ class UWUWTest(PyAPITestHarness): self._model.settings.inactive = 0 self._model.settings.particles = 100 - source = openmc.Source(space=Box([-4, -4, -4], - [ 4, 4, 4])) + source = openmc.IndependentSource(space=Box([-4, -4, -4], + [ 4, 4, 4])) self._model.settings.source = source # geometry diff --git a/tests/regression_tests/dagmc/uwuw/inputs_true.dat b/tests/regression_tests/dagmc/uwuw/inputs_true.dat index e6537a30e..d7e4a12aa 100644 --- a/tests/regression_tests/dagmc/uwuw/inputs_true.dat +++ b/tests/regression_tests/dagmc/uwuw/inputs_true.dat @@ -10,7 +10,7 @@ 100 5 0 - + -4 -4 -4 4 4 4 diff --git a/tests/regression_tests/dagmc/uwuw/test.py b/tests/regression_tests/dagmc/uwuw/test.py index 19986e589..38c335a5e 100644 --- a/tests/regression_tests/dagmc/uwuw/test.py +++ b/tests/regression_tests/dagmc/uwuw/test.py @@ -18,8 +18,8 @@ class UWUWTest(PyAPITestHarness): self._model.settings.inactive = 0 self._model.settings.particles = 100 - source = openmc.Source(space=Box([-4, -4, -4], - [ 4, 4, 4])) + source = openmc.IndependentSource(space=Box([-4, -4, -4], + [ 4, 4, 4])) self._model.settings.source = source # geometry diff --git a/tests/regression_tests/deplete_with_transport/test.py b/tests/regression_tests/deplete_with_transport/test.py index 477959d1c..49e020367 100644 --- a/tests/regression_tests/deplete_with_transport/test.py +++ b/tests/regression_tests/deplete_with_transport/test.py @@ -46,7 +46,7 @@ def test_full(run_in_tmpdir, problem, multiproc): settings.batches = 10 settings.inactive = 0 space = openmc.stats.Box(lower_left, upper_right) - settings.source = openmc.Source(space=space) + settings.source = openmc.IndependentSource(space=space) settings.seed = 1 settings.verbosity = 1 diff --git a/tests/regression_tests/diff_tally/inputs_true.dat b/tests/regression_tests/diff_tally/inputs_true.dat index 5fad7175d..3ec4154e8 100644 --- a/tests/regression_tests/diff_tally/inputs_true.dat +++ b/tests/regression_tests/diff_tally/inputs_true.dat @@ -300,7 +300,7 @@ 100 3 0 - + -160 -160 -183 160 160 183 diff --git a/tests/regression_tests/diff_tally/test.py b/tests/regression_tests/diff_tally/test.py index 18c501372..89460df91 100644 --- a/tests/regression_tests/diff_tally/test.py +++ b/tests/regression_tests/diff_tally/test.py @@ -16,7 +16,7 @@ class DiffTallyTestHarness(PyAPITestHarness): self._model.settings.batches = 3 self._model.settings.inactive = 0 self._model.settings.particles = 100 - self._model.settings.source = openmc.Source(space=openmc.stats.Box( + self._model.settings.source = openmc.IndependentSource(space=openmc.stats.Box( [-160, -160, -183], [160, 160, 183])) self._model.settings.temperature['multipole'] = True diff --git a/tests/regression_tests/distribmat/inputs_true.dat b/tests/regression_tests/distribmat/inputs_true.dat index d002f0beb..ade86999d 100644 --- a/tests/regression_tests/distribmat/inputs_true.dat +++ b/tests/regression_tests/distribmat/inputs_true.dat @@ -40,7 +40,7 @@ 1000 5 0 - + -1 -1 -1 1 1 1 diff --git a/tests/regression_tests/distribmat/test.py b/tests/regression_tests/distribmat/test.py index ab7897313..02f7e773e 100644 --- a/tests/regression_tests/distribmat/test.py +++ b/tests/regression_tests/distribmat/test.py @@ -65,7 +65,7 @@ class DistribmatTestHarness(PyAPITestHarness): sets_file.batches = 5 sets_file.inactive = 0 sets_file.particles = 1000 - sets_file.source = openmc.Source(space=openmc.stats.Box( + sets_file.source = openmc.IndependentSource(space=openmc.stats.Box( [-1, -1, -1], [1, 1, 1])) self._model.settings = sets_file diff --git a/tests/regression_tests/eigenvalue_genperbatch/inputs_true.dat b/tests/regression_tests/eigenvalue_genperbatch/inputs_true.dat index 690cd14e3..a3e67d62f 100644 --- a/tests/regression_tests/eigenvalue_genperbatch/inputs_true.dat +++ b/tests/regression_tests/eigenvalue_genperbatch/inputs_true.dat @@ -16,7 +16,7 @@ 7 3 3 - + -4.0 -4.0 -4.0 4.0 4.0 4.0 diff --git a/tests/regression_tests/eigenvalue_genperbatch/test.py b/tests/regression_tests/eigenvalue_genperbatch/test.py index 7e21c8d36..17c6dff7f 100644 --- a/tests/regression_tests/eigenvalue_genperbatch/test.py +++ b/tests/regression_tests/eigenvalue_genperbatch/test.py @@ -22,7 +22,7 @@ def model(): model.settings.batches = 7 model.settings.generations_per_batch = 3 space = openmc.stats.Box((-4.0, -4.0, -4.0), (4.0, 4.0, 4.)) - model.settings.source = openmc.Source(space=space) + model.settings.source = openmc.IndependentSource(space=space) t = openmc.Tally() t.scores = ['flux'] diff --git a/tests/regression_tests/energy_cutoff/inputs_true.dat b/tests/regression_tests/energy_cutoff/inputs_true.dat index c24164dd8..af8f86b67 100644 --- a/tests/regression_tests/energy_cutoff/inputs_true.dat +++ b/tests/regression_tests/energy_cutoff/inputs_true.dat @@ -19,7 +19,7 @@ fixed source 100 10 - + -1 -1 -1 1 1 1 diff --git a/tests/regression_tests/energy_cutoff/test.py b/tests/regression_tests/energy_cutoff/test.py index e05d17f5f..9aca802fa 100755 --- a/tests/regression_tests/energy_cutoff/test.py +++ b/tests/regression_tests/energy_cutoff/test.py @@ -40,8 +40,8 @@ class EnergyCutoffTestHarness(PyAPITestHarness): bounds = [-1, -1, -1, 1, 1, 1] uniform_dist = openmc.stats.Box(bounds[:3], bounds[3:]) watt_dist = openmc.stats.Watt() - settings_file.source = openmc.source.Source(space=uniform_dist, - energy=watt_dist) + settings_file.source = openmc.IndependentSource(space=uniform_dist, + energy=watt_dist) self._model.settings = settings_file # Tally flux under energy cutoff diff --git a/tests/regression_tests/external_moab/inputs_true.dat b/tests/regression_tests/external_moab/inputs_true.dat index d54f5db0e..23b656bce 100644 --- a/tests/regression_tests/external_moab/inputs_true.dat +++ b/tests/regression_tests/external_moab/inputs_true.dat @@ -46,7 +46,7 @@ fixed source 100 10 - + 0.0 0.0 0.0 diff --git a/tests/regression_tests/external_moab/test.py b/tests/regression_tests/external_moab/test.py index 12e0e5425..90bff69ed 100644 --- a/tests/regression_tests/external_moab/test.py +++ b/tests/regression_tests/external_moab/test.py @@ -258,7 +258,7 @@ def test_external_mesh(cpp_driver): space = openmc.stats.Point() angle = openmc.stats.Monodirectional((-1.0, 0.0, 0.0)) energy = openmc.stats.Discrete(x=[15.e+06], p=[1.0]) - source = openmc.Source(space=space, energy=energy, angle=angle) + source = openmc.IndependentSource(space=space, energy=energy, angle=angle) settings.source = source model = openmc.model.Model(geometry=geometry, diff --git a/tests/regression_tests/filter_cellinstance/inputs_true.dat b/tests/regression_tests/filter_cellinstance/inputs_true.dat index d3e0937ec..b17cc0eb5 100644 --- a/tests/regression_tests/filter_cellinstance/inputs_true.dat +++ b/tests/regression_tests/filter_cellinstance/inputs_true.dat @@ -39,7 +39,7 @@ 1000 5 0 - + 0.0 0.0 0.0 diff --git a/tests/regression_tests/filter_cellinstance/test.py b/tests/regression_tests/filter_cellinstance/test.py index 3f5fa54b2..0d6ad9366 100644 --- a/tests/regression_tests/filter_cellinstance/test.py +++ b/tests/regression_tests/filter_cellinstance/test.py @@ -69,7 +69,7 @@ def model(): model.settings.batches = 5 model.settings.inactive = 0 model.settings.particles = 1000 - model.settings.source = openmc.Source(space=openmc.stats.Point()) + model.settings.source = openmc.IndependentSource(space=openmc.stats.Point()) instances = ([(c4, i) for i in range(c4.num_instances)] + [(c2, i) for i in range(c2.num_instances)] + diff --git a/tests/regression_tests/fixed_source/inputs_true.dat b/tests/regression_tests/fixed_source/inputs_true.dat index 60043f20c..0fdb1466e 100644 --- a/tests/regression_tests/fixed_source/inputs_true.dat +++ b/tests/regression_tests/fixed_source/inputs_true.dat @@ -15,7 +15,7 @@ fixed source 100 10 - + 0.0 0.0 0.0 diff --git a/tests/regression_tests/fixed_source/test.py b/tests/regression_tests/fixed_source/test.py index 74908f87c..b9ee25125 100644 --- a/tests/regression_tests/fixed_source/test.py +++ b/tests/regression_tests/fixed_source/test.py @@ -48,8 +48,8 @@ def test_fixed_source(): model.settings.batches = 10 model.settings.particles = 100 model.settings.temperature = {'default': 294} - model.settings.source = openmc.Source(space=openmc.stats.Point(), - strength=10.0) + model.settings.source = openmc.IndependentSource(space=openmc.stats.Point(), + strength=10.0) tally = openmc.Tally() tally.scores = ['flux'] diff --git a/tests/regression_tests/iso_in_lab/inputs_true.dat b/tests/regression_tests/iso_in_lab/inputs_true.dat index 2bb81da6d..bb6494ada 100644 --- a/tests/regression_tests/iso_in_lab/inputs_true.dat +++ b/tests/regression_tests/iso_in_lab/inputs_true.dat @@ -312,7 +312,7 @@ 100 10 5 - + -160 -160 -183 160 160 183 diff --git a/tests/regression_tests/lattice_hex_coincident/inputs_true.dat b/tests/regression_tests/lattice_hex_coincident/inputs_true.dat index c51a38c89..7a83fb471 100644 --- a/tests/regression_tests/lattice_hex_coincident/inputs_true.dat +++ b/tests/regression_tests/lattice_hex_coincident/inputs_true.dat @@ -68,7 +68,7 @@ 1000 5 2 - + -0.9899494936611666 -0.9899494936611666 0.0 0.9899494936611666 0.9899494936611666 10.0 diff --git a/tests/regression_tests/lattice_hex_coincident/test.py b/tests/regression_tests/lattice_hex_coincident/test.py index fae7f939b..5a4760cd7 100644 --- a/tests/regression_tests/lattice_hex_coincident/test.py +++ b/tests/regression_tests/lattice_hex_coincident/test.py @@ -132,7 +132,7 @@ class HexLatticeCoincidentTestHarness(PyAPITestHarness): settings = openmc.Settings() settings.run_mode = 'eigenvalue' - source = openmc.Source() + source = openmc.IndependentSource() corner_dist = sqrt(2) * pin_rad ll = [-corner_dist, -corner_dist, 0.0] ur = [corner_dist, corner_dist, 10.0] diff --git a/tests/regression_tests/lattice_hex_x/inputs_true.dat b/tests/regression_tests/lattice_hex_x/inputs_true.dat index c51012029..2946258e8 100644 --- a/tests/regression_tests/lattice_hex_x/inputs_true.dat +++ b/tests/regression_tests/lattice_hex_x/inputs_true.dat @@ -113,7 +113,7 @@ 1000 10 5 - + -13.62546635287517 -13.62546635287517 0.0 13.62546635287517 13.62546635287517 10.0 diff --git a/tests/regression_tests/lattice_hex_x/test.py b/tests/regression_tests/lattice_hex_x/test.py index e582c68ae..23aec77d3 100644 --- a/tests/regression_tests/lattice_hex_x/test.py +++ b/tests/regression_tests/lattice_hex_x/test.py @@ -187,7 +187,7 @@ class HexLatticeOXTestHarness(PyAPITestHarness): settings = openmc.Settings() settings.run_mode = 'eigenvalue' - source = openmc.Source() + source = openmc.IndependentSource() ll = [-edge_length, -edge_length, 0.0] ur = [edge_length, edge_length, 10.0] source.space = openmc.stats.Box(ll, ur) diff --git a/tests/regression_tests/lattice_rotated/inputs_true.dat b/tests/regression_tests/lattice_rotated/inputs_true.dat index 3a8a0784e..1b7c74870 100644 --- a/tests/regression_tests/lattice_rotated/inputs_true.dat +++ b/tests/regression_tests/lattice_rotated/inputs_true.dat @@ -62,7 +62,7 @@ 1000 5 0 - + 0.0 0.0 0.0 diff --git a/tests/regression_tests/lattice_rotated/test.py b/tests/regression_tests/lattice_rotated/test.py index 9cab92e1e..63641fb84 100644 --- a/tests/regression_tests/lattice_rotated/test.py +++ b/tests/regression_tests/lattice_rotated/test.py @@ -73,7 +73,7 @@ def rotated_lattice_model(): model.settings.batches = 5 model.settings.inactive = 0 model.settings.particles = 1000 - model.settings.source = openmc.Source(space=openmc.stats.Point()) + model.settings.source = openmc.IndependentSource(space=openmc.stats.Point()) model.settings.export_to_xml() return model diff --git a/tests/regression_tests/mg_basic/inputs_true.dat b/tests/regression_tests/mg_basic/inputs_true.dat index 5ec5ade75..8c6faaf07 100644 --- a/tests/regression_tests/mg_basic/inputs_true.dat +++ b/tests/regression_tests/mg_basic/inputs_true.dat @@ -48,7 +48,7 @@ 1000 10 5 - + 0.0 -1000.0 -1000.0 154.90833333333333 1000.0 1000.0 diff --git a/tests/regression_tests/mg_basic_delayed/inputs_true.dat b/tests/regression_tests/mg_basic_delayed/inputs_true.dat index b3f1993d9..e0bcad15c 100644 --- a/tests/regression_tests/mg_basic_delayed/inputs_true.dat +++ b/tests/regression_tests/mg_basic_delayed/inputs_true.dat @@ -47,7 +47,7 @@ 1000 10 5 - + 0.0 -1000.0 -1000.0 154.90833333333333 1000.0 1000.0 diff --git a/tests/regression_tests/mg_convert/inputs_true.dat b/tests/regression_tests/mg_convert/inputs_true.dat index 8277ca483..4e51ec80c 100644 --- a/tests/regression_tests/mg_convert/inputs_true.dat +++ b/tests/regression_tests/mg_convert/inputs_true.dat @@ -19,7 +19,7 @@ 100 10 5 - + -5 -5 -5 5 5 5 diff --git a/tests/regression_tests/mg_convert/test.py b/tests/regression_tests/mg_convert/test.py index d9c4a57bd..8099c89a2 100755 --- a/tests/regression_tests/mg_convert/test.py +++ b/tests/regression_tests/mg_convert/test.py @@ -114,7 +114,7 @@ class MGXSTestHarness(PyAPITestHarness): # Create an initial uniform spatial source distribution bounds = [-5, -5, -5, 5, 5, 5] uniform_dist = openmc.stats.Box(bounds[:3], bounds[3:]) - settings_file.source = openmc.source.Source(space=uniform_dist) + settings_file.source = openmc.IndependentSource(space=uniform_dist) self._model.settings = settings_file diff --git a/tests/regression_tests/mg_legendre/inputs_true.dat b/tests/regression_tests/mg_legendre/inputs_true.dat index 4b7293d81..34ff7b630 100644 --- a/tests/regression_tests/mg_legendre/inputs_true.dat +++ b/tests/regression_tests/mg_legendre/inputs_true.dat @@ -17,7 +17,7 @@ 1000 10 5 - + 0.0 -1000.0 -1000.0 929.45 1000.0 1000.0 diff --git a/tests/regression_tests/mg_max_order/inputs_true.dat b/tests/regression_tests/mg_max_order/inputs_true.dat index 82699d00e..b6d70dc4c 100644 --- a/tests/regression_tests/mg_max_order/inputs_true.dat +++ b/tests/regression_tests/mg_max_order/inputs_true.dat @@ -17,7 +17,7 @@ 1000 10 5 - + 0.0 -1000.0 -1000.0 929.45 1000.0 1000.0 diff --git a/tests/regression_tests/mg_survival_biasing/inputs_true.dat b/tests/regression_tests/mg_survival_biasing/inputs_true.dat index 2b5801e12..6529c60d8 100644 --- a/tests/regression_tests/mg_survival_biasing/inputs_true.dat +++ b/tests/regression_tests/mg_survival_biasing/inputs_true.dat @@ -17,7 +17,7 @@ 1000 10 5 - + 0.0 -1000.0 -1000.0 929.45 1000.0 1000.0 diff --git a/tests/regression_tests/mg_tallies/inputs_true.dat b/tests/regression_tests/mg_tallies/inputs_true.dat index b7d362b17..c526b65a2 100644 --- a/tests/regression_tests/mg_tallies/inputs_true.dat +++ b/tests/regression_tests/mg_tallies/inputs_true.dat @@ -17,7 +17,7 @@ 1000 10 5 - + 0.0 -1000.0 -1000.0 929.45 1000.0 1000.0 diff --git a/tests/regression_tests/mg_temperature/build_2g.py b/tests/regression_tests/mg_temperature/build_2g.py index 42f948be1..f236031a7 100644 --- a/tests/regression_tests/mg_temperature/build_2g.py +++ b/tests/regression_tests/mg_temperature/build_2g.py @@ -291,6 +291,6 @@ def build_inf_model(xsnames, xslibname, temperature, tempmethod='nearest'): bounds = [-INF, -INF, -INF, INF, INF, INF] uniform_dist = openmc.stats.Box(bounds[:3], bounds[3:], only_fissionable=True) settings_file.temperature = {'method': tempmethod} - settings_file.source = openmc.Source(space=uniform_dist) + settings_file.source = openmc.IndependentSource(space=uniform_dist) model.settings = settings_file model.export_to_model_xml() diff --git a/tests/regression_tests/mgxs_library_ce_to_mg/inputs_true.dat b/tests/regression_tests/mgxs_library_ce_to_mg/inputs_true.dat index 74067874a..d9a3c52c8 100644 --- a/tests/regression_tests/mgxs_library_ce_to_mg/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_ce_to_mg/inputs_true.dat @@ -41,7 +41,7 @@ 100 10 5 - + -0.63 -0.63 -1 0.63 0.63 1 diff --git a/tests/regression_tests/mgxs_library_ce_to_mg_nuclides/inputs_true.dat b/tests/regression_tests/mgxs_library_ce_to_mg_nuclides/inputs_true.dat index 13a6ea6d4..f84adc329 100644 --- a/tests/regression_tests/mgxs_library_ce_to_mg_nuclides/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_ce_to_mg_nuclides/inputs_true.dat @@ -41,7 +41,7 @@ 100 10 5 - + -0.63 -0.63 -1 0.63 0.63 1 diff --git a/tests/regression_tests/mgxs_library_condense/inputs_true.dat b/tests/regression_tests/mgxs_library_condense/inputs_true.dat index ce7095765..93519cd2a 100644 --- a/tests/regression_tests/mgxs_library_condense/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_condense/inputs_true.dat @@ -41,7 +41,7 @@ 100 10 5 - + -0.63 -0.63 -1 0.63 0.63 1 diff --git a/tests/regression_tests/mgxs_library_correction/inputs_true.dat b/tests/regression_tests/mgxs_library_correction/inputs_true.dat index 4d9dbecd6..80cbc4bb5 100644 --- a/tests/regression_tests/mgxs_library_correction/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_correction/inputs_true.dat @@ -41,7 +41,7 @@ 100 10 5 - + -0.63 -0.63 -1 0.63 0.63 1 diff --git a/tests/regression_tests/mgxs_library_distribcell/inputs_true.dat b/tests/regression_tests/mgxs_library_distribcell/inputs_true.dat index 893e0b3bf..fc2c06d1c 100644 --- a/tests/regression_tests/mgxs_library_distribcell/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_distribcell/inputs_true.dat @@ -68,7 +68,7 @@ 100 10 5 - + -10.71 -10.71 -1 10.71 10.71 1 diff --git a/tests/regression_tests/mgxs_library_hdf5/inputs_true.dat b/tests/regression_tests/mgxs_library_hdf5/inputs_true.dat index ce7095765..93519cd2a 100644 --- a/tests/regression_tests/mgxs_library_hdf5/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_hdf5/inputs_true.dat @@ -41,7 +41,7 @@ 100 10 5 - + -0.63 -0.63 -1 0.63 0.63 1 diff --git a/tests/regression_tests/mgxs_library_histogram/inputs_true.dat b/tests/regression_tests/mgxs_library_histogram/inputs_true.dat index f45b7dbf3..178a44464 100644 --- a/tests/regression_tests/mgxs_library_histogram/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_histogram/inputs_true.dat @@ -41,7 +41,7 @@ 100 10 5 - + -0.63 -0.63 -1 0.63 0.63 1 diff --git a/tests/regression_tests/mgxs_library_no_nuclides/inputs_true.dat b/tests/regression_tests/mgxs_library_no_nuclides/inputs_true.dat index 0608d6f96..0003413ac 100644 --- a/tests/regression_tests/mgxs_library_no_nuclides/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_no_nuclides/inputs_true.dat @@ -41,7 +41,7 @@ 100 10 5 - + -0.63 -0.63 -1 0.63 0.63 1 diff --git a/tests/regression_tests/mgxs_library_nuclides/inputs_true.dat b/tests/regression_tests/mgxs_library_nuclides/inputs_true.dat index 215bb7c9f..97e227177 100644 --- a/tests/regression_tests/mgxs_library_nuclides/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_nuclides/inputs_true.dat @@ -41,7 +41,7 @@ 100 10 5 - + -0.63 -0.63 -1 0.63 0.63 1 diff --git a/tests/regression_tests/mgxs_library_specific_nuclides/inputs_true.dat b/tests/regression_tests/mgxs_library_specific_nuclides/inputs_true.dat index 907bf43cc..b73ed179e 100644 --- a/tests/regression_tests/mgxs_library_specific_nuclides/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_specific_nuclides/inputs_true.dat @@ -41,7 +41,7 @@ 100 10 5 - + -0.63 -0.63 -1 0.63 0.63 1 diff --git a/tests/regression_tests/model_xml/adj_cell_rotation_inputs_true.dat b/tests/regression_tests/model_xml/adj_cell_rotation_inputs_true.dat index 48774bb02..7e2a0cf62 100644 --- a/tests/regression_tests/model_xml/adj_cell_rotation_inputs_true.dat +++ b/tests/regression_tests/model_xml/adj_cell_rotation_inputs_true.dat @@ -29,7 +29,7 @@ 10000 10 5 - + -4.0 -4.0 -4.0 4.0 4.0 4.0 diff --git a/tests/regression_tests/model_xml/photon_production_inputs_true.dat b/tests/regression_tests/model_xml/photon_production_inputs_true.dat index 109b54c67..ee6cb8862 100644 --- a/tests/regression_tests/model_xml/photon_production_inputs_true.dat +++ b/tests/regression_tests/model_xml/photon_production_inputs_true.dat @@ -19,7 +19,7 @@ fixed source 10000 1 - + 0 0 0 diff --git a/tests/regression_tests/multipole/inputs_true.dat b/tests/regression_tests/multipole/inputs_true.dat index 5c905afb9..7bea66930 100644 --- a/tests/regression_tests/multipole/inputs_true.dat +++ b/tests/regression_tests/multipole/inputs_true.dat @@ -37,7 +37,7 @@ 1000 5 0 - + -1 -1 -1 1 1 1 diff --git a/tests/regression_tests/multipole/test.py b/tests/regression_tests/multipole/test.py index 4c4353c84..2f7369a9d 100644 --- a/tests/regression_tests/multipole/test.py +++ b/tests/regression_tests/multipole/test.py @@ -53,7 +53,7 @@ def make_model(): model.settings.batches = 5 model.settings.inactive = 0 model.settings.particles = 1000 - model.settings.source = openmc.Source(space=openmc.stats.Box( + model.settings.source = openmc.IndependentSource(space=openmc.stats.Box( [-1, -1, -1], [1, 1, 1])) model.settings.temperature = {'tolerance': 1000, 'multipole': True} diff --git a/tests/regression_tests/ncrystal/inputs_true.dat b/tests/regression_tests/ncrystal/inputs_true.dat index be2336cf0..ecbc3c54f 100644 --- a/tests/regression_tests/ncrystal/inputs_true.dat +++ b/tests/regression_tests/ncrystal/inputs_true.dat @@ -16,7 +16,7 @@ fixed source 100000 10 - + 0 0 -20 diff --git a/tests/regression_tests/ncrystal/test.py b/tests/regression_tests/ncrystal/test.py index cb6421b03..03994e0d3 100644 --- a/tests/regression_tests/ncrystal/test.py +++ b/tests/regression_tests/ncrystal/test.py @@ -33,7 +33,7 @@ def pencil_beam_model(cfg, E0, N): # Source definition - source = openmc.Source() + source = openmc.IndependentSource() source.space = openmc.stats.Point((0, 0, -20)) source.angle = openmc.stats.Monodirectional(reference_uvw=(0, 0, 1)) source.energy = openmc.stats.Discrete([E0], [1.0]) diff --git a/tests/regression_tests/periodic/inputs_true.dat b/tests/regression_tests/periodic/inputs_true.dat index 9d50c2b72..65e1b5ce3 100644 --- a/tests/regression_tests/periodic/inputs_true.dat +++ b/tests/regression_tests/periodic/inputs_true.dat @@ -28,7 +28,7 @@ 1000 4 0 - + 0 0 0 5 5 0 diff --git a/tests/regression_tests/periodic/test.py b/tests/regression_tests/periodic/test.py index 51a70a6aa..73fe8a83e 100644 --- a/tests/regression_tests/periodic/test.py +++ b/tests/regression_tests/periodic/test.py @@ -42,7 +42,7 @@ def box_model(): model.settings.particles = 1000 model.settings.batches = 4 model.settings.inactive = 0 - model.settings.source = openmc.Source(space=openmc.stats.Box( + model.settings.source = openmc.IndependentSource(space=openmc.stats.Box( (0, 0, 0), (5, 5, 0)) ) return model diff --git a/tests/regression_tests/periodic_6fold/inputs_true.dat b/tests/regression_tests/periodic_6fold/inputs_true.dat index 795ce818f..f7f413d09 100644 --- a/tests/regression_tests/periodic_6fold/inputs_true.dat +++ b/tests/regression_tests/periodic_6fold/inputs_true.dat @@ -25,7 +25,7 @@ 1000 4 0 - + 0 0 0 5 5 0 diff --git a/tests/regression_tests/periodic_6fold/test.py b/tests/regression_tests/periodic_6fold/test.py index 69712eb5a..272c65df5 100644 --- a/tests/regression_tests/periodic_6fold/test.py +++ b/tests/regression_tests/periodic_6fold/test.py @@ -46,7 +46,7 @@ def model(): model.settings.particles = 1000 model.settings.batches = 4 model.settings.inactive = 0 - model.settings.source = openmc.Source(space=openmc.stats.Box( + model.settings.source = openmc.IndependentSource(space=openmc.stats.Box( (0, 0, 0), (5, 5, 0)) ) return model diff --git a/tests/regression_tests/photon_production/inputs_true.dat b/tests/regression_tests/photon_production/inputs_true.dat index 109b54c67..ee6cb8862 100644 --- a/tests/regression_tests/photon_production/inputs_true.dat +++ b/tests/regression_tests/photon_production/inputs_true.dat @@ -19,7 +19,7 @@ fixed source 10000 1 - + 0 0 0 diff --git a/tests/regression_tests/photon_production/test.py b/tests/regression_tests/photon_production/test.py index 107b53bbb..150448a12 100644 --- a/tests/regression_tests/photon_production/test.py +++ b/tests/regression_tests/photon_production/test.py @@ -27,7 +27,7 @@ def model(): inner_cyl_right.fill = mat model.geometry = openmc.Geometry([inner_cyl_left, inner_cyl_right, outer_cyl]) - source = openmc.Source() + source = openmc.IndependentSource() source.space = openmc.stats.Point((0, 0, 0)) source.angle = openmc.stats.Monodirectional() source.energy = openmc.stats.Discrete([14.0e6], [1.0]) diff --git a/tests/regression_tests/photon_production_fission/inputs_true.dat b/tests/regression_tests/photon_production_fission/inputs_true.dat index 6a102cfdc..fa379b39e 100644 --- a/tests/regression_tests/photon_production_fission/inputs_true.dat +++ b/tests/regression_tests/photon_production_fission/inputs_true.dat @@ -15,7 +15,7 @@ 1000 5 2 - + 0 0 0 diff --git a/tests/regression_tests/photon_production_fission/test.py b/tests/regression_tests/photon_production_fission/test.py index 595d3c2d6..96665b308 100644 --- a/tests/regression_tests/photon_production_fission/test.py +++ b/tests/regression_tests/photon_production_fission/test.py @@ -20,7 +20,7 @@ def model(): model.settings.batches = 5 model.settings.inactive = 2 model.settings.photon_transport = True - model.settings.source = openmc.Source(space=openmc.stats.Point((0, 0, 0))) + model.settings.source = openmc.IndependentSource(space=openmc.stats.Point((0, 0, 0))) particle_filter = openmc.ParticleFilter(['neutron', 'photon']) tally_tracklength = openmc.Tally() diff --git a/tests/regression_tests/photon_source/inputs_true.dat b/tests/regression_tests/photon_source/inputs_true.dat index 33ace2c70..3d2e05243 100644 --- a/tests/regression_tests/photon_source/inputs_true.dat +++ b/tests/regression_tests/photon_source/inputs_true.dat @@ -17,7 +17,7 @@ fixed source 10000 1 - + 0 0 0 diff --git a/tests/regression_tests/photon_source/test.py b/tests/regression_tests/photon_source/test.py index d4b4a69fd..c2eb1476d 100644 --- a/tests/regression_tests/photon_source/test.py +++ b/tests/regression_tests/photon_source/test.py @@ -21,7 +21,7 @@ class SourceTestHarness(PyAPITestHarness): inside_sphere.fill = mat self._model.geometry = openmc.Geometry([inside_sphere]) - source = openmc.Source() + source = openmc.IndependentSource() source.space = openmc.stats.Point((0, 0, 0)) source.angle = openmc.stats.Isotropic() source.energy = openmc.stats.Discrete([10.0e6], [1.0]) diff --git a/tests/regression_tests/resonance_scattering/inputs_true.dat b/tests/regression_tests/resonance_scattering/inputs_true.dat index 6ab82ba24..dba4535c2 100644 --- a/tests/regression_tests/resonance_scattering/inputs_true.dat +++ b/tests/regression_tests/resonance_scattering/inputs_true.dat @@ -18,7 +18,7 @@ 1000 10 5 - + -4 -4 -4 4 4 4 diff --git a/tests/regression_tests/resonance_scattering/test.py b/tests/regression_tests/resonance_scattering/test.py index d9f76fac5..24629b12b 100644 --- a/tests/regression_tests/resonance_scattering/test.py +++ b/tests/regression_tests/resonance_scattering/test.py @@ -35,7 +35,7 @@ class ResonanceScatteringTestHarness(PyAPITestHarness): settings.batches = 10 settings.inactive = 5 settings.particles = 1000 - settings.source = openmc.source.Source( + settings.source = openmc.IndependentSource( space=openmc.stats.Box([-4, -4, -4], [4, 4, 4])) settings.resonance_scattering = res_scat_settings self._model.settings = settings diff --git a/tests/regression_tests/salphabeta/inputs_true.dat b/tests/regression_tests/salphabeta/inputs_true.dat index 508624b75..ef0e843c2 100644 --- a/tests/regression_tests/salphabeta/inputs_true.dat +++ b/tests/regression_tests/salphabeta/inputs_true.dat @@ -51,7 +51,7 @@ 400 5 0 - + -4 -4 -4 4 4 4 diff --git a/tests/regression_tests/salphabeta/test.py b/tests/regression_tests/salphabeta/test.py index fd0486118..11bf3bc84 100644 --- a/tests/regression_tests/salphabeta/test.py +++ b/tests/regression_tests/salphabeta/test.py @@ -67,7 +67,7 @@ def make_model(): model.settings.batches = 5 model.settings.inactive = 0 model.settings.particles = 400 - model.settings.source = openmc.Source(space=openmc.stats.Box( + model.settings.source = openmc.IndependentSource(space=openmc.stats.Box( [-4, -4, -4], [4, 4, 4])) return model diff --git a/tests/regression_tests/source/inputs_true.dat b/tests/regression_tests/source/inputs_true.dat index 460be7077..c1a616dd1 100644 --- a/tests/regression_tests/source/inputs_true.dat +++ b/tests/regression_tests/source/inputs_true.dat @@ -15,7 +15,7 @@ 1000 10 5 - + @@ -33,14 +33,14 @@ - + -4.0 -4.0 -4.0 4.0 4.0 4.0 - + 1.2 -2.3 0.781 @@ -49,7 +49,7 @@ 1.0 1.3894954943731377 1.93069772888325 2.6826957952797255 3.72759372031494 5.17947467923121 7.196856730011519 10.0 13.894954943731374 19.306977288832496 26.826957952797247 37.2759372031494 51.7947467923121 71.96856730011518 100.0 138.94954943731375 193.06977288832496 268.26957952797244 372.7593720314938 517.9474679231207 719.6856730011514 1000.0 1389.4954943731375 1930.6977288832495 2682.6957952797247 3727.593720314938 5179.474679231207 7196.856730011514 10000.0 13894.95494373136 19306.977288832495 26826.95795279722 37275.93720314938 51794.74679231213 71968.56730011514 100000.0 138949.5494373136 193069.77288832495 268269.5795279722 372759.3720314938 517947.4679231202 719685.6730011514 1000000.0 1389495.494373136 1930697.7288832497 2682695.7952797217 3727593.720314938 5179474.679231202 7196856.730011513 10000000.0 0.0 2.9086439299358713e-08 5.80533561806147e-08 8.67817193689187e-08 1.1515347785771536e-07 1.4305204600565115e-07 1.7036278261198208e-07 1.9697346200185813e-07 2.227747351856934e-07 2.4766057919761985e-07 2.715287327665956e-07 2.9428111652990295e-07 3.1582423606228735e-07 3.360695660646056e-07 3.549339141332686e-07 3.723397626156721e-07 3.882155871468592e-07 4.024961505584776e-07 4.151227709522976e-07 4.260435628367196e-07 4.3521365033538783e-07 4.4259535159179273e-07 4.4815833361210174e-07 4.5187973690993757e-07 4.5374426944091084e-07 4.5374426944091084e-07 4.5187973690993757e-07 4.4815833361210174e-07 4.4259535159179273e-07 4.352136503353879e-07 4.2604356283671966e-07 4.1512277095229767e-07 4.0249615055847764e-07 3.8821558714685926e-07 3.723397626156722e-07 3.5493391413326864e-07 3.360695660646057e-07 3.158242360622874e-07 2.942811165299031e-07 2.715287327665957e-07 2.4766057919762e-07 2.2277473518569352e-07 1.9697346200185819e-07 1.7036278261198226e-07 1.4305204600565126e-07 1.1515347785771556e-07 8.678171936891881e-08 5.805335618061493e-08 2.9086439299358858e-08 5.559621115282002e-23 - + @@ -62,7 +62,7 @@ 1.0 1.3894954943731377 1.93069772888325 2.6826957952797255 3.72759372031494 5.17947467923121 7.196856730011519 10.0 13.894954943731374 19.306977288832496 26.826957952797247 37.2759372031494 51.7947467923121 71.96856730011518 100.0 138.94954943731375 193.06977288832496 268.26957952797244 372.7593720314938 517.9474679231207 719.6856730011514 1000.0 1389.4954943731375 1930.6977288832495 2682.6957952797247 3727.593720314938 5179.474679231207 7196.856730011514 10000.0 13894.95494373136 19306.977288832495 26826.95795279722 37275.93720314938 51794.74679231213 71968.56730011514 100000.0 138949.5494373136 193069.77288832495 268269.5795279722 372759.3720314938 517947.4679231202 719685.6730011514 1000000.0 1389495.494373136 1930697.7288832497 2682695.7952797217 3727593.720314938 5179474.679231202 7196856.730011513 10000000.0 0.0 2.9086439299358713e-08 5.80533561806147e-08 8.67817193689187e-08 1.1515347785771536e-07 1.4305204600565115e-07 1.7036278261198208e-07 1.9697346200185813e-07 2.227747351856934e-07 2.4766057919761985e-07 2.715287327665956e-07 2.9428111652990295e-07 3.1582423606228735e-07 3.360695660646056e-07 3.549339141332686e-07 3.723397626156721e-07 3.882155871468592e-07 4.024961505584776e-07 4.151227709522976e-07 4.260435628367196e-07 4.3521365033538783e-07 4.4259535159179273e-07 4.4815833361210174e-07 4.5187973690993757e-07 4.5374426944091084e-07 4.5374426944091084e-07 4.5187973690993757e-07 4.4815833361210174e-07 4.4259535159179273e-07 4.352136503353879e-07 4.2604356283671966e-07 4.1512277095229767e-07 4.0249615055847764e-07 3.8821558714685926e-07 3.723397626156722e-07 3.5493391413326864e-07 3.360695660646057e-07 3.158242360622874e-07 2.942811165299031e-07 2.715287327665957e-07 2.4766057919762e-07 2.2277473518569352e-07 1.9697346200185819e-07 1.7036278261198226e-07 1.4305204600565126e-07 1.1515347785771556e-07 8.678171936891881e-08 5.805335618061493e-08 2.9086439299358858e-08 5.559621115282002e-23 - + @@ -75,7 +75,7 @@ 1.0 1.3894954943731377 1.93069772888325 2.6826957952797255 3.72759372031494 5.17947467923121 7.196856730011519 10.0 13.894954943731374 19.306977288832496 26.826957952797247 37.2759372031494 51.7947467923121 71.96856730011518 100.0 138.94954943731375 193.06977288832496 268.26957952797244 372.7593720314938 517.9474679231207 719.6856730011514 1000.0 1389.4954943731375 1930.6977288832495 2682.6957952797247 3727.593720314938 5179.474679231207 7196.856730011514 10000.0 13894.95494373136 19306.977288832495 26826.95795279722 37275.93720314938 51794.74679231213 71968.56730011514 100000.0 138949.5494373136 193069.77288832495 268269.5795279722 372759.3720314938 517947.4679231202 719685.6730011514 1000000.0 1389495.494373136 1930697.7288832497 2682695.7952797217 3727593.720314938 5179474.679231202 7196856.730011513 10000000.0 0.0 2.9086439299358713e-08 5.80533561806147e-08 8.67817193689187e-08 1.1515347785771536e-07 1.4305204600565115e-07 1.7036278261198208e-07 1.9697346200185813e-07 2.227747351856934e-07 2.4766057919761985e-07 2.715287327665956e-07 2.9428111652990295e-07 3.1582423606228735e-07 3.360695660646056e-07 3.549339141332686e-07 3.723397626156721e-07 3.882155871468592e-07 4.024961505584776e-07 4.151227709522976e-07 4.260435628367196e-07 4.3521365033538783e-07 4.4259535159179273e-07 4.4815833361210174e-07 4.5187973690993757e-07 4.5374426944091084e-07 4.5374426944091084e-07 4.5187973690993757e-07 4.4815833361210174e-07 4.4259535159179273e-07 4.352136503353879e-07 4.2604356283671966e-07 4.1512277095229767e-07 4.0249615055847764e-07 3.8821558714685926e-07 3.723397626156722e-07 3.5493391413326864e-07 3.360695660646057e-07 3.158242360622874e-07 2.942811165299031e-07 2.715287327665957e-07 2.4766057919762e-07 2.2277473518569352e-07 1.9697346200185819e-07 1.7036278261198226e-07 1.4305204600565126e-07 1.1515347785771556e-07 8.678171936891881e-08 5.805335618061493e-08 2.9086439299358858e-08 5.559621115282002e-23 - + @@ -98,7 +98,7 @@ - + @@ -122,7 +122,7 @@