From 49e22c9091acfe51939cb17c7b87690f54a89f76 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Mon, 7 Dec 2020 10:09:42 -0600 Subject: [PATCH] Correcting extraction of surface type from hdf5 formats. --- openmc/surface.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openmc/surface.py b/openmc/surface.py index 3c2c550101..70fd008318 100644 --- a/openmc/surface.py +++ b/openmc/surface.py @@ -453,15 +453,19 @@ class Surface(IDManagerMixin, ABC): """ + # If this is a DAGMC surface, do nothing for now + geom_type = group['geom_type'][()].decode() + if geom_type == 'dagmc': + return + surface_id = int(group.name.split('/')[-1].lstrip('surface ')) name = group['name'][()].decode() if 'name' in group else '' - surf_type = group['geom_type'][()].decode() - if surf_type == 'dagmc': - return + bc = group['boundary_type'][()].decode() coeffs = group['coefficients'][...] kwargs = {'boundary_type': bc, 'name': name, 'surface_id': surface_id} + surf_type = group['type'][()].decode() cls = _SURFACE_CLASSES[surf_type] return cls(*coeffs, **kwargs)