faster way to use apdl, pymapdl #1720
-
Hi everyone,
pymapdl.run_multiline("""
/prep7
k,1,coordinates
k,2,coordintaes
l,1,2
""")
pymapdl.prep7()
pymapdl.k() #create first keypoint
pymapdl.k() # create second kp
pymapdl.l() # create line connecting the two kp |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This should be a discussion. Converting... |
Beta Was this translation helpful? Give feedback.
-
Short answerSolving is not affected by PyMAPDL overhead. However sending many PyMAPDL commands is slower than MAPDL commands. Long answerEach PyMAPDL command gets converted to an MAPDL command and then sent to the MAPDL instance. This conversion, sending this command, processing it and getting back takes time. If we compare PyMAPDL and MAPDL commands, the time difference will be only the conversion, which in most of the cases is negligible. Longest answerHowever because PyMAPDL interact with an MAPDL instance (exchanging commands), the more command you send at once the better (you not need to wait for the current command before sending the other one). Hence I can recommend you to use However having said that, unless you do a lot of pymapdl commands (like thousands) the overall time will not change much compared a full MAPDL commands. And as I mentioned at the beginning, the most of the time will go to the solving ( Further readingI recommend you to have a look at this conversation: #757 |
Beta Was this translation helpful? Give feedback.
Short answer
Solving is not affected by PyMAPDL overhead. However sending many PyMAPDL commands is slower than MAPDL commands.
Long answer
Each PyMAPDL command gets converted to an MAPDL command and then sent to the MAPDL instance. This conversion, sending this command, processing it and getting back takes time. If we compare PyMAPDL and MAPDL commands, the time difference will be only the conversion, which in most of the cases is negligible.
Longest answer
However because PyMAPDL interact with an MAPDL instance (exchanging commands), the more command you send at once the better (you not need to wait for the current command before sending the other one). Hence I can recommend you to use
m…