Merge branch 'multipole' into diff_tally5

This commit is contained in:
Sterling Harper 2016-05-19 21:39:06 -04:00
commit f303b3ed8d
131 changed files with 11847 additions and 9138 deletions

View file

@ -5,9 +5,9 @@ from openmc.stats import Box
class InputSet(object):
def __init__(self):
self.settings = openmc.SettingsFile()
self.materials = openmc.MaterialsFile()
self.geometry = openmc.GeometryFile()
self.settings = openmc.Settings()
self.materials = openmc.Materials()
self.geometry = openmc.Geometry()
self.tallies = None
self.plots = None
@ -267,9 +267,9 @@ class InputSet(object):
# Define the materials file.
self.materials.default_xs = '71c'
self.materials.add_materials((fuel, clad, cold_water, hot_water,
rpv_steel, lower_rad_ref, upper_rad_ref, bot_plate, bot_nozzle,
top_nozzle, top_fa, bot_fa))
self.materials += (fuel, clad, cold_water, hot_water, rpv_steel,
lower_rad_ref, upper_rad_ref, bot_plate,
bot_nozzle, top_nozzle, top_fa, bot_fa)
# Define surfaces.
s1 = openmc.ZCylinder(R=0.41, surface_id=1)
@ -550,11 +550,8 @@ class InputSet(object):
root.add_cells((c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12))
# Define the geometry file.
geometry = openmc.Geometry()
geometry.root_universe = root
self.geometry.geometry = geometry
# Assign root universe to geometry
self.geometry.root_universe = root
def build_default_settings(self):
self.settings.batches = 10
@ -593,7 +590,7 @@ class MGInputSet(InputSet):
# Define the materials file.
self.materials.default_xs = '71c'
self.materials.add_materials((uo2, clad, water))
self.materials += (uo2, clad, water)
# Define surfaces.
@ -630,12 +627,8 @@ class MGInputSet(InputSet):
root.add_cells((c1,c2,c3))
# Define the geometry file.
geometry = openmc.Geometry()
geometry.root_universe = root
self.geometry.geometry = geometry
# Assign root universe to geometry
self.geometry.root_universe = root
def build_default_settings(self):
self.settings.batches = 10
@ -656,8 +649,3 @@ class MGInputSet(InputSet):
plot.color = 'mat'
self.plots.add_plot(plot)

View file

@ -1 +1 @@
b9b4222c4beea80fe6083590f6b785303d174972d80671fb661bac8e030db6f4a61648240cfad6162799361fc0e08a23c61d31aff844d978528d6dad5b5fbc63
9b859eb5501c05b6a652d299bd0cadc0a924ffae31117babbdc9f7f8ca87689322c275818eb0dde0ff5fa78317d8d8f1585b18dcc772e3ff4ed499de8a491dc3

View file

@ -7,8 +7,6 @@ import hashlib
sys.path.insert(0, os.pardir)
from testing_harness import PyAPITestHarness
import openmc
from openmc.source import Source
from openmc.stats import Box
class AsymmetricLatticeTestHarness(PyAPITestHarness):
@ -20,7 +18,7 @@ class AsymmetricLatticeTestHarness(PyAPITestHarness):
self._input_set.build_default_materials_and_geometry()
# Extract universes encapsulating fuel and water assemblies
geometry = self._input_set.geometry.geometry
geometry = self._input_set.geometry
water = geometry.get_universes_by_name('water assembly (hot)')[0]
fuel = geometry.get_universes_by_name('fuel assembly (hot)')[0]
@ -49,19 +47,18 @@ class AsymmetricLatticeTestHarness(PyAPITestHarness):
root_univ.add_cell(root_cell)
# Over-ride geometry in the input set with this 3x3 lattice
self._input_set.geometry.geometry.root_universe = root_univ
self._input_set.geometry.root_universe = root_univ
# Initialize a "distribcell" filter for the fuel pin cell
distrib_filter = openmc.Filter(type='distribcell', bins=[27])
# Initialize the tallies
tally = openmc.Tally(name='distribcell tally', tally_id=27)
tally.add_filter(distrib_filter)
tally.add_score('nu-fission')
tally.filters.append(distrib_filter)
tally.scores.append('nu-fission')
# Initialize the tallies file
tallies_file = openmc.TalliesFile()
tallies_file.add_tally(tally)
tallies_file = openmc.Tallies([tally])
# Assign the tallies file to the input set
self._input_set.tallies = tallies_file
@ -70,7 +67,7 @@ class AsymmetricLatticeTestHarness(PyAPITestHarness):
self._input_set.build_default_settings()
# Specify summary output and correct source sampling box
source = Source(space=Box([-32, -32, 0], [32, 32, 32]))
source = openmc.Source(space=openmc.stats.Box([-32, -32, 0], [32, 32, 32]))
source.space.only_fissionable = True
self._input_set.settings.source = source
self._input_set.settings.output = {'summary': True}
@ -85,11 +82,6 @@ class AsymmetricLatticeTestHarness(PyAPITestHarness):
statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0]
sp = openmc.StatePoint(statepoint)
# Read the summary file
summary = glob.glob(os.path.join(os.getcwd(), 'summary.h5'))[0]
su = openmc.Summary(summary)
sp.link_with_summary(su)
# Extract the tally of interest
tally = sp.get_tally(name='distribcell tally')
@ -99,8 +91,8 @@ class AsymmetricLatticeTestHarness(PyAPITestHarness):
outstr += ', '.join(map(str, tally.std_dev.flatten())) + '\n'
# Extract fuel assembly lattices from the summary
core = su.get_cell_by_id(1)
fuel = su.get_cell_by_id(80)
core = sp.summary.get_cell_by_id(1)
fuel = sp.summary.get_cell_by_id(80)
fuel = fuel.fill
core = core.fill

View file

@ -1 +1 @@
401b8be1b296db7f21ccae089c7ac480044d953b7264ca0ae8e34bb79e24cbb57195bcb568deda6f2f7e07366bbfac408a92306351b9169edd04499723707e1b
96c54eb4f1da175445bf2187449ee32c9ff435d8c60e9421a4a16497aae9f233e3e494f531892dd55f6ac1a06e0240799503ff19e14e2436a0b0f0d83ba56cb8

View file

@ -28,9 +28,8 @@ class DistribmatTestHarness(PyAPITestHarness):
light_fuel.set_density('g/cc', 2.0)
light_fuel.add_nuclide('U-235', 1.0)
mats_file = openmc.MaterialsFile()
mats_file = openmc.Materials([moderator, dense_fuel, light_fuel])
mats_file.default_xs = '71c'
mats_file.add_materials([moderator, dense_fuel, light_fuel])
mats_file.export_to_xml()
@ -74,16 +73,14 @@ class DistribmatTestHarness(PyAPITestHarness):
geometry = openmc.Geometry()
geometry.root_universe = root_univ
geo_file = openmc.GeometryFile()
geo_file.geometry = geometry
geo_file.export_to_xml()
geometry.export_to_xml()
####################
# Settings
####################
sets_file = openmc.SettingsFile()
sets_file = openmc.Settings()
sets_file.batches = 5
sets_file.inactive = 0
sets_file.particles = 1000
@ -96,7 +93,7 @@ class DistribmatTestHarness(PyAPITestHarness):
# Plots
####################
plots_file = openmc.PlotsFile()
plots_file = openmc.Plots()
plot = openmc.Plot(plot_id=1)
plot.basis = 'xy'

View file

@ -1 +1 @@
e0409e0660d58857a6a96ff5cb539ccc41c82f0e443e8081ee00bbee7b6c81b0ad43c870950ae37d4a18c329067b09479a27aa171c3a3f5771f53b384496fe61
85faac9b8c725ec9242ebc3793b70dcd1c8e58aeb4296345aefd8031304263bd66eaad0c6f1c61a1c644b73f397699856ab3d76d2b397295176650b4069acc9e

View file

@ -1 +1 @@
04b4a5099f0097bbe02983c67dea691d0d0d4ece7fb7c264b9b2c29955baa9e870b6fa999480da08ead1e5a0c078ae33ce1b0a5c8594ad465aedf9bf3933e104
2fdba76bad058eec6e43657692ef759de79c934076067d4ec5c9f2bdb131877e001f67e16b16bb14889e5e0a1ba84c780979b9d6772573aa6f82d979774c2af8

View file

@ -1,2 +1,2 @@
k-combined:
1.045320E+00 5.851680E-02
1.033731E+00 4.974463E-02

View file

@ -1 +1 @@
abe20c626d613e73ccb1a3f8468ad1b9aecca528afa9e8131a411d754eb86b8ab64a6fb1fdc9c0b8b8158ff7c82f548de5912041bf035aa5a2d4532cfe0c9510
60a35864ad71646309d7f1687ba0826d4d53a5b2e8babf73614362645205484bad3c0e7bf605ec0b11cadf58474b2e3d0a97bf2d9297f9118682c37ff0269afd

View file

@ -1,2 +1,2 @@
k-combined:
1.083030E+00 1.855038E-02
1.055274E+00 1.715904E-02

View file

@ -27,7 +27,7 @@ class MGNuclideInputSet(MGInputSet):
# Define the materials file.
self.materials.default_xs = '71c'
self.materials.add_materials((uo2, clad, water))
self.materials += (uo2, clad, water)
# Define surfaces.
@ -68,7 +68,7 @@ class MGNuclideInputSet(MGInputSet):
geometry = openmc.Geometry()
geometry.root_universe = root
self.geometry.geometry = geometry
self.geometry = geometry
class MGMaxOrderTestHarness(PyAPITestHarness):
def __init__(self, statepoint_name, tallies_present, mg=False):
@ -76,9 +76,10 @@ class MGMaxOrderTestHarness(PyAPITestHarness):
self._input_set = MGNuclideInputSet()
def _build_inputs(self):
super(MGMaxOrderTestHarness, self)._build_inputs()
# Set P1 scattering
self._input_set.settings.max_order = 1
# Call standard input build
super(MGMaxOrderTestHarness, self)._build_inputs()
if __name__ == '__main__':
harness = MGMaxOrderTestHarness('statepoint.10.*', False, mg=True)

