openmc
openmc copied to clipboard
Fix distribcell labels for lattices used as fill in multiple cells
Description
Partial fix for #2798. This fixes the creation of distribcell filter bin labels for the tallies.out file and the DistribcellFilter::get_all_bins for models that fill more than one cell with the same lattice. Without this change, all tally cell instance results are attributed to the set of cell instances in the first use of the lattice. I've extended the test_cell_instances.py to ensure that the tallies.out file is written successfully and that tally results are present for all bins in the test problem to verify that this fix is correct.
Note: This fix only applies to the RectangularLattice further corrections are needed for HexagonalLattice's (see #2798) for more info.
Checklist
- [x] I have performed a self-review of my own code
- [x] I have run clang-format (version 15) on any C++ source files (if applicable)
- [x] ~I have followed the style guidelines for Python source files (if applicable)~
- [x] ~I have made corresponding changes to the documentation (if applicable)~
- [x] I have added tests that prove my fix is effective or that my feature works (if applicable)