mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Set Model attributes only if needed (#3209)
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
parent
cf3f0201a0
commit
d39a414011
1 changed files with 5 additions and 16 deletions
|
|
@ -64,22 +64,11 @@ class Model:
|
|||
|
||||
def __init__(self, geometry=None, materials=None, settings=None,
|
||||
tallies=None, plots=None):
|
||||
self.geometry = openmc.Geometry()
|
||||
self.materials = openmc.Materials()
|
||||
self.settings = openmc.Settings()
|
||||
self.tallies = openmc.Tallies()
|
||||
self.plots = openmc.Plots()
|
||||
|
||||
if geometry is not None:
|
||||
self.geometry = geometry
|
||||
if materials is not None:
|
||||
self.materials = materials
|
||||
if settings is not None:
|
||||
self.settings = settings
|
||||
if tallies is not None:
|
||||
self.tallies = tallies
|
||||
if plots is not None:
|
||||
self.plots = plots
|
||||
self.geometry = openmc.Geometry() if geometry is None else geometry
|
||||
self.materials = openmc.Materials() if materials is None else materials
|
||||
self.settings = openmc.Settings() if settings is None else settings
|
||||
self.tallies = openmc.Tallies() if tallies is None else tallies
|
||||
self.plots = openmc.Plots() if plots is None else plots
|
||||
|
||||
@property
|
||||
def geometry(self) -> openmc.Geometry | None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue