From c7a0b716d26779b61c197a5bfcf0b64a884c9c7b Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 1 Jul 2016 22:57:14 +0700 Subject: [PATCH 01/17] General cleanup -- both bugs and style issues -- based on running pylint --- openmc/arithmetic.py | 7 +++-- openmc/cell.py | 5 ++-- openmc/checkvalue.py | 4 +-- openmc/cmfd.py | 6 ++--- openmc/element.py | 7 ++--- openmc/filter.py | 5 ++-- openmc/geometry.py | 30 +++++++++++---------- openmc/lattice.py | 9 +++---- openmc/macroscopic.py | 10 ++----- openmc/material.py | 26 +++++++++--------- openmc/mesh.py | 17 ++++++------ openmc/mgxs/library.py | 54 ++++++++++++++----------------------- openmc/mgxs/mgxs.py | 37 +++++++++++++------------ openmc/mgxs_library.py | 17 +++++------- openmc/nuclide.py | 23 ++++++---------- openmc/opencg_compatible.py | 33 ++++++++--------------- openmc/particle_restart.py | 3 --- openmc/plots.py | 13 ++++----- openmc/region.py | 4 +-- openmc/settings.py | 28 ++++++++++--------- openmc/source.py | 8 ++++++ openmc/statepoint.py | 2 +- openmc/stats/univariate.py | 4 +-- openmc/summary.py | 15 ++++++----- openmc/surface.py | 23 +++++++++------- openmc/tallies.py | 54 +++++++++++++++++-------------------- openmc/trigger.py | 7 ++--- openmc/universe.py | 15 +++++------ setup.py | 1 - 29 files changed, 215 insertions(+), 252 deletions(-) diff --git a/openmc/arithmetic.py b/openmc/arithmetic.py index f9ef58db89..74ed760c7a 100644 --- a/openmc/arithmetic.py +++ b/openmc/arithmetic.py @@ -1,6 +1,5 @@ import sys import copy -from numbers import Integral from collections import Iterable import numpy as np @@ -321,7 +320,7 @@ class CrossFilter(object): @type.setter def type(self, filter_type): - if filter_type not in _FILTER_TYPES.values(): + if filter_type not in _FILTER_TYPES: msg = 'Unable to set CrossFilter type to "{0}" since it ' \ 'is not one of the supported types'.format(filter_type) raise ValueError(msg) @@ -576,7 +575,7 @@ class AggregateNuclide(object): @nuclides.setter def nuclides(self, nuclides): cv.check_iterable_type('nuclides', nuclides, - (basestring, Nuclide, CrossNuclide)) + (basestring, Nuclide, CrossNuclide)) self._nuclides = nuclides @aggregate_op.setter @@ -691,7 +690,7 @@ class AggregateFilter(object): @type.setter def type(self, filter_type): - if filter_type not in _FILTER_TYPES.values(): + if filter_type not in _FILTER_TYPES: msg = 'Unable to set AggregateFilter type to "{0}" since it ' \ 'is not one of the supported types'.format(filter_type) raise ValueError(msg) diff --git a/openmc/cell.py b/openmc/cell.py index 9ff5d1fa30..9055f10e59 100644 --- a/openmc/cell.py +++ b/openmc/cell.py @@ -21,6 +21,7 @@ AUTO_CELL_ID = 10000 def reset_auto_cell_id(): + """Reset counter for auto-generated cell IDs.""" global AUTO_CELL_ID AUTO_CELL_ID = 10000 @@ -421,7 +422,7 @@ class Cell(object): # Append all Cells in each Cell in the Universe to the dictionary cells = self.get_all_cells() - for cell_id, cell in cells.items(): + for cell in cells.values(): materials.update(cell.get_all_materials()) return materials @@ -497,7 +498,7 @@ class Cell(object): if self.temperature is not None: if isinstance(self.temperature, Iterable): element.set("temperature", ' '.join( - str(t) for t in self.temperature)) + str(t) for t in self.temperature)) else: element.set("temperature", str(self.temperature)) diff --git a/openmc/checkvalue.py b/openmc/checkvalue.py index cc0e1190df..7c0dff99dd 100644 --- a/openmc/checkvalue.py +++ b/openmc/checkvalue.py @@ -1,6 +1,5 @@ import copy from collections import Iterable -from numbers import Integral, Real import numpy as np @@ -162,7 +161,7 @@ def check_length(name, value, length_min, length_max=None): else: msg = 'Unable to set "{0}" to "{1}" since it must have length ' \ 'between "{2}" and "{3}"'.format(name, value, length_min, - length_max) + length_max) raise ValueError(msg) @@ -255,6 +254,7 @@ class CheckedList(list): """ def __init__(self, expected_type, name, items=[]): + super(CheckedList, self).__init__() self.expected_type = expected_type self.name = name for item in items: diff --git a/openmc/cmfd.py b/openmc/cmfd.py index d4cce2af5a..76d8685ff1 100644 --- a/openmc/cmfd.py +++ b/openmc/cmfd.py @@ -15,9 +15,7 @@ from numbers import Real, Integral from xml.etree import ElementTree as ET import sys -import numpy as np - -from openmc.clean_xml import * +from openmc.clean_xml import clean_xml_indentation from openmc.checkvalue import (check_type, check_length, check_value, check_greater_than, check_less_than) @@ -188,7 +186,7 @@ class CMFDMesh(object): class CMFD(object): - """Parameters that control the use of coarse-mesh finite difference acceleration + r"""Parameters that control the use of coarse-mesh finite difference acceleration in OpenMC. This corresponds directly to the cmfd.xml input file. Attributes diff --git a/openmc/element.py b/openmc/element.py index 14c98d4952..2e22702d99 100644 --- a/openmc/element.py +++ b/openmc/element.py @@ -45,9 +45,9 @@ class Element(object): def __eq__(self, other): if isinstance(other, Element): - if self._name != other._name: + if self._name != other.name: return False - elif self._xs != other._xs: + elif self._xs != other.xs: return False else: return True @@ -68,9 +68,6 @@ class Element(object): def __hash__(self): return hash(repr(self)) - def __hash__(self): - return hash(repr(self)) - def __repr__(self): string = 'Element - {0}\n'.format(self._name) string += '{0: <16}{1}{2}\n'.format('\tXS', '=\t', self._xs) diff --git a/openmc/filter.py b/openmc/filter.py index 72fb3b14ed..bc8b5bdf77 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -6,7 +6,6 @@ import sys import numpy as np from openmc import Mesh -from openmc.summary import Summary import openmc.checkvalue as cv @@ -391,7 +390,7 @@ class Filter(object): if self.type == 'mesh': # Convert (x,y,z) to a single bin -- this is similar to # subroutine mesh_indices_to_bin in openmc/src/mesh.F90. - if (len(self.mesh.dimension) == 3): + if len(self.mesh.dimension) == 3: nx, ny, nz = self.mesh.dimension val = (filter_bin[0] - 1) * ny * nz + \ (filter_bin[1] - 1) * nz + \ @@ -568,7 +567,7 @@ class Filter(object): mesh_key = 'mesh {0}'.format(self.mesh.id) # Find mesh dimensions - use 3D indices for simplicity - if (len(self.mesh.dimension) == 3): + if len(self.mesh.dimension) == 3: nx, ny, nz = self.mesh.dimension else: nx, ny = self.mesh.dimension diff --git a/openmc/geometry.py b/openmc/geometry.py index 2625ed3fa5..14fd48fb1e 100644 --- a/openmc/geometry.py +++ b/openmc/geometry.py @@ -1,11 +1,13 @@ -from collections import Iterable, OrderedDict +from collections import OrderedDict from xml.etree import ElementTree as ET import openmc -from openmc.clean_xml import * +from openmc.clean_xml import sort_xml_elements, clean_xml_indentation from openmc.checkvalue import check_type + def reset_auto_ids(): + """Reset counters for all auto-generated IDs""" openmc.reset_auto_material_id() openmc.reset_auto_surface_id() openmc.reset_auto_cell_id() @@ -40,10 +42,10 @@ class Geometry(object): @root_universe.setter def root_universe(self, root_universe): check_type('root universe', root_universe, openmc.Universe) - if root_universe._id != 0: + if root_universe.id != 0: msg = 'Unable to add root Universe "{0}" to Geometry since ' \ 'it has ID="{1}" instead of ' \ - 'ID=0'.format(root_universe, root_universe._id) + 'ID=0'.format(root_universe, root_universe.id) raise ValueError(msg) self._root_universe = root_universe @@ -281,9 +283,9 @@ class Geometry(object): The name to match case_sensitive : bool Whether to distinguish upper and lower case letters in each - material's name (default is True) + material's name (default is False) matching : bool - Whether the names must match completely (default is True) + Whether the names must match completely (default is False) Returns ------- @@ -321,9 +323,9 @@ class Geometry(object): The name to search match case_sensitive : bool Whether to distinguish upper and lower case letters in each - cell's name (default is True) + cell's name (default is False) matching : bool - Whether the names must match completely (default is True) + Whether the names must match completely (default is False) Returns ------- @@ -361,9 +363,9 @@ class Geometry(object): The name to match case_sensitive : bool Whether to distinguish upper and lower case letters in each - cell's name (default is True) + cell's name (default is False) matching : bool - Whether the names must match completely (default is True) + Whether the names must match completely (default is False) Returns ------- @@ -401,9 +403,9 @@ class Geometry(object): The name to match case_sensitive : bool Whether to distinguish upper and lower case letters in each - universe's name (default is True) + universe's name (default is False) matching : bool - Whether the names must match completely (default is True) + Whether the names must match completely (default is False) Returns ------- @@ -441,9 +443,9 @@ class Geometry(object): The name to match case_sensitive : bool Whether to distinguish upper and lower case letters in each - lattice's name (default is True) + lattice's name (default is False) matching : bool - Whether the names must match completely (default is True) + Whether the names must match completely (default is False) Returns ------- diff --git a/openmc/lattice.py b/openmc/lattice.py index 7690104c71..81144e4d81 100644 --- a/openmc/lattice.py +++ b/openmc/lattice.py @@ -6,7 +6,6 @@ from math import sqrt, floor from numbers import Real, Integral from xml.etree import ElementTree as ET import sys -import warnings import numpy as np @@ -429,14 +428,14 @@ class RectLattice(Lattice): # For 2D Lattices if self.ndim == 2: offset = self._offsets[lat_z, lat_y, lat_x, distribcell_index-1] - offset += self._universes[lat_x][lat_y].get_cell_instance(path, - distribcell_index) + offset += self._universes[lat_x][lat_y].get_cell_instance( + path, distribcell_index) # For 3D Lattices else: offset = self._offsets[lat_z, lat_y, lat_x, distribcell_index-1] offset += self._universes[lat_z][lat_y][lat_x].get_cell_instance( - path, distribcell_index) + path, distribcell_index) return offset @@ -908,7 +907,7 @@ class HexLattice(Lattice): # coordinates d_min = np.inf for idx in [(ix, ia, iz), (ix + 1, ia, iz), (ix, ia + 1, iz), - (ix + 1, ia + 1, iz)]: + (ix + 1, ia + 1, iz)]: p = self.get_local_coordinates(point, idx) d = p[0]**2 + p[1]**2 if d < d_min: diff --git a/openmc/macroscopic.py b/openmc/macroscopic.py index 9f67a50ba4..1fdf875e72 100644 --- a/openmc/macroscopic.py +++ b/openmc/macroscopic.py @@ -1,4 +1,3 @@ -from numbers import Integral import sys from openmc.checkvalue import check_type @@ -39,9 +38,9 @@ class Macroscopic(object): def __eq__(self, other): if isinstance(other, Macroscopic): - if self._name != other._name: + if self._name != other.name: return False - elif self._xs != other._xs: + elif self._xs != other.xs: return False else: return True @@ -78,8 +77,3 @@ class Macroscopic(object): def xs(self, xs): check_type('cross-section identifier', xs, basestring) self._xs = xs - - def __repr__(self): - string = 'Macroscopic - {0}\n'.format(self._name) - string += '{0: <16}{1}{2}\n'.format('\tXS', '=\t', self.xs) - return string diff --git a/openmc/material.py b/openmc/material.py index 66c2320ea4..1ba8f533a9 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -1,16 +1,16 @@ -from collections import Iterable, OrderedDict +from collections import OrderedDict from copy import deepcopy from numbers import Real, Integral import warnings from xml.etree import ElementTree as ET import sys -if sys.version_info[0] >= 3: - basestring = str import openmc import openmc.checkvalue as cv -from openmc.clean_xml import * -from openmc.data import natural_abundance +from openmc.clean_xml import sort_xml_elements, clean_xml_indentation + +if sys.version_info[0] >= 3: + basestring = str # A static variable for auto-generated Material IDs @@ -18,6 +18,7 @@ AUTO_MATERIAL_ID = 10000 def reset_auto_material_id(): + """Reset counter for auto-generated material IDs.""" global AUTO_MATERIAL_ID AUTO_MATERIAL_ID = 10000 @@ -352,8 +353,8 @@ class Material(object): self._macroscopic = macroscopic else: msg = 'Unable to add a Macroscopic to Material ID="{0}", ' \ - 'Only One Macroscopic allowed per ' \ - 'Material!'.format(self._id, macroscopic) + 'Only one Macroscopic allowed per ' \ + 'Material!'.format(self._id) raise ValueError(msg) # Generally speaking, the density for a macroscopic object will @@ -380,7 +381,7 @@ class Material(object): raise ValueError(msg) # If the Material contains the Macroscopic, delete it - if macroscopic._name == self._macroscopic.name: + if macroscopic.name == self._macroscopic.name: self._macroscopic = None def add_element(self, element, percent, percent_type='ao', expand=False): @@ -446,7 +447,7 @@ class Material(object): """ - if not isinstance(nuclide, openmc.Element): + if not isinstance(element, openmc.Element): msg = 'Unable to remove "{0}" in Material ID="{1}" ' \ 'since it is not an Element'.format(self.id, element) raise ValueError(msg) @@ -534,7 +535,7 @@ class Material(object): def _get_macroscopic_xml(self, macroscopic): xml_element = ET.Element("macroscopic") - xml_element.set("name", macroscopic._name) + xml_element.set("name", macroscopic.name) if macroscopic.xs is not None: xml_element.set("xs", macroscopic.xs) @@ -640,7 +641,7 @@ class Material(object): if self._macroscopic is None: # Create nuclide XML subelements - subelements = self.get_nuclides_xml(self._nuclides, distrib=True) + subelements = self._get_nuclides_xml(self._nuclides, distrib=True) for subelement_nuc in subelements: subelement.append(subelement_nuc) @@ -650,8 +651,7 @@ class Material(object): subelement.append(subsubelement) else: # Create macroscopic XML subelements - subsubelement = self._get_macroscopic_xml(self._macroscopic, - distrib=True) + subsubelement = self._get_macroscopic_xml(self._macroscopic) subelement.append(subsubelement) if len(self._sab) > 0: diff --git a/openmc/mesh.py b/openmc/mesh.py index 0c88d4a680..169e7705cc 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -16,6 +16,7 @@ AUTO_MESH_ID = 10000 def reset_auto_mesh_id(): + """Reset counter for auto-generated mesh IDs.""" global AUTO_MESH_ID AUTO_MESH_ID = 10000 @@ -63,20 +64,20 @@ class Mesh(object): def __eq__(self, mesh2): # Check type - if self._type != mesh2._type: + if self._type != mesh2.type: return False # Check dimension - elif self._dimension != mesh2._dimension: + elif self._dimension != mesh2.dimension: return False # Check width - elif self._width != mesh2._width: + elif self._width != mesh2.width: return False # Check lower left / upper right - elif self._lower_left != mesh2._lower_left and \ - self._upper_right != mesh2._upper_right: + elif self._lower_left != mesh2.lower_left and \ + self._upper_right != mesh2.upper_right: return False else: @@ -129,7 +130,7 @@ class Mesh(object): def name(self, name): if name is not None: cv.check_type('name for mesh ID="{0}"'.format(self._id), - name, basestring) + name, basestring) self._name = name else: self._name = '' @@ -137,9 +138,9 @@ class Mesh(object): @type.setter def type(self, meshtype): cv.check_type('type for mesh ID="{0}"'.format(self._id), - meshtype, basestring) + meshtype, basestring) cv.check_value('type for mesh ID="{0}"'.format(self._id), - meshtype, ['regular']) + meshtype, ['regular']) self._type = meshtype @dimension.setter diff --git a/openmc/mgxs/library.py b/openmc/mgxs/library.py index 9241892646..319e4d4139 100644 --- a/openmc/mgxs/library.py +++ b/openmc/mgxs/library.py @@ -2,7 +2,6 @@ import sys import os import copy import pickle -import warnings from numbers import Integral from collections import OrderedDict from warnings import warn @@ -152,10 +151,6 @@ class Library(object): def openmc_geometry(self): return self._openmc_geometry - @property - def openmc_geometry(self): - return self._openmc_geometry - @property def opencg_geometry(self): if self._opencg_geometry is None: @@ -279,16 +274,14 @@ class Library(object): cv.check_iterable_type('domain', domains, openmc.Universe) all_domains = self.openmc_geometry.get_all_universes() else: - msg = 'Unable to set domains with ' \ - 'domain type "{}"'.format(self.domain_type) - raise ValueError(msg) + raise ValueError('Unable to set domains with domain ' + 'type "{}"'.format(self.domain_type)) # Check that each domain can be found in the geometry for domain in domains: if domain not in all_domains: - msg = 'Domain "{}" could not be found in the ' \ - 'geometry.'.format(domain) - raise ValueError(msg) + raise ValueError('Domain "{}" could not be found in the ' + 'geometry.'.format(domain)) self._domains = domains @@ -302,9 +295,8 @@ class Library(object): cv.check_value('correction', correction, ('P0', None)) if correction == 'P0' and self.legendre_order > 0: - msg = 'The P0 correction will be ignored since the scattering ' \ - 'order {} is greater than zero'.format(self.legendre_order) - warnings.warn(msg) + warn('The P0 correction will be ignored since the scattering ' + 'order {} is greater than zero'.format(self.legendre_order)) self._correction = correction @@ -317,7 +309,7 @@ class Library(object): if self.correction == 'P0' and legendre_order > 0: msg = 'The P0 correction will be ignored since the scattering ' \ 'order {} is greater than zero'.format(self.legendre_order) - warnings.warn(msg, RuntimeWarning) + warn(msg, RuntimeWarning) self.correction = None self._legendre_order = legendre_order @@ -402,7 +394,7 @@ class Library(object): for domain in self.domains: for mgxs_type in self.mgxs_types: mgxs = self.get_mgxs(domain, mgxs_type) - for tally_id, tally in mgxs.tallies.items(): + for tally in mgxs.tallies.values(): tallies_file.append(tally, merge=merge) def load_from_statepoint(self, statepoint): @@ -498,8 +490,8 @@ class Library(object): # Check that requested domain is included in library if mgxs_type not in self.mgxs_types: - msg = 'Unable to find MGXS type "{0}"'.format(mgxs_type) - raise ValueError(msg) + msg = 'Unable to find MGXS type "{0}"'.format(mgxs_type) + raise ValueError(msg) return self.all_mgxs[domain_id][mgxs_type] @@ -922,7 +914,7 @@ class Library(object): # accounted for approximately by using an adjusted # absorption cross section. if 'total' in self.mgxs_types: - xsdata._absorption = \ + xsdata.absorption = \ np.subtract(xsdata.total, np.sum(xsdata.scatter[0, :, :], axis=1)) @@ -1184,13 +1176,11 @@ class Library(object): # Ensure absorption is present if 'absorption' not in self.mgxs_types: error_flag = True - msg = '"absorption" MGXS type is required but not provided.' - warn(msg) + warn('"absorption" MGXS type is required but not provided.') # Ensure nu-scattering matrix is required if 'nu-scatter matrix' not in self.mgxs_types: error_flag = True - msg = '"nu-scatter matrix" MGXS type is required but not provided.' - warn(msg) + warn('"nu-scatter matrix" MGXS type is required but not provided.') else: # Ok, now see the status of scatter and/or multiplicity if ((('scatter matrix' not in self.mgxs_types) and @@ -1199,24 +1189,20 @@ class Library(object): # we need total, and not transport. if 'total' not in self.mgxs_types: error_flag = True - msg = '"total" MGXS type is required if a ' \ - 'scattering matrix is not provided.' - warn(msg) + warn('"total" MGXS type is required if a ' + 'scattering matrix is not provided.') # Total or transport can be present, but if using # self.correction=="P0", then we should use transport. if (((self.correction is "P0") and ('nu-transport' not in self.mgxs_types))): error_flag = True - msg = 'A "nu-transport" MGXS type is required since a "P0" ' \ - 'correction is applied, but a "nu-transport" MGXS is ' \ - 'not provided.' - warn(msg) + warn('A "nu-transport" MGXS type is required since a "P0" ' + 'correction is applied, but a "nu-transport" MGXS is ' + 'not provided.') elif (((self.correction is None) and ('total' not in self.mgxs_types))): error_flag = True - msg = '"total" MGXS type is required, but not provided.' - warn(msg) + warn('"total" MGXS type is required, but not provided.') if error_flag: - msg = 'Invalid MGXS configuration encountered.' - raise ValueError(msg) + raise ValueError('Invalid MGXS configuration encountered.') diff --git a/openmc/mgxs/mgxs.py b/openmc/mgxs/mgxs.py index c12c61bdf4..2c0cb21c60 100644 --- a/openmc/mgxs/mgxs.py +++ b/openmc/mgxs/mgxs.py @@ -1,6 +1,6 @@ from __future__ import division -from collections import Iterable, OrderedDict +from collections import OrderedDict from numbers import Integral import warnings import os @@ -412,7 +412,7 @@ class MGXS(object): self.rxn_rate_tally.sparse = sparse for tally_name in self.tallies: - self.tallies[tally_name].sparse = sparse + self.tallies[tally_name].sparse = sparse self._sparse = sparse @@ -852,7 +852,7 @@ class MGXS(object): fine_edges = self.energy_groups.group_edges # Condense each of the tallies to the coarse group structure - for tally_type, tally in condensed_xs.tallies.items(): + for tally in condensed_xs.tallies.values(): # Make condensed tally derived and null out sum, sum_sq tally._derived = True @@ -993,7 +993,8 @@ class MGXS(object): slice_nuclides = [nuc for nuc in nuclides if nuc in tally.nuclides] if len(groups) != 0 and tally.contains_filter('energy'): tally_slice = tally.get_slice(filters=filters, - filter_bins=filter_bins, nuclides=slice_nuclides) + filter_bins=filter_bins, + nuclides=slice_nuclides) else: tally_slice = tally.get_slice(nuclides=slice_nuclides) slice_xs.tallies[tally_type] = tally_slice @@ -1286,7 +1287,7 @@ class MGXS(object): num_digits = len(str(self.num_subdomains)) # Create a separate HDF5 group for each subdomain - for i, subdomain in enumerate(subdomains): + for subdomain in subdomains: # Create an HDF5 group for the subdomain if self.domain_type == 'distribcell': @@ -1311,9 +1312,11 @@ class MGXS(object): # Extract the cross section for this subdomain and nuclide average = self.get_xs(subdomains=[subdomain], nuclides=[nuclide], - xs_type=xs_type, value='mean', row_column=row_column) + xs_type=xs_type, value='mean', + row_column=row_column) std_dev = self.get_xs(subdomains=[subdomain], nuclides=[nuclide], - xs_type=xs_type, value='std_dev', row_column=row_column) + xs_type=xs_type, value='std_dev', + row_column=row_column) average = average.squeeze() std_dev = std_dev.squeeze() @@ -1386,9 +1389,9 @@ class MGXS(object): longtable=True, index=False) # Surround LaTeX table with code needed to run pdflatex - with open(filename + '.tex','r') as original: + with open(filename + '.tex', 'r') as original: data = original.read() - with open(filename + '.tex','w') as modified: + with open(filename + '.tex', 'w') as modified: modified.write( '\\documentclass[preview, 12pt, border=1mm]{standalone}\n') modified.write('\\usepackage{caption}\n') @@ -1451,7 +1454,7 @@ class MGXS(object): query_nuclides = self.get_all_nuclides() xs_tally = self.xs_tally.summation(nuclides=query_nuclides) df = xs_tally.get_pandas_dataframe( - distribcell_paths=distribcell_paths) + distribcell_paths=distribcell_paths) # Remove nuclide column since it is homogeneous and redundant df.drop('nuclide', axis=1, inplace=True) @@ -1460,12 +1463,12 @@ class MGXS(object): elif self.by_nuclide and nuclides != 'all': xs_tally = self.xs_tally.get_slice(nuclides=nuclides) df = xs_tally.get_pandas_dataframe( - distribcell_paths=distribcell_paths) + distribcell_paths=distribcell_paths) # If the user requested all nuclides, keep nuclide column in dataframe else: df = self.xs_tally.get_pandas_dataframe( - distribcell_paths=distribcell_paths) + distribcell_paths=distribcell_paths) # Remove the score column since it is homogeneous and redundant df = df.drop('score', axis=1) @@ -3443,7 +3446,7 @@ class ScatterMatrixXS(MatrixMGXS): def get_xs(self, in_groups='all', out_groups='all', subdomains='all', nuclides='all', moment='all', xs_type='macro', order_groups='increasing', - row_column='inout', value='mean', **kwargs): + row_column='inout', value='mean'): r"""Returns an array of multi-group cross sections. This method constructs a 2D NumPy array for the requested scattering @@ -3530,7 +3533,7 @@ class ScatterMatrixXS(MatrixMGXS): cv.check_type('moment', moment, Integral) cv.check_greater_than('moment', moment, 0, equality=True) cv.check_less_than( - 'moment', moment, self.legendre_order, equality=True) + 'moment', moment, self.legendre_order, equality=True) scores = [self.xs_tally.scores[moment]] else: scores = [] @@ -3641,7 +3644,7 @@ class ScatterMatrixXS(MatrixMGXS): """ df = super(ScatterMatrixXS, self).get_pandas_dataframe( - groups, nuclides, xs_type, distribcell_paths) + groups, nuclides, xs_type, distribcell_paths) # Add a moment column to dataframe if self.legendre_order > 0: @@ -3660,7 +3663,7 @@ class ScatterMatrixXS(MatrixMGXS): cv.check_type('moment', moment, Integral) cv.check_greater_than('moment', moment, 0, equality=True) cv.check_less_than( - 'moment', moment, self.legendre_order, equality=True) + 'moment', moment, self.legendre_order, equality=True) df = df[df['moment'] == 'P{}'.format(moment)] return df @@ -4601,7 +4604,7 @@ class Chi(MGXS): # Build the dataframe using the parent class method df = super(Chi, self).get_pandas_dataframe( - groups, nuclides, xs_type, distribcell_paths=distribcell_paths) + groups, nuclides, xs_type, distribcell_paths=distribcell_paths) # If user requested micro cross sections, multiply by the atom # densities to cancel out division made by the parent class method diff --git a/openmc/mgxs_library.py b/openmc/mgxs_library.py index f34f3b71ce..8a572c8748 100644 --- a/openmc/mgxs_library.py +++ b/openmc/mgxs_library.py @@ -9,7 +9,7 @@ import openmc import openmc.mgxs from openmc.checkvalue import check_type, check_value, check_greater_than, \ check_iterable_type -from openmc.clean_xml import * +from openmc.clean_xml import sort_xml_elements, clean_xml_indentation if sys.version_info[0] >= 3: basestring = str @@ -376,7 +376,7 @@ class XSdata(object): # Check validity of energy_groups check_type('energy_groups', energy_groups, openmc.mgxs.EnergyGroups) - if energy_group.group_edges is None: + if energy_groups.group_edges is None: msg = 'Unable to assign an EnergyGroups object ' \ 'with uninitialized group edges' raise ValueError(msg) @@ -597,10 +597,7 @@ class XSdata(object): [self.vector_shape, self.matrix_shape]) # Find out if we have a nu-fission matrix or vector # and set a flag to allow other methods to check this later. - if npnu_fission.shape == self.vector_shape: - self.use_chi = True - else: - self.use_chi = False + self.use_chi = (npnu_fission.shape == self.vector_shape) self._nu_fission = npnu_fission if np.sum(self._nu_fission) > 0.0: @@ -873,7 +870,7 @@ class XSdata(object): check_value('domain_type', scatter.domain_type, ['universe', 'cell', 'material']) - if (self.scatt_type != 'legendre'): + if self.scatt_type != 'legendre': msg = 'Anisotropic scattering representations other than ' \ 'Legendre expansions have not yet been implemented in ' \ 'openmc.mgxs.' @@ -1090,9 +1087,9 @@ class MGXSLibrary(object): @inverse_velocities.setter def inverse_velocities(self, inverse_velocities): - cv.check_type('inverse_velocities', inverse_velocities, Iterable, Real) - cv.check_greater_than('number of inverse_velocities', - len(inverse_velocities), 0.0) + check_type('inverse_velocities', inverse_velocities, Iterable, Real) + check_greater_than('number of inverse_velocities', + len(inverse_velocities), 0.0) self._inverse_velocities = np.array(inverse_velocities) @energy_groups.setter diff --git a/openmc/nuclide.py b/openmc/nuclide.py index 8e97f1a1c6..a2130680fb 100644 --- a/openmc/nuclide.py +++ b/openmc/nuclide.py @@ -46,9 +46,9 @@ class Nuclide(object): def __eq__(self, other): if isinstance(other, Nuclide): - if self._name != other._name: + if self._name != other.name: return False - elif self._xs != other._xs: + elif self._xs != other.xs: return False else: return True @@ -71,9 +71,12 @@ class Nuclide(object): def __repr__(self): string = 'Nuclide - {0}\n'.format(self._name) - string += '{0: <16}{1}{2}\n'.format('\tXS', '=\t', self._xs) - if self._zaid is not None: - string += '{0: <16}{1}{2}\n'.format('\tZAID', '=\t', self._zaid) + string += '{0: <16}{1}{2}\n'.format('\tXS', '=\t', self.xs) + if self.zaid is not None: + string += '{0: <16}{1}{2}\n'.format('\tZAID', '=\t', self.zaid) + if self.scattering is not None: + string += '{0: <16}{1}{2}\n'.format('\tscattering', '=\t', + self.scattering) return string @property @@ -116,13 +119,3 @@ class Nuclide(object): raise ValueError(msg) self._scattering = scattering - - def __repr__(self): - string = 'Nuclide - {0}\n'.format(self._name) - string += '{0: <16}{1}{2}\n'.format('\tXS', '=\t', self.xs) - if self.zaid is not None: - string += '{0: <16}{1}{2}\n'.format('\tZAID', '=\t', self.zaid) - if self.scattering is not None: - string += '{0: <16}{1}{2}\n'.format('\tscattering', '=\t', - self.scattering) - return string diff --git a/openmc/opencg_compatible.py b/openmc/opencg_compatible.py index b112ed327f..967e11f48c 100644 --- a/openmc/opencg_compatible.py +++ b/openmc/opencg_compatible.py @@ -6,8 +6,8 @@ import numpy as np try: import opencg except ImportError: - msg = 'Unable to import opencg which is needed by openmc.opencg_compatible' - raise ImportError(msg) + raise ImportError('Unable to import opencg which is needed by ' + 'openmc.opencg_compatible') import openmc import openmc.checkvalue as cv @@ -81,7 +81,6 @@ def get_opencg_material(openmc_material): cv.check_type('openmc_material', openmc_material, openmc.Material) - global OPENCG_MATERIALS material_id = openmc_material.id # If this Material was already created, use it @@ -118,7 +117,6 @@ def get_openmc_material(opencg_material): cv.check_type('opencg_material', opencg_material, opencg.Material) - global OPENMC_MATERIALS material_id = opencg_material.id # If this Material was already created, use it @@ -185,7 +183,6 @@ def get_opencg_surface(openmc_surface): cv.check_type('openmc_surface', openmc_surface, openmc.Surface) - global OPENCG_SURFACES surface_id = openmc_surface.id # If this Material was already created, use it @@ -226,21 +223,21 @@ def get_opencg_surface(openmc_surface): z0 = openmc_surface.z0 R = openmc_surface.r opencg_surface = opencg.XCylinder(surface_id, name, - boundary, y0, z0, R) + boundary, y0, z0, R) elif openmc_surface.type == 'y-cylinder': x0 = openmc_surface.x0 z0 = openmc_surface.z0 R = openmc_surface.r opencg_surface = opencg.YCylinder(surface_id, name, - boundary, x0, z0, R) + boundary, x0, z0, R) elif openmc_surface.type == 'z-cylinder': x0 = openmc_surface.x0 y0 = openmc_surface.y0 R = openmc_surface.r opencg_surface = opencg.ZCylinder(surface_id, name, - boundary, x0, y0, R) + boundary, x0, y0, R) # Add the OpenMC Surface to the global collection of all OpenMC Surfaces OPENMC_SURFACES[surface_id] = openmc_surface @@ -268,7 +265,6 @@ def get_openmc_surface(opencg_surface): cv.check_type('opencg_surface', opencg_surface, opencg.Surface) - global openmc_surface surface_id = opencg_surface.id # If this Surface was already created, use it @@ -356,7 +352,6 @@ def get_compatible_opencg_surfaces(opencg_surface): cv.check_type('opencg_surface', opencg_surface, opencg.Surface) - global OPENMC_SURFACES surface_id = opencg_surface.id # If this Surface was already created, use it @@ -435,7 +430,6 @@ def get_opencg_cell(openmc_cell): cv.check_type('openmc_cell', openmc_cell, openmc.Cell) - global OPENCG_CELLS cell_id = openmc_cell.id # If this Cell was already created, use it @@ -480,7 +474,7 @@ def get_opencg_cell(openmc_cell): opencg_cell.add_surface(get_opencg_surface(surface), halfspace) else: raise NotImplementedError("Complex cells not yet supported " - "in OpenCG.") + "in OpenCG.") # Add the OpenMC Cell to the global collection of all OpenMC Cells OPENMC_CELLS[cell_id] = openmc_cell @@ -615,7 +609,7 @@ def make_opencg_cells_compatible(opencg_universe): # Check all OpenCG Cells in this Universe for compatibility with OpenMC opencg_cells = opencg_universe.cells - for cell_id, opencg_cell in opencg_cells.items(): + for opencg_cell in opencg_cells.values(): # Check each of the OpenCG Surfaces for OpenMC compatibility surfaces = opencg_cell.surfaces @@ -635,7 +629,7 @@ def make_opencg_cells_compatible(opencg_universe): # of this block is necessary in the event that there are more # incompatible Surfaces in this Cell that are not accounted for. cells = get_compatible_opencg_cells(opencg_cell, - surface, halfspace) + surface, halfspace) # Remove the non-compatible OpenCG Cell from the Universe opencg_universe.remove_cell(opencg_cell) @@ -668,7 +662,6 @@ def get_openmc_cell(opencg_cell): cv.check_type('opencg_cell', opencg_cell, opencg.Cell) - global OPENMC_CELLS cell_id = opencg_cell.id # If this Cell was already created, use it @@ -730,7 +723,6 @@ def get_opencg_universe(openmc_universe): cv.check_type('openmc_universe', openmc_universe, openmc.Universe) - global OPENCG_UNIVERSES universe_id = openmc_universe.id # If this Universe was already created, use it @@ -744,7 +736,7 @@ def get_opencg_universe(openmc_universe): # Convert all OpenMC Cells in this Universe to OpenCG Cells openmc_cells = openmc_universe.cells - for cell_id, openmc_cell in openmc_cells.items(): + for openmc_cell in openmc_cells.values(): opencg_cell = get_opencg_cell(openmc_cell) opencg_universe.add_cell(opencg_cell) @@ -774,7 +766,6 @@ def get_openmc_universe(opencg_universe): cv.check_type('opencg_universe', opencg_universe, opencg.Universe) - global OPENMC_UNIVERSES universe_id = opencg_universe.id # If this Universe was already created, use it @@ -791,7 +782,7 @@ def get_openmc_universe(opencg_universe): # Convert all OpenCG Cells in this Universe to OpenMC Cells opencg_cells = opencg_universe.cells - for cell_id, opencg_cell in opencg_cells.items(): + for opencg_cell in opencg_cells.values(): openmc_cell = get_openmc_cell(opencg_cell) openmc_universe.add_cell(openmc_cell) @@ -821,7 +812,6 @@ def get_opencg_lattice(openmc_lattice): cv.check_type('openmc_lattice', openmc_lattice, openmc.Lattice) - global OPENCG_LATTICES lattice_id = openmc_lattice.id # If this Lattice was already created, use it @@ -915,7 +905,6 @@ def get_openmc_lattice(opencg_lattice): cv.check_type('opencg_lattice', opencg_lattice, opencg.Lattice) - global OPENMC_LATTICES lattice_id = opencg_lattice.id # If this Lattice was already created, use it @@ -1043,7 +1032,7 @@ def get_openmc_geometry(opencg_geometry): # Make the entire geometry "compatible" before assigning auto IDs universes = opencg_geometry.get_all_universes() - for universe_id, universe in universes.items(): + for universe in universes.values(): if not isinstance(universe, opencg.Lattice): make_opencg_cells_compatible(universe) diff --git a/openmc/particle_restart.py b/openmc/particle_restart.py index 7a27db2f60..fb2fc4736f 100644 --- a/openmc/particle_restart.py +++ b/openmc/particle_restart.py @@ -1,6 +1,3 @@ -import struct - - class Particle(object): """Information used to restart a specific particle that caused a simulation to fail. diff --git a/openmc/plots.py b/openmc/plots.py index 9167e55d50..73b51da5e8 100644 --- a/openmc/plots.py +++ b/openmc/plots.py @@ -8,7 +8,7 @@ import numpy as np import openmc import openmc.checkvalue as cv -from openmc.clean_xml import * +from openmc.clean_xml import clean_xml_indentation if sys.version_info[0] >= 3: basestring = str @@ -18,6 +18,7 @@ AUTO_PLOT_ID = 10000 def reset_auto_plot_id(): + """Reset counter for auto-generated plot IDs.""" global AUTO_PLOT_ID AUTO_PLOT_ID = 10000 @@ -201,7 +202,7 @@ class Plot(object): cv.check_type('plot background', background, Iterable, Integral) cv.check_length('plot background', background, 3) for rgb in background: - cv.check_greater_than('plot background',rgb, 0, True) + cv.check_greater_than('plot background', rgb, 0, True) cv.check_less_than('plot background', rgb, 256) self._background = background @@ -257,7 +258,7 @@ class Plot(object): string += '{0: <16}{1}{2}\n'.format('\tColor', '=\t', self._color) string += '{0: <16}{1}{2}\n'.format('\tMask', '=\t', self._mask_components) - string += '{0: <16}{1}{2}\n'.format('\tMask', '=\t', + string += '{0: <16}{1}{2}\n'.format('\tMask', '=\t', self._mask_background) string += '{0: <16}{1}{2}\n'.format('\tCol Spec', '=\t', self._col_spec) return string @@ -536,8 +537,8 @@ class Plots(cv.CheckedList): for plot in self: xml_element = plot.get_plot_xml() - if len(plot._name) > 0: - self._plots_file.append(ET.Comment(plot._name)) + if len(plot.name) > 0: + self._plots_file.append(ET.Comment(plot.name)) self._plots_file.append(xml_element) @@ -557,4 +558,4 @@ class Plots(cv.CheckedList): # Write the XML Tree to the plots.xml file tree = ET.ElementTree(self._plots_file) tree.write("plots.xml", xml_declaration=True, - encoding='utf-8', method="xml") + encoding='utf-8', method="xml") diff --git a/openmc/region.py b/openmc/region.py index 9e10112710..a1b9e9fd0d 100644 --- a/openmc/region.py +++ b/openmc/region.py @@ -203,7 +203,7 @@ class Region(object): class Intersection(Region): - """Intersection of two or more regions. + r"""Intersection of two or more regions. Instances of Intersection are generally created via the __and__ operator applied to two instances of :class:`openmc.Region`. This is illustrated in @@ -277,7 +277,7 @@ class Intersection(Region): class Union(Region): - """Union of two or more regions. + r"""Union of two or more regions. Instances of Union are generally created via the __or__ operator applied to two instances of :class:`openmc.Region`. This is illustrated in the diff --git a/openmc/settings.py b/openmc/settings.py index 3c22b39ba9..1738beb0d2 100644 --- a/openmc/settings.py +++ b/openmc/settings.py @@ -6,7 +6,7 @@ import sys import numpy as np -from openmc.clean_xml import * +from openmc.clean_xml import clean_xml_indentation from openmc.checkvalue import (check_type, check_length, check_value, check_greater_than, check_less_than) from openmc import Nuclide @@ -311,7 +311,7 @@ class Settings(object): @property def trigger_batch_interval(self): - return self._batch_interval + return self._trigger_batch_interval @property def output(self): @@ -1011,7 +1011,7 @@ class Settings(object): if self._trigger_active is not None: if self._trigger_subelement is None: self._trigger_subelement = ET.SubElement(self._settings_file, - "trigger") + "trigger") element = ET.SubElement(self._trigger_subelement, "active") element.text = str(self._trigger_active).lower() @@ -1020,7 +1020,7 @@ class Settings(object): if self._trigger_max_batches is not None: if self._trigger_subelement is None: self._trigger_subelement = ET.SubElement(self._settings_file, - "trigger") + "trigger") element = ET.SubElement(self._trigger_subelement, "max_batches") element.text = str(self._trigger_max_batches) @@ -1029,7 +1029,7 @@ class Settings(object): if self._trigger_batch_interval is not None: if self._trigger_subelement is None: self._trigger_subelement = ET.SubElement(self._settings_file, - "trigger") + "trigger") element = ET.SubElement(self._trigger_subelement, "batch_interval") element.text = str(self._trigger_batch_interval) @@ -1103,14 +1103,16 @@ class Settings(object): element.text = str(self._multipole_active) def _create_resonance_scattering_element(self): - if self.resonance_scattering is None: return + if self.resonance_scattering is None: + return element = ET.SubElement(self._settings_file, "resonance_scattering") for r in self.resonance_scattering: if r.nuclide.name != r.nuclide_0K.name: raise ValueError("The nuclide and nuclide_0K attributes of " - "a ResonantScattering object must have identical names.") + "a ResonantScattering object must have " + "identical names.") r.create_xml_subelement(element) def export_to_xml(self): @@ -1159,7 +1161,7 @@ class Settings(object): # Write the XML Tree to the settings.xml file tree = ET.ElementTree(self._settings_file) tree.write("settings.xml", xml_declaration=True, - encoding='utf-8', method="xml") + encoding='utf-8', method="xml") class ResonanceScattering(object): @@ -1215,15 +1217,17 @@ class ResonanceScattering(object): @nuclide.setter def nuclide(self, nuc): check_type('nuclide', nuc, Nuclide) - if nuc.zaid == None: raise ValueError("The nuclide must have an " - "explicitly defined zaid attribute.") + if nuc.zaid is None: + raise ValueError("The nuclide must have an explicitly defined " + "zaid attribute.") self._nuclide = nuc @nuclide_0K.setter def nuclide_0K(self, nuc): check_type('nuclide_0K', nuc, Nuclide) - if nuc.zaid == None: raise ValueError("The nuclide_0K must have an " - "explicitly defined zaid attribute.") + if nuc.zaid is None: + raise ValueError("The nuclide_0K must have an explicitly defined " + "zaid attribute.") self._nuclide_0K = nuc @method.setter diff --git a/openmc/source.py b/openmc/source.py index 36a36e5948..7e8a68accf 100644 --- a/openmc/source.py +++ b/openmc/source.py @@ -104,6 +104,14 @@ class Source(object): self._strength = strength def to_xml(self): + """Return XML representation of the source + + Returns + ------- + element : xml.etree.ElementTree.Element + XML element containing source data + + """ element = ET.Element("source") element.set("strength", str(self.strength)) if self.file is not None: diff --git a/openmc/statepoint.py b/openmc/statepoint.py index 0baa631581..6337746650 100644 --- a/openmc/statepoint.py +++ b/openmc/statepoint.py @@ -558,7 +558,7 @@ class StatePoint(object): tally = None # Iterate over all tallies to find the appropriate one - for tally_id, test_tally in self.tallies.items(): + for test_tally in self.tallies.values(): # Determine if Tally has queried name if name and name != test_tally.name: diff --git a/openmc/stats/univariate.py b/openmc/stats/univariate.py index af9b9b3013..7c84dba34c 100644 --- a/openmc/stats/univariate.py +++ b/openmc/stats/univariate.py @@ -24,7 +24,7 @@ class Univariate(object): pass @abstractmethod - def to_xml(self): + def to_xml(self, element_name): return '' @@ -180,7 +180,7 @@ class Maxwell(Univariate): class Watt(Univariate): - """Watt fission energy spectrum. + r"""Watt fission energy spectrum. The Watt fission energy spectrum is characterized by two parameters :math:`a` and :math:`b` and has density function :math:`p(E) dE = c e^{-E/a} diff --git a/openmc/summary.py b/openmc/summary.py index c5dbcadda0..8c626940e5 100644 --- a/openmc/summary.py +++ b/openmc/summary.py @@ -1,7 +1,8 @@ from collections import Iterable -import numpy as np import re +import numpy as np + import openmc from openmc.region import Region @@ -301,7 +302,7 @@ class Summary(object): # Get the distribcell index ind = self._f['geometry/cells'][key]['distribcell_index'].value if ind != 0: - cell.distribcell_index = ind + cell.distribcell_index = ind # Add the Cell to the global dictionary of all Cells self.cells[index] = cell @@ -608,7 +609,7 @@ class Summary(object): """ - for index, material in self.materials.items(): + for material in self.materials.values(): if material.id == material_id: return material @@ -629,7 +630,7 @@ class Summary(object): """ - for index, surface in self.surfaces.items(): + for surface in self.surfaces.values(): if surface.id == surface_id: return surface @@ -650,7 +651,7 @@ class Summary(object): """ - for index, cell in self.cells.items(): + for cell in self.cells.values(): if cell.id == cell_id: return cell @@ -671,7 +672,7 @@ class Summary(object): """ - for index, universe in self.universes.items(): + for universe in self.universes.values(): if universe.id == universe_id: return universe @@ -692,7 +693,7 @@ class Summary(object): """ - for index, lattice in self.lattices.items(): + for lattice in self.lattices.values(): if lattice.id == lattice_id: return lattice diff --git a/openmc/surface.py b/openmc/surface.py index 76f0d82e7d..c33c4ee74c 100644 --- a/openmc/surface.py +++ b/openmc/surface.py @@ -19,6 +19,7 @@ _BC_TYPES = ['transmission', 'vacuum', 'reflective', 'periodic'] def reset_auto_surface_id(): + """Reset counters for all auto-generated surface IDs""" global AUTO_SURFACE_ID AUTO_SURFACE_ID = 10000 @@ -1814,18 +1815,20 @@ def make_hexagon_region(edge_length=1., orientation='y'): right = XPlane(x0=sqrt(3.)/2.*l) left = XPlane(x0=-sqrt(3.)/2.*l) c = sqrt(3.)/3. - ur = Plane(A=c, B=1., D=l) # y = -x/sqrt(3) + a - ul = Plane(A=-c, B=1., D=l) # y = x/sqrt(3) + a - lr = Plane(A=-c, B=1., D=-l) # y = x/sqrt(3) - a - ll = Plane(A=c, B=1., D=-l) # y = -x/sqrt(3) - a - return Intersection(-right, +left, -ur, -ul, +lr, +ll) + upper_right = Plane(A=c, B=1., D=l) # y = -x/sqrt(3) + a + upper_left = Plane(A=-c, B=1., D=l) # y = x/sqrt(3) + a + lower_right = Plane(A=-c, B=1., D=-l) # y = x/sqrt(3) - a + lower_left = Plane(A=c, B=1., D=-l) # y = -x/sqrt(3) - a + return Intersection(-right, +left, -upper_right, -upper_left, + +lower_right, +lower_left) elif orientation == 'x': top = YPlane(y0=sqrt(3.)/2.*l) bottom = YPlane(y0=-sqrt(3.)/2.*l) c = sqrt(3.) - ur = Plane(A=c, B=1., D=c*l) # y = -sqrt(3)*(x - a) - lr = Plane(A=-c, B=1., D=-c*l) # y = sqrt(3)*(x + a) - ll = Plane(A=c, B=1., D=-c*l) # y = -sqrt(3)*(x + a) - ul = Plane(A=-c, B=1., D=c*l) # y = sqrt(3)*(x + a) - return Intersection(-top, +bottom, -ur, +lr, +ll, -ul) + upper_right = Plane(A=c, B=1., D=c*l) # y = -sqrt(3)*(x - a) + lower_right = Plane(A=-c, B=1., D=-c*l) # y = sqrt(3)*(x + a) + lower_left = Plane(A=c, B=1., D=-c*l) # y = -sqrt(3)*(x + a) + upper_left = Plane(A=-c, B=1., D=c*l) # y = sqrt(3)*(x + a) + return Intersection(-top, +bottom, -upper_right, +lower_right, + +lower_left, -upper_left) diff --git a/openmc/tallies.py b/openmc/tallies.py index af19549a7c..a58465994d 100644 --- a/openmc/tallies.py +++ b/openmc/tallies.py @@ -1,6 +1,6 @@ from __future__ import division -from collections import Iterable, MutableSequence, defaultdict +from collections import Iterable, MutableSequence import copy from functools import partial import os @@ -13,11 +13,12 @@ from xml.etree import ElementTree as ET import numpy as np -from openmc import Mesh, Filter, Trigger, Nuclide -from openmc.arithmetic import * +from openmc import Filter, Trigger, Nuclide +from openmc.arithmetic import CrossScore, CrossNuclide, CrossFilter, \ + AggregateScore, AggregateNuclide, AggregateFilter from openmc.filter import _FILTER_TYPES import openmc.checkvalue as cv -from openmc.clean_xml import * +from openmc.clean_xml import clean_xml_indentation if sys.version_info[0] >= 3: basestring = str @@ -41,6 +42,7 @@ _FILTER_CLASSES = (Filter, CrossFilter, AggregateFilter) def reset_auto_tally_id(): + """Reset counter for auto-generated tally IDs.""" global AUTO_TALLY_ID AUTO_TALLY_ID = 10000 @@ -177,7 +179,7 @@ class Tally(object): for self_filter in self.filters: string += '{0: <16}\t\t{1}\t{2}\n'.format('', self_filter.type, - self_filter.bins) + self_filter.bins) string += '{0: <16}{1}'.format('\tNuclides', '=\t') @@ -386,7 +388,7 @@ class Tally(object): @estimator.setter def estimator(self, estimator): cv.check_value('estimator', estimator, - ['analog', 'tracklength', 'collision']) + ['analog', 'tracklength', 'collision']) self._estimator = estimator @triggers.setter @@ -762,10 +764,7 @@ class Tally(object): no_nuclides_match = False # Either all nuclides should match, or none should - if no_nuclides_match or all_nuclides_match: - return True - else: - return False + return no_nuclides_match or all_nuclides_match def _can_merge_scores(self, other): """Determine if another tally's scores can be merged with this one's @@ -802,10 +801,7 @@ class Tally(object): return False # Either all scores should match, or none should - if no_scores_match or all_scores_match: - return True - else: - return False + return no_scores_match or all_scores_match def can_merge(self, other): """Determine if another tally can be merged with this one @@ -901,7 +897,7 @@ class Tally(object): # Search for mergeable filters for i, filter1 in enumerate(self.filters): - for j, filter2 in enumerate(other.filters): + for filter2 in other.filters: if filter1 != filter2 and filter1.can_merge(filter2): other_copy._swap_filters(other_copy.filters[i], filter2) merged_tally.filters[i] = filter1.merge(filter2) @@ -1058,7 +1054,7 @@ class Tally(object): for score in self.scores: scores += '{0} '.format(score) - subelement = ET.SubElement(element, "scores") + subelement = ET.SubElement(element, "scores") subelement.text = scores.rstrip(' ') # Tally estimator type @@ -1192,7 +1188,7 @@ class Tally(object): # If the Summary was linked, then values are Nuclide objects if isinstance(test_nuclide, Nuclide): - if test_nuclide._name == nuclide: + if test_nuclide.name == nuclide: nuclide_index = i break @@ -1557,7 +1553,7 @@ class Tally(object): # Append each Filter's DataFrame to the overall DataFrame for self_filter in self.filters: filter_df = self_filter.get_pandas_dataframe( - data_size, distribcell_paths) + data_size, distribcell_paths) df = pd.concat([df, filter_df], axis=1) # Include DataFrame column for nuclides if user requested it @@ -1673,7 +1669,7 @@ class Tally(object): return data def export_results(self, filename='tally-results', directory='.', - format='hdf5', append=True): + format='hdf5', append=True): """Exports tallly results to an HDF5 or Python pickle binary file. Parameters @@ -1719,7 +1715,7 @@ class Tally(object): elif not isinstance(append, bool): msg = 'Unable to export the results for Tally ID="{0}" since the ' \ - 'append parameter is not True/False'.format(self.id, append) + 'append parameter is not True/False'.format(self.id) raise ValueError(msg) # Make directory if it does not exist @@ -1776,7 +1772,7 @@ class Tally(object): filename = directory + '/' + filename + '.pkl' if os.path.exists(filename) and append: - tally_results = pickle.load(file(filename, 'rb')) + tally_results = pickle.load(open(filename, 'rb')) else: tally_results = {} @@ -1815,7 +1811,7 @@ class Tally(object): pickle.dump(tally_results, open(filename, 'wb')) def hybrid_product(self, other, binary_op, filter_product=None, - nuclide_product=None, score_product=None): + nuclide_product=None, score_product=None): """Combines filters, scores and nuclides with another tally. This is a helper method for the tally arithmetic operator overloaded @@ -2451,7 +2447,7 @@ class Tally(object): new_tally._std_dev = self.std_dev new_tally.estimator = self.estimator new_tally.with_summary = self.with_summary - new_tally.num_realization = self.num_realizations + new_tally.num_realizations = self.num_realizations new_tally.filters = copy.deepcopy(self.filters) new_tally.nuclides = copy.deepcopy(self.nuclides) @@ -2522,7 +2518,7 @@ class Tally(object): new_tally._std_dev = self.std_dev new_tally.estimator = self.estimator new_tally.with_summary = self.with_summary - new_tally.num_realization = self.num_realizations + new_tally.num_realizations = self.num_realizations new_tally.filters = copy.deepcopy(self.filters) new_tally.nuclides = copy.deepcopy(self.nuclides) @@ -2594,7 +2590,7 @@ class Tally(object): new_tally._std_dev = self.std_dev * np.abs(other) new_tally.estimator = self.estimator new_tally.with_summary = self.with_summary - new_tally.num_realization = self.num_realizations + new_tally.num_realizations = self.num_realizations new_tally.filters = copy.deepcopy(self.filters) new_tally.nuclides = copy.deepcopy(self.nuclides) @@ -2666,7 +2662,7 @@ class Tally(object): new_tally._std_dev = self.std_dev * np.abs(1. / other) new_tally.estimator = self.estimator new_tally.with_summary = self.with_summary - new_tally.num_realization = self.num_realizations + new_tally.num_realizations = self.num_realizations new_tally.filters = copy.deepcopy(self.filters) new_tally.nuclides = copy.deepcopy(self.nuclides) @@ -2742,7 +2738,7 @@ class Tally(object): new_tally._std_dev = np.abs(new_tally._mean * power * self_rel_err) new_tally.estimator = self.estimator new_tally.with_summary = self.with_summary - new_tally.num_realization = self.num_realizations + new_tally.num_realizations = self.num_realizations new_tally.filters = copy.deepcopy(self.filters) new_tally.nuclides = copy.deepcopy(self.nuclides) @@ -3149,7 +3145,7 @@ class Tally(object): return tally_sum def average(self, scores=[], filter_type=None, - filter_bins=[], nuclides=[], remove_filter=False): + filter_bins=[], nuclides=[], remove_filter=False): """Vectorized average of tally data across scores, filter bins and/or nuclides using tally aggregation. @@ -3577,4 +3573,4 @@ class Tallies(cv.CheckedList): # Write the XML Tree to the tallies.xml file tree = ET.ElementTree(self._tallies_file) tree.write("tallies.xml", xml_declaration=True, - encoding='utf-8', method="xml") + encoding='utf-8', method="xml") diff --git a/openmc/trigger.py b/openmc/trigger.py index 537af1c8d8..f23838dcff 100644 --- a/openmc/trigger.py +++ b/openmc/trigger.py @@ -40,10 +40,7 @@ class Trigger(object): self._scores = [] def __eq__(self, other): - if str(self) == str(other): - return True - else: - return False + return str(self) == str(other) def __ne__(self, other): return not self == other @@ -70,7 +67,7 @@ class Trigger(object): @trigger_type.setter def trigger_type(self, trigger_type): cv.check_value('tally trigger type', trigger_type, - ['variance', 'std_dev', 'rel_err']) + ['variance', 'std_dev', 'rel_err']) self._trigger_type = trigger_type @threshold.setter diff --git a/openmc/universe.py b/openmc/universe.py index 84a5acdcac..c8e7fcab1e 100644 --- a/openmc/universe.py +++ b/openmc/universe.py @@ -1,9 +1,7 @@ from collections import OrderedDict, Iterable from numbers import Integral -from xml.etree import ElementTree as ET import random import sys -import warnings import numpy as np @@ -22,6 +20,7 @@ AUTO_UNIVERSE_ID = 10000 def reset_auto_universe_id(): + """Reset counter for auto-generated universe IDs.""" global AUTO_UNIVERSE_ID AUTO_UNIVERSE_ID = 10000 @@ -256,7 +255,7 @@ class Universe(object): if obj not in colors: colors[obj] = (random.random(), random.random(), random.random(), 1.0) - img[j,i,:] = colors[obj] + img[j, i, :] = colors[obj] # Display image plt.imshow(img, extent=(x_min, x_max, y_min, y_max)) @@ -282,7 +281,7 @@ class Universe(object): 'a Cell'.format(self._id, cell) raise ValueError(msg) - cell_id = cell._id + cell_id = cell.id if cell_id not in self._cells: self._cells[cell_id] = cell @@ -364,7 +363,7 @@ class Universe(object): nuclides = OrderedDict() # Append all Nuclides in each Cell in the Universe to the dictionary - for cell_id, cell in self._cells.items(): + for cell in self._cells.values(): nuclides.update(cell.get_all_nuclides()) return nuclides @@ -386,7 +385,7 @@ class Universe(object): cells.update(self._cells) # Append all Cells in each Cell in the Universe to the dictionary - for cell_id, cell in self._cells.items(): + for cell in self._cells.values(): cells.update(cell.get_all_cells()) return cells @@ -406,7 +405,7 @@ class Universe(object): # Append all Cells in each Cell in the Universe to the dictionary cells = self.get_all_cells() - for cell_id, cell in cells.items(): + for cell in cells.values(): materials.update(cell.get_all_materials()) return materials @@ -428,7 +427,7 @@ class Universe(object): universes = OrderedDict() # Append all Universes containing each Cell to the dictionary - for cell_id, cell in cells.items(): + for cell in cells.values(): universes.update(cell.get_all_universes()) return universes diff --git a/setup.py b/setup.py index 99e465c9d4..a842a1c3ae 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,6 @@ #!/usr/bin/env python import glob -import os try: from setuptools import setup have_setuptools = True From b483cfe0b64bd6a77c2bc06e02b46b9a48630a33 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sat, 2 Jul 2016 15:21:58 +0700 Subject: [PATCH 02/17] Respond to @wbinventor comments on #679 --- openmc/element.py | 4 ++-- openmc/macroscopic.py | 4 ++-- openmc/material.py | 4 ++-- openmc/mgxs/library.py | 10 +++++----- openmc/nuclide.py | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/openmc/element.py b/openmc/element.py index 2e22702d99..c877c27a12 100644 --- a/openmc/element.py +++ b/openmc/element.py @@ -45,9 +45,9 @@ class Element(object): def __eq__(self, other): if isinstance(other, Element): - if self._name != other.name: + if self.name != other.name: return False - elif self._xs != other.xs: + elif self.xs != other.xs: return False else: return True diff --git a/openmc/macroscopic.py b/openmc/macroscopic.py index 1fdf875e72..1dd087903f 100644 --- a/openmc/macroscopic.py +++ b/openmc/macroscopic.py @@ -38,9 +38,9 @@ class Macroscopic(object): def __eq__(self, other): if isinstance(other, Macroscopic): - if self._name != other.name: + if self.name != other.name: return False - elif self._xs != other.xs: + elif self.xs != other.xs: return False else: return True diff --git a/openmc/material.py b/openmc/material.py index 1ba8f533a9..d7ffd04e94 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -352,9 +352,9 @@ 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="{0}". ' \ 'Only one Macroscopic allowed per ' \ - 'Material!'.format(self._id) + 'Material.'.format(self._id) raise ValueError(msg) # Generally speaking, the density for a macroscopic object will diff --git a/openmc/mgxs/library.py b/openmc/mgxs/library.py index 319e4d4139..9df9d150dd 100644 --- a/openmc/mgxs/library.py +++ b/openmc/mgxs/library.py @@ -296,7 +296,7 @@ class Library(object): if correction == 'P0' and self.legendre_order > 0: warn('The P0 correction will be ignored since the scattering ' - 'order {} is greater than zero'.format(self.legendre_order)) + 'order "{}" is greater than zero'.format(self.legendre_order)) self._correction = correction @@ -1176,11 +1176,11 @@ class Library(object): # Ensure absorption is present if 'absorption' not in self.mgxs_types: error_flag = True - warn('"absorption" MGXS type is required but not provided.') + warn('An "absorption" MGXS type is required but not provided.') # Ensure nu-scattering matrix is required if 'nu-scatter matrix' not in self.mgxs_types: error_flag = True - warn('"nu-scatter matrix" MGXS type is required but not provided.') + warn('A "nu-scatter matrix" MGXS type is required but not provided.') else: # Ok, now see the status of scatter and/or multiplicity if ((('scatter matrix' not in self.mgxs_types) and @@ -1189,7 +1189,7 @@ class Library(object): # we need total, and not transport. if 'total' not in self.mgxs_types: error_flag = True - warn('"total" MGXS type is required if a ' + warn('A "total" MGXS type is required if a ' 'scattering matrix is not provided.') # Total or transport can be present, but if using # self.correction=="P0", then we should use transport. @@ -1202,7 +1202,7 @@ class Library(object): elif (((self.correction is None) and ('total' not in self.mgxs_types))): error_flag = True - warn('"total" MGXS type is required, but not provided.') + warn('A "total" MGXS type is required, but not provided.') if error_flag: raise ValueError('Invalid MGXS configuration encountered.') diff --git a/openmc/nuclide.py b/openmc/nuclide.py index a2130680fb..bfeff93113 100644 --- a/openmc/nuclide.py +++ b/openmc/nuclide.py @@ -46,9 +46,9 @@ class Nuclide(object): def __eq__(self, other): if isinstance(other, Nuclide): - if self._name != other.name: + if self.name != other.name: return False - elif self._xs != other.xs: + elif self.xs != other.xs: return False else: return True From 1ec7ac26afbbf9aee722cfac09f9f7bdbf4750bf Mon Sep 17 00:00:00 2001 From: samuel shaner Date: Tue, 5 Jul 2016 19:30:21 +0000 Subject: [PATCH 03/17] updated mgxs and tallies test results --- tests/test_mgxs_library_condense/inputs_true.dat | 2 +- tests/test_mgxs_library_condense/results_true.dat | 6 +++--- tests/test_mgxs_library_distribcell/inputs_true.dat | 2 +- tests/test_mgxs_library_hdf5/inputs_true.dat | 2 +- tests/test_mgxs_library_hdf5/results_true.dat | 8 ++++---- tests/test_mgxs_library_no_nuclides/inputs_true.dat | 2 +- tests/test_mgxs_library_no_nuclides/results_true.dat | 10 +++++----- tests/test_mgxs_library_nuclides/inputs_true.dat | 2 +- tests/test_mgxs_library_nuclides/results_true.dat | 2 +- tests/test_tallies/inputs_true.dat | 2 +- tests/test_tallies/results_true.dat | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/test_mgxs_library_condense/inputs_true.dat b/tests/test_mgxs_library_condense/inputs_true.dat index c187a5f507..be692e46f5 100644 --- a/tests/test_mgxs_library_condense/inputs_true.dat +++ b/tests/test_mgxs_library_condense/inputs_true.dat @@ -1 +1 @@ -fa10bef56a0541a6484ed87ab0d94ae338ad9ff3ff69d917f33aa3a0bf8744f28c00fa23a2bccc1503f8815ac9d9305be7f739d1a7edcf296139b8a3ad5531c9 \ No newline at end of file +d4ad3ef5f03913bcedf7dad7f9ace431e0701dac128d1f38f571898b2c79d6b207191fd1e726d9b3c14b2b994ea9d3ba5b10489be3af9c8fbb41868b85940d9f \ No newline at end of file diff --git a/tests/test_mgxs_library_condense/results_true.dat b/tests/test_mgxs_library_condense/results_true.dat index bc820c5769..3dbb07d3c3 100644 --- a/tests/test_mgxs_library_condense/results_true.dat +++ b/tests/test_mgxs_library_condense/results_true.dat @@ -34,12 +34,12 @@ 0 10000 1 1 total 0.085835 0.005592 material group out nuclide mean std. dev. 0 10000 1 total 1.0 0.046071 - material group out nuclide mean std. dev. -0 10000 1 total 1.0 0.047454 + material group out nuclide mean std. dev. +0 10000 1 total 0.991442 0.050935 material group in nuclide mean std. dev. 0 10000 1 total 2.001309e+06 146216.555365 material group in nuclide mean std. dev. -0 10000 1 total 0.090004 0.006401 +0 10000 1 total 0.090004 0.006367 material group in nuclide mean std. dev. 0 10001 1 total 0.311594 0.013793 material group in nuclide mean std. dev. diff --git a/tests/test_mgxs_library_distribcell/inputs_true.dat b/tests/test_mgxs_library_distribcell/inputs_true.dat index 7e2a2e990f..1d013ae9f5 100644 --- a/tests/test_mgxs_library_distribcell/inputs_true.dat +++ b/tests/test_mgxs_library_distribcell/inputs_true.dat @@ -1 +1 @@ -3799e4a037364d2df56e440f005abe6a0a93817865fc046af99de59525ca468b88a8e591181bfeac851993ec2a91b767b909c262d89f2850dcbc81428a048e9d \ No newline at end of file +8387be0df212cc1b277f42e4b7946b7b1097b34a2d51733bbc0ce1fcc86b0ae97676770b0a4230735e8c11d769989a8c6f702d9f48eb1a145ab6517128443fb7 \ No newline at end of file diff --git a/tests/test_mgxs_library_hdf5/inputs_true.dat b/tests/test_mgxs_library_hdf5/inputs_true.dat index c187a5f507..be692e46f5 100644 --- a/tests/test_mgxs_library_hdf5/inputs_true.dat +++ b/tests/test_mgxs_library_hdf5/inputs_true.dat @@ -1 +1 @@ -fa10bef56a0541a6484ed87ab0d94ae338ad9ff3ff69d917f33aa3a0bf8744f28c00fa23a2bccc1503f8815ac9d9305be7f739d1a7edcf296139b8a3ad5531c9 \ No newline at end of file +d4ad3ef5f03913bcedf7dad7f9ace431e0701dac128d1f38f571898b2c79d6b207191fd1e726d9b3c14b2b994ea9d3ba5b10489be3af9c8fbb41868b85940d9f \ No newline at end of file diff --git a/tests/test_mgxs_library_hdf5/results_true.dat b/tests/test_mgxs_library_hdf5/results_true.dat index 1105f35d10..d757944925 100644 --- a/tests/test_mgxs_library_hdf5/results_true.dat +++ b/tests/test_mgxs_library_hdf5/results_true.dat @@ -64,14 +64,14 @@ domain=10000 type=chi [ 1. 0.] [ 0.04607052 0. ] domain=10000 type=chi-prompt -[ 1. 0.] -[ 0.04745364 0. ] +[ 0.9914425 0. ] +[ 0.05093465 0. ] domain=10000 type=velocity [ 17515210.62039676 350171.99519401] [ 1438175.27389879 29945.93169673] domain=10000 type=prompt-nu-fission -[ 0.01923926 0.46671903] -[ 0.00131949 0.04161421] +[ 0.01923922 0.46671903] +[ 0.00130951 0.04141087] domain=10001 type=total [ 0.31373767 0.3008214 ] [ 0.0155819 0.02805245] diff --git a/tests/test_mgxs_library_no_nuclides/inputs_true.dat b/tests/test_mgxs_library_no_nuclides/inputs_true.dat index c187a5f507..be692e46f5 100644 --- a/tests/test_mgxs_library_no_nuclides/inputs_true.dat +++ b/tests/test_mgxs_library_no_nuclides/inputs_true.dat @@ -1 +1 @@ -fa10bef56a0541a6484ed87ab0d94ae338ad9ff3ff69d917f33aa3a0bf8744f28c00fa23a2bccc1503f8815ac9d9305be7f739d1a7edcf296139b8a3ad5531c9 \ No newline at end of file +d4ad3ef5f03913bcedf7dad7f9ace431e0701dac128d1f38f571898b2c79d6b207191fd1e726d9b3c14b2b994ea9d3ba5b10489be3af9c8fbb41868b85940d9f \ No newline at end of file diff --git a/tests/test_mgxs_library_no_nuclides/results_true.dat b/tests/test_mgxs_library_no_nuclides/results_true.dat index 71583d198e..4d79dbbb3b 100644 --- a/tests/test_mgxs_library_no_nuclides/results_true.dat +++ b/tests/test_mgxs_library_no_nuclides/results_true.dat @@ -75,15 +75,15 @@ material group out nuclide mean std. dev. 1 10000 1 total 1.0 0.046071 0 10000 2 total 0.0 0.000000 - material group out nuclide mean std. dev. -1 10000 1 total 1.0 0.047454 -0 10000 2 total 0.0 0.000000 + material group out nuclide mean std. dev. +1 10000 1 total 0.991442 0.050935 +0 10000 2 total 0.000000 0.000000 material group in nuclide mean std. dev. 1 10000 1 total 1.751521e+07 1.438175e+06 0 10000 2 total 3.501720e+05 2.994593e+04 material group in nuclide mean std. dev. -1 10000 1 total 0.019239 0.001319 -0 10000 2 total 0.466719 0.041614 +1 10000 1 total 0.019239 0.001310 +0 10000 2 total 0.466719 0.041411 material group in nuclide mean std. dev. 1 10001 1 total 0.313738 0.015582 0 10001 2 total 0.300821 0.028052 diff --git a/tests/test_mgxs_library_nuclides/inputs_true.dat b/tests/test_mgxs_library_nuclides/inputs_true.dat index 7c73d5eb1b..c9b85ca27c 100644 --- a/tests/test_mgxs_library_nuclides/inputs_true.dat +++ b/tests/test_mgxs_library_nuclides/inputs_true.dat @@ -1 +1 @@ -c142d30bae2afb93e55fdeb7e364131b319f9d42523d999bb8b65cf70329b7356a1a878116d6848c4e27556b392bf76c7f49b6dbde79f4cda903738c4d3243c0 \ No newline at end of file +7e6a35ac723fc77db2865fe425832bd6c54aae0132b4543583fc6eb10f2ec5e3d53ea19aa23127a989f19cfe328a57d29f28bff43f779aff246d38f7cffdfd0c \ No newline at end of file diff --git a/tests/test_mgxs_library_nuclides/results_true.dat b/tests/test_mgxs_library_nuclides/results_true.dat index a9e3fa952e..3a61638ad4 100644 --- a/tests/test_mgxs_library_nuclides/results_true.dat +++ b/tests/test_mgxs_library_nuclides/results_true.dat @@ -1 +1 @@ -7e48c8cda041fcd77df98d128a2777ab8f411ac5b7dcba8cddd4ecfb22f5c92267ef0965dc0024ee8c31ae2d7afe9491d2b40589380167004b4bbbe7ada564ff \ No newline at end of file +30bee5191524167000108e833ae21547c0f6e416ec9367e24c1d1acd6aceead74aef0a0a2aa2968ddb55ef8c19cf7012fb6a4047ffa8b51aa2c2b2f08ccc0ea0 \ No newline at end of file diff --git a/tests/test_tallies/inputs_true.dat b/tests/test_tallies/inputs_true.dat index e3d37be300..fb836fb915 100644 --- a/tests/test_tallies/inputs_true.dat +++ b/tests/test_tallies/inputs_true.dat @@ -1 +1 @@ -ea09926d8f5c6c96529bf5529f4deb3be78eda2da80adbbf3440147c337587358c2b1823bc72df9463676135573eb481dcd361b735f18365216645ee81092f1e \ No newline at end of file +5c0dbcb03265615cd2842b280dbd3e6c14f62ec7db9052657b98f03015cd1204295542f5affbb5948f4c5e57534746435065545a0fe533e3c8b062344bb854da \ No newline at end of file diff --git a/tests/test_tallies/results_true.dat b/tests/test_tallies/results_true.dat index ff3a828454..e8283cb679 100644 --- a/tests/test_tallies/results_true.dat +++ b/tests/test_tallies/results_true.dat @@ -1 +1 @@ -a0c7d6ca246ecd7dd5fed06373af142390971401c4e97744f29e55810ab9c231c97c4d8947cdf0b3d2df0ae829a9ddf768e5b2d889bbea34f2b6db0e567db884 \ No newline at end of file +b1ef1648128580996df7ace74539e24d1183a0348f0fd9214f76ba495c00e0b54e22d16e4b146d02d152d67a19cd42fce2455384d39146f7fe8648d8f086e96d \ No newline at end of file From 04dafa13663f58f5b7206caf78e41427e48a4286 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Tue, 5 Jul 2016 19:15:30 -0400 Subject: [PATCH 04/17] updated test_mgxs_library_hdf5 --- tests/test_mgxs_library_hdf5/results_true.dat | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_mgxs_library_hdf5/results_true.dat b/tests/test_mgxs_library_hdf5/results_true.dat index d757944925..ad25d4c81c 100644 --- a/tests/test_mgxs_library_hdf5/results_true.dat +++ b/tests/test_mgxs_library_hdf5/results_true.dat @@ -67,8 +67,8 @@ domain=10000 type=chi-prompt [ 0.9914425 0. ] [ 0.05093465 0. ] domain=10000 type=velocity -[ 17515210.62039676 350171.99519401] -[ 1438175.27389879 29945.93169673] +[ 17515210.62039744 350171.995194 ] +[ 1438175.27389862 29945.93169671] domain=10000 type=prompt-nu-fission [ 0.01923922 0.46671903] [ 0.00130951 0.04141087] @@ -141,8 +141,8 @@ domain=10001 type=chi-prompt [ 0. 0.] [ 0. 0.] domain=10001 type=velocity -[ 16677839.49736621 334953.36760125] -[ 1266444.30951813 38336.78162568] +[ 16677839.497365 334953.36760126] +[ 1266444.30951798 38336.7816257 ] domain=10001 type=prompt-nu-fission [ 0. 0.] [ 0. 0.] @@ -215,8 +215,8 @@ domain=10002 type=chi-prompt [ 0. 0.] [ 0. 0.] domain=10002 type=velocity -[ 16605562.87322708 328412.03865003] -[ 1042435.52374238 38828.43572983] +[ 16605562.87322657 328412.03865004] +[ 1042435.52374247 38828.43572985] domain=10002 type=prompt-nu-fission [ 0. 0.] [ 0. 0.] From 7459f8e335a2138193d4ccc777de2b8a2ed27887 Mon Sep 17 00:00:00 2001 From: samuel shaner Date: Wed, 6 Jul 2016 00:01:09 +0000 Subject: [PATCH 05/17] updated test_mgxs_library_hdf5 test results --- tests/test_mgxs_library_hdf5/results_true.dat | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_mgxs_library_hdf5/results_true.dat b/tests/test_mgxs_library_hdf5/results_true.dat index ad25d4c81c..d757944925 100644 --- a/tests/test_mgxs_library_hdf5/results_true.dat +++ b/tests/test_mgxs_library_hdf5/results_true.dat @@ -67,8 +67,8 @@ domain=10000 type=chi-prompt [ 0.9914425 0. ] [ 0.05093465 0. ] domain=10000 type=velocity -[ 17515210.62039744 350171.995194 ] -[ 1438175.27389862 29945.93169671] +[ 17515210.62039676 350171.99519401] +[ 1438175.27389879 29945.93169673] domain=10000 type=prompt-nu-fission [ 0.01923922 0.46671903] [ 0.00130951 0.04141087] @@ -141,8 +141,8 @@ domain=10001 type=chi-prompt [ 0. 0.] [ 0. 0.] domain=10001 type=velocity -[ 16677839.497365 334953.36760126] -[ 1266444.30951798 38336.7816257 ] +[ 16677839.49736621 334953.36760125] +[ 1266444.30951813 38336.78162568] domain=10001 type=prompt-nu-fission [ 0. 0.] [ 0. 0.] @@ -215,8 +215,8 @@ domain=10002 type=chi-prompt [ 0. 0.] [ 0. 0.] domain=10002 type=velocity -[ 16605562.87322657 328412.03865004] -[ 1042435.52374247 38828.43572985] +[ 16605562.87322708 328412.03865003] +[ 1042435.52374238 38828.43572983] domain=10002 type=prompt-nu-fission [ 0. 0.] [ 0. 0.] From e479f4472d4ef16202e8c7cf15ec0a01291c9ebd Mon Sep 17 00:00:00 2001 From: samuel shaner Date: Wed, 6 Jul 2016 19:58:40 +0000 Subject: [PATCH 06/17] updated mgxs library hdf5 test --- tests/test_mgxs_library_hdf5/results_true.dat | 226 +++++++++--------- 1 file changed, 113 insertions(+), 113 deletions(-) diff --git a/tests/test_mgxs_library_hdf5/results_true.dat b/tests/test_mgxs_library_hdf5/results_true.dat index d757944925..f778fd1328 100644 --- a/tests/test_mgxs_library_hdf5/results_true.dat +++ b/tests/test_mgxs_library_hdf5/results_true.dat @@ -1,92 +1,92 @@ domain=10000 type=total -[ 0.41482549 0.66016992] -[ 0.02279291 0.04751893] +[ 0.41737699 0.65550537] +[ 0.01622049 0.04822293] domain=10000 type=transport -[ 0.35685964 0.64764766] -[ 0.0254936 0.02370374] +[ 0.36820197 0.65187559] +[ 0.01250772 0.04456647] domain=10000 type=nu-transport -[ 0.35685964 0.64764766] -[ 0.0254936 0.02370374] +[ 0.3682861 0.65187559] +[ 0.01255746 0.04456647] domain=10000 type=absorption -[ 0.02740784 0.26451074] -[ 0.0026925 0.02336708] +[ 0.02918941 0.25999786] +[ 0.00220701 0.0193732 ] domain=10000 type=capture -[ 0.01984455 0.07171935] -[ 0.0026433 0.02520786] +[ 0.02193339 0.07048146] +[ 0.00217411 0.01745302] domain=10000 type=fission -[ 0.00756329 0.19279139] -[ 0.00050848 0.01710592] +[ 0.00725602 0.1895164 ] +[ 0.00020162 0.01415226] domain=10000 type=nu-fission -[ 0.01943174 0.46977478] -[ 0.00132298 0.041682 ] +[ 0.01868423 0.46179461] +[ 0.00054368 0.0344848 ] domain=10000 type=kappa-fission -[ 1.47456982 37.28689641] -[ 0.09923532 3.30837772] +[ 1.41427101 36.65349559] +[ 0.03905455 2.73712278] domain=10000 type=scatter -[ 0.38741765 0.39565918] -[ 0.02062573 0.02512506] +[ 0.38818758 0.39550752] +[ 0.01463905 0.02930007] domain=10000 type=nu-scatter -[ 0.38518839 0.4123894 ] -[ 0.02694562 0.01542528] +[ 0.39227772 0.39485975] +[ 0.01143512 0.0378726 ] domain=10000 type=scatter matrix -[[[ 3.84199458e-01 5.18702843e-02 2.00688453e-02 9.47771571e-03] - [ 9.88930393e-04 -2.07234596e-04 -1.03366181e-04 2.34290623e-04]] +[[[ 3.90674403e-01 5.07976644e-02 2.12276198e-02 1.00823506e-02] + [ 1.24702272e-03 -9.19812968e-04 5.15976662e-04 -2.88532411e-04]] - [[ 9.24639909e-04 -7.67704968e-04 4.93788872e-04 -1.71497229e-04] - [ 4.11464759e-01 1.64817280e-02 6.37149049e-03 -1.04991221e-02]]] -[[[ 0.02700101 0.00698255 0.0028465 0.00223352] - [ 0.00048242 0.00014901 0.00018432 0.00012817]] + [[ 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00] + [ 3.94859753e-01 1.12209557e-02 1.31165142e-02 9.25288210e-03]]] +[[[ 0.01161198 0.00415913 0.0039568 0.00300004] + [ 0.00035679 0.000272 0.00030608 0.00035952]] - [[ 0.00092488 0.00076791 0.00049392 0.00017154] - [ 0.01524494 0.00450173 0.01055075 0.01043819]]] + [[ 0. 0. 0. 0. ] + [ 0.0378726 0.01056496 0.0101966 0.00310401]]] domain=10000 type=nu-scatter matrix -[[[ 3.84199458e-01 5.18702843e-02 2.00688453e-02 9.47771571e-03] - [ 9.88930393e-04 -2.07234596e-04 -1.03366181e-04 2.34290623e-04]] +[[[ 3.91030695e-01 5.07135280e-02 2.12493138e-02 9.99605867e-03] + [ 1.24702272e-03 -9.19812968e-04 5.15976662e-04 -2.88532411e-04]] - [[ 9.24639909e-04 -7.67704968e-04 4.93788872e-04 -1.71497229e-04] - [ 4.11464759e-01 1.64817280e-02 6.37149049e-03 -1.04991221e-02]]] -[[[ 0.02700101 0.00698255 0.0028465 0.00223352] - [ 0.00048242 0.00014901 0.00018432 0.00012817]] + [[ 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00] + [ 3.94859753e-01 1.12209557e-02 1.31165142e-02 9.25288210e-03]]] +[[[ 0.01150629 0.00430451 0.0038862 0.00296991] + [ 0.00035679 0.000272 0.00030608 0.00035952]] - [[ 0.00092488 0.00076791 0.00049392 0.00017154] - [ 0.01524494 0.00450173 0.01055075 0.01043819]]] + [[ 0. 0. 0. 0. ] + [ 0.0378726 0.01056496 0.0101966 0.00310401]]] domain=10000 type=multiplicity matrix -[[ 1. 1.] - [ 1. 1.]] -[[ 0.07851646 0.68718427] - [ 1.41421356 0.04113035]] +[[ 1.00091199 1. ] + [ 0. 1. ]] +[[ 0.03596231 0.40406102] + [ 0. 0.11556054]] domain=10000 type=nu-fission matrix -[[ 0.02014243 0. ] - [ 0.45436647 0. ]] -[[ 0.00314909 0. ] - [ 0.02742551 0. ]] +[[ 0.01768789 0. ] + [ 0.41868231 0. ]] +[[ 0.00118211 0. ] + [ 0.03684218 0. ]] domain=10000 type=chi -[ 1. 0.] -[ 0.04607052 0. ] +[ 0.95000711 0. ] +[ 0.07214945 0. ] domain=10000 type=chi-prompt -[ 0.9914425 0. ] -[ 0.05093465 0. ] +[ 0.94989853 0. ] +[ 0.07156216 0. ] domain=10000 type=velocity -[ 17515210.62039676 350171.99519401] -[ 1438175.27389879 29945.93169673] +[ 17726682.88576092 355801.95919094] +[ 912304.37589157 26699.39400479] domain=10000 type=prompt-nu-fission -[ 0.01923922 0.46671903] -[ 0.00130951 0.04141087] +[ 0.01850303 0.45879077] +[ 0.00053983 0.03426049] domain=10001 type=total -[ 0.31373767 0.3008214 ] -[ 0.0155819 0.02805245] +[ 0.31589603 0.30072552] +[ 0.01039063 0.0279948 ] domain=10001 type=transport -[ 0.27322787 0.31237484] -[ 0.03311537 0.04960583] +[ 0.27104783 0.32663403] +[ 0.01242444 0.06732111] domain=10001 type=nu-transport -[ 0.27322787 0.31237484] -[ 0.03311537 0.04960583] +[ 0.27104783 0.32663403] +[ 0.01242444 0.06732111] domain=10001 type=absorption -[ 0.00157499 0.00540038] -[ 0.00032255 0.00061814] +[ 0.00126653 0.00530484] +[ 0.00027329 0.00054437] domain=10001 type=capture -[ 0.00157499 0.00540038] -[ 0.00032255 0.00061814] +[ 0.00126653 0.00530484] +[ 0.00027329 0.00054437] domain=10001 type=fission [ 0. 0.] [ 0. 0.] @@ -97,38 +97,38 @@ domain=10001 type=kappa-fission [ 0. 0.] [ 0. 0.] domain=10001 type=scatter -[ 0.31216268 0.29542102] -[ 0.01532192 0.02744549] +[ 0.3146295 0.29542068] +[ 0.01028598 0.02745453] domain=10001 type=nu-scatter -[ 0.31012074 0.29626427] -[ 0.03378811 0.04379223] +[ 0.31011079 0.29015956] +[ 0.01217247 0.06236369] domain=10001 type=scatter matrix -[[[ 0.31012074 0.03822959 0.02074494 0.0079643 ] +[[[ 0.31011079 0.04197025 0.03385311 0.00735142] [ 0. 0. 0. 0. ]] [[ 0. 0. 0. 0. ] - [ 0.29626427 -0.01121364 0.00883657 -0.00327007]]] -[[[ 0.03378811 0.008484 0.00469561 0.00373162] + [ 0.29015956 -0.02638196 0.01221917 -0.01057754]]] +[[[ 0.01217247 0.00442067 0.00236562 0.0053074 ] [ 0. 0. 0. 0. ]] [[ 0. 0. 0. 0. ] - [ 0.04379223 0.01618037 0.01150396 0.00732885]]] + [ 0.06236369 0.00984106 0.0126671 0.009591 ]]] domain=10001 type=nu-scatter matrix -[[[ 0.31012074 0.03822959 0.02074494 0.0079643 ] +[[[ 0.31011079 0.04197025 0.03385311 0.00735142] [ 0. 0. 0. 0. ]] [[ 0. 0. 0. 0. ] - [ 0.29626427 -0.01121364 0.00883657 -0.00327007]]] -[[[ 0.03378811 0.008484 0.00469561 0.00373162] + [ 0.29015956 -0.02638196 0.01221917 -0.01057754]]] +[[[ 0.01217247 0.00442067 0.00236562 0.0053074 ] [ 0. 0. 0. 0. ]] [[ 0. 0. 0. 0. ] - [ 0.04379223 0.01618037 0.01150396 0.00732885]]] + [ 0.06236369 0.00984106 0.0126671 0.009591 ]]] domain=10001 type=multiplicity matrix [[ 1. 0.] [ 0. 1.]] -[[ 0.1087787 0. ] - [ 0. 0.14242717]] +[[ 0.03025768 0. ] + [ 0. 0.2173913 ]] domain=10001 type=nu-fission matrix [[ 0. 0.] [ 0. 0.]] @@ -141,26 +141,26 @@ domain=10001 type=chi-prompt [ 0. 0.] [ 0. 0.] domain=10001 type=velocity -[ 16677839.49736621 334953.36760125] -[ 1266444.30951813 38336.78162568] +[ 17612034.94932026 340983.9144147 ] +[ 659484.31513854 34989.69457459] domain=10001 type=prompt-nu-fission [ 0. 0.] [ 0. 0.] domain=10002 type=total -[ 0.66457226 2.05238401] -[ 0.03121475 0.22434291] +[ 0.67620548 2.02125348] +[ 0.02134983 0.14050739] domain=10002 type=transport -[ 0.29056526 1.51643801] -[ 0.02385185 0.23519727] +[ 0.29203886 1.4739065 ] +[ 0.01113636 0.10290272] domain=10002 type=nu-transport -[ 0.29056526 1.51643801] -[ 0.02385185 0.23519727] +[ 0.29203886 1.4739065 ] +[ 0.01113636 0.10290272] domain=10002 type=absorption -[ 0.0006904 0.03168726] -[ 4.41475687e-05 3.74655858e-03] +[ 0.00068579 0.03074796] +[ 3.68158517e-05 2.25078842e-03] domain=10002 type=capture -[ 0.0006904 0.03168726] -[ 4.41475687e-05 3.74655858e-03] +[ 0.00068579 0.03074796] +[ 3.68158517e-05 2.25078842e-03] domain=10002 type=fission [ 0. 0.] [ 0. 0.] @@ -171,38 +171,38 @@ domain=10002 type=kappa-fission [ 0. 0.] [ 0. 0.] domain=10002 type=scatter -[ 0.66388186 2.02069676] -[ 0.03117268 0.22060445] +[ 0.67551968 1.99050553] +[ 0.02133857 0.13826068] domain=10002 type=nu-scatter -[ 0.6712692 2.03538833] -[ 0.02618637 0.25806033] +[ 0.67767343 1.99516952] +[ 0.01508282 0.10853715] domain=10002 type=scatter matrix -[[[ 6.39901485e-01 3.81167449e-01 1.52391898e-01 9.14802229e-03] - [ 3.13677198e-02 8.75772321e-03 -2.56790106e-03 -3.78480288e-03]] +[[[ 0.6469338 0.38638204 0.15208191 0.00907726] + [ 0.03073963 0.00912198 -0.00378942 -0.00414448]] - [[ 4.43343134e-04 3.99960414e-04 3.19562707e-04 2.13846969e-04] - [ 2.03494499e+00 5.09940513e-01 1.11174609e-01 2.49884357e-02]]] -[[[ 2.47091228e-02 1.62432649e-02 8.15627770e-03 3.88856214e-03] - [ 1.72811290e-03 9.25670501e-04 1.01398475e-03 8.17075571e-04]] + [[ 0. 0. 0. 0. ] + [ 1.99516952 0.50320636 0.11400654 0.03222921]]] +[[[ 0.01490544 0.00783787 0.00444992 0.00269273] + [ 0.00071472 0.00043674 0.00068793 0.00030916]] - [[ 4.44850393e-04 4.01320183e-04 3.20649143e-04 2.14573997e-04] - [ 2.57799889e-01 5.12359063e-02 1.30198170e-02 8.31235256e-03]]] + [[ 0. 0. 0. 0. ] + [ 0.10853715 0.03505779 0.009685 0.014426 ]]] domain=10002 type=nu-scatter matrix -[[[ 6.39901485e-01 3.81167449e-01 1.52391898e-01 9.14802229e-03] - [ 3.13677198e-02 8.75772321e-03 -2.56790106e-03 -3.78480288e-03]] +[[[ 0.6469338 0.38638204 0.15208191 0.00907726] + [ 0.03073963 0.00912198 -0.00378942 -0.00414448]] - [[ 4.43343134e-04 3.99960414e-04 3.19562707e-04 2.13846969e-04] - [ 2.03494499e+00 5.09940513e-01 1.11174609e-01 2.49884357e-02]]] -[[[ 2.47091228e-02 1.62432649e-02 8.15627770e-03 3.88856214e-03] - [ 1.72811290e-03 9.25670501e-04 1.01398475e-03 8.17075571e-04]] + [[ 0. 0. 0. 0. ] + [ 1.99516952 0.50320636 0.11400654 0.03222921]]] +[[[ 0.01490544 0.00783787 0.00444992 0.00269273] + [ 0.00071472 0.00043674 0.00068793 0.00030916]] - [[ 4.44850393e-04 4.01320183e-04 3.20649143e-04 2.14573997e-04] - [ 2.57799889e-01 5.12359063e-02 1.30198170e-02 8.31235256e-03]]] + [[ 0. 0. 0. 0. ] + [ 0.10853715 0.03505779 0.009685 0.014426 ]]] domain=10002 type=multiplicity matrix [[ 1. 1.] - [ 1. 1.]] -[[ 0.03860919 0.06766735] - [ 1.41421356 0.13592921]] + [ 0. 1.]] +[[ 0.02036446 0.02083786] + [ 0. 0.05943471]] domain=10002 type=nu-fission matrix [[ 0. 0.] [ 0. 0.]] @@ -215,8 +215,8 @@ domain=10002 type=chi-prompt [ 0. 0.] [ 0. 0.] domain=10002 type=velocity -[ 16605562.87322708 328412.03865003] -[ 1042435.52374238 38828.43572983] +[ 16974477.47368938 338442.26464518] +[ 850676.35712708 24773.82692619] domain=10002 type=prompt-nu-fission [ 0. 0.] [ 0. 0.] From 4c1ba68f709bc6f63395133394a848b4c24d91bd Mon Sep 17 00:00:00 2001 From: samuel shaner Date: Wed, 6 Jul 2016 20:01:00 +0000 Subject: [PATCH 07/17] updated mgxs velocity comment --- openmc/mgxs/mgxs.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/openmc/mgxs/mgxs.py b/openmc/mgxs/mgxs.py index e844842539..d6cd8c2550 100644 --- a/openmc/mgxs/mgxs.py +++ b/openmc/mgxs/mgxs.py @@ -4774,11 +4774,12 @@ class Velocity(MGXS): This class can be used for both OpenMC input generation and tally data post-processing to compute spatially-homogenized and energy-integrated multi-group neutron velocities for multi-group neutronics calculations. - The units of velocity are cm per second. At a minimum, one needs to set the - :attr:`Velocity.energy_groups` and :attr:`Velocity.domain` properties. - Tallies for the flux and appropriate reaction rates over the specified - domain are generated automatically via the :attr:`Velocity.tallies` - property, which can then be appended to a :class:`openmc.Tallies` instance. + The units of velocity are centimeters per second. At a minimum, one needs to + set the :attr:`Velocity.energy_groups` and :attr:`Velocity.domain` + properties. Tallies for the flux and appropriate reaction rates over the + specified domain are generated automatically via the + :attr:`Velocity.tallies` property, which can then be appended to a + :class:`openmc.Tallies` instance. For post-processing, the :meth:`MGXS.load_from_statepoint` will pull in the necessary data to compute multi-group cross sections from a From 4c790a4093338f9cac86d7f423583b41cf174a10 Mon Sep 17 00:00:00 2001 From: samuel shaner Date: Wed, 6 Jul 2016 20:02:37 +0000 Subject: [PATCH 08/17] updated tally.F90 --- src/tally.F90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tally.F90 b/src/tally.F90 index b5f6bea7d9..6c4bb02bdd 100644 --- a/src/tally.F90 +++ b/src/tally.F90 @@ -463,7 +463,9 @@ contains * nuclides(p % event_nuclide) % nu(E, EMISSION_PROMPT) & / micro_xs(p % event_nuclide) % absorption else + score = ZERO + end if else ! Skip any non-fission events From fd56f09367299ace01810369156b49185fc230b6 Mon Sep 17 00:00:00 2001 From: samuel shaner Date: Wed, 6 Jul 2016 20:09:29 +0000 Subject: [PATCH 09/17] updated mgxs library hdf5 test --- tests/test_mgxs_library_hdf5/results_true.dat | 226 +++++++++--------- 1 file changed, 113 insertions(+), 113 deletions(-) diff --git a/tests/test_mgxs_library_hdf5/results_true.dat b/tests/test_mgxs_library_hdf5/results_true.dat index f778fd1328..af06a5a43f 100644 --- a/tests/test_mgxs_library_hdf5/results_true.dat +++ b/tests/test_mgxs_library_hdf5/results_true.dat @@ -1,92 +1,92 @@ domain=10000 type=total -[ 0.41737699 0.65550537] -[ 0.01622049 0.04822293] +[ 0.41482549 0.66016992] +[ 0.02279291 0.04751893] domain=10000 type=transport -[ 0.36820197 0.65187559] -[ 0.01250772 0.04456647] +[ 0.35685964 0.64764766] +[ 0.0254936 0.02370374] domain=10000 type=nu-transport -[ 0.3682861 0.65187559] -[ 0.01255746 0.04456647] +[ 0.35685964 0.64764766] +[ 0.0254936 0.02370374] domain=10000 type=absorption -[ 0.02918941 0.25999786] -[ 0.00220701 0.0193732 ] +[ 0.02740784 0.26451074] +[ 0.0026925 0.02336708] domain=10000 type=capture -[ 0.02193339 0.07048146] -[ 0.00217411 0.01745302] +[ 0.01984455 0.07171935] +[ 0.0026433 0.02520786] domain=10000 type=fission -[ 0.00725602 0.1895164 ] -[ 0.00020162 0.01415226] +[ 0.00756329 0.19279139] +[ 0.00050848 0.01710592] domain=10000 type=nu-fission -[ 0.01868423 0.46179461] -[ 0.00054368 0.0344848 ] +[ 0.01943174 0.46977478] +[ 0.00132298 0.041682 ] domain=10000 type=kappa-fission -[ 1.41427101 36.65349559] -[ 0.03905455 2.73712278] +[ 1.47456982 37.28689641] +[ 0.09923532 3.30837772] domain=10000 type=scatter -[ 0.38818758 0.39550752] -[ 0.01463905 0.02930007] +[ 0.38741765 0.39565918] +[ 0.02062573 0.02512506] domain=10000 type=nu-scatter -[ 0.39227772 0.39485975] -[ 0.01143512 0.0378726 ] +[ 0.38518839 0.4123894 ] +[ 0.02694562 0.01542528] domain=10000 type=scatter matrix -[[[ 3.90674403e-01 5.07976644e-02 2.12276198e-02 1.00823506e-02] - [ 1.24702272e-03 -9.19812968e-04 5.15976662e-04 -2.88532411e-04]] +[[[ 3.84199458e-01 5.18702843e-02 2.00688453e-02 9.47771571e-03] + [ 9.88930393e-04 -2.07234596e-04 -1.03366181e-04 2.34290623e-04]] - [[ 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00] - [ 3.94859753e-01 1.12209557e-02 1.31165142e-02 9.25288210e-03]]] -[[[ 0.01161198 0.00415913 0.0039568 0.00300004] - [ 0.00035679 0.000272 0.00030608 0.00035952]] + [[ 9.24639909e-04 -7.67704968e-04 4.93788872e-04 -1.71497229e-04] + [ 4.11464759e-01 1.64817280e-02 6.37149049e-03 -1.04991221e-02]]] +[[[ 0.02700101 0.00698255 0.0028465 0.00223352] + [ 0.00048242 0.00014901 0.00018432 0.00012817]] - [[ 0. 0. 0. 0. ] - [ 0.0378726 0.01056496 0.0101966 0.00310401]]] + [[ 0.00092488 0.00076791 0.00049392 0.00017154] + [ 0.01524494 0.00450173 0.01055075 0.01043819]]] domain=10000 type=nu-scatter matrix -[[[ 3.91030695e-01 5.07135280e-02 2.12493138e-02 9.99605867e-03] - [ 1.24702272e-03 -9.19812968e-04 5.15976662e-04 -2.88532411e-04]] +[[[ 3.84199458e-01 5.18702843e-02 2.00688453e-02 9.47771571e-03] + [ 9.88930393e-04 -2.07234596e-04 -1.03366181e-04 2.34290623e-04]] - [[ 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00] - [ 3.94859753e-01 1.12209557e-02 1.31165142e-02 9.25288210e-03]]] -[[[ 0.01150629 0.00430451 0.0038862 0.00296991] - [ 0.00035679 0.000272 0.00030608 0.00035952]] + [[ 9.24639909e-04 -7.67704968e-04 4.93788872e-04 -1.71497229e-04] + [ 4.11464759e-01 1.64817280e-02 6.37149049e-03 -1.04991221e-02]]] +[[[ 0.02700101 0.00698255 0.0028465 0.00223352] + [ 0.00048242 0.00014901 0.00018432 0.00012817]] - [[ 0. 0. 0. 0. ] - [ 0.0378726 0.01056496 0.0101966 0.00310401]]] + [[ 0.00092488 0.00076791 0.00049392 0.00017154] + [ 0.01524494 0.00450173 0.01055075 0.01043819]]] domain=10000 type=multiplicity matrix -[[ 1.00091199 1. ] - [ 0. 1. ]] -[[ 0.03596231 0.40406102] - [ 0. 0.11556054]] +[[ 1. 1.] + [ 1. 1.]] +[[ 0.07851646 0.68718427] + [ 1.41421356 0.04113035]] domain=10000 type=nu-fission matrix -[[ 0.01768789 0. ] - [ 0.41868231 0. ]] -[[ 0.00118211 0. ] - [ 0.03684218 0. ]] +[[ 0.02014243 0. ] + [ 0.45436647 0. ]] +[[ 0.00314909 0. ] + [ 0.02742551 0. ]] domain=10000 type=chi -[ 0.95000711 0. ] -[ 0.07214945 0. ] +[ 1. 0.] +[ 0.04607052 0. ] domain=10000 type=chi-prompt -[ 0.94989853 0. ] -[ 0.07156216 0. ] +[ 0.9914425 0. ] +[ 0.05093465 0. ] domain=10000 type=velocity -[ 17726682.88576092 355801.95919094] -[ 912304.37589157 26699.39400479] +[ 17515210.62039675 350171.99519401] +[ 1438175.27389879 29945.93169673] domain=10000 type=prompt-nu-fission -[ 0.01850303 0.45879077] -[ 0.00053983 0.03426049] +[ 0.01923922 0.46671903] +[ 0.00130951 0.04141087] domain=10001 type=total -[ 0.31589603 0.30072552] -[ 0.01039063 0.0279948 ] +[ 0.31373767 0.3008214 ] +[ 0.0155819 0.02805245] domain=10001 type=transport -[ 0.27104783 0.32663403] -[ 0.01242444 0.06732111] +[ 0.27322787 0.31237484] +[ 0.03311537 0.04960583] domain=10001 type=nu-transport -[ 0.27104783 0.32663403] -[ 0.01242444 0.06732111] +[ 0.27322787 0.31237484] +[ 0.03311537 0.04960583] domain=10001 type=absorption -[ 0.00126653 0.00530484] -[ 0.00027329 0.00054437] +[ 0.00157499 0.00540038] +[ 0.00032255 0.00061814] domain=10001 type=capture -[ 0.00126653 0.00530484] -[ 0.00027329 0.00054437] +[ 0.00157499 0.00540038] +[ 0.00032255 0.00061814] domain=10001 type=fission [ 0. 0.] [ 0. 0.] @@ -97,38 +97,38 @@ domain=10001 type=kappa-fission [ 0. 0.] [ 0. 0.] domain=10001 type=scatter -[ 0.3146295 0.29542068] -[ 0.01028598 0.02745453] +[ 0.31216268 0.29542102] +[ 0.01532192 0.02744549] domain=10001 type=nu-scatter -[ 0.31011079 0.29015956] -[ 0.01217247 0.06236369] +[ 0.31012074 0.29626427] +[ 0.03378811 0.04379223] domain=10001 type=scatter matrix -[[[ 0.31011079 0.04197025 0.03385311 0.00735142] +[[[ 0.31012074 0.03822959 0.02074494 0.0079643 ] [ 0. 0. 0. 0. ]] [[ 0. 0. 0. 0. ] - [ 0.29015956 -0.02638196 0.01221917 -0.01057754]]] -[[[ 0.01217247 0.00442067 0.00236562 0.0053074 ] + [ 0.29626427 -0.01121364 0.00883657 -0.00327007]]] +[[[ 0.03378811 0.008484 0.00469561 0.00373162] [ 0. 0. 0. 0. ]] [[ 0. 0. 0. 0. ] - [ 0.06236369 0.00984106 0.0126671 0.009591 ]]] + [ 0.04379223 0.01618037 0.01150396 0.00732885]]] domain=10001 type=nu-scatter matrix -[[[ 0.31011079 0.04197025 0.03385311 0.00735142] +[[[ 0.31012074 0.03822959 0.02074494 0.0079643 ] [ 0. 0. 0. 0. ]] [[ 0. 0. 0. 0. ] - [ 0.29015956 -0.02638196 0.01221917 -0.01057754]]] -[[[ 0.01217247 0.00442067 0.00236562 0.0053074 ] + [ 0.29626427 -0.01121364 0.00883657 -0.00327007]]] +[[[ 0.03378811 0.008484 0.00469561 0.00373162] [ 0. 0. 0. 0. ]] [[ 0. 0. 0. 0. ] - [ 0.06236369 0.00984106 0.0126671 0.009591 ]]] + [ 0.04379223 0.01618037 0.01150396 0.00732885]]] domain=10001 type=multiplicity matrix [[ 1. 0.] [ 0. 1.]] -[[ 0.03025768 0. ] - [ 0. 0.2173913 ]] +[[ 0.1087787 0. ] + [ 0. 0.14242717]] domain=10001 type=nu-fission matrix [[ 0. 0.] [ 0. 0.]] @@ -141,26 +141,26 @@ domain=10001 type=chi-prompt [ 0. 0.] [ 0. 0.] domain=10001 type=velocity -[ 17612034.94932026 340983.9144147 ] -[ 659484.31513854 34989.69457459] +[ 16677839.49736623 334953.36760125] +[ 1266444.30951813 38336.78162568] domain=10001 type=prompt-nu-fission [ 0. 0.] [ 0. 0.] domain=10002 type=total -[ 0.67620548 2.02125348] -[ 0.02134983 0.14050739] +[ 0.66457226 2.05238401] +[ 0.03121475 0.22434291] domain=10002 type=transport -[ 0.29203886 1.4739065 ] -[ 0.01113636 0.10290272] +[ 0.29056526 1.51643801] +[ 0.02385185 0.23519727] domain=10002 type=nu-transport -[ 0.29203886 1.4739065 ] -[ 0.01113636 0.10290272] +[ 0.29056526 1.51643801] +[ 0.02385185 0.23519727] domain=10002 type=absorption -[ 0.00068579 0.03074796] -[ 3.68158517e-05 2.25078842e-03] +[ 0.0006904 0.03168726] +[ 4.41475687e-05 3.74655858e-03] domain=10002 type=capture -[ 0.00068579 0.03074796] -[ 3.68158517e-05 2.25078842e-03] +[ 0.0006904 0.03168726] +[ 4.41475687e-05 3.74655858e-03] domain=10002 type=fission [ 0. 0.] [ 0. 0.] @@ -171,38 +171,38 @@ domain=10002 type=kappa-fission [ 0. 0.] [ 0. 0.] domain=10002 type=scatter -[ 0.67551968 1.99050553] -[ 0.02133857 0.13826068] +[ 0.66388186 2.02069676] +[ 0.03117268 0.22060445] domain=10002 type=nu-scatter -[ 0.67767343 1.99516952] -[ 0.01508282 0.10853715] +[ 0.6712692 2.03538833] +[ 0.02618637 0.25806033] domain=10002 type=scatter matrix -[[[ 0.6469338 0.38638204 0.15208191 0.00907726] - [ 0.03073963 0.00912198 -0.00378942 -0.00414448]] +[[[ 6.39901485e-01 3.81167449e-01 1.52391898e-01 9.14802229e-03] + [ 3.13677198e-02 8.75772321e-03 -2.56790106e-03 -3.78480288e-03]] - [[ 0. 0. 0. 0. ] - [ 1.99516952 0.50320636 0.11400654 0.03222921]]] -[[[ 0.01490544 0.00783787 0.00444992 0.00269273] - [ 0.00071472 0.00043674 0.00068793 0.00030916]] + [[ 4.43343134e-04 3.99960414e-04 3.19562707e-04 2.13846969e-04] + [ 2.03494499e+00 5.09940513e-01 1.11174609e-01 2.49884357e-02]]] +[[[ 2.47091228e-02 1.62432649e-02 8.15627770e-03 3.88856214e-03] + [ 1.72811290e-03 9.25670501e-04 1.01398475e-03 8.17075571e-04]] - [[ 0. 0. 0. 0. ] - [ 0.10853715 0.03505779 0.009685 0.014426 ]]] + [[ 4.44850393e-04 4.01320183e-04 3.20649143e-04 2.14573997e-04] + [ 2.57799889e-01 5.12359063e-02 1.30198170e-02 8.31235256e-03]]] domain=10002 type=nu-scatter matrix -[[[ 0.6469338 0.38638204 0.15208191 0.00907726] - [ 0.03073963 0.00912198 -0.00378942 -0.00414448]] +[[[ 6.39901485e-01 3.81167449e-01 1.52391898e-01 9.14802229e-03] + [ 3.13677198e-02 8.75772321e-03 -2.56790106e-03 -3.78480288e-03]] - [[ 0. 0. 0. 0. ] - [ 1.99516952 0.50320636 0.11400654 0.03222921]]] -[[[ 0.01490544 0.00783787 0.00444992 0.00269273] - [ 0.00071472 0.00043674 0.00068793 0.00030916]] + [[ 4.43343134e-04 3.99960414e-04 3.19562707e-04 2.13846969e-04] + [ 2.03494499e+00 5.09940513e-01 1.11174609e-01 2.49884357e-02]]] +[[[ 2.47091228e-02 1.62432649e-02 8.15627770e-03 3.88856214e-03] + [ 1.72811290e-03 9.25670501e-04 1.01398475e-03 8.17075571e-04]] - [[ 0. 0. 0. 0. ] - [ 0.10853715 0.03505779 0.009685 0.014426 ]]] + [[ 4.44850393e-04 4.01320183e-04 3.20649143e-04 2.14573997e-04] + [ 2.57799889e-01 5.12359063e-02 1.30198170e-02 8.31235256e-03]]] domain=10002 type=multiplicity matrix [[ 1. 1.] - [ 0. 1.]] -[[ 0.02036446 0.02083786] - [ 0. 0.05943471]] + [ 1. 1.]] +[[ 0.03860919 0.06766735] + [ 1.41421356 0.13592921]] domain=10002 type=nu-fission matrix [[ 0. 0.] [ 0. 0.]] @@ -215,8 +215,8 @@ domain=10002 type=chi-prompt [ 0. 0.] [ 0. 0.] domain=10002 type=velocity -[ 16974477.47368938 338442.26464518] -[ 850676.35712708 24773.82692619] +[ 16605562.87322706 328412.03865003] +[ 1042435.52374236 38828.43572983] domain=10002 type=prompt-nu-fission [ 0. 0.] [ 0. 0.] From f2b7709981892451db63b5ffedc08446849cba74 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Thu, 7 Jul 2016 11:24:02 -0400 Subject: [PATCH 10/17] updated mgxs library hdf5 test results --- tests/test_mgxs_library_hdf5/results_true.dat | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_mgxs_library_hdf5/results_true.dat b/tests/test_mgxs_library_hdf5/results_true.dat index af06a5a43f..ad25d4c81c 100644 --- a/tests/test_mgxs_library_hdf5/results_true.dat +++ b/tests/test_mgxs_library_hdf5/results_true.dat @@ -67,8 +67,8 @@ domain=10000 type=chi-prompt [ 0.9914425 0. ] [ 0.05093465 0. ] domain=10000 type=velocity -[ 17515210.62039675 350171.99519401] -[ 1438175.27389879 29945.93169673] +[ 17515210.62039744 350171.995194 ] +[ 1438175.27389862 29945.93169671] domain=10000 type=prompt-nu-fission [ 0.01923922 0.46671903] [ 0.00130951 0.04141087] @@ -141,8 +141,8 @@ domain=10001 type=chi-prompt [ 0. 0.] [ 0. 0.] domain=10001 type=velocity -[ 16677839.49736623 334953.36760125] -[ 1266444.30951813 38336.78162568] +[ 16677839.497365 334953.36760126] +[ 1266444.30951798 38336.7816257 ] domain=10001 type=prompt-nu-fission [ 0. 0.] [ 0. 0.] @@ -215,8 +215,8 @@ domain=10002 type=chi-prompt [ 0. 0.] [ 0. 0.] domain=10002 type=velocity -[ 16605562.87322706 328412.03865003] -[ 1042435.52374236 38828.43572983] +[ 16605562.87322657 328412.03865004] +[ 1042435.52374247 38828.43572985] domain=10002 type=prompt-nu-fission [ 0. 0.] [ 0. 0.] From e890b4855b47f1e3a974d90700e534654fb3c012 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Thu, 7 Jul 2016 11:28:09 -0400 Subject: [PATCH 11/17] removed extra spaces in tally.F90 --- src/tally.F90 | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/tally.F90 b/src/tally.F90 index 6c4bb02bdd..b5f6bea7d9 100644 --- a/src/tally.F90 +++ b/src/tally.F90 @@ -463,9 +463,7 @@ contains * nuclides(p % event_nuclide) % nu(E, EMISSION_PROMPT) & / micro_xs(p % event_nuclide) % absorption else - score = ZERO - end if else ! Skip any non-fission events From b66b381defc36b9348baf861cf11f8271a4f2a8c Mon Sep 17 00:00:00 2001 From: samuel shaner Date: Thu, 7 Jul 2016 16:03:00 +0000 Subject: [PATCH 12/17] updated mgxs library hdf5 test results --- tests/test_mgxs_library_hdf5/results_true.dat | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_mgxs_library_hdf5/results_true.dat b/tests/test_mgxs_library_hdf5/results_true.dat index ad25d4c81c..d757944925 100644 --- a/tests/test_mgxs_library_hdf5/results_true.dat +++ b/tests/test_mgxs_library_hdf5/results_true.dat @@ -67,8 +67,8 @@ domain=10000 type=chi-prompt [ 0.9914425 0. ] [ 0.05093465 0. ] domain=10000 type=velocity -[ 17515210.62039744 350171.995194 ] -[ 1438175.27389862 29945.93169671] +[ 17515210.62039676 350171.99519401] +[ 1438175.27389879 29945.93169673] domain=10000 type=prompt-nu-fission [ 0.01923922 0.46671903] [ 0.00130951 0.04141087] @@ -141,8 +141,8 @@ domain=10001 type=chi-prompt [ 0. 0.] [ 0. 0.] domain=10001 type=velocity -[ 16677839.497365 334953.36760126] -[ 1266444.30951798 38336.7816257 ] +[ 16677839.49736621 334953.36760125] +[ 1266444.30951813 38336.78162568] domain=10001 type=prompt-nu-fission [ 0. 0.] [ 0. 0.] @@ -215,8 +215,8 @@ domain=10002 type=chi-prompt [ 0. 0.] [ 0. 0.] domain=10002 type=velocity -[ 16605562.87322657 328412.03865004] -[ 1042435.52374247 38828.43572985] +[ 16605562.87322708 328412.03865003] +[ 1042435.52374238 38828.43572983] domain=10002 type=prompt-nu-fission [ 0. 0.] [ 0. 0.] From 864156c28243321a4b48de24e955c1141a294450 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Thu, 7 Jul 2016 12:39:05 -0400 Subject: [PATCH 13/17] simplified helper functions for tallying neutron production with energy out filter --- src/tally.F90 | 235 +++++++++++++------------------------------------- 1 file changed, 59 insertions(+), 176 deletions(-) diff --git a/src/tally.F90 b/src/tally.F90 index b5f6bea7d9..aa4da6b18a 100644 --- a/src/tally.F90 +++ b/src/tally.F90 @@ -407,7 +407,7 @@ contains ! neutrons were emitted with different energies, multiple ! outgoing energy bins may have been scored to. The following ! logic treats this special case and results to multiple bins - call score_fission_eout_ce(p, t, score_index) + call score_fission_eout_ce(p, t, score_index, score_bin) cycle SCORE_LOOP end if end if @@ -450,7 +450,7 @@ contains ! neutrons were emitted with different energies, multiple ! outgoing energy bins may have been scored to. The following ! logic treats this special case and results to multiple bins - call score_fission_prompt_eout(p, t, score_index) + call score_fission_eout_ce(p, t, score_index, score_bin) cycle SCORE_LOOP end if end if @@ -522,7 +522,7 @@ contains ! neutrons were emitted with different energies, multiple ! outgoing energy bins may have been scored to. The following ! logic treats this special case and results to multiple bins - call score_fission_delayed_eout(p, t, score_index) + call score_fission_eout_ce(p, t, score_index, score_bin) cycle SCORE_LOOP end if end if @@ -1576,12 +1576,18 @@ contains ! neutrons produced with different energies. !=============================================================================== - subroutine score_fission_eout_ce(p, t, i_score) - type(Particle), intent(in) :: p + subroutine score_fission_eout_ce(p, t, i_score, score_bin) + + type(Particle), intent(in) :: p type(TallyObject), intent(inout) :: t - integer, intent(in) :: i_score ! index for score + integer, intent(in) :: i_score ! index for score + integer, intent(in) :: score_bin integer :: i ! index of outgoing energy filter + integer :: j ! index of delayedgroup filter + integer :: d ! delayed group + integer :: g ! another delayed group + integer :: d_bin ! delayed group bin index integer :: n ! number of energies on filter integer :: k ! loop index for bank sites integer :: bin_energyout ! original outgoing energy bin @@ -1603,6 +1609,10 @@ contains ! loop over number of particles banked do k = 1, p % n_bank + + ! get the delayed group + g = fission_bank(n_bank - p % n_bank + k) % delayed_group + ! determine score based on bank site weight and keff score = keff * fission_bank(n_bank - p % n_bank + k) % wgt @@ -1616,13 +1626,51 @@ contains ! change outgoing energy bin matching_bins(i) = binary_search(t % filters(i) % real_bins, n, E_out) - ! determine scoring index - i_filter = sum((matching_bins(1:t%n_filters) - 1) * t % stride) + 1 + ! Case for tallying prompt neutrons + if (score_bin == SCORE_NU_FISSION .OR. \ + (score_bin == SCORE_PROMPT_NU_FISSION .AND. g == 0)) then - ! Add score to tally + ! determine scoring index + i_filter = sum((matching_bins(1:t%n_filters) - 1) * t % stride) + 1 + + ! Add score to tally + !$omp atomic + t % results(i_score, i_filter) % value = & + t % results(i_score, i_filter) % value + score + + ! Case for tallying delayed emissions + else if (score_bin == SCORE_DELAYED_NU_FISSION .AND. g /= 0) then + + ! Get the index of delayed group filter + j = t % find_filter(FILTER_DELAYEDGROUP) + + ! if the delayed group filter is present, tally to corresponding + ! delayed group bin if it exists + if (j > 0) then + + ! loop over delayed group bins until the corresponding bin is found + do d_bin = 1, t % filters(j) % n_bins + d = t % filters(j) % int_bins(d_bin) + + ! check whether the delayed group of the particle is equal to the + ! delayed group of this bin + if (d == g) then + call score_fission_delayed_dg(t, d_bin, score, i_score) + end if + end do + + ! if the delayed group filter is not present, add score to tally + else + + ! determine scoring index + i_filter = sum((matching_bins(1:t%n_filters) - 1) * t % stride) + 1 + + ! Add score to tally !$omp atomic - t % results(i_score, i_filter) % value = & - t % results(i_score, i_filter) % value + score + t % results(i_score, i_filter) % value = & + t % results(i_score, i_filter) % value + score + end if + end if end do ! reset outgoing energy bin and score index @@ -1708,171 +1756,6 @@ contains end subroutine score_fission_eout_mg -!=============================================================================== -! SCORE_FISSION_PROMPT_EOUT handles a special case where we need to store -! prompt neutron production rate with an outgoing energy filter (think of a -! fission matrix). In this case, we may need to score to multiple bins if there -! were multiple neutrons produced with different energies. -!=============================================================================== - - subroutine score_fission_prompt_eout(p, t, i_score) - - type(Particle), intent(in) :: p - type(TallyObject), intent(inout) :: t - integer, intent(in) :: i_score ! index for score - - integer :: i ! index of outgoing energy filter - integer :: g ! delayed group - integer :: n ! number of energies on filter - integer :: k ! loop index for bank sites - integer :: bin_energyout ! original outgoing energy bin - integer :: i_filter ! index for matching filter bin combination - real(8) :: score ! actual score - real(8) :: E_out ! energy of fission bank site - - ! Save original outgoing energy bin - i = t % find_filter(FILTER_ENERGYOUT) - bin_energyout = matching_bins(i) - - ! Get number of energies on filter - n = size(t % filters(i) % real_bins) - - ! Since the creation of fission sites is weighted such that it is - ! expected to create n_particles sites, we need to multiply the - ! score by keff to get the true delayed-nu-fission rate. - - ! loop over number of particles banked - do k = 1, p % n_bank - - ! get the delayed group - g = fission_bank(n_bank - p % n_bank + k) % delayed_group - - ! check if the particle was born prompt - if (g == 0) then - - ! determine score based on bank site weight and keff - score = keff * fission_bank(n_bank - p % n_bank + k) % wgt - - ! determine outgoing energy from fission bank - E_out = fission_bank(n_bank - p % n_bank + k) % E - - ! check if outgoing energy is within specified range on filter - if (E_out < t % filters(i) % real_bins(1) .or. & - E_out > t % filters(i) % real_bins(n)) cycle - - ! change outgoing energy bin - matching_bins(i) = binary_search(t % filters(i) % real_bins, n, E_out) - - ! determine scoring index - i_filter = sum((matching_bins(1:t%n_filters) - 1) * t % stride) + 1 - - ! Add score to tally -!$omp atomic - t % results(i_score, i_filter) % value = & - t % results(i_score, i_filter) % value + score - end if - end do - - ! reset outgoing energy bin - matching_bins(i) = bin_energyout - - end subroutine score_fission_prompt_eout - -!=============================================================================== -! SCORE_FISSION_DELAYED_EOUT handles a special case where we need to store -! delayed neutron production rate with an outgoing energy filter (think of a -! fission matrix). In this case, we may need to score to multiple bins if there -! were multiple neutrons produced with different energies. -!=============================================================================== - - subroutine score_fission_delayed_eout(p, t, i_score) - - type(Particle), intent(in) :: p - type(TallyObject), intent(inout) :: t - integer, intent(in) :: i_score ! index for score - - integer :: i ! index of outgoing energy filter - integer :: j ! index of delayedgroup filter - integer :: d ! delayed group - integer :: g ! another delayed group - integer :: d_bin ! delayed group bin index - integer :: n ! number of energies on filter - integer :: k ! loop index for bank sites - integer :: bin_energyout ! original outgoing energy bin - integer :: i_filter ! index for matching filter bin combination - real(8) :: score ! actual score - real(8) :: E_out ! energy of fission bank site - - ! Save original outgoing energy bin - i = t % find_filter(FILTER_ENERGYOUT) - bin_energyout = matching_bins(i) - - ! Get the index of delayed group filter - j = t % find_filter(FILTER_DELAYEDGROUP) - - ! Get number of energies on filter - n = size(t % filters(i) % real_bins) - - ! Since the creation of fission sites is weighted such that it is - ! expected to create n_particles sites, we need to multiply the - ! score by keff to get the true delayed-nu-fission rate. - - ! loop over number of particles banked - do k = 1, p % n_bank - - ! get the delayed group - g = fission_bank(n_bank - p % n_bank + k) % delayed_group - - ! check if the particle was born delayed - if (g /= 0) then - - ! determine score based on bank site weight and keff - score = keff * fission_bank(n_bank - p % n_bank + k) % wgt - - ! determine outgoing energy from fission bank - E_out = fission_bank(n_bank - p % n_bank + k) % E - - ! check if outgoing energy is within specified range on filter - if (E_out < t % filters(i) % real_bins(1) .or. & - E_out > t % filters(i) % real_bins(n)) cycle - - ! change outgoing energy bin - matching_bins(i) = binary_search(t % filters(i) % real_bins, n, E_out) - - ! if the delayed group filter is present, tally to corresponding - ! delayed group bin if it exists - if (j > 0) then - - ! loop over delayed group bins until the corresponding bin is found - do d_bin = 1, t % filters(j) % n_bins - d = t % filters(j) % int_bins(d_bin) - - ! check whether the delayed group of the particle is equal to the - ! delayed group of this bin - if (d == g) then - call score_fission_delayed_dg(t, d_bin, score, i_score) - end if - end do - - ! if the delayed group filter is not present, add score to tally - else - - ! determine scoring index - i_filter = sum((matching_bins(1:t%n_filters) - 1) * t % stride) + 1 - - ! Add score to tally -!$omp atomic - t % results(i_score, i_filter) % value = & - t % results(i_score, i_filter) % value + score - end if - end if - end do - - ! reset outgoing energy bin - matching_bins(i) = bin_energyout - - end subroutine score_fission_delayed_eout - !=============================================================================== ! SCORE_FISSION_DELAYED_DG helper function used to increment the tally when a ! delayed group filter is present. From 2815f1c97794939cd040c8b8e2fb56d18270caf0 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Thu, 7 Jul 2016 14:03:39 -0400 Subject: [PATCH 14/17] forced numpy to print output in scientific notation --- openmc/mgxs/mgxs.py | 1 + tests/test_mgxs_library_hdf5/results_true.dat | 312 +++++++++--------- 2 files changed, 157 insertions(+), 156 deletions(-) diff --git a/openmc/mgxs/mgxs.py b/openmc/mgxs/mgxs.py index d6cd8c2550..de5ae05dc9 100644 --- a/openmc/mgxs/mgxs.py +++ b/openmc/mgxs/mgxs.py @@ -9,6 +9,7 @@ import copy import abc import numpy as np +np.set_printoptions(formatter={'float': lambda x: format(x, '8.6E')}) import openmc import openmc.checkvalue as cv diff --git a/tests/test_mgxs_library_hdf5/results_true.dat b/tests/test_mgxs_library_hdf5/results_true.dat index d757944925..0f83221597 100644 --- a/tests/test_mgxs_library_hdf5/results_true.dat +++ b/tests/test_mgxs_library_hdf5/results_true.dat @@ -1,222 +1,222 @@ domain=10000 type=total -[ 0.41482549 0.66016992] -[ 0.02279291 0.04751893] +[4.148255E-01 6.601699E-01] +[2.279291E-02 4.751893E-02] domain=10000 type=transport -[ 0.35685964 0.64764766] -[ 0.0254936 0.02370374] +[3.568596E-01 6.476477E-01] +[2.549360E-02 2.370374E-02] domain=10000 type=nu-transport -[ 0.35685964 0.64764766] -[ 0.0254936 0.02370374] +[3.568596E-01 6.476477E-01] +[2.549360E-02 2.370374E-02] domain=10000 type=absorption -[ 0.02740784 0.26451074] -[ 0.0026925 0.02336708] +[2.740784E-02 2.645107E-01] +[2.692497E-03 2.336708E-02] domain=10000 type=capture -[ 0.01984455 0.07171935] -[ 0.0026433 0.02520786] +[1.984455E-02 7.171935E-02] +[2.643304E-03 2.520786E-02] domain=10000 type=fission -[ 0.00756329 0.19279139] -[ 0.00050848 0.01710592] +[7.563295E-03 1.927914E-01] +[5.084837E-04 1.710592E-02] domain=10000 type=nu-fission -[ 0.01943174 0.46977478] -[ 0.00132298 0.041682 ] +[1.943174E-02 4.697748E-01] +[1.322976E-03 4.168200E-02] domain=10000 type=kappa-fission -[ 1.47456982 37.28689641] -[ 0.09923532 3.30837772] +[1.474570E+00 3.728690E+01] +[9.923532E-02 3.308378E+00] domain=10000 type=scatter -[ 0.38741765 0.39565918] -[ 0.02062573 0.02512506] +[3.874176E-01 3.956592E-01] +[2.062573E-02 2.512506E-02] domain=10000 type=nu-scatter -[ 0.38518839 0.4123894 ] -[ 0.02694562 0.01542528] +[3.851884E-01 4.123894E-01] +[2.694562E-02 1.542528E-02] domain=10000 type=scatter matrix -[[[ 3.84199458e-01 5.18702843e-02 2.00688453e-02 9.47771571e-03] - [ 9.88930393e-04 -2.07234596e-04 -1.03366181e-04 2.34290623e-04]] +[[[3.841995E-01 5.187028E-02 2.006885E-02 9.477716E-03] + [9.889304E-04 -2.072346E-04 -1.033662E-04 2.342906E-04]] - [[ 9.24639909e-04 -7.67704968e-04 4.93788872e-04 -1.71497229e-04] - [ 4.11464759e-01 1.64817280e-02 6.37149049e-03 -1.04991221e-02]]] -[[[ 0.02700101 0.00698255 0.0028465 0.00223352] - [ 0.00048242 0.00014901 0.00018432 0.00012817]] + [[9.246399E-04 -7.677050E-04 4.937889E-04 -1.714972E-04] + [4.114648E-01 1.648173E-02 6.371490E-03 -1.049912E-02]]] +[[[2.700101E-02 6.982549E-03 2.846495E-03 2.233520E-03] + [4.824194E-04 1.490108E-04 1.843163E-04 1.281731E-04]] - [[ 0.00092488 0.00076791 0.00049392 0.00017154] - [ 0.01524494 0.00450173 0.01055075 0.01043819]]] + [[9.248835E-04 7.679072E-04 4.939189E-04 1.715424E-04] + [1.524494E-02 4.501728E-03 1.055075E-02 1.043819E-02]]] domain=10000 type=nu-scatter matrix -[[[ 3.84199458e-01 5.18702843e-02 2.00688453e-02 9.47771571e-03] - [ 9.88930393e-04 -2.07234596e-04 -1.03366181e-04 2.34290623e-04]] +[[[3.841995E-01 5.187028E-02 2.006885E-02 9.477716E-03] + [9.889304E-04 -2.072346E-04 -1.033662E-04 2.342906E-04]] - [[ 9.24639909e-04 -7.67704968e-04 4.93788872e-04 -1.71497229e-04] - [ 4.11464759e-01 1.64817280e-02 6.37149049e-03 -1.04991221e-02]]] -[[[ 0.02700101 0.00698255 0.0028465 0.00223352] - [ 0.00048242 0.00014901 0.00018432 0.00012817]] + [[9.246399E-04 -7.677050E-04 4.937889E-04 -1.714972E-04] + [4.114648E-01 1.648173E-02 6.371490E-03 -1.049912E-02]]] +[[[2.700101E-02 6.982549E-03 2.846495E-03 2.233520E-03] + [4.824194E-04 1.490108E-04 1.843163E-04 1.281731E-04]] - [[ 0.00092488 0.00076791 0.00049392 0.00017154] - [ 0.01524494 0.00450173 0.01055075 0.01043819]]] + [[9.248835E-04 7.679072E-04 4.939189E-04 1.715424E-04] + [1.524494E-02 4.501728E-03 1.055075E-02 1.043819E-02]]] domain=10000 type=multiplicity matrix -[[ 1. 1.] - [ 1. 1.]] -[[ 0.07851646 0.68718427] - [ 1.41421356 0.04113035]] +[[1.000000E+00 1.000000E+00] + [1.000000E+00 1.000000E+00]] +[[7.851646E-02 6.871843E-01] + [1.414214E+00 4.113035E-02]] domain=10000 type=nu-fission matrix -[[ 0.02014243 0. ] - [ 0.45436647 0. ]] -[[ 0.00314909 0. ] - [ 0.02742551 0. ]] +[[2.014243E-02 0.000000E+00] + [4.543665E-01 0.000000E+00]] +[[3.149092E-03 0.000000E+00] + [2.742551E-02 0.000000E+00]] domain=10000 type=chi -[ 1. 0.] -[ 0.04607052 0. ] +[1.000000E+00 0.000000E+00] +[4.607052E-02 0.000000E+00] domain=10000 type=chi-prompt -[ 0.9914425 0. ] -[ 0.05093465 0. ] +[9.914425E-01 0.000000E+00] +[5.093465E-02 0.000000E+00] domain=10000 type=velocity -[ 17515210.62039676 350171.99519401] -[ 1438175.27389879 29945.93169673] +[1.751521E+07 3.501720E+05] +[1.438175E+06 2.994593E+04] domain=10000 type=prompt-nu-fission -[ 0.01923922 0.46671903] -[ 0.00130951 0.04141087] +[1.923922E-02 4.667190E-01] +[1.309506E-03 4.141087E-02] domain=10001 type=total -[ 0.31373767 0.3008214 ] -[ 0.0155819 0.02805245] +[3.137377E-01 3.008214E-01] +[1.558190E-02 2.805245E-02] domain=10001 type=transport -[ 0.27322787 0.31237484] -[ 0.03311537 0.04960583] +[2.732279E-01 3.123748E-01] +[3.311537E-02 4.960583E-02] domain=10001 type=nu-transport -[ 0.27322787 0.31237484] -[ 0.03311537 0.04960583] +[2.732279E-01 3.123748E-01] +[3.311537E-02 4.960583E-02] domain=10001 type=absorption -[ 0.00157499 0.00540038] -[ 0.00032255 0.00061814] +[1.574991E-03 5.400379E-03] +[3.225479E-04 6.181383E-04] domain=10001 type=capture -[ 0.00157499 0.00540038] -[ 0.00032255 0.00061814] +[1.574991E-03 5.400379E-03] +[3.225479E-04 6.181383E-04] domain=10001 type=fission -[ 0. 0.] -[ 0. 0.] +[0.000000E+00 0.000000E+00] +[0.000000E+00 0.000000E+00] domain=10001 type=nu-fission -[ 0. 0.] -[ 0. 0.] +[0.000000E+00 0.000000E+00] +[0.000000E+00 0.000000E+00] domain=10001 type=kappa-fission -[ 0. 0.] -[ 0. 0.] +[0.000000E+00 0.000000E+00] +[0.000000E+00 0.000000E+00] domain=10001 type=scatter -[ 0.31216268 0.29542102] -[ 0.01532192 0.02744549] +[3.121627E-01 2.954210E-01] +[1.532192E-02 2.744549E-02] domain=10001 type=nu-scatter -[ 0.31012074 0.29626427] -[ 0.03378811 0.04379223] +[3.101207E-01 2.962643E-01] +[3.378811E-02 4.379223E-02] domain=10001 type=scatter matrix -[[[ 0.31012074 0.03822959 0.02074494 0.0079643 ] - [ 0. 0. 0. 0. ]] +[[[3.101207E-01 3.822959E-02 2.074494E-02 7.964297E-03] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0. 0. ] - [ 0.29626427 -0.01121364 0.00883657 -0.00327007]]] -[[[ 0.03378811 0.008484 0.00469561 0.00373162] - [ 0. 0. 0. 0. ]] + [[0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [2.962643E-01 -1.121364E-02 8.836566E-03 -3.270067E-03]]] +[[[3.378811E-02 8.483997E-03 4.695611E-03 3.731623E-03] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0. 0. ] - [ 0.04379223 0.01618037 0.01150396 0.00732885]]] + [[0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [4.379223E-02 1.618037E-02 1.150396E-02 7.328846E-03]]] domain=10001 type=nu-scatter matrix -[[[ 0.31012074 0.03822959 0.02074494 0.0079643 ] - [ 0. 0. 0. 0. ]] +[[[3.101207E-01 3.822959E-02 2.074494E-02 7.964297E-03] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0. 0. ] - [ 0.29626427 -0.01121364 0.00883657 -0.00327007]]] -[[[ 0.03378811 0.008484 0.00469561 0.00373162] - [ 0. 0. 0. 0. ]] + [[0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [2.962643E-01 -1.121364E-02 8.836566E-03 -3.270067E-03]]] +[[[3.378811E-02 8.483997E-03 4.695611E-03 3.731623E-03] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0. 0. ] - [ 0.04379223 0.01618037 0.01150396 0.00732885]]] + [[0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [4.379223E-02 1.618037E-02 1.150396E-02 7.328846E-03]]] domain=10001 type=multiplicity matrix -[[ 1. 0.] - [ 0. 1.]] -[[ 0.1087787 0. ] - [ 0. 0.14242717]] +[[1.000000E+00 0.000000E+00] + [0.000000E+00 1.000000E+00]] +[[1.087787E-01 0.000000E+00] + [0.000000E+00 1.424272E-01]] domain=10001 type=nu-fission matrix -[[ 0. 0.] - [ 0. 0.]] -[[ 0. 0.] - [ 0. 0.]] +[[0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00]] +[[0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00]] domain=10001 type=chi -[ 0. 0.] -[ 0. 0.] +[0.000000E+00 0.000000E+00] +[0.000000E+00 0.000000E+00] domain=10001 type=chi-prompt -[ 0. 0.] -[ 0. 0.] +[0.000000E+00 0.000000E+00] +[0.000000E+00 0.000000E+00] domain=10001 type=velocity -[ 16677839.49736621 334953.36760125] -[ 1266444.30951813 38336.78162568] +[1.667784E+07 3.349534E+05] +[1.266444E+06 3.833678E+04] domain=10001 type=prompt-nu-fission -[ 0. 0.] -[ 0. 0.] +[0.000000E+00 0.000000E+00] +[0.000000E+00 0.000000E+00] domain=10002 type=total -[ 0.66457226 2.05238401] -[ 0.03121475 0.22434291] +[6.645723E-01 2.052384E+00] +[3.121475E-02 2.243429E-01] domain=10002 type=transport -[ 0.29056526 1.51643801] -[ 0.02385185 0.23519727] +[2.905653E-01 1.516438E+00] +[2.385185E-02 2.351973E-01] domain=10002 type=nu-transport -[ 0.29056526 1.51643801] -[ 0.02385185 0.23519727] +[2.905653E-01 1.516438E+00] +[2.385185E-02 2.351973E-01] domain=10002 type=absorption -[ 0.0006904 0.03168726] -[ 4.41475687e-05 3.74655858e-03] +[6.903995E-04 3.168726E-02] +[4.414757E-05 3.746559E-03] domain=10002 type=capture -[ 0.0006904 0.03168726] -[ 4.41475687e-05 3.74655858e-03] +[6.903995E-04 3.168726E-02] +[4.414757E-05 3.746559E-03] domain=10002 type=fission -[ 0. 0.] -[ 0. 0.] +[0.000000E+00 0.000000E+00] +[0.000000E+00 0.000000E+00] domain=10002 type=nu-fission -[ 0. 0.] -[ 0. 0.] +[0.000000E+00 0.000000E+00] +[0.000000E+00 0.000000E+00] domain=10002 type=kappa-fission -[ 0. 0.] -[ 0. 0.] +[0.000000E+00 0.000000E+00] +[0.000000E+00 0.000000E+00] domain=10002 type=scatter -[ 0.66388186 2.02069676] -[ 0.03117268 0.22060445] +[6.638819E-01 2.020697E+00] +[3.117268E-02 2.206045E-01] domain=10002 type=nu-scatter -[ 0.6712692 2.03538833] -[ 0.02618637 0.25806033] +[6.712692E-01 2.035388E+00] +[2.618637E-02 2.580603E-01] domain=10002 type=scatter matrix -[[[ 6.39901485e-01 3.81167449e-01 1.52391898e-01 9.14802229e-03] - [ 3.13677198e-02 8.75772321e-03 -2.56790106e-03 -3.78480288e-03]] +[[[6.399015E-01 3.811674E-01 1.523919E-01 9.148022E-03] + [3.136772E-02 8.757723E-03 -2.567901E-03 -3.784803E-03]] - [[ 4.43343134e-04 3.99960414e-04 3.19562707e-04 2.13846969e-04] - [ 2.03494499e+00 5.09940513e-01 1.11174609e-01 2.49884357e-02]]] -[[[ 2.47091228e-02 1.62432649e-02 8.15627770e-03 3.88856214e-03] - [ 1.72811290e-03 9.25670501e-04 1.01398475e-03 8.17075571e-04]] + [[4.433431E-04 3.999604E-04 3.195627E-04 2.138470E-04] + [2.034945E+00 5.099405E-01 1.111746E-01 2.498844E-02]]] +[[[2.470912E-02 1.624326E-02 8.156278E-03 3.888562E-03] + [1.728113E-03 9.256705E-04 1.013985E-03 8.170756E-04]] - [[ 4.44850393e-04 4.01320183e-04 3.20649143e-04 2.14573997e-04] - [ 2.57799889e-01 5.12359063e-02 1.30198170e-02 8.31235256e-03]]] + [[4.448504E-04 4.013202E-04 3.206491E-04 2.145740E-04] + [2.577999E-01 5.123591E-02 1.301982E-02 8.312353E-03]]] domain=10002 type=nu-scatter matrix -[[[ 6.39901485e-01 3.81167449e-01 1.52391898e-01 9.14802229e-03] - [ 3.13677198e-02 8.75772321e-03 -2.56790106e-03 -3.78480288e-03]] +[[[6.399015E-01 3.811674E-01 1.523919E-01 9.148022E-03] + [3.136772E-02 8.757723E-03 -2.567901E-03 -3.784803E-03]] - [[ 4.43343134e-04 3.99960414e-04 3.19562707e-04 2.13846969e-04] - [ 2.03494499e+00 5.09940513e-01 1.11174609e-01 2.49884357e-02]]] -[[[ 2.47091228e-02 1.62432649e-02 8.15627770e-03 3.88856214e-03] - [ 1.72811290e-03 9.25670501e-04 1.01398475e-03 8.17075571e-04]] + [[4.433431E-04 3.999604E-04 3.195627E-04 2.138470E-04] + [2.034945E+00 5.099405E-01 1.111746E-01 2.498844E-02]]] +[[[2.470912E-02 1.624326E-02 8.156278E-03 3.888562E-03] + [1.728113E-03 9.256705E-04 1.013985E-03 8.170756E-04]] - [[ 4.44850393e-04 4.01320183e-04 3.20649143e-04 2.14573997e-04] - [ 2.57799889e-01 5.12359063e-02 1.30198170e-02 8.31235256e-03]]] + [[4.448504E-04 4.013202E-04 3.206491E-04 2.145740E-04] + [2.577999E-01 5.123591E-02 1.301982E-02 8.312353E-03]]] domain=10002 type=multiplicity matrix -[[ 1. 1.] - [ 1. 1.]] -[[ 0.03860919 0.06766735] - [ 1.41421356 0.13592921]] +[[1.000000E+00 1.000000E+00] + [1.000000E+00 1.000000E+00]] +[[3.860919E-02 6.766735E-02] + [1.414214E+00 1.359292E-01]] domain=10002 type=nu-fission matrix -[[ 0. 0.] - [ 0. 0.]] -[[ 0. 0.] - [ 0. 0.]] +[[0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00]] +[[0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00]] domain=10002 type=chi -[ 0. 0.] -[ 0. 0.] +[0.000000E+00 0.000000E+00] +[0.000000E+00 0.000000E+00] domain=10002 type=chi-prompt -[ 0. 0.] -[ 0. 0.] +[0.000000E+00 0.000000E+00] +[0.000000E+00 0.000000E+00] domain=10002 type=velocity -[ 16605562.87322708 328412.03865003] -[ 1042435.52374238 38828.43572983] +[1.660556E+07 3.284120E+05] +[1.042436E+06 3.882844E+04] domain=10002 type=prompt-nu-fission -[ 0. 0.] -[ 0. 0.] +[0.000000E+00 0.000000E+00] +[0.000000E+00 0.000000E+00] From 3b7026dcabbf9b3da3888731a9b8f9690dbd83d7 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Thu, 7 Jul 2016 14:30:45 -0400 Subject: [PATCH 15/17] updated failing tests due to change in the way mgxs values are printed --- openmc/mgxs/mgxs.py | 4 + tests/test_multipole/results_true.dat | 4 +- tests/test_tally_aggregation/results_true.dat | 2 +- tests/test_tally_arithmetic/results_true.dat | 208 +++++++++--------- 4 files changed, 111 insertions(+), 107 deletions(-) diff --git a/openmc/mgxs/mgxs.py b/openmc/mgxs/mgxs.py index de5ae05dc9..ee5848c7c7 100644 --- a/openmc/mgxs/mgxs.py +++ b/openmc/mgxs/mgxs.py @@ -9,6 +9,10 @@ import copy import abc import numpy as np + +# Require numpy to print output in scientific notation to 6 decimal places. +# This is needed to avoid round off error when large numbers are printed, +# which can cause tests to fail for different build configurations. np.set_printoptions(formatter={'float': lambda x: format(x, '8.6E')}) import openmc diff --git a/tests/test_multipole/results_true.dat b/tests/test_multipole/results_true.dat index d138fa16a9..84666915fc 100644 --- a/tests/test_multipole/results_true.dat +++ b/tests/test_multipole/results_true.dat @@ -1,12 +1,12 @@ k-combined: -1.457760E+00 1.119659E-02 +1.434998E+00 9.402333E-03 Cell ID = 11 Name = Fill = Material 2 Region = -10000 Rotation = None - Temperature = [ 500. 0. 700. 800.] + Temperature = [5.000000E+02 0.000000E+00 7.000000E+02 8.000000E+02] Translation = None Offset = None Distribcell index= 1 diff --git a/tests/test_tally_aggregation/results_true.dat b/tests/test_tally_aggregation/results_true.dat index 6c2d7a5193..0f40c54d10 100644 --- a/tests/test_tally_aggregation/results_true.dat +++ b/tests/test_tally_aggregation/results_true.dat @@ -1 +1 @@ -840d2648f9ba782926c71baa84e5a2ad31331e156740a3d1e9d86af8f1f0d301ef8c0f69474975d365dbcf8d229a68c62d3e60286d18045e5254373f4e1010bf \ No newline at end of file +d7878520296fade8e96498f53209bfc9185b4e518aba5ed598008b1078e4590a7474dfbc60f7efac360350765e37d99b9ea0f90bc47021872ff9888f2315eda9 \ No newline at end of file diff --git a/tests/test_tally_arithmetic/results_true.dat b/tests/test_tally_arithmetic/results_true.dat index ef2741cc12..0f72dafa3c 100644 --- a/tests/test_tally_arithmetic/results_true.dat +++ b/tests/test_tally_arithmetic/results_true.dat @@ -1,134 +1,134 @@ -[[[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]] +[[[0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00]] ..., - [[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]]][[[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00]]][[[0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00]] ..., - [[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]]][[[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00]]][[[0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00]] ..., - [[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]]][[[ 0. 0. 0.] - [ 0. 0. 0.] - [ 0. 0. 0.] - [ 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00]]][[[0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0.] - [ 0. 0. 0.] - [ 0. 0. 0.] - [ 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0.] - [ 0. 0. 0.] - [ 0. 0. 0.] - [ 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00]] ..., - [[ 0. 0. 0.] - [ 0. 0. 0.] - [ 0. 0. 0.] - [ 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0.] - [ 0. 0. 0.] - [ 0. 0. 0.] - [ 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0.] - [ 0. 0. 0.] - [ 0. 0. 0.] - [ 0. 0. 0.]]][[[ 0. 0. 0.] - [ 0. 0. 0.] - [ 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00]]][[[0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0.] - [ 0. 0. 0.] - [ 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0.] - [ 0. 0. 0.] - [ 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00]] ..., - [[ 0. 0. 0.] - [ 0. 0. 0.] - [ 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0.] - [ 0. 0. 0.] - [ 0. 0. 0.]] + [[0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00]] - [[ 0. 0. 0.] - [ 0. 0. 0.] - [ 0. 0. 0.]]] \ No newline at end of file + [[0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00] + [0.000000E+00 0.000000E+00 0.000000E+00]]] \ No newline at end of file From a0806be6f7ee715ecb86f2b8a5dbf97a89fda95d Mon Sep 17 00:00:00 2001 From: samuel shaner Date: Thu, 7 Jul 2016 19:21:41 +0000 Subject: [PATCH 16/17] updated multipole test results --- tests/test_multipole/results_true.dat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_multipole/results_true.dat b/tests/test_multipole/results_true.dat index 84666915fc..133140999c 100644 --- a/tests/test_multipole/results_true.dat +++ b/tests/test_multipole/results_true.dat @@ -1,5 +1,5 @@ k-combined: -1.434998E+00 9.402333E-03 +1.457760E+00 1.119659E-02 Cell ID = 11 Name = From 9757d0adf4198665680e431a4653f6cc3ec7ba9f Mon Sep 17 00:00:00 2001 From: samuel shaner Date: Thu, 7 Jul 2016 19:22:56 +0000 Subject: [PATCH 17/17] updated tally aggregation test results --- tests/test_tally_aggregation/results_true.dat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_tally_aggregation/results_true.dat b/tests/test_tally_aggregation/results_true.dat index 0f40c54d10..365f1d775e 100644 --- a/tests/test_tally_aggregation/results_true.dat +++ b/tests/test_tally_aggregation/results_true.dat @@ -1 +1 @@ -d7878520296fade8e96498f53209bfc9185b4e518aba5ed598008b1078e4590a7474dfbc60f7efac360350765e37d99b9ea0f90bc47021872ff9888f2315eda9 \ No newline at end of file +d5c21b44afd44a6e2be483090db0e2525d7d7cdbee1c02bee43621f1889193cc4712d74e28b3961a9ea9be093b33b56633046749a70f40c68982d6ca653d4cc1 \ No newline at end of file