mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Updated hexagonal lattice tests to use new StatePoint API
This commit is contained in:
parent
a614ba3a3b
commit
2be0c934c9
4 changed files with 6 additions and 22 deletions
|
|
@ -730,4 +730,4 @@ class StatePoint(object):
|
|||
if self._hdf5:
|
||||
return str(self._f[path].value)
|
||||
else:
|
||||
return str(self._get_data(n, 's', 1)[0])
|
||||
return str(self._get_data(n, 's', 1)[0])
|
||||
|
|
@ -703,24 +703,6 @@ class Tally(object):
|
|||
'string'.format(score, self._id)
|
||||
raise ValueError(msg)
|
||||
|
||||
elif 'scatter-' in score:
|
||||
|
||||
moment = score.split('-')[-1]
|
||||
|
||||
if 'p' in moment.lower() or 'y' in moment.lower():
|
||||
moment = moment[1:]
|
||||
|
||||
if int(moment) < 0 or int(moment) > 10:
|
||||
msg = 'Unable to add score {0} to Tally ID={1} since OpenMC ' \
|
||||
'can only tally the scattering moments between 0 and ' \
|
||||
'10'.format(score, self._id)
|
||||
raise ValueError(msg)
|
||||
|
||||
elif not score in SCORE_TYPES.values():
|
||||
msg = 'Unable to add score {0} to Tally ID={1} since it is not a ' \
|
||||
'supported score in OpenMC'.format(score, self._id)
|
||||
raise ValueError(msg)
|
||||
|
||||
# If the score is already in the Tally, don't add it again
|
||||
if score in self._scores:
|
||||
return
|
||||
|
|
@ -1254,4 +1236,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")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import numpy as np
|
||||
|
||||
sys.path.insert(0, '../../src/utils')
|
||||
|
||||
|
|
@ -17,10 +18,10 @@ sp.read_results()
|
|||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import numpy as np
|
||||
|
||||
sys.path.insert(0, '../../src/utils')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue