[Gmsh] Gmsh: quadrangles and hexahedrons only

Christophe Geuzaine geuzaine at acm.caltech.edu
Sat Apr 17 01:56:37 CEST 2004


zhihua ouyang wrote:
> Dear Gmsh users,
> I would like to create meshes consisting of
> quadrangles and hexahedrons only. is that possible for
> gmsh to do so?
> I have tried the following geo file for a while. But
> some triangular elements can not be "recombined" into
> quadrangles. Can any experienced GMSH users help me
> with this? I am using the FEM package from deal.II
> which can not handle triangular and  tetrahedral
> meshes. Thanks in advance.
> 

"Opposite" edges of transfinite surfaces must have the same number of nodes:

lc = 10.0;
Point(1) = {0, 0, 0, 9.e-1 * lc};
Point(2) = {200.0, 0,  0, lc} ;
Point(3) = {500.0, 0,  0, lc} ;
Point(4) = {500.0, 200.0, 0, lc} ;
Point(5) = {200.0, 200.0, 0, lc} ;
Point(6) = {100.0, 300.0, 0, lc} ;
Point(7) = {0, 300.0, 0, lc} ;
Point(8) = {0, 200.0, 0, lc} ;

Line(1) = {1,2} ;
Line(2) = {2,5} ;
Line(3) = {5,8} ;
Line(4) = {8,1} ;
Line(5) = {2,3} ;
Line(6) = {3,4} ;
Line(7) = {4,5} ;
Line(8) = {5,6} ;
Line(9) = {6,7} ;
Line(10) = {7,8} ;
Line Loop(11) = {1,2,3,4} ;
Line Loop(12) = {5,6,7,-2} ;
Line Loop(13) = {8,9,10,-3} ;
Plane Surface(14) = {11};
Plane Surface(15) = {12};
Plane Surface(16) = {13};

Transfinite Line{1:10}=20.001 Using Progression 1;

Transfinite Surface{14} = {1,2,5,8};
Transfinite Surface{16} = {5,6,7,8};
Transfinite Surface{15} = {2,3,4,5};

Recombine Surface {14,15,16};

MySurface = 100;
Physical Surface(MySurface) = {14,15,16} ;


Take care,

Christophe

-- 
Christophe Geuzaine
Applied and Computational Mathematics, Caltech
geuzaine at acm.caltech.edu - http://geuz.org