View file

@ -1 +1 @@
c9f9e7211bfb2af58130bedfd64592d093b7bfa424953eba433ecf08940595a96b8de7a892f12d1ab465cebd8e5dd784114c1b1299b534ed329df92752c9ed1f
0efba3dd7882fdd38756d0a8f01ff00d7a1abdaab6430b3f090f3339e552448453bbb733852b6bd6ff09608d923c282f168320f942fc2eb3a45610873c588734

View file

@ -1,2 +1,2 @@
k-combined:
1.380785E-01 5.556526E-03
1.033731E+00 4.974463E-02

View file

@ -12,21 +12,21 @@ class MGNuclideInputSet(MGInputSet):
# Define materials needed for 1D/1G slab problem
# This time do using nuclide, not macroscopic
uo2 = openmc.Material(name='UO2', material_id=1)
uo2.set_density('g/cm3', 1.0)
uo2.set_density('sum', 1.0)
uo2.add_nuclide("uo2_iso", 1.0)
clad = openmc.Material(name='Clad', material_id=2)
clad.set_density('g/cm3', 1.0)
clad.set_density('sum', 1.0)
clad.add_nuclide("clad_ang_mu", 1.0)
water_data = openmc.Nuclide('lwtr_iso_mu', '71c')
# water_data = openmc.Nuclide('lwtr_iso_mu', '71c')
water = openmc.Material(name='LWTR', material_id=3)
water.set_density('g/cm3', 1.0)
water.set_density('sum', 1.0)
water.add_nuclide("lwtr_iso_mu", 1.0)
# Define the materials file.
self.materials.default_xs = '71c'
self.materials.add_materials((uo2, clad, water))
self.materials += (uo2, clad, water)
# Define surfaces.
@ -67,7 +67,7 @@ class MGNuclideInputSet(MGInputSet):
geometry = openmc.Geometry()
geometry.root_universe = root
self.geometry.geometry = geometry
self.geometry = geometry
class MGNuclideTestHarness(PyAPITestHarness):
def __init__(self, statepoint_name, tallies_present, mg=False):

View file

@ -1 +1 @@
ca8490e0e4549fed727ddc75b6d92cfe5162e11b905218a0afaa3ce2ee0763e2ff38074de27aaa678818624f49c5823650475dfa8f66f502a98fc03145399c0d
6c437c3f9281c52a80a9b166971aa0f5db7ff8b6cf65c79b6d7bf294fad30cc7044f6a665cd9059f8580441bcbb581f7152ff5bccbc21fbcc407847ea6fe3306

File diff suppressed because it is too large Load diff

View file

@ -27,24 +27,15 @@ class MGTalliesTestHarness(PyAPITestHarness):
mat_filter = openmc.Filter(type='material', bins=[1,2,3])
tally1 = openmc.Tally(tally_id=1)
tally1.add_filter(mesh_filter)
tally1.add_score('total')
tally1.add_score('absorption')
tally1.add_score('flux')
tally1.add_score('fission')
tally1.add_score('nu-fission')
tally1.filters = [mesh_filter]
tally1.scores = ['total', 'absorption', 'flux',
'fission', 'nu-fission']
tally2 = openmc.Tally(tally_id=2)
tally2.add_filter(mat_filter)
tally2.add_filter(energy_filter)
tally2.add_filter(energyout_filter)
tally2.add_score('scatter')
tally2.add_score('nu-scatter')
tally2.filters = [mat_filter, energy_filter, energyout_filter]
tally2.scores = ['scatter', 'nu-scatter']
self._input_set.tallies = openmc.TalliesFile()
self._input_set.tallies.add_mesh(mesh)
self._input_set.tallies.add_tally(tally1)
self._input_set.tallies.add_tally(tally2)
self._input_set.tallies = openmc.Tallies([tally1, tally2])
super(MGTalliesTestHarness, self)._build_inputs()

View file

@ -1 +1 @@
53b1740921b71e4ead909ab9e4c25f7d43990fe7d7051fde6f66c39c0a6082177385640244010e1b9dbeaf5f34adf1627e9603088af729fadd6b589c19102edc
104e7fb527770ac5d3fc636da7716e8fb05d55761253d30516c899f466e6b38ffd881611a3d0cdf65c6af058c32f6f6758c68782be7a170d21024bdae751862f

View file

@ -1,49 +1,85 @@
material group in nuclide mean std. dev.
0 1 1 total 0.412084 0.02359 material group in nuclide mean std. dev.
0 1 1 total 0.076425 0.003691 material group in group out nuclide mean std. dev.
0 1 1 1 total 0.345643 0.021487 material group out nuclide mean std. dev.
0 1 1 total 0.076425 0.003691 material group in group out nuclide moment mean std. dev.
0 1 1 1 total P0 0.384780 0.022253
1 1 1 1 total P1 0.039277 0.004308
2 1 1 1 total P2 0.017574 0.002402
3 1 1 1 total P3 0.012203 0.002164 material group out nuclide mean std. dev.
0 1 1 total 1.0 0.055333 material group in nuclide mean std. dev.
0 2 1 total 0.241262 0.00841 material group in nuclide mean std. dev.
0 2 1 total 0.0 0.0 material group in group out nuclide mean std. dev.
0 2 1 1 total 0.241262 0.00841 material group out nuclide mean std. dev.
0 2 1 total 0.0 0.0 material group in group out nuclide moment mean std. dev.
0 2 1 1 total P0 0.272369 0.006872
1 2 1 1 total P1 0.031107 0.005483
2 2 1 1 total P2 0.025999 0.006151
3 2 1 1 total P3 0.003219 0.003312 material group out nuclide mean std. dev.
0 2 1 total 0.0 0.0 material group in nuclide mean std. dev.
0 3 1 total 0.400028 0.034667 material group in nuclide mean std. dev.
0 3 1 total 0.0 0.0 material group in group out nuclide mean std. dev.
0 3 1 1 total 0.393462 0.033646 material group out nuclide mean std. dev.
0 3 1 total 0.0 0.0 material group in group out nuclide moment mean std. dev.
0 3 1 1 total P0 0.794999 0.036548
1 3 1 1 total P1 0.401537 0.016175
2 3 1 1 total P2 0.143623 0.008719
3 3 1 1 total P3 0.001991 0.004433 material group out nuclide mean std. dev.
0 3 1 total 0.0 0.0 material group in nuclide mean std. dev.
0 4 1 total 0.377402 0.072937 material group in nuclide mean std. dev.
0 4 1 total 0.0 0.0 material group in group out nuclide mean std. dev.
0 4 1 1 total 0.371473 0.071226 material group out nuclide mean std. dev.
0 4 1 total 0.0 0.0 material group in group out nuclide moment mean std. dev.
0 4 1 1 total P0 0.727311 0.080096
1 4 1 1 total P1 0.355839 0.037901
2 4 1 1 total P2 0.124483 0.015823
3 4 1 1 total P3 0.012168 0.006224 material group out nuclide mean std. dev.
0 4 1 total 0.0 0.0 material group in nuclide mean std. dev.
0 5 1 total 0.0 0.0 material group in nuclide mean std. dev.
0 5 1 total 0.0 0.0 material group in group out nuclide mean std. dev.
0 5 1 1 total 0.0 0.0 material group out nuclide mean std. dev.
0 5 1 total 0.0 0.0 material group in group out nuclide moment mean std. dev.
0 5 1 1 total P0 0.0 0.0
1 5 1 1 total P1 0.0 0.0
2 5 1 1 total P2 0.0 0.0
3 5 1 1 total P3 0.0 0.0 material group out nuclide mean std. dev.
0 5 1 total 0.0 0.0 material group in nuclide mean std. dev.
0 6 1 total 0.0 0.0 material group in nuclide mean std. dev.
0 6 1 total 0.0 0.0 material group in group out nuclide mean std. dev.
0 6 1 1 total 0.0 0.0 material group out nuclide mean std. dev.
0 6 1 total 0.0 0.0 material group in group out nuclide moment mean std. dev.
0 6 1 1 total P0 0.0 0.0
1 6 1 1 total P1 0.0 0.0
2 6 1 1 total P2 0.0 0.0
3 6 1 1 total P3 0.0 0.0 material group out nuclide mean std. dev.
0 6 1 total 0.0 0.0 material group in nuclide mean std. dev.
0 7 1 total 0.0 0.0 material group in nuclide mean std. dev.
0 7 1 total 0.0 0.0 material group in group out nuclide mean std. dev.
0 7 1 1 total 0.0 0.0 material group out nuclide mean std. dev.
0 7 1 total 0.0 0.0 material group in group out nuclide moment mean std. dev.
0 7 1 1 total P0 0.0 0.0
1 7 1 1 total P1 0.0 0.0
2 7 1 1 total P2 0.0 0.0
3 7 1 1 total P3 0.0 0.0 material group out nuclide mean std. dev.
0 7 1 total 0.0 0.0 material group in nuclide mean std. dev.
0 8 1 total 0.0 0.0 material group in nuclide mean std. dev.
0 8 1 total 0.0 0.0 material group in group out nuclide mean std. dev.
0 8 1 1 total 0.0 0.0 material group out nuclide mean std. dev.
0 8 1 total 0.0 0.0 material group in group out nuclide moment mean std. dev.
0 8 1 1 total P0 0.0 0.0
1 8 1 1 total P1 0.0 0.0
2 8 1 1 total P2 0.0 0.0
3 8 1 1 total P3 0.0 0.0 material group out nuclide mean std. dev.
0 8 1 total 0.0 0.0 material group in nuclide mean std. dev.
0 9 1 total 0.600536 0.748875 material group in nuclide mean std. dev.
0 9 1 total 0.0 0.0 material group in group out nuclide mean std. dev.
0 9 1 1 total 0.600536 0.748875 material group out nuclide mean std. dev.
0 9 1 total 0.0 0.0 material group in group out nuclide moment mean std. dev.
0 9 1 1 total P0 0.720380 0.771015
1 9 1 1 total P1 0.119844 0.184691
2 9 1 1 total P2 0.038522 0.064485
3 9 1 1 total P3 0.056023 0.050595 material group out nuclide mean std. dev.
0 9 1 total 0.0 0.0 material group in nuclide mean std. dev.
0 10 1 total 0.235515 0.613974 material group in nuclide mean std. dev.
0 10 1 total 0.0 0.0 material group in group out nuclide mean std. dev.
0 10 1 1 total 0.235515 0.613974 material group out nuclide mean std. dev.
0 10 1 total 0.0 0.0 material group in group out nuclide moment mean std. dev.
0 10 1 1 total P0 0.501009 0.708534
1 10 1 1 total P1 0.265494 0.375465
2 10 1 1 total P2 0.141979 0.200788
3 10 1 1 total P3 0.074258 0.105017 material group out nuclide mean std. dev.
0 10 1 total 0.0 0.0 material group in nuclide mean std. dev.
0 11 1 total 0.510145 0.741941 material group in nuclide mean std. dev.
0 11 1 total 0.0 0.0 material group in group out nuclide mean std. dev.
0 11 1 1 total 0.491857 0.715554 material group out nuclide mean std. dev.
0 11 1 total 0.0 0.0 material group in group out nuclide moment mean std. dev.
0 11 1 1 total P0 0.804661 0.817658
1 11 1 1 total P1 0.312803 0.315315
2 11 1 1 total P2 0.168113 0.172935
3 11 1 1 total P3 0.003808 0.037911 material group out nuclide mean std. dev.
0 11 1 total 0.0 0.0 material group in nuclide mean std. dev.
0 12 1 total 0.73836 0.825631 material group in nuclide mean std. dev.
0 12 1 total 0.0 0.0 material group in group out nuclide mean std. dev.
0 12 1 1 total 0.723265 0.808231 material group out nuclide mean std. dev.
0 12 1 total 0.0 0.0 material group in group out nuclide moment mean std. dev.
0 12 1 1 total P0 0.943429 0.856119
1 12 1 1 total P1 0.220164 0.163180
2 12 1 1 total P2 0.052884 0.042440
3 12 1 1 total P3 0.039939 0.032867 material group out nuclide mean std. dev.
0 12 1 total 0.0 0.0

