Cannot Merge h5m files with CAd_to_OpenMC

Hello,

I ran this code to convert CAD files to h5m using CAD_to_OpenMC:

import CAD_to_OpenMC.assembly as ab

CORE = ab.Assembly([“msre_core.step”])

CORE.run(backend=‘stl2’, merge=True, h5m_filename=‘msre_core.h5m’)

DETECTOR_ROD = ab.Assembly([“Detector Rod3.step”])

DETECTOR_ROD.run(backend=‘stl2’, merge=True, h5m_filename=‘detector_rod3.h5m’)

PIT = ab.Assembly([“msre_pit.step”])

PIT.run(backend=‘stl2’, merge=True, h5m_filename=‘msre_pit.h5m’)

CR = ab.Assembly([“msre_control_rod.step”])

CR.run(backend=‘stl2’, merge=True, h5m_filename=‘msre_control_rod.h5m’)

ab.merge2h5m([CORE,PIT], h5m_file=‘msre_reactor.h5m’)

However, I got the following error:

INFO: reassembling stl-files into h5m structure msre_reactor.h5m
MOAB ERROR: --------------------- Error Message ------------------------------------
MOAB ERROR: vol_1_face0000.stl: No such file or directory!
MOAB ERROR: serial_load_file() line 527 in src/Core.cpp
MOAB ERROR: load_file() line 471 in src/Core.cpp
Traceback (most recent call last):
File “/home/elie/Thesis2024/Simulation Files/script2.py”, line 22, in
ab.merge2h5m([CORE, PIT], h5m_file=‘msre_reactor.h5m’)
File “/home/elie/micromamba/envs/msresim/lib/python3.9/site-packages/CAD_to_OpenMC/assembly.py”, line 1133, in merge2h5m
mbcore = a.add_entities_to_moab_core(mbcore, mbtags, noimplicit=True, in_datadir=a.datadir)
File “/home/elie/micromamba/envs/msresim/lib/python3.9/site-packages/CAD_to_OpenMC/assembly.py”, line 663, in add_entities_to_moab_core
mbcore.load_file(str(pl.Path(in_datadir) / f), fset)
File “pymoab/core.pyx”, line 91, in pymoab.core.Core.load_file
File “pymoab/types.pyx”, line 109, in pymoab.types.check_error
OSError: MOAB ErrorCode: MB_FILE_DOES_NOT_EXIST

Perhaps not a clear error message that is being returned here but I think MOAB is saying that it can’t find the h5m file at the specified path. You could try putting in the absolute path instead of the relative path to the h5m file

Many apologies for not noticing this one before now ( I am the author of CAD_to_OpenMC ). Is this problem still relevant? If so - the best way for me to help you is for you to raise an issue in the CAD_to_OpenMC repo at GitHub - united-neux/CAD_to_OpenMC: code to target the conversion from a step-file to a h5m-geometry for neutronics.

Not sure what could cause this particular problem but (shooting from the hip): A likely candidate is the fact that you have spaces in the path to your working directory.
cheers
Erik