Fixed failing build and renamed more Xsdatas to XSdata

This commit is contained in:
Adam Nelson 2016-01-07 20:31:56 -05:00
parent 05b600819a
commit 75093ea43d
3 changed files with 21 additions and 18 deletions

View file

@ -20,7 +20,7 @@ groups = openmc.mgxs.EnergyGroups(group_edges=[1E-11, 0.0635E-6, 10.0E-6,
1.0E-4, 1.0E-3, 0.5, 1.0, 20.0])
# Instantiate the 7-group (C5G7) cross section data
uo2_xsdata = openmc.Xsdata('UO2.300k', groups)
uo2_xsdata = openmc.XSdata('UO2.300k', groups)
uo2_xsdata.order = 0
uo2_xsdata.total = np.array([0.1779492, 0.3298048, 0.4803882, 0.5543674,
0.3118013, 0.3951678, 0.5644058])
@ -43,7 +43,7 @@ uo2_xsdata.nu_fission = np.array([2.005998E-02, 2.027303E-03, 1.570599E-02,
uo2_xsdata.chi = np.array([5.8791E-01, 4.1176E-01, 3.3906E-04, 1.1761E-07,
0.0000E+00, 0.0000E+00, 0.0000E+00])
h2o_xsdata = openmc.Xsdata('LWTR.300k', groups)
h2o_xsdata = openmc.XSdata('LWTR.300k', groups)
h2o_xsdata.order = 0
h2o_xsdata.total = np.array([0.15920605, 0.412969593, 0.59030986, 0.58435,
0.718, 1.2544497, 2.650379])

View file

@ -221,7 +221,7 @@ class XSdata(object):
@name.setter
def name(self, name):
check_type('name for Xsdata', name, basestring)
check_type('name for XSdata', name, basestring)
self._name = name
@energy_groups.setter
@ -247,7 +247,7 @@ class XSdata(object):
@alias.setter
def alias(self, alias):
if alias is not None:
check_type('alias for Xsdata', alias, basestring)
check_type('alias for XSdata', alias, basestring)
self._alias = alias
else:
self._alias = self._name
@ -604,24 +604,24 @@ class MGXSLibraryFile(object):
self._energy_groups = energy_groups
def add_xsdata(self, xsdata):
"""Add an xsdata entry to the file.
"""Add an XSdata entry to the file.
Parameters
----------
xsdata : Xsdata
xsdata : XSdata
MGXS information to add
"""
# Check the type
if not isinstance(xsdata, Xsdata):
msg = 'Unable to add a non-Xsdata "{0}" to the ' \
if not isinstance(xsdata, XSdata):
msg = 'Unable to add a non-XSdata "{0}" to the ' \
'MGXSLibraryFile'.format(xsdata)
raise ValueError(msg)
# Make sure energy groups match.
if xsdata.energy_groups != self._energy_groups:
msg = 'Energy groups of Xsdata do not match that of MGXSLibraryFile!'
msg = 'Energy groups of XSdata do not match that of MGXSLibraryFile!'
raise ValueError(msg)
self._xsdatas.append(xsdata)
@ -631,8 +631,8 @@ class MGXSLibraryFile(object):
Parameters
----------
xsdatas : tuple or list of Xsdata
Xsdatas to add
xsdatas : tuple or list of XSdata
XSdatas to add
"""
@ -649,14 +649,14 @@ class MGXSLibraryFile(object):
Parameters
----------
xsdata : Xsdata
Xsdata to remove
xsdata : XSdata
XSdata to remove
"""
if not isinstance(xsdata, Xsdata):
msg = 'Unable to remove a non-Xsdata "{0}" from the ' \
'XsdatasFile'.format(xsdata)
if not isinstance(xsdata, XSdata):
msg = 'Unable to remove a non-XSdata "{0}" from the ' \
'XSdatasFile'.format(xsdata)
raise ValueError(msg)
self._xsdatas.remove(xsdata)

View file

@ -2483,6 +2483,7 @@ contains
integer :: i ! loop index for filters
integer :: j
integer :: n ! number of bins for single filter
integer :: distribcell_index ! index in distribcell arrays
integer :: offset ! offset for distribcell
real(8) :: theta, phi ! Polar and Azimuthal Angles, respectively
real(8) :: E
@ -2528,12 +2529,14 @@ contains
case (FILTER_DISTRIBCELL)
! determine next distribcell bin
distribcell_index = cells(t % filters(i) % int_bins(1)) &
% distribcell_index
matching_bins(i) = NO_BIN_FOUND
offset = 0
do j = 1, p % n_coord
if (cells(p % coord(j) % cell) % type == CELL_FILL) then
offset = offset + cells(p % coord(j) % cell) % &
offset(t % filters(i) % offset)
offset(distribcell_index)
elseif(cells(p % coord(j) % cell) % type == CELL_LATTICE) then
if (lattices(p % coord(j + 1) % lattice) % obj &
% are_valid_indices([&
@ -2541,7 +2544,7 @@ contains
p % coord(j + 1) % lattice_y, &
p % coord(j + 1) % lattice_z])) then
offset = offset + lattices(p % coord(j + 1) % lattice) % obj % &
offset(t % filters(i) % offset, &
offset(distribcell_index, &
p % coord(j + 1) % lattice_x, &
p % coord(j + 1) % lattice_y, &
p % coord(j + 1) % lattice_z)