mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
Geometric intrinsics now use property setter/getter decorators
This commit is contained in:
parent
9cada4df0e
commit
5dac75297d
14 changed files with 1014 additions and 466 deletions
|
|
@ -25,7 +25,7 @@ fuel.add_nuclide(u235, 1.)
|
|||
|
||||
# Instantiate a MaterialsFile, register Material, and export to XML
|
||||
materials_file = openmc.MaterialsFile()
|
||||
materials_file.set_default_xs('71c')
|
||||
materials_file.default_xs = '71c'
|
||||
materials_file.add_material(fuel)
|
||||
materials_file.export_to_xml()
|
||||
|
||||
|
|
@ -42,12 +42,12 @@ surf4 = openmc.YPlane(surface_id=4, y0=+1, name='surf 4')
|
|||
surf5 = openmc.ZPlane(surface_id=5, z0=-1, name='surf 5')
|
||||
surf6 = openmc.ZPlane(surface_id=6, z0=+1, name='surf 6')
|
||||
|
||||
surf1.set_boundary_type('vacuum')
|
||||
surf2.set_boundary_type('vacuum')
|
||||
surf3.set_boundary_type('reflective')
|
||||
surf4.set_boundary_type('reflective')
|
||||
surf5.set_boundary_type('reflective')
|
||||
surf6.set_boundary_type('reflective')
|
||||
surf1.boundary_type = 'vacuum'
|
||||
surf2.boundary_type = 'vacuum'
|
||||
surf3.boundary_type = 'reflective'
|
||||
surf4.boundary_type = 'reflective'
|
||||
surf5.boundary_type = 'reflective'
|
||||
surf6.boundary_type = 'reflective'
|
||||
|
||||
# Instantiate Cell
|
||||
cell = openmc.Cell(cell_id=1, name='cell 1')
|
||||
|
|
@ -61,7 +61,7 @@ cell.add_surface(surface=surf5, halfspace=+1)
|
|||
cell.add_surface(surface=surf6, halfspace=-1)
|
||||
|
||||
# Register Material with Cell
|
||||
cell.set_fill(fuel)
|
||||
cell.fill = fuel
|
||||
|
||||
# Instantiate Universes
|
||||
root = openmc.Universe(universe_id=0, name='root universe')
|
||||
|
|
@ -71,11 +71,11 @@ root.add_cell(cell)
|
|||
|
||||
# Instantiate a Geometry and register the root Universe
|
||||
geometry = openmc.Geometry()
|
||||
geometry.set_root_universe(root)
|
||||
geometry.root_universe = root
|
||||
|
||||
# Instantiate a GeometryFile, register Geometry, and export to XML
|
||||
geometry_file = openmc.GeometryFile()
|
||||
geometry_file.set_geometry(geometry)
|
||||
geometry_file.geometry = geometry
|
||||
geometry_file.export_to_xml()
|
||||
|
||||
|
||||
|
|
@ -85,8 +85,8 @@ geometry_file.export_to_xml()
|
|||
|
||||
# Instantiate a SettingsFile, set all runtime parameters, and export to XML
|
||||
settings_file = openmc.SettingsFile()
|
||||
settings_file.set_batches(batches)
|
||||
settings_file.set_inactive(inactive)
|
||||
settings_file.set_particles(particles)
|
||||
settings_file.batches = batches
|
||||
settings_file.inactive = inactive
|
||||
settings_file.particles = particles
|
||||
settings_file.set_source_space('box', [-1, -1, -1, 1, 1, 1])
|
||||
settings_file.export_to_xml()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue