I’m filling a lattice and my Y indices are inverted or flipped with respect to what I would expect.
In MCNP on the lattice line I can change the order of the surfaces to ‘switch’ the direction of the indexing. And I can do this for only Y.
Is there a way I can do this in OpenMC?
My only other solution is to go back to my lattice and use a script to re-order it.
Rotations won’t work as the geometry is now ‘reflected’.
The openmc-plotter shows exactly the geometry I want with my lattice pitch of “1.0 -1.0 1.0” and the appropriate transformations.
But the execution of openmc gives numerous “had a negative distance to a lattice boundary” lost particles,
which I am pretty sure are due to my negative pitch.
So the original question stands, unless any other ideas for my negative pitch.
Hey @yrrepy. Yes, in OpenMC when you specify the universes for a rectangular lattice, the y-indices are reversed (goes from higher y coordinates to lower y coordinates). This makes it such that when you “look” at your code, e.g.:
it corresponds visually to what you would see if you took a slice through the geometry (i.e., what you’ll see in the plotter). If you want to reverse the y direction, the best thing I can suggest is to use numpy indexing capabilities. So, set the universes using a numpy array:
# reverse y direction
lattices.universes[:] = lattice.universes[::-1, :]
Our lattices were never designed to work with negative pitches, although perhaps it wouldn’t be too difficult for us to make some fixes in the code such that it would.