Questions about HexLattice

I constructed a HexLattice:

u = openmc.Universe(…)
hl = openmc.HexLattice(…)
hl.universes=[ [u]*18, [u]*12, [u]*6, [u] ]
hlc = openmc.Cell(fill=hl, region=…)
root = openmc.Universe(cells=[hlc])
Using root.plot() I see them laid out properly, so it is clearly using many instances of u – but Universe has no position variable or translation() function – how does each instance of u know where it is located?

Somehow it must be calling Cell.clone() – how do I tell HexLattice to clone the regions but not the materials (fuel is continuously-mixed molten salt)? I do want to do depletion studies.

Or do I have to use a separate Universe for each instance in the HexLattice.universes 2D list, calling Cell.clone() myself when constructing each Universe? If so, giving Universe a clone() function would help a lot (same arguments as Cell.clone)…

This is not addressed in the example, which constructs HexLattice.universes as I did, using many repeats of a single universe.

Hi @tjrob and welcome to the community! I’m not sure I understand what you are intending to do. In the example you have here, the same universe will be repeated in each lattice position. Although there is no translation specified, OpenMC knows to translate the universe to the center of the lattice position. So in this case, each cell is repeated so that you have many “instances” of the same cell, but it is never cloned. Do you want to have different universes/cells in each lattice position? Note that even if you don’t have different universes/cells, it is still possible to tally different instances of the same repeated cell using DistribcellFilter or CellInstanceFilter. You can also assign unique materials to repeated instances of a cell.