Hi,
I have a large HDF file already set up and ready for mesh computation. I need to run the computation on an Azure VM since I don’t have enough RAM on my laptop.
In the Python API, is there a way to load the compute-ready HDF file, run the mesh computatation, and save the mesh? I could do it with GUI on the Azure VM but I’d have to maintain the SSH connection until the computation is done.
Thanks in advance!
Hello,
From what I understand you might need to generate a python dump ? It is a python script that reproduces all the steps of the generation of the geometry and the mesh of the HDF file. It is also lighter than an HDF file.
You just need to do “File > Dump Study”. You can then load it again in Salome to check if it is working.
Corentin
Hi Corentin,
Thanks for the reply! I am familiar with dumping studies into Python scripts, however, there are 2 main problems with that:
- My HDF is built based on many external 3D models that I no longer have access to, the Python dump requires those component models. My HDF is the only source that contains all the geometric information.
- The HDF file is itself generated by many complex operations using other Python scripts which took me really long time, I don’t want to rerun all the previous operations even if I had all the 3D models I need.
Therefore I really need a way to just “click” the Compute button without launching the GUI.
I’m not sure if the attached script will fit your specific needs, but feel free to check it out. It essentially opens the attached HDF (SF1809.hdf
), computes the mesh named Mesh_1
which is implemented in the HDF but was not computed, then saves the final mesh as a MED file and the study as an HDF file. You might encounter some limitations when adapting it to your case, and I’m sure others have more clever solutions.
Run it with: salome -t SF1809.py
SF1809.py (1.5 KB)
SF1809.hdf (74.1 KB)
2 Likes
Hi Nabil,
This looks exactly like what I need! I’ll test it and get back to you ASAP!
Many thanks
I tried to test your script with my Salome 9.12.0 installation but I got the following error:
Same error when I opened the HDF in GUI. It looks like a version compatibility issue but I never had problems opening an HDF created by a different version of Salome. Do you have any ideas on this?
Thanks!
Are you using the HDF I shared? If so, note that it was produced with SALOME 9.14, and its OCCT version (7.8) is newer than the one used in SALOME 9.12 (V7_5_3p5). This might explain the error which seems to be raised by OCCT.
Thus, if you’re simply checking that the approach is functional with the HDF I shared=d, better use SALOME-9.14.0 or generate one HDF file with SALOME 9.12 in which you implement a box and in SMESH create a mesh which uses NETGEN.
If it still fails and to better understand and assist you, please provide the following details:
- version of SALOME (universal linux, …)
- Operating system (
cat /etc/os-release
)
- environment variables, run
env
.
When sharing your env
command output , make sure to not share any sensitive information (e.g., personal directories, unique identifiers, or credentials).
Note that I strongly suggest you to try with latest SALOME release, you will benefit from several bug fixes and improvements. In principle there is a backward compatibility.
Regards.