[Gmsh] gmsh and python

Nico Schlömer nico.schloemer at gmail.com
Fri Jan 25 11:33:23 CET 2013


I'd also be *very* interested in this.
I see there is
https://launchpad.net/ubuntu/raring/+package/python-gmsh
but I don't really know what this is all about.

--Nico


On Fri, Jan 25, 2013 at 9:04 AM, Eiser, Sebastian
<sebastian.eiser at k-ai.at> wrote:
> Elisabetta,
> I'm also curious on the python interface and heard about it, but have never used it. From what you write though, it may be sufficient to do this in a python script:
>
> #!/usr/bin/python
> from subprocess import call
> # you script that writes "input.geo"
> # ...
> # after writing the geo file, call gmsh
> call(["gmsh", "-2", "-order 2", "input.geo", "-o", "out.msh"])
>
> Alternatively, you can put everything into a (e.g.) bash script (if you use Linux)
>
> #!/bin/bash
> python createGeometry.py # writes "input.geo"
> gmsh -2 input.geo -o out.msh
>
> hope this helps
>
>
> -----Original Message-----
> From: gmsh-bounces at ace20.montefiore.ulg.ac.be [mailto:gmsh-bounces at ace20.montefiore.ulg.ac.be] On Behalf Of Elisabetta Sieni
> Sent: Tuesday, January 22, 2013 11:58 AM
> To: gmsh at geuz.org
> Subject: [Gmsh] gmsh and python
>
> Dear gmsh developper,
> I would use gmsh to implement my project. I would to use my code written in Python to run gmsh to build the geometry and the mesh of my problem domain and after save results.
>
> I see that is possible to interface gmsh and python script. Currently I written a phyton script that writes the .geo file to build my geometry.
> I would like to known how I can open gmsh and run my gmsh-files in gmsh using python. Where I can find a tutorial with commands to interface python and gmsh?
>
> Thank you very much
>
> Elisabetta Sieni
>
> --
>
> Elisabetta Sieni
> Dipartimento di Ingegneria Industriale
> Università di Padova
> via Gradenigo 6/a
> 35131 Padova - Italy
> e-mail: elisabetta.sieni at dii.unipd.it
>          elisabetta.sieni at unipd.it
> tel  +39 049 827 7514
> fax  +39 049 827 7599
> cell +39 338 9991731
>
>
> _______________________________________________
> gmsh mailing list
> gmsh at geuz.org
> http://www.geuz.org/mailman/listinfo/gmsh
>
> _______________________________________________
> gmsh mailing list
> gmsh at geuz.org
> http://www.geuz.org/mailman/listinfo/gmsh