[Gmsh] python and gmsh
Magnus Hagdorn
Magnus.Hagdorn at OHMsurveys.com
Fri Mar 23 13:08:46 CET 2007
On Tue, 2007-03-20 at 20:09 +0000, Magnus Hagdorn wrote:
> On Tue, 2007-03-20 at 17:58 +0000, Daniel Wheeler wrote:
> > It is fairly crude in that we write the gmsh file and then use our
> > GmshImporter object to read it.
> > GmshImporter is subclassed from our base Mesh classes. Ideally, we'd
> > like to query gmsh directly for
> > things like cell centers, face areas and the like and have these
> > returned as numpy arrays rather than computing
> > all of this in python, which can be slow and use a lot of memory.
> >
> >
> > How do you query gmsh in order monitor its progress? Are you actually
> > hooking into to gmsh with a python call?
> >
> >
> Hi Daniel,
> I just use the python thread support and start one thread which runs gms
> with some command line options and another thread which monitors the
> output to stdout. I'll ask my boss if I can pass the code on. I would
> love to be able to contribute something slightly useful to gmsh which is
> really excellent.
> Cheers
> magi
>
Hi list,
I just got the ok from my boss to post my gmsh wrapper. Please find
attached two python files, one just contains a class for a simple ASCII
progress bar which I found somewhere on the web, the other contains my
wrapper. It's quite simple and probably doesn't work for other setups
however it is a starting point. At the end it has a simple test
demonstrating how you can use the function. It would be nice to write a
python class which queries the gmsh mesh files properly.
Let me know if you have any questions.
Cheers
magnus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gmsh_wrapper.py
Type: text/x-python
Size: 4615 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20070323/6098feee/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: progressbar.py
Type: text/x-python
Size: 1805 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20070323/6098feee/attachment-0001.py>