[Gmsh] uniform mesh refinement

Jaensson, N.O. n.o.jaensson at tue.nl
Sat Feb 22 12:01:56 CET 2014

Dear Gmsh users,

I use Gmsh to generate quite simple 2nd-order 2D meshes, where one of 
the boundaries is part of a circle. I would like to perform a mesh 
convergence study of my FEM code, so I would like to be able to start 
with a coarse mesh, which is subsequently uniformly refined a number of 
times. If I load my .geo file into the GUI, I generate the coarsest mesh 
by subsequently clicking "2D" in the "Mesh" section, and then "Set order 
2", this aligns the midpoints of the quadratic elements nicely on the 
circle. If I now click "Refine by splitting", a first order, refined 
mesh is created. Clicking "set order 2", converts this into a second 
order mesh where the midpoints of the quadratic elements align nicely 
with the circle again. The problem is that I have no idea how to do this 
using the command line, which I mainly use to generate meshes from 
within the FEM code.

I am able to uniformly refine my mesh using the command line, by 
following the suggestions in this thread:


However, the midpoints of the quadratic elements on the boundary are 
just inserted between the existing nodes, and not on the circle. I guess 
since the .msh file is used, the geometric information is lost, and new 
nodes are just inserted between the existing nodes.

Since the GUI is able to do this, I expect that it is also possible from 
the command line. Any help would be much appreciated!

Kind regards,