[Gmsh] message to socket client
Christophe Geuzaine
christophe.geuzaine at case.edu
Thu Feb 23 17:32:59 CET 2006
Jose M. Sancho wrote:
> Dear Cristophe:
>
> Related to my previous question,
> I remember a post some time ago about sending commands to Gmsh directly
> via a socket.
> I do not know if it is yet implemented but it will be great, because to
> achieve on the fly animation I need to
> Delete View[0] before the next View is loaded and in binary format it is
> not possible to send standard commands.
>
> But if I could send directly commands like " Delete View;",
> "BoundingBox;" or whatever, then half of the problem is solved.
>
Hello - I think you can actually already do that right now: just save a
small temporary file (e.g. "tmp.txt") that contains the options or any
other commands you want to execute, and call client.View("tmp.txt")
after client.View("solve.pos"): Gmsh will then just parse that file
after reading your view.
Two remarks:
1) We should rename client.View() into client.Merge(), since this is in
fact what Gmsh does (you can merge any file, including a geometry, a
mesh, etc., not just a post-processing view)
2) I agree that we could make the interface a bit nicer by allowing to
pass arbitrary strings directly through the solver interface, instead of
just files names. But currently Gmsh will rewrite these strings to disk
before parsing them anyway, so we would not gain anything in terms of
speed...
Let me know if it works!
Christophe
> As a fringe benefit it would be possible to have easily an open console
> to send all the commands to Gmsh directly,
> even in a remote computer.
>
> I think this feature could open very interesting capabilities to yet a
> wonderful piece of software.
>
> Best regards.
>
> José M. Sancho
>
> Professor of Structural Analysis
>
> Universidad Politecnica de Madrid
>
> ETS de Arquitectura
>
> Avda. Juan de Herrera,4
>
> 28040 Madrid, Spain
>
> Tel. +34 91 336 65 16
>
> Fax. +34 91 336 65 67
>
> E-mail: jose.sancho at upm.es <mailto:jose.sancho at upm.es>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> gmsh mailing list
> gmsh at geuz.org
> http://www.geuz.org/mailman/listinfo/gmsh
--
Christophe Geuzaine
Assistant Professor, Case Western Reserve University, Mathematics
http://www.case.edu/artsci/math/geuzaine