diff --git a/docs/source/conf.py b/docs/source/conf.py index d7fc23c43e..22fc13a3ff 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -248,7 +248,7 @@ napoleon_use_ivar = True intersphinx_mapping = { 'python': ('https://docs.python.org/3', None), - 'numpy': ('http://docs.scipy.org/doc/numpy/', None), + 'numpy': ('https://docs.scipy.org/doc/numpy/', None), 'pandas': ('http://pandas.pydata.org/pandas-docs/stable/', None), 'matplotlib': ('http://matplotlib.org/', None) } diff --git a/docs/source/pythonapi/index.rst b/docs/source/pythonapi/index.rst index 1125a4b32d..fb6cfe9277 100644 --- a/docs/source/pythonapi/index.rst +++ b/docs/source/pythonapi/index.rst @@ -115,15 +115,17 @@ Many of the above classes are derived from several abstract classes: openmc.Region openmc.Lattice -One function is also available to create a hexagonal region defined by the -intersection of six surface half-spaces. +Two helper function are also available to create rectangular and hexagonal +prisms defined by the intersection of four and six surface half-spaces, +respectively. .. autosummary:: :toctree: generated :nosignatures: :template: myfunction.rst - openmc.make_hexagon_region + openmc.get_hexagonal_prism + openmc.get_rectangular_prism Constructing Tallies -------------------- diff --git a/docs/source/usersguide/input.rst b/docs/source/usersguide/input.rst index 809e02b916..a64454e92e 100644 --- a/docs/source/usersguide/input.rst +++ b/docs/source/usersguide/input.rst @@ -94,6 +94,18 @@ Settings Specification -- settings.xml All simulation parameters and miscellaneous options are specified in the settings.xml file. +```` Element +--------------------- + +The ```` element indicates the total number of batches to execute, +where each batch corresponds to a tally realization. In a fixed source +calculation, each batch consists of a number of source particles. In an +eigenvalue calculation, each batch consists of one or many fission source +iterations (generations), where each generation itself consists of a number of +source neutrons. + + *Default*: None + ```` Element ---------------------------------- @@ -132,67 +144,6 @@ you care. This element has the following attributes/sub-elements: *Default*: 0.0 -.. _eigenvalue: - -```` Element ------------------------- - -The ```` element indicates that a :math:`k`-eigenvalue calculation -should be performed. It has the following attributes/sub-elements: - - :batches: - The total number of batches, where each batch corresponds to multiple - fission source iterations. Batching is done to eliminate correlation between - realizations of random variables. - - *Default*: None - - :generations_per_batch: - The number of total fission source iterations per batch. - - *Default*: 1 - - :inactive: - The number of inactive batches. In general, the starting cycles in a - criticality calculation can not be used to contribute to tallies since the - fission source distribution and eigenvalue are generally not converged - immediately. - - *Default*: None - - :particles: - The number of neutrons to simulate per fission source iteration. - - *Default*: None - - :keff_trigger: - This tag specifies a precision trigger on the combined :math:`k_{eff}`. The - trigger is a convergence criterion on the uncertainty of the estimated - eigenvalue. It has the following attributes/sub-elements: - - :type: - The type of precision trigger. Accepted options are "variance", "std_dev", - and "rel_err". - - :variance: - Variance of the batch mean :math:`\sigma^2` - - :std_dev: - Standard deviation of the batch mean :math:`\sigma` - - :rel_err: - Relative error of the batch mean :math:`\frac{\sigma}{\mu}` - - *Default*: None - - :threshold: - The precision trigger's convergence criterion for the - combined :math:`k_{eff}`. - - *Default*: None - - .. note:: See section on the :ref:`trigger` for more information. - ```` Element ------------------------- @@ -247,23 +198,58 @@ problem. It has the following attributes/sub-elements: *Default*: None -```` Element +```` Element +----------------------------------- + +The ```` element indicates the number of total fission +source iterations per batch for an eigenvalue calculation. This element is +ignored for all run modes other than "eigenvalue". + + *Default*: 1 + +```` Element +---------------------- + +The ```` element indicates the number of inactive batches used in a +k-eigenvalue calculation. In general, the starting fission source iterations in +an eigenvalue calculation can not be used to contribute to tallies since the +fission source distribution and eigenvalue are generally not converged +immediately. This element is ignored for all run modes other than "eigenvalue". + + *Default*: 0 + +```` Element -------------------------- -The ```` element indicates that a fixed source calculation should -be performed. It has the following attributes/sub-elements: +The ```` element (ignored for all run modes other than +"eigenvalue".) specifies a precision trigger on the combined +:math:`k_{eff}`. The trigger is a convergence criterion on the uncertainty of +the estimated eigenvalue. It has the following attributes/sub-elements: - :batches: - The total number of batches. For fixed source calculations, each batch - represents a realization of random variables for tallies. + :type: + The type of precision trigger. Accepted options are "variance", "std_dev", + and "rel_err". + + :variance: + Variance of the batch mean :math:`\sigma^2` + + :std_dev: + Standard deviation of the batch mean :math:`\sigma` + + :rel_err: + Relative error of the batch mean :math:`\frac{\sigma}{\mu}` *Default*: None - :particles: - The number of particles to simulate per batch. + :threshold: + The precision trigger's convergence criterion for the + combined :math:`k_{eff}`. *Default*: None +.. note:: See section on the :ref:`trigger` for more information. + + ```` Element --------------------------- @@ -336,6 +322,15 @@ will abort. *Default*: Current working directory +```` Element +----------------------- + +This element indicates the number of neutrons to simulate per fission source +iteration when a k-eigenvalue calculation is performed or the number of neutrons +per batch for a fixed source simulation. + + *Default*: None + ```` Element --------------------- @@ -408,7 +403,16 @@ The ```` element indicates whether or not CMFD acceleration should be turned on or off. This element has no attributes or sub-elements and can be set to either "false" or "true". - *Defualt*: false + *Default*: false + +```` Element +---------------------- + +The ```` element indicates which run mode should be used when OpenMC +is executed. This element has no attributes or sub-elements and can be set to +"eigenvalue", "fixed source", "plot", "volume", or "particle restart". + + *Default*: None ```` Element ------------------ @@ -774,13 +778,13 @@ number, and particle number, respectively. ------------------------- OpenMC includes tally precision triggers which allow the user to define -uncertainty thresholds on :math:`k_{eff}` in the ```` subelement of -``settings.xml``, and/or tallies in ``tallies.xml``. When using triggers, +uncertainty thresholds on :math:`k_{eff}` in the ```` subelement +of ``settings.xml``, and/or tallies in ``tallies.xml``. When using triggers, OpenMC will run until it completes as many batches as defined by ````. -At this point, the uncertainties on all tallied values are computed and -compared with their corresponding trigger thresholds. If any triggers have not -been met, OpenMC will continue until either all trigger thresholds have been -satisfied or ```` has been reached. +At this point, the uncertainties on all tallied values are computed and compared +with their corresponding trigger thresholds. If any triggers have not been met, +OpenMC will continue until either all trigger thresholds have been satisfied or +```` has been reached. The ```` element provides an active "toggle switch" for tally precision trigger(s), the maximum number of batches and the batch interval. It @@ -793,8 +797,8 @@ has the following attributes/sub-elements: :max_batches: This describes the maximum number of batches allowed when using trigger(s). - .. note:: When max_batches is set, the number of ``batches`` shown in - ```` element represents minimum number of batches to + .. note:: When max_batches is set, the number of ``batches`` shown in the + ```` element represents minimum number of batches to simulate when using the trigger(s). :batch_interval: diff --git a/examples/xml/basic/settings.xml b/examples/xml/basic/settings.xml index eb9f5bd56d..6e622b6cef 100644 --- a/examples/xml/basic/settings.xml +++ b/examples/xml/basic/settings.xml @@ -1,12 +1,10 @@ - - - 15 - 5 - 10000 - + eigenvalue + 15 + 5 + 10000 diff --git a/examples/xml/boxes/settings.xml b/examples/xml/boxes/settings.xml index eff7c1c105..9007a12c59 100644 --- a/examples/xml/boxes/settings.xml +++ b/examples/xml/boxes/settings.xml @@ -2,11 +2,10 @@ - - 15 - 5 - 10000 - + eigenvalue + 15 + 5 + 10000 diff --git a/examples/xml/lattice/nested/settings.xml b/examples/xml/lattice/nested/settings.xml index 2a6aaaf426..879173d1b3 100644 --- a/examples/xml/lattice/nested/settings.xml +++ b/examples/xml/lattice/nested/settings.xml @@ -2,11 +2,10 @@ - - 20 - 10 - 10000 - + eigenvalue + 20 + 10 + 10000 diff --git a/examples/xml/lattice/simple/settings.xml b/examples/xml/lattice/simple/settings.xml index 2a6aaaf426..879173d1b3 100644 --- a/examples/xml/lattice/simple/settings.xml +++ b/examples/xml/lattice/simple/settings.xml @@ -2,11 +2,10 @@ - - 20 - 10 - 10000 - + eigenvalue + 20 + 10 + 10000 diff --git a/examples/xml/pincell/settings.xml b/examples/xml/pincell/settings.xml index 443af9cde2..733de19260 100644 --- a/examples/xml/pincell/settings.xml +++ b/examples/xml/pincell/settings.xml @@ -2,11 +2,10 @@ - - 100 - 10 - 1000 - + eigenvalue + 100 + 10 + 1000 - - 500 - 10 - 10000 - + eigenvalue + 500 + 10 + 10000 diff --git a/openmc/executor.py b/openmc/executor.py index a20437e1cd..3b9b8abd8d 100644 --- a/openmc/executor.py +++ b/openmc/executor.py @@ -44,8 +44,8 @@ def plot_geometry(output=True, openmc_exec='openmc', cwd='.'): def run(particles=None, threads=None, geometry_debug=False, - restart_file=None, tracks=False, mpi_procs=1, output=True, - openmc_exec='openmc', mpi_exec='mpiexec', cwd='.'): + restart_file=None, tracks=False, output=True, cwd='.', + openmc_exec='openmc', mpi_args=None): """Run an OpenMC simulation. Parameters @@ -56,23 +56,23 @@ def run(particles=None, threads=None, geometry_debug=False, Number of OpenMP threads. If OpenMC is compiled with OpenMP threading enabled, the default is implementation-dependent but is usually equal to the number of hardware threads available (or a value set by the - OMP_NUM_THREADS environment variable). + :envvar:`OMP_NUM_THREADS` environment variable). geometry_debug : bool, optional Turn on geometry debugging during simulation. Defaults to False. restart_file : str, optional Path to restart file to use tracks : bool, optional Write tracks for all particles. Defaults to False. - mpi_procs : int, optional - Number of MPI processes. output : bool, optional Capture OpenMC output from standard out. Defaults to True. + cwd : str, optional + Path to working directory to run in. Defaults to the current working + directory. openmc_exec : str, optional Path to OpenMC executable. Defaults to 'openmc'. - mpi_exec : str, optional - MPI execute command. Defaults to 'mpiexec'. - cwd : str, optional - Path to working directory to run in. Defaults to the current working directory. + mpi_args : list of str, optional + MPI execute command and any additional MPI arguments to pass, + e.g. ['mpiexec', '-n', '8']. """ @@ -94,8 +94,8 @@ def run(particles=None, threads=None, geometry_debug=False, if tracks: post_args += '-t' - if isinstance(mpi_procs, Integral) and mpi_procs > 1: - pre_args += '{} -n {} '.format(mpi_exec, mpi_procs) + if mpi_args is not None: + pre_args = ' '.join(mpi_args) + ' ' command = pre_args + openmc_exec + ' ' + post_args diff --git a/openmc/material.py b/openmc/material.py index f276f0f1ab..7d59c52ee1 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -56,6 +56,9 @@ class Material(object): Units used for `density`. Can be one of 'g/cm3', 'g/cc', 'kg/cm3', 'atom/b-cm', 'atom/cm3', 'sum', or 'macro'. The 'macro' unit only applies in the case of a multi-group calculation. + depletable : bool + Indicate whether the material is depletable. This attribute can be used + by downstream depletion applications. elements : list of tuple List in which each item is a 4-tuple consisting of an :class:`openmc.Element` instance, the percent density, the percent @@ -78,6 +81,7 @@ class Material(object): self.temperature = temperature self._density = None self._density_units = '' + self._depletable = False # A list of tuples (nuclide, percent, percent type) self._nuclides = [] @@ -127,37 +131,36 @@ class Material(object): def __repr__(self): string = 'Material\n' - string += '{0: <16}{1}{2}\n'.format('\tID', '=\t', self._id) - string += '{0: <16}{1}{2}\n'.format('\tName', '=\t', self._name) - string += '{0: <16}{1}{2}\n'.format('\tTemperature', '=\t', - self._temperature) + string += '{: <16}=\t{}\n'.format('\tID', self._id) + string += '{: <16}=\t{}\n'.format('\tName', self._name) + string += '{: <16}=\t{}\n'.format('\tTemperature', self._temperature) - string += '{0: <16}{1}{2}'.format('\tDensity', '=\t', self._density) - string += ' [{0}]\n'.format(self._density_units) + string += '{: <16}=\t{}'.format('\tDensity', self._density) + string += ' [{}]\n'.format(self._density_units) - string += '{0: <16}\n'.format('\tS(a,b) Tables') + string += '{: <16}\n'.format('\tS(a,b) Tables') for sab in self._sab: - string += '{0: <16}{1}{2}\n'.format('\tS(a,b)', '=\t', sab) + string += '{: <16}=\t{}\n'.format('\tS(a,b)', sab) - string += '{0: <16}\n'.format('\tNuclides') + string += '{: <16}\n'.format('\tNuclides') for nuclide, percent, percent_type in self._nuclides: string += '{0: <16}'.format('\t{0.name}'.format(nuclide)) - string += '=\t{0: <12} [{1}]\n'.format(percent, percent_type) + string += '=\t{: <12} [{}]\n'.format(percent, percent_type) if self._macroscopic is not None: - string += '{0: <16}\n'.format('\tMacroscopic Data') - string += '{0: <16}'.format('\t{0}'.format(self._macroscopic)) + string += '{: <16}\n'.format('\tMacroscopic Data') + string += '{: <16}'.format('\t{}'.format(self._macroscopic)) - string += '{0: <16}\n'.format('\tElements') + string += '{: <16}\n'.format('\tElements') for element, percent, percent_type, enr in self._elements: string += '{0: <16}'.format('\t{0.name}'.format(element)) if enr is None: - string += '=\t{0: <12} [{1}]\n'.format(percent, percent_type) + string += '=\t{: <12} [{}]\n'.format(percent, percent_type) else: - string += '=\t{0: <12} [{1}] @ {2} w/o enrichment\n'\ + string += '=\t{: <12} [{}] @ {} w/o enrichment\n'\ .format(percent, percent_type, enr) return string @@ -182,6 +185,10 @@ class Material(object): def density_units(self): return self._density_units + @property + def depletable(self): + return self._depletable + @property def elements(self): return self._elements @@ -234,7 +241,7 @@ class Material(object): @name.setter def name(self, name): if name is not None: - cv.check_type('name for Material ID="{0}"'.format(self._id), + cv.check_type('name for Material ID="{}"'.format(self._id), name, string_types) self._name = name else: @@ -242,10 +249,16 @@ class Material(object): @temperature.setter def temperature(self, temperature): - cv.check_type('Temperature for Material ID="{0}"'.format(self._id), + cv.check_type('Temperature for Material ID="{}"'.format(self._id), temperature, (Real, type(None))) self._temperature = temperature + @depletable.setter + def depletable(self, depletable): + cv.check_type('Depletable flag for Material ID="{}"'.format(self.id), + depletable, bool) + self._depletable = depletable + def set_density(self, units, density=None): """Set the density of the material @@ -264,17 +277,17 @@ class Material(object): if units is 'sum': if density is not None: - msg = 'Density "{0}" for Material ID="{1}" is ignored ' \ + msg = 'Density "{}" for Material ID="{}" is ignored ' \ 'because the unit is "sum"'.format(density, self.id) warnings.warn(msg) else: if density is None: - msg = 'Unable to set the density for Material ID="{0}" ' \ + msg = 'Unable to set the density for Material ID="{}" ' \ 'because a density value must be given when not using ' \ '"sum" unit'.format(self.id) raise ValueError(msg) - cv.check_type('the density for Material ID="{0}"'.format(self.id), + cv.check_type('the density for Material ID="{}"'.format(self.id), density, Real) self._density = density @@ -285,8 +298,8 @@ class Material(object): 'version of openmc') if not isinstance(filename, string_types) and filename is not None: - msg = 'Unable to add OTF material file to Material ID="{0}" with a ' \ - 'non-string name "{1}"'.format(self._id, filename) + msg = 'Unable to add OTF material file to Material ID="{}" with a ' \ + 'non-string name "{}"'.format(self._id, filename) raise ValueError(msg) self._distrib_otf_file = filename @@ -314,23 +327,23 @@ class Material(object): """ if self._macroscopic is not None: - msg = 'Unable to add a Nuclide to Material ID="{0}" as a ' \ + msg = 'Unable to add a Nuclide to Material ID="{}" as a ' \ 'macroscopic data-set has already been added'.format(self._id) raise ValueError(msg) if not isinstance(nuclide, string_types + (openmc.Nuclide,)): - msg = 'Unable to add a Nuclide to Material ID="{0}" with a ' \ - 'non-Nuclide value "{1}"'.format(self._id, nuclide) + msg = 'Unable to add a Nuclide to Material ID="{}" with a ' \ + 'non-Nuclide value "{}"'.format(self._id, nuclide) raise ValueError(msg) elif not isinstance(percent, Real): - msg = 'Unable to add a Nuclide to Material ID="{0}" with a ' \ - 'non-floating point value "{1}"'.format(self._id, percent) + msg = 'Unable to add a Nuclide to Material ID="{}" with a ' \ + 'non-floating point value "{}"'.format(self._id, percent) raise ValueError(msg) elif percent_type not in ['ao', 'wo', 'at/g-cm']: - msg = 'Unable to add a Nuclide to Material ID="{0}" with a ' \ - 'percent type "{1}"'.format(self._id, percent_type) + msg = 'Unable to add a Nuclide to Material ID="{}" with a ' \ + 'percent type "{}"'.format(self._id, percent_type) raise ValueError(msg) if isinstance(nuclide, openmc.Nuclide): @@ -353,7 +366,7 @@ class Material(object): """ if not isinstance(nuclide, openmc.Nuclide): - msg = 'Unable to remove a Nuclide "{0}" in Material ID="{1}" ' \ + msg = 'Unable to remove a Nuclide "{}" in Material ID="{}" ' \ 'since it is not a Nuclide'.format(self._id, nuclide) raise ValueError(msg) @@ -377,15 +390,15 @@ class Material(object): # Ensure no nuclides, elements, or sab are added since these would be # incompatible with macroscopics if self._nuclides or self._elements or self._sab: - msg = 'Unable to add a Macroscopic data set to Material ID="{0}" ' \ - 'with a macroscopic value "{1}" as an incompatible data ' \ + msg = 'Unable to add a Macroscopic data set to Material ID="{}" ' \ + 'with a macroscopic value "{}" as an incompatible data ' \ 'member (i.e., nuclide, element, or S(a,b) table) ' \ 'has already been added'.format(self._id, macroscopic) raise ValueError(msg) if not isinstance(macroscopic, string_types + (openmc.Macroscopic,)): - msg = 'Unable to add a Macroscopic to Material ID="{0}" with a ' \ - 'non-Macroscopic value "{1}"'.format(self._id, macroscopic) + msg = 'Unable to add a Macroscopic to Material ID="{}" with a ' \ + 'non-Macroscopic value "{}"'.format(self._id, macroscopic) raise ValueError(msg) if isinstance(macroscopic, openmc.Macroscopic): @@ -398,7 +411,7 @@ class Material(object): if self._macroscopic is None: self._macroscopic = macroscopic else: - msg = 'Unable to add a Macroscopic to Material ID="{0}". ' \ + msg = 'Unable to add a Macroscopic to Material ID="{}". ' \ 'Only one Macroscopic allowed per ' \ 'Material.'.format(self._id) raise ValueError(msg) @@ -422,7 +435,7 @@ class Material(object): """ if not isinstance(macroscopic, openmc.Macroscopic): - msg = 'Unable to remove a Macroscopic "{0}" in Material ID="{1}" ' \ + msg = 'Unable to remove a Macroscopic "{}" in Material ID="{}" ' \ 'since it is not a Macroscopic'.format(self._id, macroscopic) raise ValueError(msg) @@ -450,23 +463,23 @@ class Material(object): """ if self._macroscopic is not None: - msg = 'Unable to add an Element to Material ID="{0}" as a ' \ + msg = 'Unable to add an Element to Material ID="{}" as a ' \ 'macroscopic data-set has already been added'.format(self._id) raise ValueError(msg) if not isinstance(element, string_types + (openmc.Element,)): - msg = 'Unable to add an Element to Material ID="{0}" with a ' \ - 'non-Element value "{1}"'.format(self._id, element) + msg = 'Unable to add an Element to Material ID="{}" with a ' \ + 'non-Element value "{}"'.format(self._id, element) raise ValueError(msg) if not isinstance(percent, Real): - msg = 'Unable to add an Element to Material ID="{0}" with a ' \ - 'non-floating point value "{1}"'.format(self._id, percent) + msg = 'Unable to add an Element to Material ID="{}" with a ' \ + 'non-floating point value "{}"'.format(self._id, percent) raise ValueError(msg) if percent_type not in ['ao', 'wo']: - msg = 'Unable to add an Element to Material ID="{0}" with a ' \ - 'percent type "{1}"'.format(self._id, percent_type) + msg = 'Unable to add an Element to Material ID="{}" with a ' \ + 'percent type "{}"'.format(self._id, percent_type) raise ValueError(msg) # Copy this Element to separate it from same Element in other Materials @@ -477,14 +490,14 @@ class Material(object): if enrichment is not None: if not isinstance(enrichment, Real): - msg = 'Unable to add an Element to Material ID="{0}" with a ' \ - 'non-floating point enrichment value "{1}"'\ + msg = 'Unable to add an Element to Material ID="{}" with a ' \ + 'non-floating point enrichment value "{}"'\ .format(self._id, enrichment) raise ValueError(msg) elif element.name != 'U': - msg = 'Unable to use enrichment for element {0} which is not ' \ - 'uranium for Material ID="{1}"'.format(element.name, + msg = 'Unable to use enrichment for element {} which is not ' \ + 'uranium for Material ID="{}"'.format(element.name, self._id) raise ValueError(msg) @@ -493,8 +506,8 @@ class Material(object): cv.check_greater_than('enrichment', enrichment, 0., equality=True) if enrichment > 5.0: - msg = 'A uranium enrichment of {0} was given for Material ID='\ - '"{1}". OpenMC assumes the U234/U235 mass ratio is '\ + msg = 'A uranium enrichment of {} was given for Material ID='\ + '"{}". OpenMC assumes the U234/U235 mass ratio is '\ 'constant at 0.008, which is only valid at low ' \ 'enrichments. Consider setting the isotopic ' \ 'composition manually for enrichments over 5%.'.\ @@ -514,7 +527,7 @@ class Material(object): """ if not isinstance(element, openmc.Element): - msg = 'Unable to remove "{0}" in Material ID="{1}" ' \ + msg = 'Unable to remove "{}" in Material ID="{}" ' \ 'since it is not an Element'.format(self.id, element) raise ValueError(msg) @@ -534,13 +547,13 @@ class Material(object): """ if self._macroscopic is not None: - msg = 'Unable to add an S(a,b) table to Material ID="{0}" as a ' \ + msg = 'Unable to add an S(a,b) table to Material ID="{}" as a ' \ 'macroscopic data-set has already been added'.format(self._id) raise ValueError(msg) if not isinstance(name, string_types): - msg = 'Unable to add an S(a,b) table to Material ID="{0}" with a ' \ - 'non-string table name "{1}"'.format(self._id, name) + msg = 'Unable to add an S(a,b) table to Material ID="{}" with a ' \ + 'non-string table name "{}"'.format(self._id, name) raise ValueError(msg) new_name = openmc.data.get_thermal_name(name) @@ -758,6 +771,9 @@ class Material(object): if len(self._name) > 0: element.set("name", str(self._name)) + if self._depletable: + element.set("depletable", "true") + # Create temperature XML subelement if self.temperature is not None: subelement = ET.SubElement(element, "temperature") diff --git a/openmc/settings.py b/openmc/settings.py index e6a3f9e131..a4dde8da30 100644 --- a/openmc/settings.py +++ b/openmc/settings.py @@ -11,6 +11,9 @@ from openmc.clean_xml import clean_xml_indentation import openmc.checkvalue as cv from openmc import Nuclide, VolumeCalculation, Source, Mesh +_RUN_MODES = ['eigenvalue', 'fixed source', 'plot', 'volume', + 'particle restart'] + class Settings(object): """Settings used for an OpenMC simulation. @@ -81,7 +84,7 @@ class Settings(object): The elastic scattering model to use for resonant isotopes run_cmfd : bool Indicate if coarse mesh finite difference acceleration is to be used - run_mode : {'eigenvalue' or 'fixed source'} + run_mode : {'eigenvalue', 'fixed source', 'plot', 'volume', 'particle restart'} The type of calculation to perform (default is 'eigenvalue') seed : int Seed for the linear congruential pseudorandom number generator @@ -388,10 +391,7 @@ class Settings(object): @run_mode.setter def run_mode(self, run_mode): - if run_mode not in ['eigenvalue', 'fixed source']: - msg = 'Unable to set run mode to "{0}". Only "eigenvalue" ' \ - 'and "fixed source" are supported."'.format(run_mode) - raise ValueError(msg) + cv.check_value('run mode', run_mode, _RUN_MODES) self._run_mode = run_mode @batches.setter @@ -794,18 +794,8 @@ class Settings(object): self._create_fission_neutrons = create_fission_neutrons def _create_run_mode_subelement(self, root): - - if self.run_mode == 'eigenvalue': - elem = ET.SubElement(root, "eigenvalue") - self._create_particles_subelement(elem) - self._create_batches_subelement(elem) - self._create_inactive_subelement(elem) - self._create_generations_per_batch_subelement(elem) - self._create_keff_trigger_subelement(elem) - else: - elem = ET.SubElement(root, "fixed_source") - self._create_particles_subelement(elem) - self._create_batches_subelement(elem) + elem = ET.SubElement(root, "run_mode") + elem.text = self._run_mode def _create_batches_subelement(self, run_mode_element): if self._batches is not None: @@ -814,8 +804,7 @@ class Settings(object): def _create_generations_per_batch_subelement(self, run_mode_element): if self._generations_per_batch is not None: - element = ET.SubElement(run_mode_element, - "generations_per_batch") + element = ET.SubElement(run_mode_element, "generations_per_batch") element.text = str(self._generations_per_batch) def _create_inactive_subelement(self, run_mode_element): @@ -1081,6 +1070,11 @@ class Settings(object): root_element = ET.Element("settings") self._create_run_mode_subelement(root_element) + self._create_particles_subelement(root_element) + self._create_batches_subelement(root_element) + self._create_inactive_subelement(root_element) + self._create_generations_per_batch_subelement(root_element) + self._create_keff_trigger_subelement(root_element) self._create_source_subelement(root_element) self._create_output_subelement(root_element) self._create_statepoint_subelement(root_element) diff --git a/openmc/summary.py b/openmc/summary.py index b283ed502c..5bc4c56a2e 100644 --- a/openmc/summary.py +++ b/openmc/summary.py @@ -97,23 +97,25 @@ class Summary(object): # Values - Material objects self.materials = {} - for key in self._f['materials'].keys(): + for key, group in self._f['materials'].items(): if key == 'n_materials': continue material_id = int(key.lstrip('material ')) - index = self._f['materials'][key]['index'].value - name = self._f['materials'][key]['name'].value.decode() - density = self._f['materials'][key]['atom_density'].value - nuc_densities = self._f['materials'][key]['nuclide_densities'][...] - nuclides = self._f['materials'][key]['nuclides'].value + + index = group['index'].value + name = group['name'].value.decode() + density = group['atom_density'].value + nuc_densities = group['nuclide_densities'][...] + nuclides = group['nuclides'].value # Create the Material material = openmc.Material(material_id=material_id, name=name) + material.depletable = bool(group.attrs['depletable']) # Read the names of the S(a,b) tables for this Material and add them - if 'sab_names' in self._f['materials'][key]: - sab_tables = self._f['materials'][key]['sab_names'].value + if 'sab_names' in group: + sab_tables = group['sab_names'].value for sab_table in sab_tables: name = sab_table.decode() material.add_s_alpha_beta(name) diff --git a/src/constants.F90 b/src/constants.F90 index 8ed657339c..43ba2c223c 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -424,7 +424,8 @@ module constants MODE_FIXEDSOURCE = 1, & ! Fixed source mode MODE_EIGENVALUE = 2, & ! K eigenvalue mode MODE_PLOTTING = 3, & ! Plotting mode - MODE_PARTICLE = 4 ! Particle restart mode + MODE_PARTICLE = 4, & ! Particle restart mode + MODE_VOLUME = 5 ! Volume calculation mode !============================================================================= ! CMFD CONSTANTS diff --git a/src/finalize.F90 b/src/finalize.F90 index 7ad99d0b55..0f1af23560 100644 --- a/src/finalize.F90 +++ b/src/finalize.F90 @@ -5,9 +5,6 @@ module finalize use global use hdf5_interface, only: hdf5_bank_t use message_passing - use output, only: print_runtime, print_results, & - print_overlap_check, write_tallies - use tally, only: tally_statistics implicit none @@ -22,30 +19,6 @@ contains integer :: hdf5_err - ! Start finalization timer - call time_finalize%start() - - if (run_mode /= MODE_PLOTTING .and. run_mode /= MODE_PARTICLE) then - ! Calculate statistics for tallies and write to tallies.out - if (master) then - if (n_realizations > 1) call tally_statistics() - end if - if (output_tallies) then - if (master) call write_tallies() - end if - if (check_overlaps) call reduce_overlap_count() - end if - - ! Stop timers and show timing statistics - call time_finalize%stop() - call time_total%stop() - if (master .and. (run_mode /= MODE_PLOTTING .and. & - run_mode /= MODE_PARTICLE)) then - call print_runtime() - call print_results() - if (check_overlaps) call print_overlap_check() - end if - ! Deallocate arrays call free_memory() @@ -65,22 +38,4 @@ contains end subroutine openmc_finalize -!=============================================================================== -! REDUCE_OVERLAP_COUNT accumulates cell overlap check counts to master -!=============================================================================== - - subroutine reduce_overlap_count() - -#ifdef MPI - if (master) then - call MPI_REDUCE(MPI_IN_PLACE, overlap_check_cnt, n_cells, & - MPI_INTEGER8, MPI_SUM, 0, mpi_intracomm, mpi_err) - else - call MPI_REDUCE(overlap_check_cnt, overlap_check_cnt, n_cells, & - MPI_INTEGER8, MPI_SUM, 0, mpi_intracomm, mpi_err) - end if -#endif - - end subroutine reduce_overlap_count - end module finalize diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 2be8cbd573..fa2e9881c0 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -79,7 +79,6 @@ contains integer :: temp_int integer :: temp_int_array3(3) integer, allocatable :: temp_int_array(:) - integer(8) :: temp_long real(8), allocatable :: temp_real(:) integer :: n_tracks logical :: file_exists @@ -100,7 +99,6 @@ contains type(Node), pointer :: node_res_scat => null() type(Node), pointer :: node_scatterer => null() type(Node), pointer :: node_trigger => null() - type(Node), pointer :: node_keff_trigger => null() type(Node), pointer :: node_vol => null() type(Node), pointer :: node_tab_leg => null() type(NodeList), pointer :: node_scat_list => null() @@ -224,119 +222,62 @@ contains end if end if - ! Make sure that either eigenvalue or fixed source was specified - if (.not. check_for_node(doc, "eigenvalue") .and. & - .not. check_for_node(doc, "fixed_source")) then - call fatal_error(" or not specified.") - end if + ! Check run mode if it hasn't been set from the command line + if (run_mode == NONE) then + if (check_for_node(doc, "run_mode")) then + call get_node_value(doc, "run_mode", temp_str) + select case (to_lower(temp_str)) + case ("eigenvalue") + run_mode = MODE_EIGENVALUE + case ("fixed source") + run_mode = MODE_FIXEDSOURCE + case ("plot") + run_mode = MODE_PLOTTING + case ("particle restart") + run_mode = MODE_PARTICLE + case ("volume") + run_mode = MODE_VOLUME + end select - ! Eigenvalue information - if (check_for_node(doc, "eigenvalue")) then - ! Set run mode - if (run_mode == NONE) run_mode = MODE_EIGENVALUE + ! Assume XML specifics , , etc. directly + node_mode => doc + else + call warning(" should be specified.") - ! Get pointer to eigenvalue XML block - call get_node_ptr(doc, "eigenvalue", node_mode) - - ! Check number of particles - if (.not. check_for_node(node_mode, "particles")) then - call fatal_error("Need to specify number of particles per generation.") - end if - - ! Get number of particles - call get_node_value(node_mode, "particles", temp_long) - - ! If the number of particles was specified as a command-line argument, we - ! don't set it here - if (n_particles == 0) n_particles = temp_long - - ! Get number of basic batches - call get_node_value(node_mode, "batches", n_batches) - if (.not. trigger_on) then - n_max_batches = n_batches - end if - - ! Get number of inactive batches - call get_node_value(node_mode, "inactive", n_inactive) - n_active = n_batches - n_inactive - if (check_for_node(node_mode, "generations_per_batch")) then - call get_node_value(node_mode, "generations_per_batch", gen_per_batch) - end if - - ! Allocate array for batch keff and entropy - allocate(k_generation(n_max_batches*gen_per_batch)) - allocate(entropy(n_max_batches*gen_per_batch)) - entropy = ZERO - - ! Get the trigger information for keff - if (check_for_node(node_mode, "keff_trigger")) then - call get_node_ptr(node_mode, "keff_trigger", node_keff_trigger) - - if (check_for_node(node_keff_trigger, "type")) then - call get_node_value(node_keff_trigger, "type", temp_str) - temp_str = trim(to_lower(temp_str)) - - select case (temp_str) - case ('std_dev') - keff_trigger % trigger_type = STANDARD_DEVIATION - case ('variance') - keff_trigger % trigger_type = VARIANCE - case ('rel_err') - keff_trigger % trigger_type = RELATIVE_ERROR - case default - call fatal_error("Unrecognized keff trigger type " // temp_str) - end select - - else - call fatal_error("Specify keff trigger type in settings XML") + ! Make sure that either eigenvalue or fixed source was specified + if (.not. check_for_node(doc, "eigenvalue") .and. & + .not. check_for_node(doc, "fixed_source")) then + call fatal_error(" or not specified.") end if - if (check_for_node(node_keff_trigger, "threshold")) then - call get_node_value(node_keff_trigger, "threshold", & - keff_trigger % threshold) - else - call fatal_error("Specify keff trigger threshold in settings XML") + if (check_for_node(doc, "eigenvalue")) then + ! Set run mode + if (run_mode == NONE) run_mode = MODE_EIGENVALUE + + ! Get pointer to eigenvalue XML block + call get_node_ptr(doc, "eigenvalue", node_mode) + elseif (check_for_node(doc, "fixed_source")) then + ! Set run mode + if (run_mode == NONE) run_mode = MODE_FIXEDSOURCE + + ! Get pointer to fixed_source XML block + call get_node_ptr(doc, "fixed_source", node_mode) end if end if end if - ! Fixed source calculation information - if (check_for_node(doc, "fixed_source")) then - ! Set run mode - if (run_mode == NONE) run_mode = MODE_FIXEDSOURCE + if (run_mode == MODE_EIGENVALUE .or. run_mode == MODE_FIXEDSOURCE) then + ! Read run parameters + call get_run_parameters(node_mode) - ! Get pointer to fixed_source XML block - call get_node_ptr(doc, "fixed_source", node_mode) - - ! Check number of particles - if (.not. check_for_node(node_mode, "particles")) then - call fatal_error("Need to specify number of particles per batch.") + ! Check number of active batches, inactive batches, and particles + if (n_active <= 0) then + call fatal_error("Number of active batches must be greater than zero.") + elseif (n_inactive < 0) then + call fatal_error("Number of inactive batches must be non-negative.") + elseif (n_particles <= 0) then + call fatal_error("Number of particles must be greater than zero.") end if - - ! Get number of particles - call get_node_value(node_mode, "particles", temp_long) - - ! If the number of particles was specified as a command-line argument, we - ! don't set it here - if (n_particles == 0) n_particles = temp_long - - ! Copy batch information - call get_node_value(node_mode, "batches", n_batches) - if (.not. trigger_on) then - n_max_batches = n_batches - end if - n_active = n_batches - n_inactive = 0 - gen_per_batch = 1 - end if - - ! Check number of active batches, inactive batches, and particles - if (n_active <= 0) then - call fatal_error("Number of active batches must be greater than zero.") - elseif (n_inactive < 0) then - call fatal_error("Number of inactive batches must be non-negative.") - elseif (n_particles <= 0) then - call fatal_error("Number of particles must be greater than zero.") end if ! Copy random number seed if specified @@ -380,7 +321,10 @@ contains ! Get point to list of elements and make sure there is at least one call get_node_list(doc, "source", node_source_list) n = get_list_size(node_source_list) - if (n == 0) call fatal_error("No source specified in settings XML file.") + + if (run_mode == MODE_EIGENVALUE .or. run_mode == MODE_FIXEDSOURCE) then + if (n == 0) call fatal_error("No source specified in settings XML file.") + end if ! Allocate array for sources allocate(external_source(n)) @@ -1093,6 +1037,86 @@ contains end subroutine read_settings_xml +!=============================================================================== +! GET_RUN_PARAMETERS +!=============================================================================== + + subroutine get_run_parameters(node_base) + type(Node), pointer :: node_base + + integer(8) :: temp_long + character(MAX_LINE_LEN) :: temp_str + type(Node), pointer :: node_keff_trigger => null() + + ! Check number of particles + if (.not. check_for_node(node_base, "particles")) then + call fatal_error("Need to specify number of particles.") + end if + + ! Get number of particles + call get_node_value(node_base, "particles", temp_long) + + ! If the number of particles was specified as a command-line argument, we + ! don't set it here + if (n_particles == 0) n_particles = temp_long + + ! Get number of basic batches + call get_node_value(node_base, "batches", n_batches) + if (.not. trigger_on) then + n_max_batches = n_batches + end if + n_inactive = 0 + gen_per_batch = 1 + + ! Get number of inactive batches + if (run_mode == MODE_EIGENVALUE) then + call get_node_value(node_base, "inactive", n_inactive) + if (check_for_node(node_base, "generations_per_batch")) then + call get_node_value(node_base, "generations_per_batch", gen_per_batch) + end if + + ! Allocate array for batch keff and entropy + allocate(k_generation(n_max_batches*gen_per_batch)) + allocate(entropy(n_max_batches*gen_per_batch)) + entropy = ZERO + + ! Get the trigger information for keff + if (check_for_node(node_base, "keff_trigger")) then + call get_node_ptr(node_base, "keff_trigger", node_keff_trigger) + + if (check_for_node(node_keff_trigger, "type")) then + call get_node_value(node_keff_trigger, "type", temp_str) + temp_str = trim(to_lower(temp_str)) + + select case (temp_str) + case ('std_dev') + keff_trigger % trigger_type = STANDARD_DEVIATION + case ('variance') + keff_trigger % trigger_type = VARIANCE + case ('rel_err') + keff_trigger % trigger_type = RELATIVE_ERROR + case default + call fatal_error("Unrecognized keff trigger type " // temp_str) + end select + + else + call fatal_error("Specify keff trigger type in settings XML") + end if + + if (check_for_node(node_keff_trigger, "threshold")) then + call get_node_value(node_keff_trigger, "threshold", & + keff_trigger % threshold) + else + call fatal_error("Specify keff trigger threshold in settings XML") + end if + end if + end if + + ! Determine number of active batches + n_active = n_batches - n_inactive + + end subroutine get_run_parameters + !=============================================================================== ! READ_GEOMETRY_XML reads data from a geometry.xml file and parses it, checking ! for errors and placing properly-formatted data in the right data structures @@ -2227,6 +2251,13 @@ contains call fatal_error("Must specify id of material in materials XML file") end if + ! Check if material is depletable + if (check_for_node(node_mat, "depletable")) then + call get_node_value(node_mat, "depletable", temp_str) + if (to_lower(temp_str) == "true" .or. temp_str == "1") & + mat % depletable = .true. + end if + ! Check to make sure 'id' hasn't been used if (material_dict % has_key(mat % id)) then call fatal_error("Two or more materials use the same unique ID: " & diff --git a/src/main.F90 b/src/main.F90 index 8582ef7039..1cd3a9e547 100644 --- a/src/main.F90 +++ b/src/main.F90 @@ -8,6 +8,7 @@ program main use particle_restart, only: run_particle_restart use plot, only: run_plot use simulation, only: run_simulation + use volume_calc, only: run_volume_calculations implicit none @@ -26,6 +27,8 @@ program main call run_plot() case (MODE_PARTICLE) if (master) call run_particle_restart() + case (MODE_VOLUME) + call run_volume_calculations() end select ! finalize run diff --git a/src/material_header.F90 b/src/material_header.F90 index f7c1b5db09..fdc36548f6 100644 --- a/src/material_header.F90 +++ b/src/material_header.F90 @@ -31,8 +31,9 @@ module material_header character(20), allocatable :: names(:) ! isotope names character(20), allocatable :: sab_names(:) ! name of S(a,b) table - ! Does this material contain fissionable nuclides? + ! Does this material contain fissionable nuclides? Is it depletable? logical :: fissionable = .false. + logical :: depletable = .false. ! enforce isotropic scattering in lab logical, allocatable :: p0(:) diff --git a/src/simulation.F90 b/src/simulation.F90 index 187632836e..1274c2b008 100644 --- a/src/simulation.F90 +++ b/src/simulation.F90 @@ -11,13 +11,15 @@ module simulation use global use message_passing use output, only: write_message, header, print_columns, & - print_batch_keff, print_generation + print_batch_keff, print_generation, print_runtime, & + print_results, print_overlap_check, write_tallies use particle_header, only: Particle use random_lcg, only: set_particle_seed use source, only: initialize_source, sample_external_source use state_point, only: write_state_point, write_source_point use string, only: to_str - use tally, only: synchronize_tallies, setup_active_usertallies + use tally, only: synchronize_tallies, setup_active_usertallies, & + tally_statistics use trigger, only: check_triggers use tracking, only: transport use volume_calc, only: run_volume_calculations @@ -39,9 +41,6 @@ contains type(Particle) :: p integer(8) :: i_work - ! Volume calculations - if (size(volume_calcs) > 0) call run_volume_calculations() - if (.not. restart_run) call initialize_source() ! Display header @@ -113,6 +112,8 @@ contains if (master) call header("SIMULATION FINISHED", level=1) + call finalize_simulation() + ! Clear particle call p % clear() @@ -379,4 +380,52 @@ contains end subroutine replay_batch_history +!=============================================================================== +! FINALIZE_SIMULATION calculates tally statistics, writes tallies, and displays +! execution time and results +!=============================================================================== + + subroutine finalize_simulation + + ! Start finalization timer + call time_finalize%start() + + ! Calculate statistics for tallies and write to tallies.out + if (master) then + if (n_realizations > 1) call tally_statistics() + end if + if (output_tallies) then + if (master) call write_tallies() + end if + if (check_overlaps) call reduce_overlap_count() + + ! Stop timers and show timing statistics + call time_finalize%stop() + call time_total%stop() + if (master) then + call print_runtime() + call print_results() + if (check_overlaps) call print_overlap_check() + end if + + end subroutine finalize_simulation + +!=============================================================================== +! REDUCE_OVERLAP_COUNT accumulates cell overlap check counts to master +!=============================================================================== + + subroutine reduce_overlap_count() + +#ifdef MPI + if (master) then + call MPI_REDUCE(MPI_IN_PLACE, overlap_check_cnt, n_cells, & + MPI_INTEGER8, MPI_SUM, 0, mpi_intracomm, mpi_err) + else + call MPI_REDUCE(overlap_check_cnt, overlap_check_cnt, n_cells, & + MPI_INTEGER8, MPI_SUM, 0, mpi_intracomm, mpi_err) + end if +#endif + + end subroutine reduce_overlap_count + end module simulation diff --git a/src/summary.F90 b/src/summary.F90 index efe07b1ab8..78a8276f16 100644 --- a/src/summary.F90 +++ b/src/summary.F90 @@ -536,6 +536,12 @@ contains material_group = create_group(materials_group, "material " // & trim(to_str(m%id))) + if (m % depletable) then + call write_attribute(material_group, "depletable", 1) + else + call write_attribute(material_group, "depletable", 0) + end if + ! Write internal OpenMC index for this material call write_dataset(material_group, "index", i) diff --git a/src/timer_header.F90 b/src/timer_header.F90 index 3a633f7004..6f9785d565 100644 --- a/src/timer_header.F90 +++ b/src/timer_header.F90 @@ -42,11 +42,11 @@ contains function timer_get_value(self) result(elapsed) class(Timer), intent(in) :: self ! the timer - real(8) :: elapsed ! total elapsed time + real(8) :: elapsed ! total elapsed time integer(8) :: end_counts ! current number of counts integer(8) :: count_rate ! system-dependent counting rate - real :: elapsed_time ! elapsed time since last start + real(8) :: elapsed_time ! elapsed time since last start if (self % running) then call system_clock(end_counts, count_rate) diff --git a/tests/test_asymmetric_lattice/inputs_true.dat b/tests/test_asymmetric_lattice/inputs_true.dat index ada4f8f052..32745dad1e 100644 --- a/tests/test_asymmetric_lattice/inputs_true.dat +++ b/tests/test_asymmetric_lattice/inputs_true.dat @@ -205,11 +205,10 @@ - - 100 - 10 - 5 - + eigenvalue + 100 + 10 + 5 -32 -32 0 32 32 32 diff --git a/tests/test_cmfd_feed/settings.xml b/tests/test_cmfd_feed/settings.xml index 41de07f569..eab90b70fd 100644 --- a/tests/test_cmfd_feed/settings.xml +++ b/tests/test_cmfd_feed/settings.xml @@ -2,11 +2,10 @@ - - 20 - 10 - 1000 - + eigenvalue + 20 + 10 + 1000 @@ -19,7 +18,7 @@ - + 10 1 1 -10.0 -1.0 -1.0 diff --git a/tests/test_cmfd_nofeed/settings.xml b/tests/test_cmfd_nofeed/settings.xml index 41de07f569..eab90b70fd 100644 --- a/tests/test_cmfd_nofeed/settings.xml +++ b/tests/test_cmfd_nofeed/settings.xml @@ -2,11 +2,10 @@ - - 20 - 10 - 1000 - + eigenvalue + 20 + 10 + 1000 @@ -19,7 +18,7 @@ - + 10 1 1 -10.0 -1.0 -1.0 diff --git a/tests/test_complex_cell/settings.xml b/tests/test_complex_cell/settings.xml index a6fd5da19e..70b4e802f8 100644 --- a/tests/test_complex_cell/settings.xml +++ b/tests/test_complex_cell/settings.xml @@ -1,11 +1,10 @@ - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_confidence_intervals/settings.xml b/tests/test_confidence_intervals/settings.xml index 19a27694e0..09e53927d3 100644 --- a/tests/test_confidence_intervals/settings.xml +++ b/tests/test_confidence_intervals/settings.xml @@ -3,11 +3,10 @@ true - - 10 - 2 - 100 - + eigenvalue + 10 + 2 + 100 diff --git a/tests/test_create_fission_neutrons/inputs_true.dat b/tests/test_create_fission_neutrons/inputs_true.dat index ad2e47f9b3..b4245d2c89 100644 --- a/tests/test_create_fission_neutrons/inputs_true.dat +++ b/tests/test_create_fission_neutrons/inputs_true.dat @@ -18,10 +18,9 @@ - - 100 - 10 - + fixed source + 100 + 10 -1 -1 -1 1 1 1 diff --git a/tests/test_density/settings.xml b/tests/test_density/settings.xml index a6fd5da19e..70b4e802f8 100644 --- a/tests/test_density/settings.xml +++ b/tests/test_density/settings.xml @@ -1,11 +1,10 @@ - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_diff_tally/inputs_true.dat b/tests/test_diff_tally/inputs_true.dat index 0010c6d97f..0d75e48c6f 100644 --- a/tests/test_diff_tally/inputs_true.dat +++ b/tests/test_diff_tally/inputs_true.dat @@ -297,11 +297,10 @@ - - 100 - 3 - 0 - + eigenvalue + 100 + 3 + 0 -160 -160 -183 160 160 183 diff --git a/tests/test_distribmat/inputs_true.dat b/tests/test_distribmat/inputs_true.dat index d9b32ca841..746bb8bef5 100644 --- a/tests/test_distribmat/inputs_true.dat +++ b/tests/test_distribmat/inputs_true.dat @@ -37,11 +37,10 @@ - - 1000 - 5 - 0 - + eigenvalue + 1000 + 5 + 0 -1 -1 -1 1 1 1 diff --git a/tests/test_eigenvalue_genperbatch/settings.xml b/tests/test_eigenvalue_genperbatch/settings.xml index a64b477b88..fefc2d059a 100644 --- a/tests/test_eigenvalue_genperbatch/settings.xml +++ b/tests/test_eigenvalue_genperbatch/settings.xml @@ -1,12 +1,11 @@ - - 7 - 3 - 1000 - 3 - + eigenvalue + 7 + 3 + 1000 + 3 diff --git a/tests/test_eigenvalue_no_inactive/settings.xml b/tests/test_eigenvalue_no_inactive/settings.xml index 36d323ac04..f13a1665e7 100644 --- a/tests/test_eigenvalue_no_inactive/settings.xml +++ b/tests/test_eigenvalue_no_inactive/settings.xml @@ -1,11 +1,10 @@ - - 10 - 0 - 1000 - + eigenvalue + 10 + 0 + 1000 diff --git a/tests/test_energy_cutoff/inputs_true.dat b/tests/test_energy_cutoff/inputs_true.dat index eafb2e3895..7f67288d1e 100644 --- a/tests/test_energy_cutoff/inputs_true.dat +++ b/tests/test_energy_cutoff/inputs_true.dat @@ -17,10 +17,9 @@ - - 100 - 10 - + fixed source + 100 + 10 -1 -1 -1 1 1 1 diff --git a/tests/test_energy_grid/settings.xml b/tests/test_energy_grid/settings.xml index 1e4b5937b8..4b8d4fcebb 100644 --- a/tests/test_energy_grid/settings.xml +++ b/tests/test_energy_grid/settings.xml @@ -3,11 +3,10 @@ 20000 - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_energy_laws/settings.xml b/tests/test_energy_laws/settings.xml index 1c3f444f0f..946345eeb5 100644 --- a/tests/test_energy_laws/settings.xml +++ b/tests/test_energy_laws/settings.xml @@ -1,10 +1,9 @@ - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_entropy/settings.xml b/tests/test_entropy/settings.xml index d6c6c4a478..df6a851ef6 100644 --- a/tests/test_entropy/settings.xml +++ b/tests/test_entropy/settings.xml @@ -1,11 +1,10 @@ - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_filter_distribcell/case-1/settings.xml b/tests/test_filter_distribcell/case-1/settings.xml index 3ca5c1a327..14c6f3020f 100644 --- a/tests/test_filter_distribcell/case-1/settings.xml +++ b/tests/test_filter_distribcell/case-1/settings.xml @@ -1,11 +1,10 @@ - - 1 - 0 - 1000 - + eigenvalue + 1 + 0 + 1000 diff --git a/tests/test_filter_distribcell/case-2/settings.xml b/tests/test_filter_distribcell/case-2/settings.xml index 3ca5c1a327..14c6f3020f 100644 --- a/tests/test_filter_distribcell/case-2/settings.xml +++ b/tests/test_filter_distribcell/case-2/settings.xml @@ -1,11 +1,10 @@ - - 1 - 0 - 1000 - + eigenvalue + 1 + 0 + 1000 diff --git a/tests/test_filter_distribcell/case-3/settings.xml b/tests/test_filter_distribcell/case-3/settings.xml index 98c02fc307..ac716f3209 100644 --- a/tests/test_filter_distribcell/case-3/settings.xml +++ b/tests/test_filter_distribcell/case-3/settings.xml @@ -1,11 +1,10 @@ - - 3 - 0 - 100 - + eigenvalue + 3 + 0 + 100 diff --git a/tests/test_filter_distribcell/case-4/settings.xml b/tests/test_filter_distribcell/case-4/settings.xml index 90e48b9c18..f3f0779bc9 100644 --- a/tests/test_filter_distribcell/case-4/settings.xml +++ b/tests/test_filter_distribcell/case-4/settings.xml @@ -1,13 +1,12 @@ - - 1000 - 1 - 0 - - - - -1 -1 -1 1 1 1 - - + eigenvalue + 1000 + 1 + 0 + + + -1 -1 -1 1 1 1 + + diff --git a/tests/test_filter_energyfun/inputs_true.dat b/tests/test_filter_energyfun/inputs_true.dat index df627fa049..48f6c5033e 100644 --- a/tests/test_filter_energyfun/inputs_true.dat +++ b/tests/test_filter_energyfun/inputs_true.dat @@ -298,11 +298,10 @@ - - 100 - 10 - 5 - + eigenvalue + 100 + 10 + 5 -160 -160 -183 160 160 183 diff --git a/tests/test_filter_mesh/inputs_true.dat b/tests/test_filter_mesh/inputs_true.dat index 9f1951b56b..1d9d6ac5c2 100644 --- a/tests/test_filter_mesh/inputs_true.dat +++ b/tests/test_filter_mesh/inputs_true.dat @@ -297,11 +297,10 @@ - - 100 - 10 - 5 - + eigenvalue + 100 + 10 + 5 -160 -160 -183 160 160 183 diff --git a/tests/test_fixed_source/settings.xml b/tests/test_fixed_source/settings.xml index 1e9b85d5a8..e7e7f2f5b9 100644 --- a/tests/test_fixed_source/settings.xml +++ b/tests/test_fixed_source/settings.xml @@ -1,10 +1,9 @@ - - 10 - 100 - + fixed source + 10 + 100 294 diff --git a/tests/test_infinite_cell/settings.xml b/tests/test_infinite_cell/settings.xml index a6fd5da19e..70b4e802f8 100644 --- a/tests/test_infinite_cell/settings.xml +++ b/tests/test_infinite_cell/settings.xml @@ -1,11 +1,10 @@ - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_iso_in_lab/inputs_true.dat b/tests/test_iso_in_lab/inputs_true.dat index 6b4b14c2c4..682f8020f6 100644 --- a/tests/test_iso_in_lab/inputs_true.dat +++ b/tests/test_iso_in_lab/inputs_true.dat @@ -297,11 +297,10 @@ - - 100 - 10 - 5 - + eigenvalue + 100 + 10 + 5 -160 -160 -183 160 160 183 diff --git a/tests/test_lattice/settings.xml b/tests/test_lattice/settings.xml index d152920c11..ebe98a2837 100644 --- a/tests/test_lattice/settings.xml +++ b/tests/test_lattice/settings.xml @@ -10,11 +10,10 @@ =============================================================== --> - - 10 - 5 - 100 - + eigenvalue + 10 + 5 + 100 diff --git a/tests/test_lattice_hex/settings.xml b/tests/test_lattice_hex/settings.xml index 810529cb13..0d87c3b861 100644 --- a/tests/test_lattice_hex/settings.xml +++ b/tests/test_lattice_hex/settings.xml @@ -1,10 +1,9 @@ - - 10 - 5 - 500 - + eigenvalue + 10 + 5 + 500 diff --git a/tests/test_lattice_mixed/settings.xml b/tests/test_lattice_mixed/settings.xml index b67824d036..69d50204e0 100644 --- a/tests/test_lattice_mixed/settings.xml +++ b/tests/test_lattice_mixed/settings.xml @@ -1,10 +1,9 @@ - - 10 - 5 - 500 - + eigenvalue + 10 + 5 + 500 diff --git a/tests/test_lattice_multiple/settings.xml b/tests/test_lattice_multiple/settings.xml index 517637a59f..569c809821 100644 --- a/tests/test_lattice_multiple/settings.xml +++ b/tests/test_lattice_multiple/settings.xml @@ -1,11 +1,10 @@ - - 10 - 5 - 100 - + eigenvalue + 10 + 5 + 100 diff --git a/tests/test_mg_basic/inputs_true.dat b/tests/test_mg_basic/inputs_true.dat index 182e5f46d3..7141e57dd4 100644 --- a/tests/test_mg_basic/inputs_true.dat +++ b/tests/test_mg_basic/inputs_true.dat @@ -84,11 +84,10 @@ - - 100 - 10 - 5 - + eigenvalue + 100 + 10 + 5 0.0 0.0 0.0 10.0 10.0 5.0 diff --git a/tests/test_mg_max_order/inputs_true.dat b/tests/test_mg_max_order/inputs_true.dat index 857e95bf55..a5feed722d 100644 --- a/tests/test_mg_max_order/inputs_true.dat +++ b/tests/test_mg_max_order/inputs_true.dat @@ -30,11 +30,10 @@ - - 100 - 10 - 5 - + eigenvalue + 100 + 10 + 5 0.0 0.0 0.0 10.0 10.0 5.0 diff --git a/tests/test_mg_nuclide/inputs_true.dat b/tests/test_mg_nuclide/inputs_true.dat index 829b908ffa..b5cb31b59c 100644 --- a/tests/test_mg_nuclide/inputs_true.dat +++ b/tests/test_mg_nuclide/inputs_true.dat @@ -84,11 +84,10 @@ - - 100 - 10 - 5 - + eigenvalue + 100 + 10 + 5 0.0 0.0 0.0 10.0 10.0 5.0 diff --git a/tests/test_mg_tallies/inputs_true.dat b/tests/test_mg_tallies/inputs_true.dat index 56d97a394c..244d92b06b 100644 --- a/tests/test_mg_tallies/inputs_true.dat +++ b/tests/test_mg_tallies/inputs_true.dat @@ -84,11 +84,10 @@ - - 100 - 10 - 5 - + eigenvalue + 100 + 10 + 5 0.0 0.0 0.0 10.0 10.0 5.0 diff --git a/tests/test_mgxs_library_ce_to_mg/inputs_true.dat b/tests/test_mgxs_library_ce_to_mg/inputs_true.dat index 920dc4b5ef..e31ee4d049 100644 --- a/tests/test_mgxs_library_ce_to_mg/inputs_true.dat +++ b/tests/test_mgxs_library_ce_to_mg/inputs_true.dat @@ -38,11 +38,10 @@ - - 100 - 10 - 5 - + eigenvalue + 100 + 10 + 5 -0.63 -0.63 -1 0.63 0.63 1 diff --git a/tests/test_mgxs_library_ce_to_mg/test_mgxs_library_ce_to_mg.py b/tests/test_mgxs_library_ce_to_mg/test_mgxs_library_ce_to_mg.py index e6511fd623..dbc2e0916c 100644 --- a/tests/test_mgxs_library_ce_to_mg/test_mgxs_library_ce_to_mg.py +++ b/tests/test_mgxs_library_ce_to_mg/test_mgxs_library_ce_to_mg.py @@ -41,10 +41,9 @@ class MGXSTestHarness(PyAPITestHarness): def _run_openmc(self): # Initial run if self._opts.mpi_exec is not None: - returncode = openmc.run(mpi_procs=self._opts.mpi_np, - openmc_exec=self._opts.exe, - mpi_exec=self._opts.mpi_exec) - + mpi_args = [self._opts.mpi_exec, '-n', self._opts.mpi_np] + returncode = openmc.run(openmc_exec=self._opts.exe, + mpi_args=mpi_args) else: returncode = openmc.run(openmc_exec=self._opts.exe) @@ -77,10 +76,9 @@ class MGXSTestHarness(PyAPITestHarness): # Re-run MG mode. if self._opts.mpi_exec is not None: - returncode = openmc.run(mpi_procs=self._opts.mpi_np, - openmc_exec=self._opts.exe, - mpi_exec=self._opts.mpi_exec) - + mpi_args = [self._opts.mpi_exec, '-n', self._opts.mpi_np] + returncode = openmc.run(openmc_exec=self._opts.exe, + mpi_args=mpi_args) else: returncode = openmc.run(openmc_exec=self._opts.exe) diff --git a/tests/test_mgxs_library_condense/inputs_true.dat b/tests/test_mgxs_library_condense/inputs_true.dat index ac3f32c4f7..ad6526fc16 100644 --- a/tests/test_mgxs_library_condense/inputs_true.dat +++ b/tests/test_mgxs_library_condense/inputs_true.dat @@ -38,11 +38,10 @@ - - 100 - 10 - 5 - + eigenvalue + 100 + 10 + 5 -0.63 -0.63 -1 0.63 0.63 1 diff --git a/tests/test_mgxs_library_distribcell/inputs_true.dat b/tests/test_mgxs_library_distribcell/inputs_true.dat index fd04015270..9103a4b968 100644 --- a/tests/test_mgxs_library_distribcell/inputs_true.dat +++ b/tests/test_mgxs_library_distribcell/inputs_true.dat @@ -65,11 +65,10 @@ - - 100 - 10 - 5 - + eigenvalue + 100 + 10 + 5 -10.71 -10.71 -1 10.71 10.71 1 diff --git a/tests/test_mgxs_library_hdf5/inputs_true.dat b/tests/test_mgxs_library_hdf5/inputs_true.dat index ac3f32c4f7..ad6526fc16 100644 --- a/tests/test_mgxs_library_hdf5/inputs_true.dat +++ b/tests/test_mgxs_library_hdf5/inputs_true.dat @@ -38,11 +38,10 @@ - - 100 - 10 - 5 - + eigenvalue + 100 + 10 + 5 -0.63 -0.63 -1 0.63 0.63 1 diff --git a/tests/test_mgxs_library_mesh/inputs_true.dat b/tests/test_mgxs_library_mesh/inputs_true.dat index 07b2076d73..421f4d8c78 100644 --- a/tests/test_mgxs_library_mesh/inputs_true.dat +++ b/tests/test_mgxs_library_mesh/inputs_true.dat @@ -297,11 +297,10 @@ - - 100 - 10 - 5 - + eigenvalue + 100 + 10 + 5 -160 -160 -183 160 160 183 diff --git a/tests/test_mgxs_library_no_nuclides/inputs_true.dat b/tests/test_mgxs_library_no_nuclides/inputs_true.dat index ac3f32c4f7..ad6526fc16 100644 --- a/tests/test_mgxs_library_no_nuclides/inputs_true.dat +++ b/tests/test_mgxs_library_no_nuclides/inputs_true.dat @@ -38,11 +38,10 @@ - - 100 - 10 - 5 - + eigenvalue + 100 + 10 + 5 -0.63 -0.63 -1 0.63 0.63 1 diff --git a/tests/test_mgxs_library_nuclides/inputs_true.dat b/tests/test_mgxs_library_nuclides/inputs_true.dat index 05227ca8c6..74dfc7b2e3 100644 --- a/tests/test_mgxs_library_nuclides/inputs_true.dat +++ b/tests/test_mgxs_library_nuclides/inputs_true.dat @@ -38,11 +38,10 @@ - - 100 - 10 - 5 - + eigenvalue + 100 + 10 + 5 -0.63 -0.63 -1 0.63 0.63 1 diff --git a/tests/test_multipole/inputs_true.dat b/tests/test_multipole/inputs_true.dat index 4b158b07c7..2a1e865ada 100644 --- a/tests/test_multipole/inputs_true.dat +++ b/tests/test_multipole/inputs_true.dat @@ -34,11 +34,10 @@ - - 1000 - 5 - 0 - + eigenvalue + 1000 + 5 + 0 -1 -1 -1 1 1 1 diff --git a/tests/test_output/settings.xml b/tests/test_output/settings.xml index e2f3fc0186..22b6267a33 100644 --- a/tests/test_output/settings.xml +++ b/tests/test_output/settings.xml @@ -3,11 +3,10 @@ - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_particle_restart_eigval/settings.xml b/tests/test_particle_restart_eigval/settings.xml index c01617e221..da37b4fc2e 100644 --- a/tests/test_particle_restart_eigval/settings.xml +++ b/tests/test_particle_restart_eigval/settings.xml @@ -1,11 +1,10 @@ - - 12 - 5 - 1200 - + eigenvalue + 12 + 5 + 1200 diff --git a/tests/test_particle_restart_fixed/settings.xml b/tests/test_particle_restart_fixed/settings.xml index 1d8193f8f6..9c731fde8c 100644 --- a/tests/test_particle_restart_fixed/settings.xml +++ b/tests/test_particle_restart_fixed/settings.xml @@ -1,10 +1,9 @@ - - 12 - 1000 - + fixed source + 12 + 1000 diff --git a/tests/test_periodic/inputs_true.dat b/tests/test_periodic/inputs_true.dat index 764fec50db..5f7da5c470 100644 --- a/tests/test_periodic/inputs_true.dat +++ b/tests/test_periodic/inputs_true.dat @@ -25,11 +25,10 @@ - - 1000 - 4 - 0 - + eigenvalue + 1000 + 4 + 0 -5.0 -5.0 -5.0 5.0 5.0 5.0 diff --git a/tests/test_plot/settings.xml b/tests/test_plot/settings.xml index 03985b3ae9..37623cb1fb 100644 --- a/tests/test_plot/settings.xml +++ b/tests/test_plot/settings.xml @@ -1,11 +1,10 @@ - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_ptables_off/settings.xml b/tests/test_ptables_off/settings.xml index ab5404b206..5ae20fd386 100644 --- a/tests/test_ptables_off/settings.xml +++ b/tests/test_ptables_off/settings.xml @@ -3,11 +3,10 @@ false - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_quadric_surfaces/settings.xml b/tests/test_quadric_surfaces/settings.xml index 9f0e8ed05f..81e5ad1855 100644 --- a/tests/test_quadric_surfaces/settings.xml +++ b/tests/test_quadric_surfaces/settings.xml @@ -1,11 +1,10 @@ - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_reflective_plane/settings.xml b/tests/test_reflective_plane/settings.xml index a6fd5da19e..70b4e802f8 100644 --- a/tests/test_reflective_plane/settings.xml +++ b/tests/test_reflective_plane/settings.xml @@ -1,11 +1,10 @@ - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_resonance_scattering/inputs_true.dat b/tests/test_resonance_scattering/inputs_true.dat index 804c6c4f6f..2801f115de 100644 --- a/tests/test_resonance_scattering/inputs_true.dat +++ b/tests/test_resonance_scattering/inputs_true.dat @@ -15,11 +15,10 @@ - - 1000 - 10 - 5 - + eigenvalue + 1000 + 10 + 5 -4 -4 -4 4 4 4 diff --git a/tests/test_rotation/settings.xml b/tests/test_rotation/settings.xml index a6fd5da19e..70b4e802f8 100644 --- a/tests/test_rotation/settings.xml +++ b/tests/test_rotation/settings.xml @@ -1,11 +1,10 @@ - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_salphabeta/settings.xml b/tests/test_salphabeta/settings.xml index a6fd5da19e..70b4e802f8 100644 --- a/tests/test_salphabeta/settings.xml +++ b/tests/test_salphabeta/settings.xml @@ -1,11 +1,10 @@ - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_score_current/settings.xml b/tests/test_score_current/settings.xml index 517637a59f..569c809821 100644 --- a/tests/test_score_current/settings.xml +++ b/tests/test_score_current/settings.xml @@ -1,11 +1,10 @@ - - 10 - 5 - 100 - + eigenvalue + 10 + 5 + 100 diff --git a/tests/test_seed/settings.xml b/tests/test_seed/settings.xml index 0514e8a0ac..11da445885 100644 --- a/tests/test_seed/settings.xml +++ b/tests/test_seed/settings.xml @@ -3,11 +3,10 @@ 239407351 - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_source/inputs_true.dat b/tests/test_source/inputs_true.dat index 727636c517..bb80609aff 100644 --- a/tests/test_source/inputs_true.dat +++ b/tests/test_source/inputs_true.dat @@ -13,11 +13,10 @@ - - 1000 - 10 - 5 - + eigenvalue + 1000 + 10 + 5 diff --git a/tests/test_sourcepoint_batch/settings.xml b/tests/test_sourcepoint_batch/settings.xml index c816fe700e..13096d551b 100644 --- a/tests/test_sourcepoint_batch/settings.xml +++ b/tests/test_sourcepoint_batch/settings.xml @@ -4,11 +4,10 @@ - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_sourcepoint_latest/settings.xml b/tests/test_sourcepoint_latest/settings.xml index fa7f07dfae..58dfa671d4 100644 --- a/tests/test_sourcepoint_latest/settings.xml +++ b/tests/test_sourcepoint_latest/settings.xml @@ -3,11 +3,10 @@ - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_sourcepoint_restart/settings.xml b/tests/test_sourcepoint_restart/settings.xml index 4e9b12d246..1a7a21357c 100644 --- a/tests/test_sourcepoint_restart/settings.xml +++ b/tests/test_sourcepoint_restart/settings.xml @@ -4,11 +4,10 @@ - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_statepoint_batch/settings.xml b/tests/test_statepoint_batch/settings.xml index 0d8c3e88f0..e2f8dad47b 100644 --- a/tests/test_statepoint_batch/settings.xml +++ b/tests/test_statepoint_batch/settings.xml @@ -3,11 +3,10 @@ - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_statepoint_restart/settings.xml b/tests/test_statepoint_restart/settings.xml index ec9adfb1dc..88382f74b4 100644 --- a/tests/test_statepoint_restart/settings.xml +++ b/tests/test_statepoint_restart/settings.xml @@ -3,11 +3,10 @@ - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_statepoint_restart/test_statepoint_restart.py b/tests/test_statepoint_restart/test_statepoint_restart.py index d39bf7cd5f..61522ee051 100644 --- a/tests/test_statepoint_restart/test_statepoint_restart.py +++ b/tests/test_statepoint_restart/test_statepoint_restart.py @@ -50,11 +50,10 @@ class StatepointRestartTestHarness(TestHarness): # Run OpenMC if self._opts.mpi_exec is not None: - returncode = openmc.run(mpi_procs=self._opts.mpi_np, - restart_file=statepoint, + mpi_args = [self._opts.mpi_exec, '-n', self._opts.mpi_np] + returncode = openmc.run(restart_file=statepoint, openmc_exec=self._opts.exe, - mpi_exec=self._opts.mpi_exec) - + mpi_args=mpi_args) else: returncode = openmc.run(openmc_exec=self._opts.exe, restart_file=statepoint) diff --git a/tests/test_statepoint_sourcesep/settings.xml b/tests/test_statepoint_sourcesep/settings.xml index 17d4ee2e2e..86489bf33d 100644 --- a/tests/test_statepoint_sourcesep/settings.xml +++ b/tests/test_statepoint_sourcesep/settings.xml @@ -4,11 +4,10 @@ - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_survival_biasing/settings.xml b/tests/test_survival_biasing/settings.xml index b0ff3fafc6..6d5b667891 100644 --- a/tests/test_survival_biasing/settings.xml +++ b/tests/test_survival_biasing/settings.xml @@ -8,11 +8,10 @@ 1.2 - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_tallies/inputs_true.dat b/tests/test_tallies/inputs_true.dat index c349c3b94a..88ff72f9bb 100644 --- a/tests/test_tallies/inputs_true.dat +++ b/tests/test_tallies/inputs_true.dat @@ -297,11 +297,10 @@ - - 400 - 5 - 0 - + eigenvalue + 400 + 5 + 0 -160 -160 -183 160 160 183 diff --git a/tests/test_tally_aggregation/inputs_true.dat b/tests/test_tally_aggregation/inputs_true.dat index 23a35ad792..8223b8d6a2 100644 --- a/tests/test_tally_aggregation/inputs_true.dat +++ b/tests/test_tally_aggregation/inputs_true.dat @@ -297,11 +297,10 @@ - - 100 - 10 - 5 - + eigenvalue + 100 + 10 + 5 -160 -160 -183 160 160 183 diff --git a/tests/test_tally_arithmetic/inputs_true.dat b/tests/test_tally_arithmetic/inputs_true.dat index 323b56e496..4ade94e938 100644 --- a/tests/test_tally_arithmetic/inputs_true.dat +++ b/tests/test_tally_arithmetic/inputs_true.dat @@ -297,11 +297,10 @@ - - 100 - 10 - 5 - + eigenvalue + 100 + 10 + 5 -160 -160 -183 160 160 183 diff --git a/tests/test_tally_assumesep/settings.xml b/tests/test_tally_assumesep/settings.xml index 517637a59f..569c809821 100644 --- a/tests/test_tally_assumesep/settings.xml +++ b/tests/test_tally_assumesep/settings.xml @@ -1,11 +1,10 @@ - - 10 - 5 - 100 - + eigenvalue + 10 + 5 + 100 diff --git a/tests/test_tally_nuclides/settings.xml b/tests/test_tally_nuclides/settings.xml index b2ddb42483..32afc717a9 100644 --- a/tests/test_tally_nuclides/settings.xml +++ b/tests/test_tally_nuclides/settings.xml @@ -1,11 +1,10 @@ - - 10 - 5 - 100 - + eigenvalue + 10 + 5 + 100 diff --git a/tests/test_tally_slice_merge/inputs_true.dat b/tests/test_tally_slice_merge/inputs_true.dat index 8941737607..93b4af5cd9 100644 --- a/tests/test_tally_slice_merge/inputs_true.dat +++ b/tests/test_tally_slice_merge/inputs_true.dat @@ -297,11 +297,10 @@ - - 100 - 10 - 5 - + eigenvalue + 100 + 10 + 5 -160 -160 -183 160 160 183 diff --git a/tests/test_trace/settings.xml b/tests/test_trace/settings.xml index e50684eef6..ce614711bd 100644 --- a/tests/test_trace/settings.xml +++ b/tests/test_trace/settings.xml @@ -3,11 +3,10 @@ 5 1 453 - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_track_output/settings.xml b/tests/test_track_output/settings.xml index ef74341dbb..299ee72c53 100644 --- a/tests/test_track_output/settings.xml +++ b/tests/test_track_output/settings.xml @@ -1,19 +1,11 @@ - - - - - - 2 - 0 - 100 - - - - + eigenvalue + 2 + 0 + 100 @@ -26,5 +18,5 @@ 1 1 1 1 1 2 - + diff --git a/tests/test_translation/settings.xml b/tests/test_translation/settings.xml index a6fd5da19e..70b4e802f8 100644 --- a/tests/test_translation/settings.xml +++ b/tests/test_translation/settings.xml @@ -1,11 +1,10 @@ - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_trigger_batch_interval/settings.xml b/tests/test_trigger_batch_interval/settings.xml index b8e1e9c96a..ecba8d3475 100644 --- a/tests/test_trigger_batch_interval/settings.xml +++ b/tests/test_trigger_batch_interval/settings.xml @@ -1,14 +1,13 @@ - - 15 - 5 - 1000 - - std_dev - 0.004 - - + eigenvalue + 15 + 5 + 1000 + + std_dev + 0.004 + true diff --git a/tests/test_trigger_no_batch_interval/settings.xml b/tests/test_trigger_no_batch_interval/settings.xml index 5412af35f9..9a4c94226c 100644 --- a/tests/test_trigger_no_batch_interval/settings.xml +++ b/tests/test_trigger_no_batch_interval/settings.xml @@ -1,14 +1,13 @@ - - 15 - 5 - 1000 - - std_dev - 0.004 - - + eigenvalue + 15 + 5 + 1000 + + std_dev + 0.004 + true diff --git a/tests/test_trigger_no_status/settings.xml b/tests/test_trigger_no_status/settings.xml index 3d215a4329..b85816240e 100644 --- a/tests/test_trigger_no_status/settings.xml +++ b/tests/test_trigger_no_status/settings.xml @@ -1,20 +1,19 @@ - - 10 - 5 - 1000 - - std_dev - 0.009 - - + eigenvalue + 10 + 5 + 1000 + + std_dev + 0.009 + false 15 1 - + diff --git a/tests/test_trigger_tallies/settings.xml b/tests/test_trigger_tallies/settings.xml index 895c0ee72c..d8f814bf33 100644 --- a/tests/test_trigger_tallies/settings.xml +++ b/tests/test_trigger_tallies/settings.xml @@ -1,14 +1,13 @@ - - 10 - 5 - 1000 - - std_dev - 0.001 - - + eigenvalue + 10 + 5 + 1000 + + std_dev + 0.001 + true diff --git a/tests/test_triso/inputs_true.dat b/tests/test_triso/inputs_true.dat index be6d2d0eae..43b15b037c 100644 --- a/tests/test_triso/inputs_true.dat +++ b/tests/test_triso/inputs_true.dat @@ -430,11 +430,10 @@ - - 100 - 5 - 0 - + eigenvalue + 100 + 5 + 0 0.0 0.0 0.0 diff --git a/tests/test_uniform_fs/settings.xml b/tests/test_uniform_fs/settings.xml index d7956e7438..3e6ef672fd 100644 --- a/tests/test_uniform_fs/settings.xml +++ b/tests/test_uniform_fs/settings.xml @@ -1,11 +1,10 @@ - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_universe/settings.xml b/tests/test_universe/settings.xml index a6fd5da19e..70b4e802f8 100644 --- a/tests/test_universe/settings.xml +++ b/tests/test_universe/settings.xml @@ -1,11 +1,10 @@ - - 10 - 5 - 1000 - + eigenvalue + 10 + 5 + 1000 diff --git a/tests/test_void/settings.xml b/tests/test_void/settings.xml index b2ddb42483..32afc717a9 100644 --- a/tests/test_void/settings.xml +++ b/tests/test_void/settings.xml @@ -1,11 +1,10 @@ - - 10 - 5 - 100 - + eigenvalue + 10 + 5 + 100 diff --git a/tests/test_volume_calc/inputs_true.dat b/tests/test_volume_calc/inputs_true.dat index af26cf8e7b..627d30a404 100644 --- a/tests/test_volume_calc/inputs_true.dat +++ b/tests/test_volume_calc/inputs_true.dat @@ -26,16 +26,7 @@ - - 1000 - 4 - 0 - - - - -1.0 -1.0 -5.0 1.0 1.0 5.0 - - + volume cell 1 2 3 diff --git a/tests/test_volume_calc/results_true.dat b/tests/test_volume_calc/results_true.dat index a36e61fb5e..8eb2a61acf 100644 --- a/tests/test_volume_calc/results_true.dat +++ b/tests/test_volume_calc/results_true.dat @@ -1,4 +1,3 @@ -k-combined: 4.165450e-02 3.582533e-04 Volume calculation 0 Domain 1: 31.4693 +/- 0.0721 cm^3 Domain 2: 2.0933 +/- 0.0310 cm^3 diff --git a/tests/test_volume_calc/test_volume_calc.py b/tests/test_volume_calc/test_volume_calc.py index fa267efb6a..cb4ecc2d74 100644 --- a/tests/test_volume_calc/test_volume_calc.py +++ b/tests/test_volume_calc/test_volume_calc.py @@ -52,22 +52,12 @@ class VolumeTest(PyAPITestHarness): # Define settings settings = openmc.Settings() - settings.particles = 1000 - settings.batches = 4 - settings.inactive = 0 - settings.source = openmc.Source(space=openmc.stats.Box( - [-1., -1., -5.], [1., 1., 5.])) + settings.run_mode = 'volume' settings.volume_calculations = vol_calcs settings.export_to_xml() def _get_results(self): - # Read the statepoint file. - statepoint = os.path.join(os.getcwd(), self._sp_name) - sp = openmc.StatePoint(statepoint) - - # Write out k-combined. - outstr = 'k-combined: {:12.6e} {:12.6e}\n'.format(*sp.k_combined) - + outstr = '' for i, filename in enumerate(sorted(glob.glob(os.path.join( os.getcwd(), 'volume_*.h5')))): outstr += 'Volume calculation {}\n'.format(i) @@ -83,6 +73,9 @@ class VolumeTest(PyAPITestHarness): return outstr + def _test_output_created(self): + pass + if __name__ == '__main__': - harness = VolumeTest('statepoint.4.h5') + harness = VolumeTest('') harness.main() diff --git a/tests/testing_harness.py b/tests/testing_harness.py index b833615c79..fc3b4f9346 100644 --- a/tests/testing_harness.py +++ b/tests/testing_harness.py @@ -24,7 +24,7 @@ class TestHarness(object): self.parser = OptionParser() self.parser.add_option('--exe', dest='exe', default='openmc') self.parser.add_option('--mpi_exec', dest='mpi_exec', default=None) - self.parser.add_option('--mpi_np', dest='mpi_np', type=int, default=2) + self.parser.add_option('--mpi_np', dest='mpi_np', default='2') self.parser.add_option('--update', dest='update', action='store_true', default=False) self._opts = None @@ -62,9 +62,9 @@ class TestHarness(object): def _run_openmc(self): if self._opts.mpi_exec is not None: - returncode = openmc.run(mpi_procs=self._opts.mpi_np, - openmc_exec=self._opts.exe, - mpi_exec=self._opts.mpi_exec) + returncode = openmc.run( + openmc_exec=self._opts.exe, + mpi_args=[self._opts.mpi_exec, '-n', self._opts.mpi_np]) else: returncode = openmc.run(openmc_exec=self._opts.exe) @@ -190,8 +190,7 @@ class ParticleRestartTestHarness(TestHarness): # Set arguments args = {'openmc_exec': self._opts.exe} if self._opts.mpi_exec is not None: - args.update({'mpi_procs': self._opts.mpi_np, - 'mpi_exec': self._opts.mpi_exec}) + args['mpi_args'] = [self._opts.mpi_exec, '-n', self._opts.mpi_np] # Initial run returncode = openmc.run(**args)