Merge pull request #2263 from eepeterson/redundant_surf_fix

Fix for finding redundant surfaces
This commit is contained in:
Paul Romano 2022-11-10 05:18:24 -08:00 committed by GitHub
commit 1a91fc6fcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 82 additions and 36 deletions

View file

@ -339,12 +339,13 @@ def test_remove_redundant_surfaces():
water = get_cyl_cell(r2, r3, z1, z2, m3)
root = openmc.Universe(cells=[fuel, clad, water])
geom = openmc.Geometry(root)
geom.merge_surfaces=True
model = openmc.model.Model(geometry=geom,
materials=openmc.Materials([m1, m2, m3]))
# There should be 6 redundant surfaces in this geometry
n_redundant_surfs = len(geom.get_redundant_surfaces().keys())
n_redundant_surfs = len(geom.remove_redundant_surfaces().keys())
assert n_redundant_surfs == 6
# Remove redundant surfaces
geom.remove_redundant_surfaces()
# There should be 0 remaining redundant surfaces
n_redundant_surfs = len(geom.get_redundant_surfaces().keys())
n_redundant_surfs = len(geom.remove_redundant_surfaces().keys())
assert n_redundant_surfs == 0