View file

@ -23,16 +23,17 @@ class MGXSTestHarness(PyAPITestHarness):
energy_groups = openmc.mgxs.EnergyGroups(group_edges=[0, 0.625e-6, 20.])
# Initialize MGXS Library for a few cross section types
self.mgxs_lib = openmc.mgxs.Library(self._input_set.geometry.geometry)
self.mgxs_lib = openmc.mgxs.Library(self._input_set.geometry)
self.mgxs_lib.by_nuclide = False
self.mgxs_lib.mgxs_types = ['transport', 'nu-fission',
'nu-scatter matrix', 'chi']
self.mgxs_lib.energy_groups = energy_groups
self.mgxs_lib.legendre_order = 3
self.mgxs_lib.domain_type = 'material'
self.mgxs_lib.build_library()
# Initialize a tallies file
self._input_set.tallies = openmc.TalliesFile()
self._input_set.tallies = openmc.Tallies()
self.mgxs_lib.add_to_tallies_file(self._input_set.tallies, merge=False)
self._input_set.tallies.export_to_xml()
@ -43,11 +44,6 @@ class MGXSTestHarness(PyAPITestHarness):
statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0]
sp = openmc.StatePoint(statepoint)
# Read the summary file.
summary = glob.glob(os.path.join(os.getcwd(), 'summary.h5'))[0]
su = openmc.Summary(summary)
sp.link_with_summary(su)
# Load the MGXS library from the statepoint
self.mgxs_lib.load_from_statepoint(sp)

View file

@ -1 +1 @@
224a9e84e87c8a21385326d34ef27c046107d4a2ace6ee85d7a36142a3726e12532e2fc1a318ab707437e0b306a81c6d2b80c531d4c3210d4162242e6265ba70
018bbbc2099f7b94180b391e46e42fc9a82498c60b3f8f7f4c91480ea373427932d287fe571d53b2397f329e71485e7155d7644f0f995bbcb458ba3e872ab043

View file

@ -1,5 +1,8 @@
avg(distribcell) group in nuclide mean std. dev.
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.718919 0.520644 avg(distribcell) group in nuclide mean std. dev.
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.0 0.0 avg(distribcell) group in group out nuclide mean std. dev.
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total 0.695166 0.510606 avg(distribcell) group out nuclide mean std. dev.
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.0 0.0 avg(distribcell) group in group out nuclide moment mean std. dev.
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total P0 1.142547 0.570131
1 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total P1 0.447381 0.216322
2 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total P2 0.141202 0.066504
3 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total P3 0.039228 0.024621 avg(distribcell) group out nuclide mean std. dev.
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.0 0.0

View file

@ -24,18 +24,19 @@ class MGXSTestHarness(PyAPITestHarness):
# Initialize MGXS Library for a few cross section types
# for one material-filled cell in the geometry
self.mgxs_lib = openmc.mgxs.Library(self._input_set.geometry.geometry)
self.mgxs_lib = openmc.mgxs.Library(self._input_set.geometry)
self.mgxs_lib.by_nuclide = False
self.mgxs_lib.mgxs_types = ['transport', 'nu-fission',
'nu-scatter matrix', 'chi']
self.mgxs_lib.energy_groups = energy_groups
self.mgxs_lib.legendre_order = 3
self.mgxs_lib.domain_type = 'distribcell'
material_cells = self.mgxs_lib.openmc_geometry.get_all_material_cells()
self.mgxs_lib.domains = [material_cells[-1]]
self.mgxs_lib.build_library()
# Initialize a tallies file
self._input_set.tallies = openmc.TalliesFile()
self._input_set.tallies = openmc.Tallies()
self.mgxs_lib.add_to_tallies_file(self._input_set.tallies, merge=False)
self._input_set.tallies.export_to_xml()
@ -46,11 +47,6 @@ class MGXSTestHarness(PyAPITestHarness):
statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0]
sp = openmc.StatePoint(statepoint)
# Read the summary file.
summary = glob.glob(os.path.join(os.getcwd(), 'summary.h5'))[0]
su = openmc.Summary(summary)
sp.link_with_summary(su)
# Load the MGXS library from the statepoint
self.mgxs_lib.load_from_statepoint(sp)

View file

@ -1 +1 @@
53b1740921b71e4ead909ab9e4c25f7d43990fe7d7051fde6f66c39c0a6082177385640244010e1b9dbeaf5f34adf1627e9603088af729fadd6b589c19102edc
104e7fb527770ac5d3fc636da7716e8fb05d55761253d30516c899f466e6b38ffd881611a3d0cdf65c6af058c32f6f6758c68782be7a170d21024bdae751862f

View file

