Fixed energyout filter indices in mg mode, fixed failing test_mg_convert and test_mgxs_library_ce_to_mg due to sp and su files not being closed

This commit is contained in:
Adam Nelson 2017-03-04 05:13:55 -05:00
parent 7927a2d814
commit 3b5ebc0eff
3 changed files with 15 additions and 1 deletions

View file

@ -2523,9 +2523,13 @@ contains
if (.not. run_CE .and. eo_filt % matches_transport_groups) then
! determine outgoing energy from fission bank
! determine outgoing energy group from fission bank
g_out = int(fission_bank(n_bank - p % n_bank + k) % E)
! modify the value so that g_out = 1 corresponds to the highest
! energy bin
g_out = size(eo_filt % bins) - g_out
! change outgoing energy bin
matching_bins(i) = g_out

View file

@ -154,6 +154,11 @@ class MGXSTestHarness(PyAPITestHarness):
form = '{0:12.6E} {1:12.6E}\n'
outstr += form.format(sp.k_combined[0], sp.k_combined[1])
# Enforce closing statepoint and summary files so HDF5
# does not throw an error during the next OpenMC execution
sp._f.close()
sp._summary._f.close()
return outstr
def _get_results(self, outstr, hash_output=False):

View file

@ -71,6 +71,11 @@ class MGXSTestHarness(PyAPITestHarness):
if os.path.exists('./tallies.xml'):
os.remove('./tallies.xml')
# Enforce closing statepoint and summary files so HDF5
# does not throw an error during the next OpenMC execution
sp._f.close()
sp._summary._f.close()
# Re-run MG mode.
if self._opts.mpi_exec is not None:
mpi_args = [self._opts.mpi_exec, '-n', self._opts.mpi_np]