Adding minimal volume checking CI comparing CAD and CSG volumes #56
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds to the CI with some tests that check the volume of the CAD file and the volume of the resulting CSG file.
The tests can be run locally or on the CI. When run locally the volume tolerance is decreased and the number of samples is increased in the stochastic volume calculation.
There were a few approaches that could have bee taken with this. I first made an implementation that did one stochastic volume calculation per model with a large bounding box over the whole model. While this worked I found it was quicker to do a stochastic volume calculation for every cell in every model. In this way the bound boxes were more compact around the solid and the stochastic volume calculation was more efficient.
Several of the stp files have been removed from the volume calculation test. While they all convert on the existing conversion testing CI they don't all result in the same volumes for both CSG and CAD. I've raised an issue for the simplest two stp files as they are single volumes that contain torus. I think the conversion bug can be tracked in that issue tackled separately and then we can introduce more of the stp files into the volume testing CI.
For now the volume testing CI doesn't cover all the stp files but I think it is still very useful to have as it makes sure that as we refactor and add to the code that we don't lose the capability of converting the stp files that are currently successfully converted.
As openmc runs best on linux I've only added these volume tests for ubuntu and excluded mac and windows from this testing.
As it is setup at the moment with the number of samples and acceptable tolerance and the removal of some step files the addition of these volume tests add about 1 min to the current CI. Naturally increasing the samples, reducing the acceptable tolerance or including some of the missing stp files will increase that 1 min.