@ -5,10 +5,16 @@ domain=1 type=nu-fission
[ 0.02178897 0.71407658]
[ 0.00118187 0.04055185]
domain=1 type=nu-scatter matrix
[[ 0.3373971 0.00155945]
[ 0. 0.42205129]]
[[ 0.02303884 0.00051015]
[ 0. 0.02161702]]
[[[ 3.81546297e-01 4.43012537e-02 2.06462886e-02 1.36952959e-02]
[ 1.55945353e-03 -5.97269486e-04 -2.38789528e-04 1.75508083e-04]]
[[ 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00]
[ 4.03915981e-01 -1.13103276e-02 -1.48065932e-02 -6.85505346e-03]]]
[[[ 0.02403322 0.00472203 0.00253903 0.00222437]
[ 0.00051015 0.00022485 0.00022157 0.00020939]]
[[ 0. 0. 0. 0. ]
[ 0.01896646 0.00783919 0.00862908 0.00904704]]]
domain=1 type=chi
[ 1. 0.]
[ 0.05533329 0. ]
@ -19,10 +25,16 @@ domain=2 type=nu-fission
[ 0. 0.]
[ 0. 0.]
domain=2 type=nu-scatter matrix
[[ 0.23725441 0. ]
[ 0. 0.28593027]]
[[ 0.00818357 0. ]
[ 0. 0.04879593]]
[[[ 0.27311543 0.03586102 0.02970389 0.00224892]
[ 0. 0. 0. 0. ]]
[[ 0. 0. 0. 0. ]
[ 0.26405068 -0.02187959 -0.01529469 0.01403395]]]
[[[ 0.00625287 0.00587756 0.00664018 0.00337568]
[ 0. 0. 0. 0. ]]
[[ 0. 0. 0. 0. ]
[ 0.04539742 0.01221814 0.01027609 0.01431818]]]
domain=2 type=chi
[ 0. 0.]
[ 0. 0.]
@ -33,10 +45,16 @@ domain=3 type=nu-fission
[ 0. 0.]
[ 0. 0.]
domain=3 type=nu-scatter matrix
[[ 0.25993686 0.02618721]
[ 0. 1.35952132]]
[[ 0.02611466 0.00166461]
[ 0. 0.2585046 ]]
[[[ 0.64334557 0.38340871 0.15218526 0.00303724]
[ 0.02618721 0.00736219 -0.00273849 -0.00271989]]
[[ 0. 0. 0. 0. ]
[ 1.92421362 0.4984312 0.09120485 0.01705441]]]
[[[ 0.02837604 0.01644677 0.00957372 0.00464802]
[ 0.00166461 0.00093414 0.00075617 0.00055807]]
[[ 0. 0. 0. 0. ]
[ 0.28406198 0.06342067 0.01372628 0.01391602]]]
domain=3 type=chi
[ 0. 0.]
[ 0. 0.]
@ -47,10 +65,16 @@ domain=4 type=nu-fission
[ 0. 0.]
[ 0. 0.]
domain=4 type=nu-scatter matrix
[[ 0.2179296 0.023662 ]
[ 0. 1.21507398]]
[[ 0.0585649 0.00308328]
[ 0. 0.3810251 ]]
[[[ 0.54394096 0.32601136 0.13113269 0.01210477]
[ 0.023662 0.00752551 -0.00272975 -0.0031405 ]]
[[ 0. 0. 0. 0. ]
[ 1.76464845 0.50069481 0.09902596 0.03297543]]]
[[[ 0.06542705 0.03860196 0.0174751 0.00607268]
[ 0.00308328 0.00130111 0.00084112 0.00057761]]
[[ 0. 0. 0. 0. ]
[ 0.41620952 0.12217802 0.03871874 0.02510259]]]
domain=4 type=chi
[ 0. 0.]
[ 0. 0.]
@ -61,10 +85,16 @@ domain=5 type=nu-fission
[ 0. 0.]
[ 0. 0.]
domain=5 type=nu-scatter matrix
[[ 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. 0. 0. 0.]
[ 0. 0. 0. 0.]]]
domain=5 type=chi
[ 0. 0.]
[ 0. 0.]
@ -75,10 +105,16 @@ domain=6 type=nu-fission
[ 0. 0.]
[ 0. 0.]
domain=6 type=nu-scatter matrix
[[ 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. 0. 0. 0.]
[ 0. 0. 0. 0.]]]
domain=6 type=chi
[ 0. 0.]
[ 0. 0.]
@ -89,10 +125,16 @@ domain=7 type=nu-fission
[ 0. 0.]
[ 0. 0.]
domain=7 type=nu-scatter matrix
[[ 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. 0. 0. 0.]
[ 0. 0. 0. 0.]]]
domain=7 type=chi
[ 0. 0.]
[ 0. 0.]
@ -103,10 +145,16 @@ domain=8 type=nu-fission
[ 0. 0.]
[ 0. 0.]
domain=8 type=nu-scatter matrix
[[ 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. 0. 0. 0.]
[ 0. 0. 0. 0.]]]
domain=8 type=chi
[ 0. 0.]
[ 0. 0.]
@ -117,10 +165,16 @@ domain=9 type=nu-fission
[ 0. 0.]
[ 0. 0.]
domain=9 type=nu-scatter matrix
[[ 0.60053598 0. ]
[ 0. 0. ]]
[[ 0.74887543 0. ]
[ 0. 0. ]]
[[[ 0.72037987 0.11984389 0.03852204 0.05602285]
[ 0. 0. 0. 0. ]]
[[ 0. 0. 0. 0. ]
[ 0. 0. 0. 0. ]]]
[[[ 0.77101455 0.18469083 0.06448453 0.05059534]
[ 0. 0. 0. 0. ]]
[[ 0. 0. 0. 0. ]
[ 0. 0. 0. 0. ]]]
domain=9 type=chi
[ 0. 0.]
[ 0. 0.]
@ -131,10 +185,16 @@ domain=10 type=nu-fission
[ 0. 0.]
[ 0. 0.]
domain=10 type=nu-scatter matrix
[[ 0.23551495 0. ]
[ 0. 0. ]]
[[ 0.61397415 0. ]
[ 0. 0. ]]
[[[ 0.50100891 0.26549396 0.14197875 0.07425836]
[ 0. 0. 0. 0. ]]
[[ 0. 0. 0. 0. ]
[ 0. 0. 0. 0. ]]]
[[[ 0.70853359 0.37546516 0.20078827 0.10501718]
[ 0. 0. 0. 0. ]]
[[ 0. 0. 0. 0. ]
[ 0. 0. 0. 0. ]]]
domain=10 type=chi
[ 0. 0.]
[ 0. 0.]
@ -145,10 +205,16 @@ domain=11 type=nu-fission
[ 0. 0.]
[ 0. 0.]
domain=11 type=nu-scatter matrix
[[ 0.15444875 0.03187517]
[ 0. 0.90308451]]
[[ 0.59768579 0.0450783 ]
[ 0. 1.53214394]]
[[[ 0.47812753 0.32367878 0.14337507 0.05400336]
[ 0.03187517 0.00858456 -0.01246962 -0.01132019]]
[[ 0. 0. 0. 0. ]
[ 1.20124973 0.28661101 0.21819147 -0.04851424]]]
[[[ 0.67617444 0.45775092 0.20276296 0.07637229]
[ 0.0450783 0.0121404 0.01763471 0.01600917]]
[[ 0. 0. 0. 0. ]
[ 1.69882367 0.40532917 0.30856933 0.0686095 ]]]
domain=11 type=chi
[ 0. 0.]
[ 0. 0.]
@ -159,10 +225,16 @@ domain=12 type=nu-fission
[ 0. 0.]
[ 0. 0.]
domain=12 type=nu-scatter matrix
[[ 0.18605249 0.02723959]
[ 0. 1.35711799]]
[[ 0.25763254 0.02955488]
[ 0. 2.08984614]]
[[[ 0.40859392 0.22254143 0.0909719 0.03100368]
[ 0.02723959 -0.01008785 -0.00694631 0.00969231]]
[[ 0. 0. 0. 0. ]
[ 1.57432766 0.22974802 0.01417839 0.03899727]]]
[[[ 0.27812309 0.14577636 0.06962553 0.03598053]
[ 0.02955488 0.01094529 0.00753673 0.01051613]]
[[ 0. 0. 0. 0. ]
[ 2.22643553 0.32491277 0.02005128 0.05515046]]]
domain=12 type=chi
[ 0. 0.]
[ 0. 0.]

View file

@ -24,16 +24,17 @@ class MGXSTestHarness(PyAPITestHarness):
energy_groups = openmc.mgxs.EnergyGroups(group_edges=[0, 0.625e-6, 20.])
# Initialize MGXS Library for a few cross section types
self.mgxs_lib = openmc.mgxs.Library(self._input_set.geometry.geometry)
self.mgxs_lib = openmc.mgxs.Library(self._input_set.geometry)
self.mgxs_lib.by_nuclide = False
self.mgxs_lib.mgxs_types = ['transport', 'nu-fission',
'nu-scatter matrix', 'chi']
self.mgxs_lib.energy_groups = energy_groups
self.mgxs_lib.legendre_order = 3
self.mgxs_lib.domain_type = 'material'
self.mgxs_lib.build_library()
# Initialize a tallies file
self._input_set.tallies = openmc.TalliesFile()
self._input_set.tallies = openmc.Tallies()
self.mgxs_lib.add_to_tallies_file(self._input_set.tallies, merge=False)
self._input_set.tallies.export_to_xml()
@ -44,14 +45,9 @@ class MGXSTestHarness(PyAPITestHarness):
statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0]
sp = openmc.StatePoint(statepoint)
# Read the summary file.
summary = glob.glob(os.path.join(os.getcwd(), 'summary.h5'))[0]
su = openmc.Summary(summary)
sp.link_with_summary(su)
# Load the MGXS library from the statepoint
self.mgxs_lib.load_from_statepoint(sp)
# Export the MGXS Library to an HDF5 file
self.mgxs_lib.build_hdf5_store(directory='.')
@ -67,7 +63,7 @@ class MGXSTestHarness(PyAPITestHarness):
outstr += str(f[key][...]) + '\n'
key = 'material/{0}/{1}/std. dev.'.format(domain.id, mgxs_type)
outstr += str(f[key][...]) + '\n'
# Close the MGXS HDF5 file
f.close()

View file

@ -1 +1 @@
53b1740921b71e4ead909ab9e4c25f7d43990fe7d7051fde6f66c39c0a6082177385640244010e1b9dbeaf5f34adf1627e9603088af729fadd6b589c19102edc
104e7fb527770ac5d3fc636da7716e8fb05d55761253d30516c899f466e6b38ffd881611a3d0cdf65c6af058c32f6f6758c68782be7a170d21024bdae751862f

View file

