Hi all,
I’m trying to generalize a CSG definition where some cells are free to move around, and others may appear based on others’ locations. I’m using the Python API to define the cells and regions with a function that takes x position as an argument and returns two lists - one is the list of cells and the other is the list of regions (i.e. region_list.append(-box100 & -box101)
). I was hoping to take this list of regions and use the complement of each element to define the region for my air-filled “World” volume. Is there a good way to do this?
Basically, is it possible to convert
region_list = [-box100 & -box101, -box102 & -box103]
into
World = openmc.Cell(fill=Air, region = ~region_list[0] & ~region_list[1])
for an arbitrary (and potentially changing) number of list elements?