From 445c96980445703f3c8561c499eb788a092c51f2 Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Wed, 13 Jan 2016 11:36:05 -0500 Subject: [PATCH] Small fixes for #548 --- src/initialize.F90 | 7 ++- src/input_xml.F90 | 4 +- tests/test_distribmat/test_distribmat.py | 56 +++++++++++++----------- 3 files changed, 38 insertions(+), 29 deletions(-) diff --git a/src/initialize.F90 b/src/initialize.F90 index a50fe09a01..de681fb949 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -625,7 +625,7 @@ contains c % fill = lid else call fatal_error("Specified fill " // trim(to_str(id)) // " on cell "& - &// trim(to_str(c % id)) // " is neither a universe nor a & + // trim(to_str(c % id)) // " is neither a universe nor a & &lattice.") end if else @@ -638,7 +638,7 @@ contains c % material(j) = material_dict % get_key(id) else call fatal_error("Could not find material " // trim(to_str(id)) & - &// " specified on cell " // trim(to_str(c % id))) + // " specified on cell " // trim(to_str(c % id))) end if end do end if @@ -1115,6 +1115,9 @@ contains end if end do + ! Free up memory + call cell_list % clear() + end subroutine allocate_offsets end module initialize diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 41ee5aab2a..1ca8cc8799 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -1104,7 +1104,7 @@ contains ! Check for error if (c % material(j) == ERROR_INT) then call fatal_error("Invalid material specified on cell " & - &// to_str(c % id)) + // to_str(c % id)) end if end select end do @@ -1124,7 +1124,7 @@ contains ! Check to make sure that either material or fill was specified if (c % material(1) == NONE .and. c % fill == NONE) then call fatal_error("Neither material nor fill was specified for cell " & - &// trim(to_str(c % id))) + // trim(to_str(c % id))) end if ! Check to make sure that both material and fill haven't been diff --git a/tests/test_distribmat/test_distribmat.py b/tests/test_distribmat/test_distribmat.py index f0d09e963a..b1252a8e7b 100644 --- a/tests/test_distribmat/test_distribmat.py +++ b/tests/test_distribmat/test_distribmat.py @@ -90,31 +90,31 @@ class DistribmatTestHarness(PyAPITestHarness): sets_file.export_to_xml() -# #################### -# # Plots -# #################### -# -# plots_file = openmc.PlotsFile() -# -# plot = openmc.Plot(plot_id=1) -# plot.basis = 'xy' -# plot.color = 'cell' -# plot.filename = 'cellplot' -# plot.origin = (0, 0, 0) -# plot.width = (7, 7) -# plot.pixels = (400, 400) -# plots_file.add_plot(plot) -# -# plot = openmc.Plot(plot_id=2) -# plot.basis = 'xy' -# plot.color = 'mat' -# plot.filename = 'matplot' -# plot.origin = (0, 0, 0) -# plot.width = (7, 7) -# plot.pixels = (400, 400) -# plots_file.add_plot(plot) -# -# plots_file.export_to_xml() + #################### + # Plots + #################### + + plots_file = openmc.PlotsFile() + + plot = openmc.Plot(plot_id=1) + plot.basis = 'xy' + plot.color = 'cell' + plot.filename = 'cellplot' + plot.origin = (0, 0, 0) + plot.width = (7, 7) + plot.pixels = (400, 400) + plots_file.add_plot(plot) + + plot = openmc.Plot(plot_id=2) + plot.basis = 'xy' + plot.color = 'mat' + plot.filename = 'matplot' + plot.origin = (0, 0, 0) + plot.width = (7, 7) + plot.pixels = (400, 400) + plots_file.add_plot(plot) + + plots_file.export_to_xml() def _get_results(self): outstr = super(DistribmatTestHarness, self)._get_results() @@ -122,6 +122,12 @@ class DistribmatTestHarness(PyAPITestHarness): outstr += str(su.get_cell_by_id(11)) return outstr + def _cleanup(self): + f = os.path.join(os.getcwd(), 'plots.xml') + if os.path.exists(f): + os.remove(f) + super(DistribmatTestHarness, self)._cleanup() + if __name__ == '__main__': harness = DistribmatTestHarness('statepoint.5.*')