From ff5490e3ba432209a95cb75ce07d21b167f90efd Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Fri, 22 Jul 2022 08:01:28 +0100 Subject: [PATCH] User able to set bounding cell id --- openmc/universe.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/openmc/universe.py b/openmc/universe.py index 5bcbfde468..fe41674d54 100644 --- a/openmc/universe.py +++ b/openmc/universe.py @@ -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