Allow cells filled with lattices to be translated/rotated
Created by: paulromano
This PR implements the ability to translate/rotate cells that are filled with rectangular or hexagonal lattices, which has not been possible until now (closes #161). This makes it very straightforward to create a hexagonal lattice in a different orientation than the default -- all you need to do is add
rotation=(0, 0, 30) to the cell that is filled with the lattice.
Other than removing this longstanding limitation, this is really meant as an alternative to another PR submitted by @dryuri92, #1216, which proposes adding a dedicated syntax for different hexagonal lattice orientations. The benefits of this PR are:
- It is flexible in the sense that now a user can specify any translation/rotation on a lattice without needing an extra coordinate level.
- It doesn't require as many changes at the C++ source level compared to #1216.
- It doesn't introduce new user input or change existing classes.
The downsides are:
- It requires
Positionobjects to be rotated more often compared to having a dedicated syntax like in #1216, so there could be some runtime overhead.
- Changing the orientation of a hexagonal lattice is less obvious. To combat this, I've added an example notebook demonstrating how to work with hexagonal lattices and it shows how they can be rotated.
@openmc-dev/technical-committee I'd love to get second opinions on this PR versus #1216.
I've added a new
lattice_rotated test that includes both a translated/rotated rectangular lattice and translated/rotated hexagonal lattice. Since
lattice_mixed doesn't provide any extra coverage compared to this new test, I've removed it.