mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Fixed score strings for scatter-*n and added statepoint.close() routine
This commit is contained in:
parent
8c3789cb78
commit
b0e0e6d026
3 changed files with 7 additions and 20 deletions
|
|
@ -56,6 +56,9 @@ class StatePoint(object):
|
|||
self._read_tallies()
|
||||
|
||||
|
||||
def close(self):
|
||||
self._f.close()
|
||||
|
||||
@property
|
||||
def k_combined(self):
|
||||
return self._k_combined
|
||||
|
|
@ -382,9 +385,9 @@ class StatePoint(object):
|
|||
# If this is a scattering moment, insert the scattering order
|
||||
if '-n' in score:
|
||||
score = score.replace('-n', '-' + str(scatt_order[j]))
|
||||
elif '-yn' in score:
|
||||
score = score.replace('-pn', '-p' + str(scatt_order[j]))
|
||||
elif '-pn' in score:
|
||||
score = score.replace('-pn', '-p' + str(scatt_order[j]))
|
||||
elif '-yn' in score:
|
||||
score = score.replace('-yn', '-y' + str(scatt_order[j]))
|
||||
|
||||
tally.add_score(score)
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ class Summary(object):
|
|||
|
||||
if fill_type == 'normal':
|
||||
fill = self._f['geometry/cells'][key]['material'][0]
|
||||
elif fill_type == 'fill':
|
||||
elif fill_type == 'universe':
|
||||
fill = self._f['geometry/cells'][key]['fill'][0]
|
||||
else:
|
||||
fill = self._f['geometry/cells'][key]['lattice'][0]
|
||||
|
|
@ -274,12 +274,6 @@ class Summary(object):
|
|||
cell = openmc.Cell(cell_id=cell_id)
|
||||
|
||||
if fill_type == 'universe':
|
||||
maps = self._f['geometry/cells'][key]['maps'][0]
|
||||
|
||||
if maps > 0:
|
||||
offset = self._f['geometry/cells'][key]['offset'][...]
|
||||
cell.set_offset(offset)
|
||||
|
||||
translated = self._f['geometry/cells'][key]['translated'][0]
|
||||
if translated:
|
||||
translation = \
|
||||
|
|
@ -360,13 +354,6 @@ class Summary(object):
|
|||
dimension = self._f['geometry/lattices'][key]['dimension'][...]
|
||||
lower_left = self._f['geometry/lattices'][key]['lower_left'][...]
|
||||
outside = self._f['geometry/lattices'][key]['outside'][0]
|
||||
maps = self._f['geometry/lattices'][key]['maps'][0]
|
||||
offset_size = self._f['geometry/lattices'][key]['offset_size'][0]
|
||||
|
||||
if offset_size > 0:
|
||||
offsets = self._f['geometry/lattices'][key]['offsets'][...]
|
||||
offsets = np.swapaxes(offsets, 0, 1)
|
||||
offsets = np.swapaxes(offsets, 1, 2)
|
||||
|
||||
universe_ids = self._f['geometry/lattices'][key]['universes'][...]
|
||||
universe_ids = np.swapaxes(universe_ids, 0, 1)
|
||||
|
|
@ -398,9 +385,6 @@ class Summary(object):
|
|||
if outside != -1:
|
||||
lattice.set_outside(self.materials[outside])
|
||||
|
||||
if offset_size > 0:
|
||||
lattice.set_offsets(offsets)
|
||||
|
||||
# Add the Lattice to the global dictionary of all Lattices
|
||||
self.lattices[index] = lattice
|
||||
|
||||
|
|
|
|||
|
|
@ -1250,4 +1250,4 @@ class TalliesFile(object):
|
|||
# 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")
|
||||
Loading…
Add table
Add a link
Reference in a new issue