Hello, I’m currently using Windows 10 and trying to create a script to automate meshing and simulation tasks. The main goal is to move nodes based on the stress results, this involves multiples iterations calling salome (to edit the mesh) and aster_study (to run the FEA) from my python IDE (Spyder) using 'Popen" from “subprocess” library.
Ideally, I would like to use salome python libraries by just typing: “import salome”, “import GEOM”, “import SMESH” to edit a mesh, but I don’t have access to these libraries in my python instance - in Spyder IDE. In this scenario I would be able to execute ‘.MoveNode()’ function from my IDE.
The current solution is working but with manual iterations:
path_meshing = 'run_salome.bat -t --pinter'
mesh_creation = Popen(path_meshing, shell = True, cwd=r"\sm-2019-w64-1.2")
This command opens a 1st terminal (CMD) and then call a 2nd terminal (Python) where I can run python commands (and execute my node movements) manually. The problem is that I lose the connection of the 2nd terminal from python IDE, I just have acess to the 1st terminal (CMD).
In conclusion, I have to apply the “nodeMove()” input mannualy because I don’t have acess to the 2nd terminal from python IDE.
Note: I’ve also tried using
path_meshing = 'run_salome.bat -t --pinter MyAutomation.py'
mesh_creation = Popen(path_meshing, shell = True, cwd=r"\sm-2019-w64-1.2")
But the main problem here is that I have to execute this command several times (and also because the ‘MyAutomation.py’ needs to be updated each iteration).
Besides that, the time to open salome each iterations consumes almost 8 seconds. For an example, I’m running basic tests and the salome is consuming almost 80% of the total time (1000s) in just 100 iterations .
This currently solution is too slow and also creates multiples terminal windows (making it impossible to use the machine while running the script). Because I’ve to reopen a new instance of salome each time I want to move nodes in my mesh…
I hope someone will be able to help me, thank you!