Small fixes for #548

This commit is contained in:
Sterling Harper 2016-01-13 11:36:05 -05:00
parent a7ac2db068
commit 445c969804
3 changed files with 38 additions and 29 deletions

View file

@ -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

View file

@ -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

View file

@ -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.*')