Speed up find_cell searches for geometries with many z-planes
Created by: smharper
This PR is aimed at speeding up multiphysics calculations that typically cut the geometry up with a bunch of z-planes. Neighbor lists cannot be used when crossing lattice and universe boundaries which results in a very expensive search with finely discretized models. This PR cuts down the cost of those
find_cells by performing a binary search on the z-planes. After the binary search, the code can just check the small list of cells that can be found between the two bounding planes.
I did a timing test on my quarter-assembly multiphysics model with 37 axial regions. When combined with #1208, I see a 60% increase in the neutrons per second.
There is also a ton of improvements we can make later to build off of this PR.
- Right now it only considers z-planes, but it is natural to extend the work to the other planes, cylinders, and spheres.
- This code can be further optimized by better handling cells that do not contain z-planes. Currently those cells are added to all of the possible search outputs, e.g. the code doesn't check to see if a spherical cell is contained between a subset of the z-planes.
- In the future, we could also potentially have the code automatically detect universes with many cells (such as TRISO compacts) and add fake surfaces that aren't used in any region specifications but accelerate the searches.