[Gmsh] simple mesh with hole

Christophe Geuzaine cgeuzaine at ulg.ac.be
Mon May 5 20:21:45 CEST 2008


denis cohen wrote:
> Hello,
> 
> I am trying to make a simple 2d mesh with a hole inside: a square mesh 
> with a hole in the middle in the shape of a circle.
> Can you outline a simple .geo file to do that?
> I've tried following the tutorials but somehow I am not achieving the 
> correct result.

lc = .5;
Point(1) = {-2,-1,0,lc};
Point(2) = {-2,1,0,lc};
Point(3) = {0,-1,0,lc};
Point(4) = {0,1,0,lc};
Point(5) = {-3,-2,0,lc};
Point(6) = {-3,2,0,lc};
Point(7) = {1,-2,0,lc};
Point(8) = {1,2,0,lc};
Line(1) = {6,8};
Line(2) = {8,7};
Line(3) = {7,5};
Line(4) = {5,6};
Line(5) = {2,1};
Line(6) = {1,3};
Line(7) = {3,4};
Line(8) = {4,2};
Line Loop(1) = {5,6,7,8}; // interior loop
Line Loop(2) = {1,2,3,4}; // exterior loop
Plane Surface(1) = {1}; // interior surface
Plane Surface(2) = {2,1}; // exterior surface (with a whole)




> Thank you for your help
> 
> Denis Cohen
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> gmsh mailing list
> gmsh at geuz.org
> http://www.geuz.org/mailman/listinfo/gmsh


-- 
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine