GEOUNED-org / GEOUNED

A tool to convert CAD to CSG & CSG to CAD for Monte Carlo transport codes
European Union Public License 1.2
53 stars 29 forks source link

OpenMC output format restructuring #110

Open alberto743 opened 4 months ago

alberto743 commented 4 months ago

src/geouned/GEOUNED/Write/OpenMCFormat.py contains the OpenmcInput output driver class, which in turn exposes to main functions writeXML and writePY. The writeXML method should be rewritten employing the ElementTree Python package since it provides a standard way to deal with XML documents in Python. The writePY method is constructed as a code generator, in which a Python script is written to be run later. Instead, we should think about calling directly the relevant OpenMC Python API. It should be noted that OpenMC Python API shall be managed via multiprocessing into a different interpreter instance, to avoid side effects of the internal object persistence due to the current nature of the OpenMC Python to C++ bindings.

shimwell commented 3 months ago

I've been working through the openmc code to make openmc classes fully constructed on class initialization

here are the PRs

https://github.com/openmc-dev/openmc/pulls?q=is%3Apr+constructor+is%3Aclosed+author%3Ashimwell

Once this is complete for all the geometry classes then making the python code from openmc xml files will be easy