Live convergence plot attached to the .solve()
method
#1414
Replies: 4 comments 2 replies
-
This is closely related to #1380. @RaghvendraPSingh, can you comment regarding this? |
Beta Was this translation helpful? Give feedback.
-
Hi @CesarRodriguezPereira @RaghvendraPSingh @akaszynski When opened there is a file filter in the lower right; choose *.gst. You may want to copy the jobname.gst file from the PyMAPDL working directory to some other, then open the copy. It has a interface a lot like the MAPDL /POST26 tool to choose what to plot. I thought that a real time convergence plot tool would make a good after-hours project for myself (trying to learn Python). I hacked my way through the XML parser module of Python and can get the data out of the gst file that I want. And have been learning/practicing with the matplotlib FuncAnimation feature. I think I can combine these to get a tool that would work. But it would not be part of PyMAPDL i.e. I think we would need to run it separately (for now?). Anyway just an idea that I have. Mike p.s. this is what the PL tracker looks like: |
Beta Was this translation helpful? Give feedback.
-
Hi @CesarRodriguezPereira @RaghvendraPSingh @akaszynski |
Beta Was this translation helpful? Give feedback.
-
Hi @CesarRodriguezPereira I put an example of my version of the live convergence tracker here: https://github.com/mikerife/Convergence-Plotter I keep meaning to add it to the PyMAPDL documentation as an example...and just have not had time. There is not much documentation yet. But you can save both Jupyter Lab files to the same folder. Then run all the cells on the "solidbeam" notebook. While it is solving run all the cells on the other JL notebook and it should live plot the convergence. Mike |
Beta Was this translation helpful? Give feedback.
-
Over the last month I have delved a bit into transient models, and found that in this regard, pure APDL is still better than the python interface. When running the solve from APDL you get live convergence plots, and you can see in real time how the model is doing, which makes it way easier to troubleshoot convergence issues and optimize run times.
When running a command
print(mapdl.solve())
we only get the solve log at the end of the solution process. We have no way to know how the model is doing in any way. Right now I'm running a CMS transient model that involves different files, and that I construct with pymapdl. Solving it by runningopen_gui()
is a bit tedious (as it doesn't have access to the same files and directories by default when you run the command). So my process usually involves running the cells, leaving it in the background for about an hour, and hoping that everything has run smoothly when I decide to postprocess. Now that I'm introducing a big non linear effect on one of my actuators, I'm starting to find that more often than not, the models I get have stopped converging somewhere along the way.My take on this: while seeing convergence plots in real time might involve dependency creep (something that admits streaming datasets, such as hvplot might be needed), I think implementing something that at least every 10 seconds takes a peek at the log and displays how far along the model is can be of great help, sort of a progress bar (can be even made in ascii). If I'm not mistaken,
animate_nodal_solution_set()
already does something similar when caching the scalars, and something like that would be great to have during the solve process.Beta Was this translation helpful? Give feedback.
All reactions