Dear all,

In a hexahedral mesh generation, I can do the tetrahedral meshing without problems with the below piece of code. But uncommenting the commented lines results in this problem : My surface is extruded, however the surfaces in the direction of the extrusion are meshed with quadrangles and the others with triangles and (I guess) as a result, I can not get a hexahedral mesh for a simple box geometry. I am sure I am missing sth simple from the manual and your help is appreciated.

P.S. I think I can define 8 corners of my box, define lines and surfaces with transfinite to end up with the hexa mesh. But I wondered the correct usage of extruded mesh option if I understood correctly from the manual with the code below(lines uncommented).

Thanks for the replies in advance. Attached also the include file.

Umut

   11 Include "truck3d_1r.geo";
   12
   13 // Transfinite Line{1} = 21 ;
   14 // Transfinite Line{2,4} = 11;
   15 // Transfinite Line{3} = 21;
   16 // Transfinite Surface{10} = {1,2,3,4};
   17 // Recombine Surface { 10 };
   18 // Physical Surface(4) = {10};
19 // vol[]=Extrude {0.0,0.0,0.5}{ Surface{10};Layers{10};Recombine; };
   20 // vol[]=Extrude {0.0,0.0,0.5}{ Surface{10};Layers{10}; };
   21 vol[]=Extrude {0.0,0.0,0.5}{ Surface{10}; Layers{5}; };
   22 //Transfinite Volume {11} = vol[1] ;
   23 Physical Volume (11) = { vol[1] } ;
   24 // binary format
   25 // Mesh.MshBinary = 1 ;  // GMSH 2.2.4
   26 // Mesh.Binary = 1 ;         // GMSH 2.2.5 changed to this
   27 // color
   28 // Mesh.Color.Quadrangles ;
   29 // Nastran bdf format : option value is 31 for BDF output
   30 // Mesh.Format = 31 ;


/********************************************************************* 
 *
 *  Gmsh tutorial 1
 * 
 *  Variables, elementary entities (points, lines, surfaces), physical
 *  entities (points, lines, surfaces)
 *
 *********************************************************************/

// The simplest construction in Gmsh's scripting language is the
// `affectation'. The following command defines a new variable `lc':

// lc = 0.009;
lc = 0.05;
// This variable can then be used in the definition of Gmsh's simplest
// `elementary entity', a `Point'. A Point is defined by a list of
// four numbers: three coordinates (X, Y and Z), and a characteristic
// length (lc) that sets the target element size at the point:

Point(1) = {0, 0, 0, lc};

// The distribution of the mesh element sizes is then obtained by
// interpolation of these characteristic lengths throughout the
// geometry. Another method to specify characteristic lengths is to
// use a background mesh (see `t7.geo' and `bgmesh.pos').

// We can then define some additional points as well as our first
// curve.  Curves are Gmsh's second type of elementery entities, and,
// amongst curves, straight lines are the simplest. A straight line is
// defined by a list of point numbers. In the commands below, for
// example, the line 1 starts at point 1 and ends at point 2:

Point(2) = {1.0, 0.0,  0.0, lc} ;
Point(3) = {1.0, 0.5, 0.0, lc} ;
Point(4) = {0.0, 0.5, 0.0, lc} ;
// Point(5) = {0.0, 0.25, 0, lc};

Line(1) = {1,2} ;
Line(2) = {2,3} ;
Line(3) = {3,4} ;
Line(4) = {4,1} ;
// Line(5) = {5,1} ;

// The third elementary entity is the surface. In order to define a
// simple rectangular surface from the four lines defined above, a
// line loop has first to be defined. A line loop is a list of
// connected lines, a sign being associated with each line (depending
// on the orientation of the line):

Line Loop(8) = {1,2,3,4} ;
//Line Loop(9) = {2,3,4,7} ;

// Line Loop(8) = {7,4,5, 6} ;

// We can then define the surface as a list of line loops (only one
// here, since there are no holes--see `t4.geo'):

Plane Surface(10) = {8} ;
//Plane Surface(11) = {9} ;

//Plane Surface(11) = {9} ;

// At this level, Gmsh knows everything to display the rectangular
// surface 6 and to mesh it. An optional step is needed if we want to
// associate specific region numbers to the various elements in the
// mesh (e.g. to the line segments discretizing lines 1 to 4 or to the
// triangles discretizing surface 6). This is achieved by the
// definition of `physical entities'. Physical entities will group
// elements belonging to several elementary entities by giving them a
// common number (a region number), and specifying their orientation.

// We can for example group the points 1 and 2 into the physical
// entity 1:

// Physical Line(1) = {5} ;

// Consequently, two punctual elements will be saved in the output
// mesh file, both with the region number 1. The mechanism is
// identical for line or surface elements:

// plateLine = 222 ;
// Physical Line(plateLine) = {4,5} ;

// quadSurf = 444 ;
// Physical Surface(quadSurf) = {10} ;

// All the line elements created during the meshing of lines 1, 2 and
// 4 will be saved in the output mesh file with the region number 99;
// and all the triangular elements resulting from the discretization
// of surface 6 will be given an automatic region number (100,
// associated with the label "My fancy surface label").

// Note that if no physical entities are defined, then all the
// elements in the mesh will be saved "as is", with their default
// orientation.
_______________________________________________
gmsh mailing list
[email protected]
http://www.geuz.org/mailman/listinfo/gmsh

Reply via email to