Merge pull request #472 from smharper/pyapi_summary_sab_bug

Fix PyAPI summary S(alpha,beta) bug
This commit is contained in:
Will Boyd 2015-10-03 16:45:19 -04:00
commit fe43819e90

View file

@ -72,6 +72,9 @@ class Summary(object):
nuc_densities = self._f['materials'][key]['nuclide_densities'][...]
nuclides = self._f['materials'][key]['nuclides'].value
# Create the Material
material = openmc.Material(material_id=material_id, name=name)
# Read the names of the S(a,b) tables for this Material and add them
if 'sab_names' in self._f['materials'][key]:
sab_tables = self._f['materials'][key]['sab_names'].value
@ -79,10 +82,8 @@ class Summary(object):
name, xs = sab_table.decode().split('.')
material.add_s_alpha_beta(name, xs)
# Create the Material
material = openmc.Material(material_id=material_id, name=name)
# Set the Material's density to g/cm3 - this is what is used in OpenMC
# Set the Material's density to g/cm3 - this is what is used in
# OpenMC
material.set_density(density=density, units='g/cm3')
# Add all nuclides to the Material