User able to set bounding cell id

This commit is contained in:
Jonathan Shimwell 2022-07-22 08:01:28 +01:00 committed by GitHub
parent 0256fe90d4
commit ff5490e3ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -767,19 +767,25 @@ class DAGMCUniverse(UniverseBase):
return +lower_x & -upper_x & +lower_y & -upper_y & +lower_z & -upper_z
def bounded_universe(self, **kwargs):
def bounded_universe(self, bounding_cell_id=10000, **kwargs):
"""Returns an openmc.Universe filled with this DAGMCUniverse and bounded
with a cell. Defaults to a box cell with a vacuum surface however this
can be changed using the kwargs which are passed directly to
DAGMCUniverse.bounding_region().
Parameters
----------
bounding_cell_id : int
The cell ID number to use for the bounding cell, defaults to 1000 to reduce
the chance of overlapping ID numbers with the DAGMC geometry.
Returns
-------
openmc.Universe
Universe instance
"""
bounding_cell = openmc.Cell(fill=self, region=self.bounding_region(**kwargs))
bounding_cell = openmc.Cell(fill=self, id=bounding_cell_id, region=self.bounding_region(**kwargs))
return openmc.Universe(cells=[bounding_cell])
@classmethod