@ -2,120 +2,264 @@
1 1 1 total 0.372745 0.024269
0 1 2 total 0.861607 0.032349 material group in nuclide mean std. dev.
1 1 1 total 0.021789 0.001182
0 1 2 total 0.714077 0.040552 material group in group out nuclide mean std. dev.
3 1 1 1 total 0.337397 0.023039
2 1 1 2 total 0.001559 0.000510
1 1 2 1 total 0.000000 0.000000
0 1 2 2 total 0.422051 0.021617 material group out nuclide mean std. dev.
0 1 2 total 0.714077 0.040552 material group in group out nuclide moment mean std. dev.
12 1 1 1 total P0 0.381546 0.024033
13 1 1 1 total P1 0.044301 0.004722
14 1 1 1 total P2 0.020646 0.002539
15 1 1 1 total P3 0.013695 0.002224
8 1 1 2 total P0 0.001559 0.000510
9 1 1 2 total P1 -0.000597 0.000225
10 1 1 2 total P2 -0.000239 0.000222
11 1 1 2 total P3 0.000176 0.000209
4 1 2 1 total P0 0.000000 0.000000
5 1 2 1 total P1 0.000000 0.000000
6 1 2 1 total P2 0.000000 0.000000
7 1 2 1 total P3 0.000000 0.000000
0 1 2 2 total P0 0.403916 0.018966
1 1 2 2 total P1 -0.011310 0.007839
2 1 2 2 total P2 -0.014807 0.008629
3 1 2 2 total P3 -0.006855 0.009047 material group out nuclide mean std. dev.
1 1 1 total 1.0 0.055333
0 1 2 total 0.0 0.000000 material group in nuclide mean std. dev.
1 2 1 total 0.237254 0.008184
0 2 2 total 0.285930 0.048796 material group in nuclide mean std. dev.
1 2 1 total 0.0 0.0
0 2 2 total 0.0 0.0 material group in group out nuclide mean std. dev.
3 2 1 1 total 0.237254 0.008184
2 2 1 2 total 0.000000 0.000000
1 2 2 1 total 0.000000 0.000000
0 2 2 2 total 0.285930 0.048796 material group out nuclide mean std. dev.
0 2 2 total 0.0 0.0 material group in group out nuclide moment mean std. dev.
12 2 1 1 total P0 0.273115 0.006253
13 2 1 1 total P1 0.035861 0.005878
14 2 1 1 total P2 0.029704 0.006640
15 2 1 1 total P3 0.002249 0.003376
8 2 1 2 total P0 0.000000 0.000000
9 2 1 2 total P1 0.000000 0.000000
10 2 1 2 total P2 0.000000 0.000000
11 2 1 2 total P3 0.000000 0.000000
4 2 2 1 total P0 0.000000 0.000000
5 2 2 1 total P1 0.000000 0.000000
6 2 2 1 total P2 0.000000 0.000000
7 2 2 1 total P3 0.000000 0.000000
0 2 2 2 total P0 0.264051 0.045397
1 2 2 2 total P1 -0.021880 0.012218
2 2 2 2 total P2 -0.015295 0.010276
3 2 2 2 total P3 0.014034 0.014318 material group out nuclide mean std. dev.
1 2 1 total 0.0 0.0
0 2 2 total 0.0 0.0 material group in nuclide mean std. dev.
1 3 1 total 0.286906 0.027401
0 3 2 total 1.418151 0.265308 material group in nuclide mean std. dev.
1 3 1 total 0.0 0.0
0 3 2 total 0.0 0.0 material group in group out nuclide mean std. dev.
3 3 1 1 total 0.259937 0.026115
2 3 1 2 total 0.026187 0.001665
1 3 2 1 total 0.000000 0.000000
0 3 2 2 total 1.359521 0.258505 material group out nuclide mean std. dev.
0 3 2 total 0.0 0.0 material group in group out nuclide moment mean std. dev.
12 3 1 1 total P0 0.643346 0.028376
13 3 1 1 total P1 0.383409 0.016447
14 3 1 1 total P2 0.152185 0.009574
15 3 1 1 total P3 0.003037 0.004648
8 3 1 2 total P0 0.026187 0.001665
9 3 1 2 total P1 0.007362 0.000934
10 3 1 2 total P2 -0.002738 0.000756
11 3 1 2 total P3 -0.002720 0.000558
4 3 2 1 total P0 0.000000 0.000000
5 3 2 1 total P1 0.000000 0.000000
6 3 2 1 total P2 0.000000 0.000000
7 3 2 1 total P3 0.000000 0.000000
0 3 2 2 total P0 1.924214 0.284062
1 3 2 2 total P1 0.498431 0.063421
2 3 2 2 total P2 0.091205 0.013726
3 3 2 2 total P3 0.017054 0.013916 material group out nuclide mean std. dev.
1 3 1 total 0.0 0.0
0 3 2 total 0.0 0.0 material group in nuclide mean std. dev.
1 4 1 total 0.242447 0.061031
0 4 2 total 1.253959 0.388363 material group in nuclide mean std. dev.
1 4 1 total 0.0 0.0
0 4 2 total 0.0 0.0 material group in group out nuclide mean std. dev.
3 4 1 1 total 0.217930 0.058565
2 4 1 2 total 0.023662 0.003083
1 4 2 1 total 0.000000 0.000000
0 4 2 2 total 1.215074 0.381025 material group out nuclide mean std. dev.
0 4 2 total 0.0 0.0 material group in group out nuclide moment mean std. dev.
12 4 1 1 total P0 0.543941 0.065427
13 4 1 1 total P1 0.326011 0.038602
14 4 1 1 total P2 0.131133 0.017475
15 4 1 1 total P3 0.012105 0.006073
8 4 1 2 total P0 0.023662 0.003083
9 4 1 2 total P1 0.007526 0.001301
10 4 1 2 total P2 -0.002730 0.000841
11 4 1 2 total P3 -0.003140 0.000578
4 4 2 1 total P0 0.000000 0.000000
5 4 2 1 total P1 0.000000 0.000000
6 4 2 1 total P2 0.000000 0.000000
7 4 2 1 total P3 0.000000 0.000000
0 4 2 2 total P0 1.764648 0.416210
1 4 2 2 total P1 0.500695 0.122178
2 4 2 2 total P2 0.099026 0.038719
3 4 2 2 total P3 0.032975 0.025103 material group out nuclide mean std. dev.
1 4 1 total 0.0 0.0
0 4 2 total 0.0 0.0 material group in nuclide mean std. dev.
1 5 1 total 0.0 0.0
0 5 2 total 0.0 0.0 material group in nuclide mean std. dev.
1 5 1 total 0.0 0.0
0 5 2 total 0.0 0.0 material group in group out nuclide mean std. dev.
3 5 1 1 total 0.0 0.0
2 5 1 2 total 0.0 0.0
1 5 2 1 total 0.0 0.0
0 5 2 2 total 0.0 0.0 material group out nuclide mean std. dev.
0 5 2 total 0.0 0.0 material group in group out nuclide moment mean std. dev.
12 5 1 1 total P0 0.0 0.0
13 5 1 1 total P1 0.0 0.0
14 5 1 1 total P2 0.0 0.0
15 5 1 1 total P3 0.0 0.0
8 5 1 2 total P0 0.0 0.0
9 5 1 2 total P1 0.0 0.0
10 5 1 2 total P2 0.0 0.0
11 5 1 2 total P3 0.0 0.0
4 5 2 1 total P0 0.0 0.0
5 5 2 1 total P1 0.0 0.0
6 5 2 1 total P2 0.0 0.0
7 5 2 1 total P3 0.0 0.0
0 5 2 2 total P0 0.0 0.0
1 5 2 2 total P1 0.0 0.0
2 5 2 2 total P2 0.0 0.0
3 5 2 2 total P3 0.0 0.0 material group out nuclide mean std. dev.
1 5 1 total 0.0 0.0
0 5 2 total 0.0 0.0 material group in nuclide mean std. dev.
1 6 1 total 0.0 0.0
0 6 2 total 0.0 0.0 material group in nuclide mean std. dev.
1 6 1 total 0.0 0.0
0 6 2 total 0.0 0.0 material group in group out nuclide mean std. dev.
3 6 1 1 total 0.0 0.0
2 6 1 2 total 0.0 0.0
1 6 2 1 total 0.0 0.0
0 6 2 2 total 0.0 0.0 material group out nuclide mean std. dev.
0 6 2 total 0.0 0.0 material group in group out nuclide moment mean std. dev.
12 6 1 1 total P0 0.0 0.0
13 6 1 1 total P1 0.0 0.0
14 6 1 1 total P2 0.0 0.0
15 6 1 1 total P3 0.0 0.0
8 6 1 2 total P0 0.0 0.0
9 6 1 2 total P1 0.0 0.0
10 6 1 2 total P2 0.0 0.0
11 6 1 2 total P3 0.0 0.0
4 6 2 1 total P0 0.0 0.0
5 6 2 1 total P1 0.0 0.0
6 6 2 1 total P2 0.0 0.0
7 6 2 1 total P3 0.0 0.0
0 6 2 2 total P0 0.0 0.0
1 6 2 2 total P1 0.0 0.0
2 6 2 2 total P2 0.0 0.0
3 6 2 2 total P3 0.0 0.0 material group out nuclide mean std. dev.
1 6 1 total 0.0 0.0
0 6 2 total 0.0 0.0 material group in nuclide mean std. dev.
1 7 1 total 0.0 0.0
0 7 2 total 0.0 0.0 material group in nuclide mean std. dev.
1 7 1 total 0.0 0.0
0 7 2 total 0.0 0.0 material group in group out nuclide mean std. dev.
3 7 1 1 total 0.0 0.0
2 7 1 2 total 0.0 0.0
1 7 2 1 total 0.0 0.0
0 7 2 2 total 0.0 0.0 material group out nuclide mean std. dev.
0 7 2 total 0.0 0.0 material group in group out nuclide moment mean std. dev.
12 7 1 1 total P0 0.0 0.0
13 7 1 1 total P1 0.0 0.0
14 7 1 1 total P2 0.0 0.0
15 7 1 1 total P3 0.0 0.0
8 7 1 2 total P0 0.0 0.0
9 7 1 2 total P1 0.0 0.0
10 7 1 2 total P2 0.0 0.0
11 7 1 2 total P3 0.0 0.0
4 7 2 1 total P0 0.0 0.0
5 7 2 1 total P1 0.0 0.0
6 7 2 1 total P2 0.0 0.0
7 7 2 1 total P3 0.0 0.0
0 7 2 2 total P0 0.0 0.0
1 7 2 2 total P1 0.0 0.0
2 7 2 2 total P2 0.0 0.0
3 7 2 2 total P3 0.0 0.0 material group out nuclide mean std. dev.
1 7 1 total 0.0 0.0
0 7 2 total 0.0 0.0 material group in nuclide mean std. dev.
1 8 1 total 0.0 0.0
0 8 2 total 0.0 0.0 material group in nuclide mean std. dev.
1 8 1 total 0.0 0.0
0 8 2 total 0.0 0.0 material group in group out nuclide mean std. dev.
3 8 1 1 total 0.0 0.0
2 8 1 2 total 0.0 0.0
1 8 2 1 total 0.0 0.0
0 8 2 2 total 0.0 0.0 material group out nuclide mean std. dev.
0 8 2 total 0.0 0.0 material group in group out nuclide moment mean std. dev.
12 8 1 1 total P0 0.0 0.0
13 8 1 1 total P1 0.0 0.0
14 8 1 1 total P2 0.0 0.0
15 8 1 1 total P3 0.0 0.0
8 8 1 2 total P0 0.0 0.0
9 8 1 2 total P1 0.0 0.0
10 8 1 2 total P2 0.0 0.0
11 8 1 2 total P3 0.0 0.0
4 8 2 1 total P0 0.0 0.0
5 8 2 1 total P1 0.0 0.0
6 8 2 1 total P2 0.0 0.0
7 8 2 1 total P3 0.0 0.0
0 8 2 2 total P0 0.0 0.0
1 8 2 2 total P1 0.0 0.0
2 8 2 2 total P2 0.0 0.0
3 8 2 2 total P3 0.0 0.0 material group out nuclide mean std. dev.
1 8 1 total 0.0 0.0
0 8 2 total 0.0 0.0 material group in nuclide mean std. dev.
1 9 1 total 0.600536 0.748875
0 9 2 total 0.000000 0.000000 material group in nuclide mean std. dev.
1 9 1 total 0.0 0.0
0 9 2 total 0.0 0.0 material group in group out nuclide mean std. dev.
3 9 1 1 total 0.600536 0.748875
2 9 1 2 total 0.000000 0.000000
1 9 2 1 total 0.000000 0.000000
0 9 2 2 total 0.000000 0.000000 material group out nuclide mean std. dev.
0 9 2 total 0.0 0.0 material group in group out nuclide moment mean std. dev.
12 9 1 1 total P0 0.720380 0.771015
13 9 1 1 total P1 0.119844 0.184691
14 9 1 1 total P2 0.038522 0.064485
15 9 1 1 total P3 0.056023 0.050595
8 9 1 2 total P0 0.000000 0.000000
9 9 1 2 total P1 0.000000 0.000000
10 9 1 2 total P2 0.000000 0.000000
11 9 1 2 total P3 0.000000 0.000000
4 9 2 1 total P0 0.000000 0.000000
5 9 2 1 total P1 0.000000 0.000000
6 9 2 1 total P2 0.000000 0.000000
7 9 2 1 total P3 0.000000 0.000000
0 9 2 2 total P0 0.000000 0.000000
1 9 2 2 total P1 0.000000 0.000000
2 9 2 2 total P2 0.000000 0.000000
3 9 2 2 total P3 0.000000 0.000000 material group out nuclide mean std. dev.
1 9 1 total 0.0 0.0
0 9 2 total 0.0 0.0 material group in nuclide mean std. dev.
1 10 1 total 0.235515 0.613974
0 10 2 total 0.000000 0.000000 material group in nuclide mean std. dev.
1 10 1 total 0.0 0.0
0 10 2 total 0.0 0.0 material group in group out nuclide mean std. dev.
3 10 1 1 total 0.235515 0.613974
2 10 1 2 total 0.000000 0.000000
1 10 2 1 total 0.000000 0.000000
0 10 2 2 total 0.000000 0.000000 material group out nuclide mean std. dev.
0 10 2 total 0.0 0.0 material group in group out nuclide moment mean std. dev.
12 10 1 1 total P0 0.501009 0.708534
13 10 1 1 total P1 0.265494 0.375465
14 10 1 1 total P2 0.141979 0.200788
15 10 1 1 total P3 0.074258 0.105017
8 10 1 2 total P0 0.000000 0.000000
9 10 1 2 total P1 0.000000 0.000000
10 10 1 2 total P2 0.000000 0.000000
11 10 1 2 total P3 0.000000 0.000000
4 10 2 1 total P0 0.000000 0.000000
5 10 2 1 total P1 0.000000 0.000000
6 10 2 1 total P2 0.000000 0.000000
7 10 2 1 total P3 0.000000 0.000000
0 10 2 2 total P0 0.000000 0.000000
1 10 2 2 total P1 0.000000 0.000000
2 10 2 2 total P2 0.000000 0.000000
3 10 2 2 total P3 0.000000 0.000000 material group out nuclide mean std. dev.
1 10 1 total 0.0 0.0
0 10 2 total 0.0 0.0 material group in nuclide mean std. dev.
1 11 1 total 0.186324 0.632129
0 11 2 total 0.945986 1.591133 material group in nuclide mean std. dev.
1 11 1 total 0.0 0.0
0 11 2 total 0.0 0.0 material group in group out nuclide mean std. dev.
3 11 1 1 total 0.154449 0.597686
2 11 1 2 total 0.031875 0.045078
1 11 2 1 total 0.000000 0.000000
0 11 2 2 total 0.903085 1.532144 material group out nuclide mean std. dev.
0 11 2 total 0.0 0.0 material group in group out nuclide moment mean std. dev.
12 11 1 1 total P0 0.478128 0.676174
13 11 1 1 total P1 0.323679 0.457751
14 11 1 1 total P2 0.143375 0.202763
15 11 1 1 total P3 0.054003 0.076372
8 11 1 2 total P0 0.031875 0.045078
9 11 1 2 total P1 0.008585 0.012140
10 11 1 2 total P2 -0.012470 0.017635
11 11 1 2 total P3 -0.011320 0.016009
4 11 2 1 total P0 0.000000 0.000000
5 11 2 1 total P1 0.000000 0.000000
6 11 2 1 total P2 0.000000 0.000000
7 11 2 1 total P3 0.000000 0.000000
0 11 2 2 total P0 1.201250 1.698824
1 11 2 2 total P1 0.286611 0.405329
2 11 2 2 total P2 0.218191 0.308569
3 11 2 2 total P3 -0.048514 0.068609 material group out nuclide mean std. dev.
1 11 1 total 0.0 0.0
0 11 2 total 0.0 0.0 material group in nuclide mean std. dev.
1 12 1 total 0.213292 0.271444
0 12 2 total 1.390975 2.137346 material group in nuclide mean std. dev.
1 12 1 total 0.0 0.0
0 12 2 total 0.0 0.0 material group in group out nuclide mean std. dev.
3 12 1 1 total 0.186052 0.257633
2 12 1 2 total 0.027240 0.029555
1 12 2 1 total 0.000000 0.000000
0 12 2 2 total 1.357118 2.089846 material group out nuclide mean std. dev.
0 12 2 total 0.0 0.0 material group in group out nuclide moment mean std. dev.
12 12 1 1 total P0 0.408594 0.278123
13 12 1 1 total P1 0.222541 0.145776
14 12 1 1 total P2 0.090972 0.069626
15 12 1 1 total P3 0.031004 0.035981
8 12 1 2 total P0 0.027240 0.029555
9 12 1 2 total P1 -0.010088 0.010945
10 12 1 2 total P2 -0.006946 0.007537
11 12 1 2 total P3 0.009692 0.010516
4 12 2 1 total P0 0.000000 0.000000
5 12 2 1 total P1 0.000000 0.000000
6 12 2 1 total P2 0.000000 0.000000
7 12 2 1 total P3 0.000000 0.000000
0 12 2 2 total P0 1.574328 2.226436
1 12 2 2 total P1 0.229748 0.324913
2 12 2 2 total P2 0.014178 0.020051
3 12 2 2 total P3 0.038997 0.055150 material group out nuclide mean std. dev.
1 12 1 total 0.0 0.0
0 12 2 total 0.0 0.0

View file

@ -23,16 +23,17 @@ class MGXSTestHarness(PyAPITestHarness):
energy_groups = openmc.mgxs.EnergyGroups(group_edges=[0, 0.625e-6, 20.])
# Initialize MGXS Library for a few cross section types
self.mgxs_lib = openmc.mgxs.Library(self._input_set.geometry.geometry)
self.mgxs_lib = openmc.mgxs.Library(self._input_set.geometry)
self.mgxs_lib.by_nuclide = False
self.mgxs_lib.mgxs_types = ['transport', 'nu-fission',
'nu-scatter matrix', 'chi']
self.mgxs_lib.energy_groups = energy_groups
self.mgxs_lib.legendre_order = 3
self.mgxs_lib.domain_type = 'material'
self.mgxs_lib.build_library()
# Initialize a tallies file
self._input_set.tallies = openmc.TalliesFile()
self._input_set.tallies = openmc.Tallies()
self.mgxs_lib.add_to_tallies_file(self._input_set.tallies, merge=False)
self._input_set.tallies.export_to_xml()
@ -43,11 +44,6 @@ class MGXSTestHarness(PyAPITestHarness):
statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0]
sp = openmc.StatePoint(statepoint)
# Read the summary file.
summary = glob.glob(os.path.join(os.getcwd(), 'summary.h5'))[0]
su = openmc.Summary(summary)
sp.link_with_summary(su)
# Load the MGXS library from the statepoint
self.mgxs_lib.load_from_statepoint(sp)

View file

@ -1 +1 @@
c6a2a1c707bc723fd38bafd18efcfb22beaac0bd5953d7524ced1d47866cc1e1ee4152e39234d32a06fe43aff446fb12f8c5b62a44075607f274778b49110762
791a2bd647b8bae03aafc39e29ff1ce1ffc44063b0d757ccba4e1eda6eb73b8a275020f4f5774b17dede49fbf15549787279c8b2fc45caba0097155b32e56fa8

File diff suppressed because it is too large Load diff

View file

@ -23,31 +23,27 @@ class MGXSTestHarness(PyAPITestHarness):
energy_groups = openmc.mgxs.EnergyGroups(group_edges=[0, 0.625e-6, 20.])
# Initialize MGXS Library for a few cross section types
self.mgxs_lib = openmc.mgxs.Library(self._input_set.geometry.geometry)
self.mgxs_lib = openmc.mgxs.Library(self._input_set.geometry)
self.mgxs_lib.by_nuclide = True
self.mgxs_lib.mgxs_types = ['transport', 'nu-fission',
'nu-scatter matrix', 'chi']
self.mgxs_lib.energy_groups = energy_groups
self.mgxs_lib.legendre_order = 3
self.mgxs_lib.domain_type = 'material'
self.mgxs_lib.build_library()
# Initialize a tallies file
self._input_set.tallies = openmc.TalliesFile()
self._input_set.tallies = openmc.Tallies()
self.mgxs_lib.add_to_tallies_file(self._input_set.tallies, merge=False)
self._input_set.tallies.export_to_xml()
def _get_results(self, hash_output=False):
def _get_results(self, hash_output=True):
"""Digest info in the statepoint and return as a string."""
# Read the statepoint file.
statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0]
sp = openmc.StatePoint(statepoint)
# Read the summary file.
summary = glob.glob(os.path.join(os.getcwd(), 'summary.h5'))[0]
su = openmc.Summary(summary)
sp.link_with_summary(su)
# Load the MGXS library from the statepoint
self.mgxs_lib.load_from_statepoint(sp)

View file

