You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to convert a STEP file into an OpenMC .xml file. The conversion via GEOUNED succeeds but it creates cells that references a non-existent surface (surface 0). This causes an issue when loading in OpenMC, as it won't be able to locate the surface. No error is thrown by GEOUNED.
The STEP file and the OpenMC .xml and .py files are available in this link to download.
To Reproduce
Steps to reproduce the behaviour:
Download the Defeature_Simplify_0.stp file from the link above
The code will produce OpenMC geometry .xml and .py files with cells that reference a non-existent surface S0. This can be shown in the below snippet of the first cell's definition which requires the positive half-space of surface S0:
I expected for the cells to not reference cell S0 - I've seen in previous conversion files by GEOUNED the surface indexing starts at 1.
Error message
If applicable, include the error message displayed in the console: strange type of surface, unexpected exit, python
exception…
No error is thrown by GEOUNED. But upon loading the file using openmc.Geometry.from_xml, this error is thrown by OpenMC:
model.geometry = openmc.Geometry.from_xml(path = geometry_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/raska/miniconda3/envs/openmc/lib/python3.12/site-packages/openmc/geometry.py", line 300, in from_xml
return cls.from_xml_element(root, materials)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/raska/miniconda3/envs/openmc/lib/python3.12/site-packages/openmc/geometry.py", line 254, in from_xml_element
c = openmc.Cell.from_xml_element(e, surfaces, mats, get_universe)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/raska/miniconda3/envs/openmc/lib/python3.12/site-packages/openmc/cell.py", line 759, in from_xml_element
c.region = Region.from_expression(region, surfaces)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/raska/miniconda3/envs/openmc/lib/python3.12/site-packages/openmc/region.py", line 124, in from_expression
tokens.append(+surfaces[abs(j)])
~~~~~~~~^^^^^^^^
KeyError: 0
Please complete the following information):
OS: Description: Ubuntu 22.04.4 LTS
GEOUNED version: 1.2.0
Python version: 3.12.5
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Thanks for this! Can confirm the CAD file contains splines. Is it possible to add a feature that stops conversion when splines are detected? Or a pre-check before solid decomposition?
Describe the bug
I am trying to convert a STEP file into an OpenMC .xml file. The conversion via GEOUNED succeeds but it creates cells that references a non-existent surface (surface 0). This causes an issue when loading in OpenMC, as it won't be able to locate the surface. No error is thrown by GEOUNED.
The STEP file and the OpenMC .xml and .py files are available in this link to download.
To Reproduce
Steps to reproduce the behaviour:
The code will produce OpenMC geometry .xml and .py files with cells that reference a non-existent surface S0. This can be shown in the below snippet of the first cell's definition which requires the positive half-space of surface S0:
Expected behaviour
I expected for the cells to not reference cell S0 - I've seen in previous conversion files by GEOUNED the surface indexing starts at 1.
Error message
If applicable, include the error message displayed in the console: strange type of surface, unexpected exit, python
exception…
No error is thrown by GEOUNED. But upon loading the file using openmc.Geometry.from_xml, this error is thrown by OpenMC:
Please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: