Warning for bounds with inf values
A user recently reached out to us with a problem about OpenMC crashing during volume calculation. This was caused by inf values in the definition of the volume calculation's box.
<lower_left>-inf -2.375 0.0</lower_left>
<upper_right>inf 2.375 53.0</upper_right>
These values came from the global bounding box for the user's model
llc, urc = main_cell.bounding_box()
which in their case was a hexagon w/ sides parallel to the y axis.
This is pretty clean and, ideally, OpenMC's bounding box routines would be able to return a finite bounding box for this cell. At the moment this returns a box with +/- infinity along the x-axis, however.
The user requested that we display a warning for bounds applied in volume calculations with infinite values. I think this is a fair request. There are a couple of other places where this might be useful as well:
- lattice corners
- source boxes
Some kind of "finite point" check in our check value.py module that will display a warning or raise an error (whichever we feel is more appropriate for the situation) would do the trick.
Additionally, we could support parsing inf in the input XML as this is technically valid for 1D/2D models. Seeing as we don't have a way of detecting the dimensionality of the geometry on initialization to check that inf is ok, I'd say it's best to leave it at the warnings/errors in the Python API for now.
@pshriwise Agreed that warnings/errors are the right approach here.
As a side note, yeah it does suck that we can't compute the bounding box of a hexagon properly, but I don't think there's an easy way to resolve that. Once you have non-axis-aligned planes, the bounding boxes go to infinity.