# [Gmsh] a mesh problem

Billy Araujo billyaraujo at gmail.com
Mon Mar 29 16:57:11 CEST 2010

```I suppose the elements follow the orientation of the loop or surface.

Just use:
ex:
Plane Surface(10) = {-8} ;

Plane Surface(10) = {8} ;

to invert the ones you want.

Regards,

Billy.

On Mon, Mar 29, 2010 at 3:53 PM, Umut Tabak <u.tabak at tudelft.nl> wrote:

> Dear all,
>
> I am trying to model a 2 domain problem for a simple 2d academic case
> study. I have a structural region on the upper side of the model, and a
> fluid domain below. However there is a problem with the element node orders
> in domains of fluid and structure. You can see the what I mean in the
> attached png. 1 is the structural domain and 2 is the fluid domain. But
> there is a problem which I could not solve, if I create the two surfaces
> separately and mesh them, I am getting the node orders of region 1 wrong.
> What I mean is: for instance for an element, say 326, in domain 2, I get
>
>
> 393____412
> |              |
> |              |
> |392___411
>
> and the ordering in the msh file is
>
> 326 3 3 1 10 0 392 411 412 393
>
> But for an element in domain 1, say 785,
>
> 813____822
> |              |
> |              |
> 812____821
>
> but the ordering in the msh file is given as
>
> 785 3 3 2 11 0 812 813 822 821
>
> I did not understand the cause of this problem I am facing.
>
> Most probably, there is sth I am missing in the definitions of the domains
> and line loops but could not find myself. geo file is also attached.
>
> Any help is appreciated, thx in advance and regards,
>
> Umut
>
> /*********************************************************************
>  *
>  *  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.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.45,  0.0, lc} ;
> Point(4) = {0.0, 0.45, 0.0, lc} ;
> Point(5) = {0.0, 0.5, 0.0, lc} ;
> Point(6) = {1.0, 0.5, 0.0, lc} ;
> // the acoustic only domain
> Line(1) = {1,2} ;
> Line(2) = {2,3} ;
> Line(3) = {3,4} ;
> Line(4) = {4,1} ;
> // interface domain is created
> Line(5) = {4,5} ;
> Line(6) = {5,6} ;
> Line(7) = {6,3} ;
> // 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):
> Transfinite Line{ 1, 3, 6} = 31 ;
> Transfinite Line{ 2, 4 } = 21 ;
> Transfinite Line{ 5, 7 } = 11 ;
> //
> Line Loop(8) = { 1, 2, 3, 4 } ;
> Line Loop(9) = { 3, 7, 6, 5 } ;
> // 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} ;
> //
> Transfinite Surface{10} = { 1, 2, 3, 4 };
> Transfinite Surface{11} = { 4, 3, 6 ,5 };
> // Recombine the triangles into quads
> Recombine Surface{10};
> Recombine Surface{11};
> // 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:
> // bc line applied
> Physical Line(1) = {5,7} ;
> // interface line
> Physical Line(2) = {3};
> //
> Physical Surface(1) = {10} ;
> Physical Surface(2) = {11} ;
>
> _______________________________________________
> gmsh mailing list
> gmsh at geuz.org
> http://www.geuz.org/mailman/listinfo/gmsh
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20100329/2dfdcb7a/attachment.html>
```