[Gmsh] Is it possible to generate 2D uniform mesh with specified number of grid cells?

li huang huang.li.ca at outlook.com
Fri Dec 8 21:44:59 CET 2017


Dear all,


I am new to GMSH but have searched around helps for a few hours with no luck to solve my problem. Could you please help?


I have a simple surface. I'd like to mesh it with a uniform mesh (structured or unstructured are both fine), but with a specified number of grid cells. Could I do it with GMSH?


Below is my .geo file:


Point(1) = {0, 0, 0, 1e+22};
Point(2) = {2, 0, 0, 1e+22};
Point(3) = {2, 5, 0, 1e+22};
Point(4) = {0, 5, 0, 1e+22};
Point(5) = {1, 4.8, 0, 1e+22};
Point(6) = {1, 0.2, 0, 1e+22};
Line(1) = {4, 5};
Line(2) = {5, 3};
Line(3) = {3, 2};
Line(4) = {2, 6};
Line(5) = {6, 1};
Line(6) = {1, 4};
Line Loop(8) = {6, 1, 2, 3, 4, 5};
Plane Surface(8) = {8};
Transfinite Surface {8} = {1, 2, 3, 4};
Recombine Surface {8};

Thanks,


Li
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20171208/1bfd3a1d/attachment.html>


More information about the gmsh mailing list