Re: [Gmsh] python API save geo file
Hi Miro, sorry about giving you the wrong info. I’ve still got a lot to learn about Gmsh. Thanks, Max On Friday, September 27, 2019, Miroslav Kuchta wrote: > Perfect, thank you. > > Miro > > On Fri, Sep 27, 2019 at 8:48 AM Christophe Geuzaine > wrote: > >> >> >> > On 26 Sep 2019, at 17:21, Miroslav Kuchta >> wrote: >> > >> > Hi Max, >> > >> > what I am trying to accomplish is the ability to call something like >> `model.save('foo.geo')` >> >> Use gmsh.write("foo.geo_unrolled") >> >> Christophe >> >> >> >> > in the attached script. I am only beginning to explore the API and this >> would allow me to >> > create part of the model in python, save it and optionally continue in >> gmsh language. I guess >> > this would be useful if not all of the API is exposed. >> > >> > Thanks, Miro >> > >> > On Thu, Sep 26, 2019 at 4:23 PM Max Orok wrote: >> > Hi Miro, >> > >> > I don't think so. Can you tell us more about what you are trying to >> accomplish? >> > The tutorials have many examples of equivalent functionality between >> geo and python (c++, julia, etc.) >> > >> > Geo examples: https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial >> > Equivalent API examples: https://gitlab.onelab.info/ >> gmsh/gmsh/tree/master/demos/api >> > >> > Sincerely, >> > Max >> > >> > On Wed, Sep 25, 2019 at 4:20 PM Miroslav Kuchta < >> miroslav.kuc...@gmail.com> wrote: >> > Hi, >> > >> > is there a way to write as geo file the model constructed using python >> API? >> > >> > Thanks, Miro >> > ___ >> > gmsh mailing list >> > gmsh@onelab.info >> > http://onelab.info/mailman/listinfo/gmsh >> > >> > >> > -- >> > Max Orok >> > Contractor >> > www.mevex.com >> > >> > >> > ___ >> > gmsh mailing list >> > gmsh@onelab.info >> > http://onelab.info/mailman/listinfo/gmsh >> >> — >> Prof. Christophe Geuzaine >> University of Liege, Electrical Engineering and Computer Science >> http://www.montefiore.ulg.ac.be/~geuzaine >> >> >> >> -- Max Orok Contractor www.mevex.com ___ gmsh mailing list gmsh@onelab.info http://onelab.info/mailman/listinfo/gmsh
Re: [Gmsh] python API save geo file
Perfect, thank you. Miro On Fri, Sep 27, 2019 at 8:48 AM Christophe Geuzaine wrote: > > > > On 26 Sep 2019, at 17:21, Miroslav Kuchta > wrote: > > > > Hi Max, > > > > what I am trying to accomplish is the ability to call something like > `model.save('foo.geo')` > > Use gmsh.write("foo.geo_unrolled") > > Christophe > > > > > in the attached script. I am only beginning to explore the API and this > would allow me to > > create part of the model in python, save it and optionally continue in > gmsh language. I guess > > this would be useful if not all of the API is exposed. > > > > Thanks, Miro > > > > On Thu, Sep 26, 2019 at 4:23 PM Max Orok wrote: > > Hi Miro, > > > > I don't think so. Can you tell us more about what you are trying to > accomplish? > > The tutorials have many examples of equivalent functionality between geo > and python (c++, julia, etc.) > > > > Geo examples: https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial > > Equivalent API examples: > https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api > > > > Sincerely, > > Max > > > > On Wed, Sep 25, 2019 at 4:20 PM Miroslav Kuchta < > miroslav.kuc...@gmail.com> wrote: > > Hi, > > > > is there a way to write as geo file the model constructed using python > API? > > > > Thanks, Miro > > ___ > > gmsh mailing list > > gmsh@onelab.info > > http://onelab.info/mailman/listinfo/gmsh > > > > > > -- > > Max Orok > > Contractor > > www.mevex.com > > > > > > ___ > > gmsh mailing list > > gmsh@onelab.info > > http://onelab.info/mailman/listinfo/gmsh > > — > Prof. Christophe Geuzaine > University of Liege, Electrical Engineering and Computer Science > http://www.montefiore.ulg.ac.be/~geuzaine > > > > ___ gmsh mailing list gmsh@onelab.info http://onelab.info/mailman/listinfo/gmsh
Re: [Gmsh] python API save geo file
> On 26 Sep 2019, at 17:21, Miroslav Kuchta wrote: > > Hi Max, > > what I am trying to accomplish is the ability to call something like > `model.save('foo.geo')` Use gmsh.write("foo.geo_unrolled") Christophe > in the attached script. I am only beginning to explore the API and this would > allow me to > create part of the model in python, save it and optionally continue in gmsh > language. I guess > this would be useful if not all of the API is exposed. > > Thanks, Miro > > On Thu, Sep 26, 2019 at 4:23 PM Max Orok wrote: > Hi Miro, > > I don't think so. Can you tell us more about what you are trying to > accomplish? > The tutorials have many examples of equivalent functionality between geo and > python (c++, julia, etc.) > > Geo examples: https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial > Equivalent API examples: > https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api > > Sincerely, > Max > > On Wed, Sep 25, 2019 at 4:20 PM Miroslav Kuchta > wrote: > Hi, > > is there a way to write as geo file the model constructed using python API? > > Thanks, Miro > ___ > gmsh mailing list > gmsh@onelab.info > http://onelab.info/mailman/listinfo/gmsh > > > -- > Max Orok > Contractor > www.mevex.com > > > ___ > gmsh mailing list > gmsh@onelab.info > http://onelab.info/mailman/listinfo/gmsh — Prof. Christophe Geuzaine University of Liege, Electrical Engineering and Computer Science http://www.montefiore.ulg.ac.be/~geuzaine ___ gmsh mailing list gmsh@onelab.info http://onelab.info/mailman/listinfo/gmsh
Re: [Gmsh] python API save geo file
Hi Juan, thanks for pointing out pygmsh. However, I'd like to do some computations in the process of defining the model, e.g. compute the labels of the boundary, and this functionality is missing in pygmsh as far as I can tell. Of course with the saved geo file I can extend the script with gmsh language. So that's a plan B :) Miro On Thu, Sep 26, 2019 at 5:06 PM Juan Sanchez wrote: > Hello, > > This project offers a Python interface. > > https://github.com/nschloe/pygmsh > > It is able to dump a geo file that can be processed through Gmsh. I have > successfully used it to handle more complex geometries processed through > Gmsh. > > Regards, > > Juan > > On Wed, Sep 25, 2019 at 3:20 PM Miroslav Kuchta > wrote: > >> Hi, >> >> is there a way to write as geo file the model constructed using python >> API? >> >> Thanks, Miro >> ___ >> gmsh mailing list >> gmsh@onelab.info >> http://onelab.info/mailman/listinfo/gmsh >> > ___ gmsh mailing list gmsh@onelab.info http://onelab.info/mailman/listinfo/gmsh
Re: [Gmsh] python API save geo file
Hello, This project offers a Python interface. https://github.com/nschloe/pygmsh It is able to dump a geo file that can be processed through Gmsh. I have successfully used it to handle more complex geometries processed through Gmsh. Regards, Juan On Wed, Sep 25, 2019 at 3:20 PM Miroslav Kuchta wrote: > Hi, > > is there a way to write as geo file the model constructed using python API? > > Thanks, Miro > ___ > gmsh mailing list > gmsh@onelab.info > http://onelab.info/mailman/listinfo/gmsh > ___ gmsh mailing list gmsh@onelab.info http://onelab.info/mailman/listinfo/gmsh
Re: [Gmsh] python API save geo file
Hi Miro, I do not know the current status of such a feature in pygmsh, or if it is possible with their approach. For such an application, I have written scripts to: read the generated mesh script (mesh format 2) find surface triangles between volumes add the triangles and Physical names to a new mesh file It is available here: https://github.com/devsim/devsim_misc/tree/master/gmsh Regards, Juan On Thu, Sep 26, 2019 at 10:26 AM Miroslav Kuchta wrote: > Hi Juan, > > thanks for pointing out pygmsh. However, I'd like to do some computations > in the process of defining the model, e.g. compute the labels of the > boundary, > and this functionality is missing in pygmsh as far as I can tell. > > Of course with the saved geo file I can extend the script with gmsh > language. > So that's a plan B :) > > Miro > > > On Thu, Sep 26, 2019 at 5:06 PM Juan Sanchez > wrote: > >> Hello, >> >> This project offers a Python interface. >> >> https://github.com/nschloe/pygmsh >> >> It is able to dump a geo file that can be processed through Gmsh. I have >> successfully used it to handle more complex geometries processed through >> Gmsh. >> >> Regards, >> >> Juan >> >> On Wed, Sep 25, 2019 at 3:20 PM Miroslav Kuchta < >> miroslav.kuc...@gmail.com> wrote: >> >>> Hi, >>> >>> is there a way to write as geo file the model constructed using python >>> API? >>> >>> Thanks, Miro >>> ___ >>> gmsh mailing list >>> gmsh@onelab.info >>> http://onelab.info/mailman/listinfo/gmsh >>> >> ___ gmsh mailing list gmsh@onelab.info http://onelab.info/mailman/listinfo/gmsh
Re: [Gmsh] python API save geo file
Hi Max, what I am trying to accomplish is the ability to call something like `model.save('foo.geo')` in the attached script. I am only beginning to explore the API and this would allow me to create part of the model in python, save it and optionally continue in gmsh language. I guess this would be useful if not all of the API is exposed. Thanks, Miro On Thu, Sep 26, 2019 at 4:23 PM Max Orok wrote: > Hi Miro, > > I don't think so. Can you tell us more about what you are trying to > accomplish? > The tutorials have many examples of equivalent functionality between geo > and python (c++, julia, etc.) > > Geo examples: https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial > Equivalent API examples: > https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api > > Sincerely, > Max > > On Wed, Sep 25, 2019 at 4:20 PM Miroslav Kuchta > wrote: > >> Hi, >> >> is there a way to write as geo file the model constructed using python >> API? >> >> Thanks, Miro >> ___ >> gmsh mailing list >> gmsh@onelab.info >> http://onelab.info/mailman/listinfo/gmsh >> > > > -- > Max Orok > Contractor > www.mevex.com > > > import gmsh import sys model = gmsh.model factory = model.occ gmsh.initialize(sys.argv) gmsh.option.setNumber("General.Terminal", 1) factory.addBox(0, 0, 0, 1, 1, 1) factory.synchronize(); model.mesh.generate(3) gmsh.write("boolean.msh") ___ gmsh mailing list gmsh@onelab.info http://onelab.info/mailman/listinfo/gmsh
Re: [Gmsh] python API save geo file
Hi Miro, I don't think so. Can you tell us more about what you are trying to accomplish? The tutorials have many examples of equivalent functionality between geo and python (c++, julia, etc.) Geo examples: https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial Equivalent API examples: https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api Sincerely, Max On Wed, Sep 25, 2019 at 4:20 PM Miroslav Kuchta wrote: > Hi, > > is there a way to write as geo file the model constructed using python API? > > Thanks, Miro > ___ > gmsh mailing list > gmsh@onelab.info > http://onelab.info/mailman/listinfo/gmsh > -- Max Orok Contractor www.mevex.com ___ gmsh mailing list gmsh@onelab.info http://onelab.info/mailman/listinfo/gmsh
[Gmsh] python API save geo file
Hi, is there a way to write as geo file the model constructed using python API? Thanks, Miro ___ gmsh mailing list gmsh@onelab.info http://onelab.info/mailman/listinfo/gmsh