Skip to content

Incorrect logic in Cell definitions leading to incorrect definitions. #3685

@jude-moo

Description

@jude-moo

Bug Description

Direct reading of a geometry.xml file and immediate writing of the file is altering the geometry unintentionally.

Steps to Reproduce

for a cell defined as:

  <cell id="1" material="4" region="1 -6 (-2 -4) | (-5 3)" universe="1"/>

Run a simple python code:
geom = openmc.Geometry.from_xml('/lustre/home/jk8173/FNG_ss/openmc/write_geometry_test/geometry.2.xml')
geom.export_to_xml('geometry.out.xml')

The outputted cell is defined as,

  <cell id="1" material="4" region="(1 -6 -2 -4) | (-5 3)" universe="1"/>

Which substantially changes the geometry.

I believe the intention of the code is correct, as logically speaking these two definitions are the same. However, in OpenMC, the first line is read as:

  <cell id="1" material="4" region="1 -6 ( (-2 -4) | (-5 3) )" universe="1"/>

Environment

OpenMC version 0.15.3-dev110

Ran on Linux

geometry.2.xml

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions