[Gmsh] elements orientation

Christophe Geuzaine christophe.geuzaine at case.edu
Tue Jun 20 16:49:01 CEST 2006

```Lev Vaisman wrote:
> Hello
> I would like to inquire if GMSH has a way to ensure
> that in all the physical surfaces the orientation of
> the nodes in the triangular elements is
> counter-clockwise? Maybe I need to specify surfaces in
> some special way.
> I understand that I can manually check if it is
> clockwise or counter-clockwise in a region and put in
> a minus sign before the region's number in the
> definition of physical surface, but if there are many
> regions it is very inconvenient.

The orientation of the elements follows the orientation of the surface.
For example,

Point(1) = {0,0,0,.1};
Point(2) = {1,0,0,.1};
Point(3) = {1,1,0,.1};
Point(4) = {0,1,0,.1};
Line(1) = {1,2};
Line(2) = {2,3};
Line(3) = {3,4};
Line(4) = {4,1};
Line Loop(5) = {1,2,3,4};
Plane Surface(6) = {5};

defines the surface 6 with a normal pointing up (z>0), so the triangles
will be oriented with upward pointing normals too. On the other hand,

Point(1) = {0,0,0,.1};
Point(2) = {1,0,0,.1};
Point(3) = {1,1,0,.1};
Point(4) = {0,1,0,.1};
Line(1) = {1,4};
Line(2) = {4,3};
Line(3) = {3,2};
Line(4) = {2,1};
Line Loop(5) = {1,2,3,4};
Plane Surface(6) = {5};

defines the surface 6 with a normal pointing down (z<0), so the
triangles will be oriented with downward pointing normals.

(Then if you want to change this default "natural" orientation, you can
put a minus sign in the definition of the physical surface. You could
also just change the signs in the definition of the line loop.)

> Thank you
>                                    Lev Vaisman
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> gmsh mailing list
> gmsh at geuz.org
> http://www.geuz.org/mailman/listinfo/gmsh
>

--
Christophe Geuzaine
Assistant Professor, Case Western Reserve University, Mathematics
http://www.case.edu/artsci/math/geuzaine

```