<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi,<br>
    I just added python fields (they will be available in the next
    nightly build).<br>
    <br>
    There is no embedded python interpreter in Gmsh, we rather provide
    python bindings for the Gmsh library. This is still work in
    progress, in particular there is no documentation nor stable API, we
    just bind most of Gmsh internal functions to python.<br>
    Gmsh Library and python bindings can be downloaded with the gmsh
    dynamic library from  Gmsh website :<br>
    <a class="moz-txt-link-freetext"
      href="http://geuz.org/gmsh/bin/Linux/gmsh-svn-Linux64-dynamic.tgz">http://geuz.org/gmsh/bin/Linux/gmsh-svn-Linux64-dynamic.tgz</a><br>
    <a class="moz-txt-link-freetext"
      href="http://geuz.org/gmsh/bin/MacOSX/gmsh-svn-MacOSX-dynamic.tgz">http://geuz.org/gmsh/bin/MacOSX/gmsh-svn-MacOSX-dynamic.tgz</a><br>
    <a class="moz-txt-link-freetext"
      href="http://geuz.org/gmsh/bin/Windows/gmsh-svn-Windows64-dynamic.zip">http://geuz.org/gmsh/bin/Windows/gmsh-svn-Windows64-dynamic.zip</a><br>
    <br>
    On linux and OSX, to build the python bindings, go to the "gmshpy"
    sub-directory the run the python script "setup.py" (e.g. python
    setup.py build; python setup.py install). On windows, I'm not sure
    if it works ...<br>
    <br>
    An example of python field is attached, the python script imports
    the gmsh python bindings then loads a geo file and adds some python
    fields and at the end, the GUI is started.<br>
    <br>
    regards,<br>
    <br>
    Jonathan<br>
    <br>
    <div class="moz-cite-prefix">On 11/07/13 11:49, Nico Schlömer wrote:<br>
    </div>
    <blockquote
cite="mid:CAK6Z60cRyLqjZXkco=WN38wB1hJRnxxwzMZtYONvf8KQcgFNqw@mail.gmail.com"
      type="cite">
      <div dir="ltr">I'd be very much interested in a hands-on example
        of Gmsh + Python as well.
        <div><br>
        </div>
        <div>--Nico</div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Thu, Jul 11, 2013 at 10:06 AM,
          Christophe Geuzaine <span dir="ltr"><<a
              moz-do-not-send="true" href="mailto:cgeuzaine@ulg.ac.be"
              target="_blank">cgeuzaine@ulg.ac.be</a>></span> wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div class="im"><br>
              On 11 Jul 2013, at 09:07, moritz braun <<a
                moz-do-not-send="true"
                href="mailto:moritz.braun@gmail.com">moritz.braun@gmail.com</a>>

              wrote:<br>
              <br>
              > Dear All<br>
              ><br>
              > I am using gmsh in the moment to<br>
              > create 3D grids with  background field to control the
              characteristic length.<br>
              > Writing functions as  .F attribute of an Field
              variable is rather restrictive<br>
              > it would be nice if  gmsh could be extended by
              embedding the python interpreter for<br>
              >  such functions.<br>
              > How difficult whould that be?<br>
              ><br>
              <br>
            </div>
            I think you can already define fields in the Gmsh Python
            interface (CC'ing Jon on this one: Jon, could you send a
            small example?). If this is the case, then your python
            script could simply import the Gmsh module, merge your
            current .geo definitions, then define the fields directly in
            Python.<br>
            <div class="im"><br>
              <br>
              > regards<br>
              ><br>
              > Moritz<br>
              ><br>
              > --<br>
              > Prof M Braun         Tel.:27-12-4298006/8027<br>
              > Physics Department  Fax.: 27-12-4293643<br>
              > University of South Africa (UNISA)<br>
              > <a moz-do-not-send="true"
                href="mailto:moritz.braun@gmail.com">moritz.braun@gmail.com</a><br>
              > P.O. Box 392<br>
              > 0003<br>
              > UNISA<br>
              >  South Africa<br>
              > <a moz-do-not-send="true"
                href="http://moritz-braun.blogspot.com" target="_blank">http://moritz-braun.blogspot.com</a><br>
            </div>
            > _______________________________________________<br>
            > gmsh mailing list<br>
            > <a moz-do-not-send="true" href="mailto:gmsh@geuz.org">gmsh@geuz.org</a><br>
            > <a moz-do-not-send="true"
              href="http://www.geuz.org/mailman/listinfo/gmsh"
              target="_blank">http://www.geuz.org/mailman/listinfo/gmsh</a><br>
            <span class="HOEnZb"><font color="#888888"><br>
                --<br>
                Prof. Christophe Geuzaine<br>
                University of Liege, Electrical Engineering and Computer
                Science<br>
                <a moz-do-not-send="true"
                  href="http://www.montefiore.ulg.ac.be/%7Egeuzaine"
                  target="_blank">http://www.montefiore.ulg.ac.be/~geuzaine</a><br>
                <br>
                <br>
                <br>
                <br>
                _______________________________________________<br>
                gmsh mailing list<br>
                <a moz-do-not-send="true" href="mailto:gmsh@geuz.org">gmsh@geuz.org</a><br>
                <a moz-do-not-send="true"
                  href="http://www.geuz.org/mailman/listinfo/gmsh"
                  target="_blank">http://www.geuz.org/mailman/listinfo/gmsh</a><br>
              </font></span></blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>