@ -1 +1 @@
7658bebe2b6f93feae06417a05bfd4bbbfca668eebd100d976543326439b82d16ea23752ac0537284e1839d9681714df116828daf30857bc83e86cc67e4550d7
28df9e4c4729798d35741e6e9a4f910f3386c831acc54325d0e583bd989065a487cea6981068d8669bc80c3388b166c002c2127446936733f8f3f0da3e154bae

View file

@ -1,5 +1,5 @@
k-combined:
1.457760E+00 1.119659E-02
1.457760E+00 1.119656E-02
Cell
ID = 11
Name =

View file

@ -23,9 +23,8 @@ class MultipoleTestHarness(PyAPITestHarness):
dense_fuel.set_density('g/cc', 4.5)
dense_fuel.add_nuclide('U-235', 1.0)
mats_file = openmc.MaterialsFile()
mats_file = openmc.Materials([moderator, dense_fuel])
mats_file.default_xs = '71c'
mats_file.add_materials([moderator, dense_fuel])
mats_file.export_to_xml()
@ -70,16 +69,14 @@ class MultipoleTestHarness(PyAPITestHarness):
geometry = openmc.Geometry()
geometry.root_universe = root_univ
geo_file = openmc.GeometryFile()
geo_file.geometry = geometry
geo_file.export_to_xml()
geometry.export_to_xml()
####################
# Settings
####################
sets_file = openmc.SettingsFile()
sets_file = openmc.Settings()
sets_file.batches = 5
sets_file.inactive = 0
sets_file.particles = 1000
@ -93,7 +90,7 @@ class MultipoleTestHarness(PyAPITestHarness):
# Plots
####################
plots_file = openmc.PlotsFile()
plots_file = openmc.Plots()
plot = openmc.Plot(plot_id=1)
plot.basis = 'xy'
@ -102,7 +99,7 @@ class MultipoleTestHarness(PyAPITestHarness):
plot.origin = (0, 0, 0)
plot.width = (7, 7)
plot.pixels = (400, 400)
plots_file.add_plot(plot)
plots_file.append(plot)
plot = openmc.Plot(plot_id=2)
plot.basis = 'xy'
@ -111,7 +108,7 @@ class MultipoleTestHarness(PyAPITestHarness):
plot.origin = (0, 0, 0)
plot.width = (7, 7)
plot.pixels = (400, 400)
plots_file.add_plot(plot)
plots_file.append(plot)
plots_file.export_to_xml()

View file

@ -9,7 +9,7 @@ from testing_harness import TestHarness
import h5py
from openmc import Executor
import openmc
class PlotTestHarness(TestHarness):
@ -19,8 +19,7 @@ class PlotTestHarness(TestHarness):
self._plot_names = plot_names
def _run_openmc(self):
executor = Executor()
returncode = executor.plot_geometry(openmc_exec=self._opts.exe)
returncode = openmc.plot_geometry(openmc_exec=self._opts.exe)
assert returncode == 0, 'OpenMC did not exit successfully.'
def _test_output_created(self):

View file

@ -17,9 +17,8 @@ class ResonanceScatteringTestHarness(PyAPITestHarness):
mat.add_nuclide('Pu-239', 0.02)
mat.add_nuclide('H-1', 20.0)
mats_file = openmc.MaterialsFile()
mats_file = openmc.Materials([mat])
mats_file.default_xs = '71c'
mats_file.add_material(mat)
mats_file.export_to_xml()
# Geometry
@ -35,9 +34,7 @@ class ResonanceScatteringTestHarness(PyAPITestHarness):
geometry = openmc.Geometry()
geometry.root_universe = root_univ
geo_file = openmc.GeometryFile()
geo_file.geometry = geometry
geo_file.export_to_xml()
geometry.export_to_xml()
# Settings
nuclide = openmc.Nuclide('U-238', '71c')
@ -67,7 +64,7 @@ class ResonanceScatteringTestHarness(PyAPITestHarness):
res_scatt_ares.E_min = 1e-6
res_scatt_ares.E_max = 210e-6
sets_file = openmc.SettingsFile()
sets_file = openmc.Settings()
sets_file.batches = 10
sets_file.inactive = 5
sets_file.particles = 1000

View file

@ -9,8 +9,6 @@ import numpy as np
sys.path.insert(0, os.pardir)
from testing_harness import PyAPITestHarness
import openmc
import openmc.stats
from openmc.source import Source
class SourceTestHarness(PyAPITestHarness):
@ -18,8 +16,7 @@ class SourceTestHarness(PyAPITestHarness):
mat1 = openmc.Material(material_id=1)
mat1.set_density('g/cm3', 4.5)
mat1.add_nuclide(openmc.Nuclide('U-235', '71c'), 1.0)
materials = openmc.MaterialsFile()
materials.add_material(mat1)
materials = openmc.Materials([mat1])
materials.export_to_xml()
sphere = openmc.Sphere(surface_id=1, R=10.0, boundary_type='vacuum')
@ -31,9 +28,7 @@ class SourceTestHarness(PyAPITestHarness):
root.add_cell(inside_sphere)
geometry = openmc.Geometry()
geometry.root_universe = root
geometry_xml = openmc.GeometryFile()
geometry_xml.geometry = geometry
geometry_xml.export_to_xml()
geometry.export_to_xml()
# Create an array of different sources
x_dist = openmc.stats.Uniform(-3., 3.)
@ -56,11 +51,11 @@ class SourceTestHarness(PyAPITestHarness):
energy2 = openmc.stats.Watt(0.988, 2.249)
energy3 = openmc.stats.Tabular(E, p, interpolation='histogram')
source1 = Source(spatial1, angle1, energy1, strength=0.5)
source2 = Source(spatial2, angle2, energy2, strength=0.3)
source3 = Source(spatial3, angle3, energy3, strength=0.2)
source1 = openmc.Source(spatial1, angle1, energy1, strength=0.5)
source2 = openmc.Source(spatial2, angle2, energy2, strength=0.3)
source3 = openmc.Source(spatial3, angle3, energy3, strength=0.2)
settings = openmc.SettingsFile()
settings = openmc.Settings()
settings.batches = 10
settings.inactive = 5
settings.particles = 1000

View file

@ -5,8 +5,7 @@ import os
import sys
sys.path.insert(0, os.pardir)
from testing_harness import TestHarness
from openmc.statepoint import StatePoint
from openmc.executor import Executor
import openmc
class StatepointRestartTestHarness(TestHarness):
@ -50,17 +49,15 @@ class StatepointRestartTestHarness(TestHarness):
statepoint = statepoint[0]
# Run OpenMC
executor = Executor()
if self._opts.mpi_exec is not None:
returncode = executor.run_simulation(mpi_procs=self._opts.mpi_np,
restart_file=statepoint,
openmc_exec=self._opts.exe,
mpi_exec=self._opts.mpi_exec)
returncode = openmc.run(mpi_procs=self._opts.mpi_np,
restart_file=statepoint,
openmc_exec=self._opts.exe,
mpi_exec=self._opts.mpi_exec)
else:
returncode = executor.run_simulation(openmc_exec=self._opts.exe,
restart_file=statepoint)
returncode = openmc.run(openmc_exec=self._opts.exe,
restart_file=statepoint)
assert returncode == 0, 'OpenMC did not exit successfully.'

View file

@ -1 +1 @@
5e168146d91b7b5fadecb80a32df9edc906718fb2d70b68b4c18dbed0641739251a1c16177c9f4d47516dfd528ec930879534292ff0eb82af89eca2c3fa4a3e0
0597eff3fddbc45a09b5b324c9704e540b694b07c136f2040426fdcfe5ec544f036073e4afa34a5fb0fbd721a4c0a609b9b68bf17ce4ec78302023b46b71930c

View file

@ -4,7 +4,7 @@ import os
import sys
sys.path.insert(0, os.pardir)
from testing_harness import PyAPITestHarness
from openmc import Filter, Mesh, Tally, TalliesFile
from openmc import Filter, Mesh, Tally, Tallies
from openmc.source import Source
from openmc.stats import Box
@ -42,7 +42,8 @@ class TalliesTestHarness(PyAPITestHarness):
mesh_2x2.lower_left = [-182.07, -182.07]
mesh_2x2.upper_right = [182.07, 182.07]
mesh_2x2.dimension = [2, 2]
mesh_filter = Filter(type='mesh', bins=(1,))
mesh_filter = Filter(type='mesh')
mesh_filter.mesh = mesh_2x2
azimuthal_tally4 = Tally()
azimuthal_tally4.filters = [azimuthal_filter2, mesh_filter]
azimuthal_tally4.scores = ['flux']
@ -170,33 +171,19 @@ class TalliesTestHarness(PyAPITestHarness):
all_nuclide_tallies[0].estimator = 'tracklength'
all_nuclide_tallies[0].estimator = 'collision'
self._input_set.tallies = TalliesFile()
self._input_set.tallies.add_tally(azimuthal_tally1)
self._input_set.tallies.add_tally(azimuthal_tally2)
self._input_set.tallies.add_tally(azimuthal_tally3)
self._input_set.tallies.add_tally(azimuthal_tally4)
self._input_set.tallies.add_tally(cellborn_tally)
self._input_set.tallies.add_tally(dg_tally)
self._input_set.tallies.add_tally(energy_tally)
self._input_set.tallies.add_tally(energyout_tally)
self._input_set.tallies.add_tally(transfer_tally)
self._input_set.tallies.add_tally(material_tally)
self._input_set.tallies.add_tally(mu_tally1)
self._input_set.tallies.add_tally(mu_tally2)
self._input_set.tallies.add_tally(mu_tally3)
self._input_set.tallies.add_tally(polar_tally1)
self._input_set.tallies.add_tally(polar_tally2)
self._input_set.tallies.add_tally(polar_tally3)
self._input_set.tallies.add_tally(polar_tally4)
self._input_set.tallies.add_tally(universe_tally)
[self._input_set.tallies.add_tally(t) for t in score_tallies]
[self._input_set.tallies.add_tally(t) for t in flux_tallies]
self._input_set.tallies.add_tally(scatter_tally1)
self._input_set.tallies.add_tally(scatter_tally2)
[self._input_set.tallies.add_tally(t) for t in total_tallies]
self._input_set.tallies.add_tally(questionable_tally)
[self._input_set.tallies.add_tally(t) for t in all_nuclide_tallies]
self._input_set.tallies.add_mesh(mesh_2x2)
self._input_set.tallies = Tallies()
self._input_set.tallies += (
[azimuthal_tally1, azimuthal_tally2, azimuthal_tally3,
azimuthal_tally4, cellborn_tally, dg_tally, energy_tally,
energyout_tally, transfer_tally, material_tally, mu_tally1,
mu_tally2, mu_tally3, polar_tally1, polar_tally2, polar_tally3,
polar_tally4, universe_tally])
self._input_set.tallies += score_tallies
self._input_set.tallies += flux_tallies
self._input_set.tallies += (scatter_tally1, scatter_tally2)
self._input_set.tallies += total_tallies
self._input_set.tallies.append(questionable_tally)
self._input_set.tallies += all_nuclide_tallies
self._input_set.export()

