[Gmsh] why news is incremented

Christophe Geuzaine c.geuzaine at ulg.ac.be
Thu Aug 7 00:22:01 CEST 2003


Wladimyr Mattos C. Dourado wrote:

>    Dear Geuzaine
> 
> Tank you for your fast answer. I have another doubt. In the attached 
> .geo file (the last more detailed) the surface number given by s1 
> variable is incremented each time that Line command is called. By 
> consequence the surface is created with  number 6 not with number 1 or 
> 2. Is it correct? Is Line considered as a surface?

It's actually a backward compatibility feature (useful if you want to 
parse geometries created with old versions of Gmsh). You can turn this 
off with

Geometry.OldNewReg = 0;

Cheers,

Christophe


> 
> Tank you for you attention
> 
> Wladimyr
> 
> 
> 
> ------------------------------------------------------------------------
> 
> /********************************************************************* 
>  *
>  *  Gmsh mesh for triangular obstacle of Sanquer's Thesis
>  * 
>  *  By Wladimyr M. C. Dourado, 06/Aug/03 SJC/BR
>  *
>  *********************************************************************/
> 
> // Including the parameters
> 
> Include "triang-obst-parameters.geo" ;
> 
> 
> // Defining the lastest point, curve, surface etc number
> // When including in other geometry files these must to be correctly set
> lastp = 0;
> lastc = 0;
> lasts = 0;
> lastv = 0;
> 
> // The new anisotropic 2D mesh generator can be selected with:
> 
> Mesh.Algorithm = 2 ;
> 
> // One can force a 4 step Laplacian smoothing of the mesh with:
> 
> Mesh.Smoothing = 4 ;
> 
> /********************************************************************* 
>  * GEOMETRY DEFINITION
>  * 
>  *********************************************************************/
> 
> p1=newp+lastp; Point(p1) = {xpd1,ypd1,Z0,lc_died};
> p2=newp+lastp; Point(p2) = {xpd2,ypd2,Z0,lc_died};
> p3=newp+lastp; Point(p3) = {xpd3,ypd3,Z0,lc_died};
> 
> p4=newp+lastp; Point(p4) = {X0-l_ent,Y0+delta,Z0,lc};
> p5=newp+lastp;
> Symmetry { 0,1,0,Y0-h } {
>   Duplicata { Point{p4}; }
> }
> p6=newp+lastp;Point(p6) = {X0-1.5*ht,Y0+delta,Z0,lc_he};
> p7=newp+lastp;
> Symmetry { 0,1,0,Y0-h } {
>   Duplicata { Point{p6}; }
> }
> /*
> p8=newp;Point(p8) = {X0-l_ent,Y0+h,Z0,lc};
> p9=newp;Point(p9) = {X0-1.5*(d*Cos(alpha/2.)),Y0+h,Z0,lc_he};
> */
> /********************* 
>  * LINES DEFINITION
>  * 
>  *********************/
> Printf( "news = %g", news);
> l1 = newc+lastc; Line(l1) = {p4,p6};
> l2 = newc+lastc; Line(l2) = {p5,p7};
> l3 = newc+lastc; Line(l3) = {p4,p5};
> l4 = newc+lastc; Line(l4) = {p6,p7};
> 
> /********************* 
>  * SURFACES DEFINITION
>  * 
>  *********************/
> Printf( "news = %g", news);
> l5 = newc+lastc; Line Loop(l5) = {l4,-l2,-l3,l1}; 
> s1 = news; Ruled Surface(1) = {l5};
> Printf( "s1 = %g", s1);
> 
> /********************* 
>  * PHYSICAL DEFINITION
>  * 
>  *********************/
> Physical Point(cc_parede_canal) = {p4,p6};
> Physical Point(cc_parede_canal) = {p5,p7};
> 
> 
> Physical Line(cc_entrada) = {l3};
> Physical Line(cc_parede_canal) = {l1};
> Physical Line(cc_parede_canal) = {l2};
> Physical Line(dominio1) = {l4};
> 
> 
> /********************************************************************* 
>  * MESH DEFINITION
>  * 
>  *********************************************************************/
> 
> /* 
> Transfinite Line {l3,l4} = 2*nyc Using Bump syc;
> Transfinite Line {l1,l2} = nxsec Using Bump sxsec;
> Transfinite Surface {s1} = {p4,p6,p7,p5};
> Recombine Surface {s1};
> 
>  */
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> gmsh mailing list
> gmsh at geuz.org
> http://www.geuz.org/mailman/listinfo/gmsh


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