Update example Python inputs, fix exporting to XML for <cell>

This commit is contained in:
Paul Romano 2015-09-28 16:53:27 +07:00
parent 6beee729cb
commit f093429ced
7 changed files with 46 additions and 61 deletions

View file

@ -1,4 +1,5 @@
import openmc
from openmc.region import Intersection
###############################################################################
@ -67,20 +68,16 @@ cell7 = openmc.Cell(cell_id=301, name='cell 7')
cell8 = openmc.Cell(cell_id=302, name='cell 8')
# Register Surfaces with Cells
cell1.add_surface(left, halfspace=+1)
cell1.add_surface(right, halfspace=-1)
cell1.add_surface(bottom, halfspace=+1)
cell1.add_surface(top, halfspace=-1)
cell2.add_surface(left, halfspace=+1)
cell2.add_surface(right, halfspace=-1)
cell2.add_surface(bottom, halfspace=+1)
cell2.add_surface(top, halfspace=-1)
cell3.add_surface(fuel1, halfspace=-1)
cell4.add_surface(fuel1, halfspace=+1)
cell5.add_surface(fuel2, halfspace=-1)
cell6.add_surface(fuel2, halfspace=+1)
cell7.add_surface(fuel3, halfspace=-1)
cell8.add_surface(fuel3, halfspace=+1)
cell1.region = Intersection(left.positive, right.negative,
bottom.positive, top.negative)
cell2.region = Intersection(left.positive, right.negative,
bottom.positive, top.negative)
cell3.region = fuel1.negative
cell4.region = fuel1.positive
cell5.region = fuel2.negative
cell6.region = fuel2.positive
cell7.region = fuel3.negative
cell8.region = fuel3.positive
# Register Materials with Cells
cell3.fill = fuel