View file

@ -1 +1 @@
530a5e969901e153531f74aed46246b1e8783a0e2f347e472f7554c9970152f45d85499f17d7df9c35c74fed6f78d449aa70bf0c1f8947cd34d3a829483a0055
f819f1b3564ca1df1e235f120f4bd65003cd80935fa8261f0a5982b7e7ec5b2e7497716673c142fab99f3fb26c174ac7a12e145b9a6f2caf707d2a07702f6eb2

View file

@ -15,9 +15,6 @@ class TallyAggregationTestHarness(PyAPITestHarness):
# The summary.h5 file needs to be created to read in the tallies
self._input_set.settings.output = {'summary': True}
# Initialize the tallies file
tallies_file = openmc.TalliesFile()
# Initialize the nuclides
u235 = openmc.Nuclide('U-235')
u238 = openmc.Nuclide('U-238')
@ -33,7 +30,7 @@ class TallyAggregationTestHarness(PyAPITestHarness):
tally.filters = [energy_filter, distrib_filter]
tally.scores = ['nu-fission', 'total']
tally.nuclides = [u235, u238, pu239]
tallies_file.add_tally(tally)
tallies_file = openmc.Tallies([tally])
# Export tallies to file
self._input_set.tallies = tallies_file
@ -46,11 +43,6 @@ class TallyAggregationTestHarness(PyAPITestHarness):
statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0]
sp = openmc.StatePoint(statepoint)
# Read the summary file.
summary = glob.glob(os.path.join(os.getcwd(), 'summary.h5'))[0]
su = openmc.Summary(summary)
sp.link_with_summary(su)
# Extract the tally of interest
tally = sp.get_tally(name='distribcell tally')

View file

@ -1 +1 @@
57384883e37964076aa82c19fa542434331cdb09735d710485b5aa0ca3445d543729e40cb9c7b6a70e7101ef186923eb1ff6315c73b01ff257052838add68fc7
bb7e730630f7bb4694a27fd77c3c0171f70c78df2681acc26b0ef88bcff367523b11335f487b46269325adbcee7faeb756484af64055c3c91b0103f7ed962053

View file

@ -16,7 +16,7 @@ class TallyArithmeticTestHarness(PyAPITestHarness):
self._input_set.settings.output = {'summary': True}
# Initialize the tallies file
tallies_file = openmc.TalliesFile()
tallies_file = openmc.Tallies()
# Initialize the nuclides
u235 = openmc.Nuclide('U-235')
@ -43,14 +43,13 @@ class TallyArithmeticTestHarness(PyAPITestHarness):
tally.filters = [material_filter, energy_filter, distrib_filter]
tally.scores = ['nu-fission', 'total']
tally.nuclides = [u235, pu239]
tallies_file.add_tally(tally)
tallies_file.append(tally)
tally = openmc.Tally(name='tally 2')
tally.filters = [energy_filter, mesh_filter]
tally.scores = ['total', 'fission']
tally.nuclides = [u238, u235]
tallies_file.add_tally(tally)
tallies_file.add_mesh(mesh)
tallies_file.append(tally)
# Export tallies to file
self._input_set.tallies = tallies_file
@ -63,11 +62,6 @@ class TallyArithmeticTestHarness(PyAPITestHarness):
statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0]
sp = openmc.StatePoint(statepoint)
# Read the summary file.
summary = glob.glob(os.path.join(os.getcwd(), 'summary.h5'))[0]
su = openmc.Summary(summary)
sp.link_with_summary(su)
# Load the tallies
tally_1 = sp.get_tally(name='tally 1')
tally_2 = sp.get_tally(name='tally 2')

View file

@ -1 +1 @@
8d1ab9e4add51b99045e990ac9c3dad9447e9720d811bc430d4bfdd7c2c035424bcb7750e4a4d0ec0460ea1ef4be46ac58372ed01d55f5d8cfeebbce75559066
bb4ae3b75445846bd5db05a06cc20e7589990154ccef8302f276cd8356630d585c513ebb6bfa99f9fc93dd2d30c42bfbb67dd3454134f4c9fcb3bac128d1f1c5

View file

@ -17,7 +17,7 @@ class TallySliceMergeTestHarness(PyAPITestHarness):
self._input_set.settings.output = {'summary': True}
# Initialize the tallies file
tallies_file = openmc.TalliesFile()
tallies_file = openmc.Tallies()
# Define nuclides and scores to add to both tallies
self.nuclides = ['U-235', 'U-238']
@ -69,10 +69,8 @@ class TallySliceMergeTestHarness(PyAPITestHarness):
for nuclide in self.nuclides:
distribcell_tally.add_nuclide(nuclide)
# Add tallies to a TalliesFile
tallies_file = openmc.TalliesFile()
tallies_file.add_tally(tallies[0])
tallies_file.add_tally(distribcell_tally)
# Add tallies to a Tallies object
tallies_file = openmc.Tallies((tallies[0], distribcell_tally))
# Export tallies to file
self._input_set.tallies = tallies_file
@ -85,17 +83,12 @@ class TallySliceMergeTestHarness(PyAPITestHarness):
statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0]
sp = openmc.StatePoint(statepoint)
# Read the summary file.
summary = glob.glob(os.path.join(os.getcwd(), 'summary.h5'))[0]
su = openmc.Summary(summary)
sp.link_with_summary(su)
# Extract the cell tally
tallies = [sp.get_tally(name='cell tally')]
# Slice the tallies by cell filter bins
cell_filter_prod = itertools.product(tallies, self.cell_filters)
tallies = map(lambda tf: tf[0].get_slice(filters=[tf[1].type],
tallies = map(lambda tf: tf[0].get_slice(filters=[tf[1].type],
filter_bins=[tf[1].get_bin(0)]), cell_filter_prod)
# Slice the tallies by energy filter bins
@ -133,11 +126,11 @@ class TallySliceMergeTestHarness(PyAPITestHarness):
# Extract the distribcell tally
distribcell_tally = sp.get_tally(name='distribcell tally')
# Sum up a few subdomains from the distribcell tally
sum1 = distribcell_tally.summation(filter_type='distribcell',
# Sum up a few subdomains from the distribcell tally
sum1 = distribcell_tally.summation(filter_type='distribcell',
filter_bins=[0,100,2000,30000])
# Sum up a few subdomains from the distribcell tally
sum2 = distribcell_tally.summation(filter_type='distribcell',
sum2 = distribcell_tally.summation(filter_type='distribcell',
filter_bins=[500,5000,50000])
# Merge the distribcell tally slices

View file

@ -13,9 +13,7 @@ import numpy as np
sys.path.insert(0, os.path.join(os.pardir, os.pardir))
from input_set import InputSet, MGInputSet
from openmc.statepoint import StatePoint
from openmc.executor import Executor
import openmc.particle_restart as pr
import openmc
class TestHarness(object):
@ -63,15 +61,13 @@ class TestHarness(object):
self._cleanup()
def _run_openmc(self):
executor = Executor()
if self._opts.mpi_exec is not None:
returncode = executor.run_simulation(mpi_procs=self._opts.mpi_np,
openmc_exec=self._opts.exe,
mpi_exec=self._opts.mpi_exec)
returncode = openmc.run(mpi_procs=self._opts.mpi_np,
openmc_exec=self._opts.exe,
mpi_exec=self._opts.mpi_exec)
else:
returncode = executor.run_simulation(openmc_exec=self._opts.exe)
returncode = openmc.run(openmc_exec=self._opts.exe)
assert returncode == 0, 'OpenMC did not exit successfully.'
@ -90,7 +86,7 @@ class TestHarness(object):
"""Digest info in the statepoint and return as a string."""
# Read the statepoint file.
statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0]
sp = StatePoint(statepoint)
sp = openmc.StatePoint(statepoint)
# Write out k-combined.
outstr = 'k-combined:\n'
@ -158,7 +154,7 @@ class CMFDTestHarness(TestHarness):
"""Digest info in the statepoint and return as a string."""
# Read the statepoint file.
statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0]
sp = StatePoint(statepoint)
sp = openmc.StatePoint(statepoint)
# Write out the eigenvalue and tallies.
outstr = super(CMFDTestHarness, self)._get_results()
@ -195,13 +191,12 @@ class ParticleRestartTestHarness(TestHarness):
'mpi_exec': self._opts.mpi_exec})
# Initial run
executor = Executor()
returncode = executor.run_simulation(**args)
returncode = openmc.run(**args)
assert returncode == 0, 'OpenMC did not exit successfully.'
# Run particle restart
args.update({'restart_file': self._sp_name})
returncode = executor.run_simulation(**args)
returncode = openmc.run(**args)
assert returncode == 0, 'OpenMC did not exit successfully.'
def _test_output_created(self):
@ -216,7 +211,7 @@ class ParticleRestartTestHarness(TestHarness):
"""Digest info in the statepoint and return as a string."""
# Read the particle restart file.
particle = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0]
p = pr.Particle(particle)
p = openmc.Particle(particle)
# Write out the properties.
outstr = ''