[Gmsh] Mesh and refine from command line

Jérémy Béjanin jbejanin at uwaterloo.ca
Wed Jan 25 19:46:37 CET 2017


Hello, I would like to mesh a model, refine that mesh and save it from the
command line, in one shot, that is without having to call gmsh twice (it
seems that doing `gmsh file.geo -2 -refine -o output.msh` does not work...).

I have found most of the options for this (eg using "Mesh 2;" followed by
"RefineMesh;" in the geo file).

I have now two questions:
1. How do I save the mesh using the same filename as the geo file? Is there
a way to retrieve the filename from within the geo file? I have seen the
"General.FileName" option, but typing "Save General.FileName;" at the end
of the geo file does not work.

2. I would like to run this from the command line, without the GUI
appearing. Since the mesh command is already in the geo file, I cannot just
call `gmsh -2` since that will perform the meshing twice...

Thanks,
Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20170125/0faafd88/attachment.html>


More information about the gmsh mailing list