<div dir="ltr"><div>Thank you, that's very helpful. <br></div><div>I was trying to add Gmsh API python scripts through the Add Solver -> Choose exe path</div><div>and think it was failing because the lack of proper onelab.py setup. <br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Dec 6, 2019 at 4:18 AM Christophe Geuzaine <<a href="mailto:cgeuzaine@uliege.be">cgeuzaine@uliege.be</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
> On 5 Dec 2019, at 23:29, Max Orok <<a href="mailto:morok@mevex.com" target="_blank">morok@mevex.com</a>> wrote:<br>
> <br>
> Hello all, <br>
> <br>
> I believe you can only use executable files as Gmsh solvers. <br>
> Would there be any interest in using Python scripts as solvers directly? <br>
> Perhaps there's a clever workaround used right now. <br>
> <br>
> From the GUI, I'd like to be able to:<br>
>       • add a python solver to the solver list <br>
>       • have that solver modify the gui window with onelab parameters, like exec solvers do currently<br>
<br>
Sure : see for example <a href="https://gitlab.onelab.info/doc/tutorials/wikis/Double-pendulum-model-in-Python" rel="noreferrer" target="_blank">https://gitlab.onelab.info/doc/tutorials/wikis/Double-pendulum-model-in-Python</a><br>
<br>
<br>
> I know about the custom_gui.py demo, but believe it requires users to start it from the command line. <br>
> <br>
<br>
No, you can also run it like any other python script.<br>
<br>
The two approaches are complementary :<br>
<br>
- with the first you can use the binary Gmsh app ; all communications are done through a socket, so you can have a proprietary (python) solver if you wish<br>
<br>
- with the second you interact with the Gmsh lib directly in the same memory space: it's more powerful but in effect you create a "new" Gmsh app, bound by the GPL license.<br>
<br>
Christophe<br>
<br>
<br>
> Maybe this could be a more portable option for distributing solvers or reduce the barrier to writing one? <br>
> <br>
> Thank you, <br>
> Max <br>
> <br>
> -- <br>
> Max Orok<br>
> Contractor<br>
> <a href="http://www.mevex.com" rel="noreferrer" target="_blank">www.mevex.com</a><br>
> <br>
> <br>
> _______________________________________________<br>
> gmsh mailing list<br>
> <a href="mailto:gmsh@onelab.info" target="_blank">gmsh@onelab.info</a><br>
> <a href="http://onelab.info/mailman/listinfo/gmsh" rel="noreferrer" target="_blank">http://onelab.info/mailman/listinfo/gmsh</a><br>
<br>
— <br>
Prof. Christophe Geuzaine<br>
University of Liege, Electrical Engineering and Computer Science <br>
<a href="http://www.montefiore.ulg.ac.be/~geuzaine" rel="noreferrer" target="_blank">http://www.montefiore.ulg.ac.be/~geuzaine</a><br>
<br>
<br>
<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Max Orok</div><div>Contractor<br></div></div><div dir="ltr"><a href="http://www.mevex.com" target="_blank">www.mevex.com</a><br><br><img src="https://docs.google.com/uc?export=download&id=1fHTIiW4OMUjQr1iOkspQ7wiEsxunoOs0&revid=0B6x5w-5zVaEjSkpwbm5oY29jbG1XMzJoYldXTmJpNGFtb3dVPQ" width="164" height="42"><br></div></div></div></div></div></div>