Skip to content
Snippets Groups Projects
Gmsh.tab.cpp 236 KiB
Newer Older
      Attractor *a;
      double p;
      int ip;
      for(int i=0;i<List_Nbr(yyvsp[-9].l);i++){
      	List_Read(yyvsp[-9].l,i,&p);
        ip = (int)p;
        v = FindPoint(ip,THEM);
        if(!v)
	  vyyerror("Unkown Point %d", ip);
	else{
	  a = Create_Attractor(List_Nbr(THEM->Metric->Attractors)+1,
			       yyvsp[-6].d,yyvsp[-4].d,yyvsp[-2].d,v,NULL,NULL);
	  List_Add(THEM->Metric->Attractors,&a);
        }
      }
    ;
    break;}
{
      for(i=0;i<List_Nbr(yyvsp[-3].l);i++){
	List_Read(yyvsp[-3].l,i,&d);
	Vertex *v = FindPoint((int)d,THEM);
	if(!v)
	  vyyerror("Unkown Point %d", (int)d);
	else
	  v->lc = yyvsp[-1].d;
      }
    ;
      yyval.s.Type = MSH_POINT;
      yyval.s.Num  = (int)yyvsp[-2].d;
      Cdbseg101((int)yyvsp[-4].d,MSH_SEGM_LINE,1,yyvsp[-1].l,NULL,-1,-1,0.,1.,NULL,NULL,NULL);
      yyval.s.Type = MSH_SEGM_LINE;
      Cdbseg101((int)yyvsp[-4].d,MSH_SEGM_SPLN,3,yyvsp[-1].l,NULL,-1,-1,0.,1.,NULL,NULL,NULL);
      yyval.s.Type = MSH_SEGM_SPLN;
      Curve *c;
      Attractor *a;
      double p;
      int ip;
      for(int i=0;i<List_Nbr(yyvsp[-9].l);i++){
      	List_Read(yyvsp[-9].l,i,&p);
        ip = (int)p;
        c = FindCurve(ip,THEM);
        if(!c)
	  vyyerror("Unkown Curve %d", ip);
	else{
	  a = Create_Attractor(List_Nbr(THEM->Metric->Attractors)+1,
			       yyvsp[-6].d,yyvsp[-4].d,yyvsp[-2].d,NULL,c,NULL);
	  List_Add(THEM->Metric->Attractors,&a);
        }
      }
      Cdbseg101((int)yyvsp[-4].d,MSH_SEGM_CIRC,2,yyvsp[-1].l,NULL,-1,-1,0.,1.,NULL,NULL,NULL);
      yyval.s.Type = MSH_SEGM_CIRC ;
      yyval.s.Num  = (int)yyvsp[-4].d;
{
      Cdbseg101((int)yyvsp[-4].d,MSH_SEGM_ELLI,2,yyvsp[-1].l,NULL,-1,-1,0.,1.,NULL,NULL,NULL);
      yyval.s.Type = MSH_SEGM_ELLI ;
      yyval.s.Num  = (int)yyvsp[-4].d;
    ;
    break;}
case 167:
#line 1199 "Gmsh.y"
      List_T *temp;
      int i,j;
      double d;
      temp = List_Create(List_Nbr(yyvsp[-3].l),1,sizeof(int));
      for(i=0;i<List_Nbr(yyvsp[-3].l);i++){
      	List_Read(yyvsp[-3].l,i,&d);
        j = (int)d;
        List_Add(temp,&j);
      }
      AddCircleInDataBase ((int) yyvsp[-6].d, MSH_SEGM_CIRC, temp, yyvsp[-1].v);
      List_Delete(temp);
      yyval.s.Type = MSH_SEGM_CIRC ;
      yyval.s.Num  = (int)yyvsp[-6].d;
      Cdbseg101((int)yyvsp[-14].d,MSH_SEGM_PARAMETRIC,2,NULL,NULL,-1,-1,yyvsp[-10].d,yyvsp[-8].d,yyvsp[-6].c,yyvsp[-4].c,yyvsp[-2].c);
      yyval.s.Type = MSH_SEGM_PARAMETRIC ;
      yyval.s.Num  = (int)yyvsp[-14].d;
{
      Cdbz101((int)yyvsp[-4].d,MSH_PHYSICAL_LINE,0,0,0,0,0,NULL,yyvsp[-1].l,NULL);
      yyval.s.Type = MSH_PHYSICAL_LINE;
      yyval.s.Num  = (int)yyvsp[-4].d;
    ;
{
      yyval.s.Type = MSH_SEGM_LOOP;
      Cdbz101((int)yyvsp[-4].d,yyval.s.Type,0,0,0,0,0,NULL,yyvsp[-1].l,NULL);
      yyval.s.Num = (int)yyvsp[-4].d;
    ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      if(List_Nbr(yyvsp[-1].l) > 3){
	Cdbseg101((int)yyvsp[-4].d,MSH_SEGM_BSPLN,2,yyvsp[-1].l,NULL,-1,-1,0.,1.,NULL,NULL,NULL);
	yyval.s.Type = MSH_SEGM_BSPLN;
	yyval.s.Num  = (int)yyvsp[-4].d;
      }
      else
	vyyerror("Too few control points for BSpline %d (%d < 4)", (int)yyvsp[-4].d, 
		 List_Nbr(yyvsp[-1].l));
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 1245 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
{
      if(List_Nbr(yyvsp[-1].l) > 3){
	Cdbseg101((int)yyvsp[-4].d,MSH_SEGM_BEZIER,2,yyvsp[-1].l,NULL,-1,-1,0.,1.,NULL,NULL,NULL);
	yyval.s.Type = MSH_SEGM_BSPLN;
	yyval.s.Num  = (int)yyvsp[-4].d;
      }
      else
	vyyerror("Too few control points for Bezier %d (%d < 4)", (int)yyvsp[-4].d, 
		 List_Nbr(yyvsp[-1].l));
    ;
    break;}
case 173:
#line 1256 "Gmsh.y"
      List_T *Temp;
      int i;
      double d;
      if((int)yyvsp[-1].d + 1 + List_Nbr(yyvsp[-5].l) != List_Nbr(yyvsp[-3].l)){
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	vyyerror("Wrong definition of Nurbs Curve %d: "
		"[Degree]%d + 1 + [NbPts]%d != [NbKnots]%d",
		(int)yyvsp[-8].d, (int)yyvsp[-1].d, List_Nbr(yyvsp[-5].l), List_Nbr(yyvsp[-3].l));
      }
      Temp = List_Create(List_Nbr(yyvsp[-5].l),1,sizeof(int));
      for(i=0;i<List_Nbr(yyvsp[-5].l);i++) {
      	List_Read(yyvsp[-5].l,i,&d);
        j = (int)d;
        List_Add(Temp,&j);
      }
      AddCurveInDataBase ((int)yyvsp[-8].d,MSH_SEGM_NURBS,(int)yyvsp[-1].d,Temp,yyvsp[-3].l,-1,-1,0.,1.);
      List_Delete(Temp);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 174:
#line 1275 "Gmsh.y"
      yyval.s.Num = (int)yyvsp[-2].d;
      Curve *c = FindCurve(yyval.s.Num,THEM);
      if(!c)
	vyyerror("Unkown Curve %d", yyval.s.Num);
      else
	yyval.s.Type = c->Typ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 175:
#line 1287 "Gmsh.y"
      Cdbz101((int)yyvsp[-4].d,MSH_SURF_PLAN,0,0,0,0,0,NULL,yyvsp[-1].l,NULL);
      yyval.s.Type = MSH_SURF_PLAN;
      yyval.s.Num  = (int)yyvsp[-4].d;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 176:
#line 1293 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      support = FindSurface((int)yyvsp[-4].d,THEM);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	vyyerror("Unkown Surface %d", (int)yyvsp[-4].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	Cdbz101((int)yyvsp[-8].d,MSH_SURF_PLAN,0,0,0,0,0,NULL,yyvsp[-2].l,NULL);
	s = FindSurface((int)yyvsp[-8].d,THEM);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	  vyyerror("Unkown Surface %d", (int)yyvsp[-8].d);
	else{
	  s->Typ =  MSH_SURF_TRIMMED;
	  s->Support = support;
	  yyval.s.Type = MSH_SURF_TRIMMED;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	  yyval.s.Num  = (int)yyvsp[-8].d;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 177:
#line 1312 "Gmsh.y"
      List_Read(yyvsp[-1].l,0,&d);
      i = (int)d;
      EdgeLoop *el = FindEdgeLoop(i,THEM);
      if(!el)
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	vyyerror("Unkown Line Loop %d", i);
      else{
	j = List_Nbr(el->Curves);
	if(j==4)
	  yyval.s.Type = MSH_SURF_REGL;
	else if(j==3)
	  yyval.s.Type  = MSH_SURF_TRIC;
	else
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	  vyyerror("Wrong definition of Ruled Surface %d: "
		   "%d borders instead of 3 or 4", 
		   (int)yyvsp[-4].d, j);
	Cdbz101((int)yyvsp[-4].d,yyval.s.Type,0,0,0,0,0,NULL,yyvsp[-1].l,NULL);
	yyval.s.Num = (int)yyvsp[-4].d;
      }
    ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 178:
#line 1335 "Gmsh.y"
      CreateNurbsSurface ( (int) yyvsp[-16].d , (int)yyvsp[-4].d , (int)yyvsp[-2].d  , yyvsp[-13].l, yyvsp[-10].l, yyvsp[-8].l);
      yyval.s.Type  = MSH_SURF_NURBS;
      yyval.s.Num = (int)yyvsp[-16].d;
    ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 179:
#line 1343 "Gmsh.y"
      CreateNurbsSurfaceSupport ((int)yyvsp[-16].d, (int) yyvsp[-4].d , (int) yyvsp[-2].d , yyvsp[-13].l, yyvsp[-10].l, yyvsp[-8].l);
    ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 180:
#line 1347 "Gmsh.y"
      Cdbz101((int)yyvsp[-4].d,MSH_PHYSICAL_SURFACE,0,0,0,0,0,NULL,yyvsp[-1].l,NULL);
      yyval.s.Type = MSH_PHYSICAL_SURFACE;
      yyval.s.Num  = (int)yyvsp[-4].d;
    ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 181:
#line 1353 "Gmsh.y"
      Cdbz101((int)yyvsp[-4].d,MSH_SURF_LOOP,0,0,0,0,0,NULL,yyvsp[-1].l,NULL);
      yyval.s.Type = MSH_SURF_LOOP;
      yyval.s.Num  = (int)yyvsp[-4].d;
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 182:
#line 1359 "Gmsh.y"
{
      yyval.s.Num = (int)yyvsp[-2].d;
      Surface *s = FindSurface(yyval.s.Num,THEM);
      if(!s)
	vyyerror("Unknown Surface %d", yyval.s.Num);
      else
	yyval.s.Type = s->Typ;
     ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 183:
#line 1371 "Gmsh.y"
{
      Cdbz101((int)yyvsp[-4].d,MSH_VOLUME,0,0,0,0,0,NULL,yyvsp[-1].l,NULL);
      yyval.s.Type = MSH_VOLUME;
      yyval.s.Num  = (int)yyvsp[-4].d;      
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 184:
#line 1377 "Gmsh.y"
{
      Cdbz101((int)yyvsp[-4].d,MSH_VOLUME,0,0,0,0,0,NULL,yyvsp[-1].l,NULL);
      yyval.s.Type = MSH_VOLUME;
      yyval.s.Num  = (int)yyvsp[-4].d;
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 185:
#line 1383 "Gmsh.y"
{
      Cdbz101((int)yyvsp[-4].d,MSH_PHYSICAL_VOLUME,0,0,0,0,0,NULL,yyvsp[-1].l,NULL);
      yyval.s.Type = MSH_PHYSICAL_VOLUME;
      yyval.s.Num  = (int)yyvsp[-4].d;
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 186:
#line 1396 "Gmsh.y"
      TranslateShapes (yyvsp[-3].v[0],yyvsp[-3].v[1],yyvsp[-3].v[2],yyvsp[-1].l,1);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 187:
#line 1401 "Gmsh.y"
      RotateShapes(yyvsp[-8].v[0],yyvsp[-8].v[1],yyvsp[-8].v[2],yyvsp[-6].v[0],yyvsp[-6].v[1],yyvsp[-6].v[2],yyvsp[-4].d,yyvsp[-1].l);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 188:
#line 1406 "Gmsh.y"
      SymmetryShapes(yyvsp[-3].v[0],yyvsp[-3].v[1],yyvsp[-3].v[2],yyvsp[-3].v[3],yyvsp[-1].l,1);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 189:
#line 1411 "Gmsh.y"
{
      DilatShapes(yyvsp[-6].v[0],yyvsp[-6].v[1],yyvsp[-6].v[2],yyvsp[-4].d,yyvsp[-1].l,1);
      yyval.l = yyvsp[-1].l;
    ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 1418 "Gmsh.y"
{ yyval.l = yyvsp[0].l; ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 1419 "Gmsh.y"
{ yyval.l = yyvsp[0].l; ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 1420 "Gmsh.y"
{ yyval.l = yyvsp[0].l; ;
    break;}
case 193:
#line 1425 "Gmsh.y"
{
      yyval.l = List_Create(3,3,sizeof(Shape));
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 194:
#line 1429 "Gmsh.y"
{
      List_Add(yyval.l,&yyvsp[0].s);
      yyval.l = yyvsp[-1].l;
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 195:
#line 1441 "Gmsh.y"
{
      yyval.l = List_Create(3,3,sizeof(Shape));
      for(i=0;i<List_Nbr(yyvsp[-1].l);i++){
	List_Read (yyvsp[-1].l,i,&TheShape);
	CopyShape(TheShape.Type,TheShape.Num,&j);
	TheShape.Num = j;
	List_Add(yyval.l,&TheShape);
      }
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 196:
#line 1459 "Gmsh.y"
{
      for(i=0;i<List_Nbr(yyvsp[-1].l);i++){
	List_Read (yyvsp[-1].l,i,&TheShape);
	DeleteShape(TheShape.Type,TheShape.Num);
      }
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 197:
#line 1466 "Gmsh.y"
	if(!strcmp(yyvsp[-4].c, "View"))
	  FreeView((int)yyvsp[-2].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 198:
#line 1471 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 199:
#line 1483 "Gmsh.y"
      if(!strcmp(yyvsp[-2].c, "Include")){

	yyinTab[RecursionLevel++] = yyin;

	strcpy(tmpstring, yyname);
	i = strlen(yyname)-1 ;
	while(i >= 0 && yyname[i] != '/' && yyname[i] != '\\') i-- ;
	tmpstring[i+1] = '\0';
	strcat(tmpstring,yyvsp[-1].c);

	if((yyin = fopen(tmpstring,"r"))){
	  Msg(INFO, "Including '%s'", tmpstring); 
	  strcpy(yynameTab[RecursionLevel-1],yyname);
	  yylinenoTab[RecursionLevel-1]=yylineno;
	  yylineno=1;
	  strcpy(yyname,tmpstring);
	  while(!feof(yyin)){
	    yyparse();
	  }
	  //
	  //Est-ce grave de laisser le stream ouvert? Si on fait le
	  //fclose, on ne peut pas faire appel a une fonction
	  //(Function) definie en dehors de son fichier de
	  //definition...
	  //
	  //fclose(yyin);
	  yyin = yyinTab[--RecursionLevel];
	  strcpy(yyname,yynameTab[RecursionLevel]);
	  yylineno = yylinenoTab[RecursionLevel];
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	  vyyerror("Unknown file '%s'", tmpstring) ;  
	  yyin = yyinTab[--RecursionLevel];
	}

      else if(!strcmp(yyvsp[-2].c, "Print")){
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	if(!CTX.batch) CreateOutputFile(yyvsp[-1].c, CTX.print.format);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      }
      else if(!strcmp(yyvsp[-2].c, "Save")){
	CreateOutputFile(yyvsp[-1].c, CTX.mesh.format);
      }
      else if(!strcmp(yyvsp[-2].c, "Merge")){

	FILE *ff = yyin;
	MergeProblem(yyvsp[-1].c);
	yyin = ff;

      }
      else if(!strcmp(yyvsp[-2].c, "Open")){

	FILE *ff = yyin;
	OpenProblem(yyvsp[-1].c);
	yyin = ff;

      }
      else if(!strcmp(yyvsp[-2].c, "System")){
	
	Msg(PARSER_INFO, "Executing system call \"%s\"", yyvsp[-1].c);
	system(yyvsp[-1].c);

Christophe Geuzaine's avatar
Christophe Geuzaine committed
	vyyerror("Unknown command '%s'", yyvsp[-2].c);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 200:
#line 1550 "Gmsh.y"
      if(!strcmp(yyvsp[-2].c, "Sleep")){

	long sleep_time = GetTime();
	while(1){
	  if(GetTime() - sleep_time > (long)(yyvsp[-1].d*1.e6)) break;
	}
      
      }
      else if(!strcmp(yyvsp[-2].c, "Mesh")){

	//Maillage_Dimension_0(THEM);
	//mai3d(THEM,(int)$2);
	vyyerror("Mesh directives are not (yet) allowed in scripts");

Christophe Geuzaine's avatar
Christophe Geuzaine committed
	vyyerror("Unknown command '%s'", yyvsp[-2].c);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 201:
#line 1570 "Gmsh.y"
{
#ifndef _NOPLUGIN
    GMSH_PluginManager::Instance()->Action(yyvsp[-4].c,yyvsp[-1].c,0); 
#endif
   ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 202:
#line 1576 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 203:
#line 1580 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      if(!CTX.batch){ // we're in interactive mode
	if(Tree_Nbr(THEM->Points) != Last_NumberOfPoints){
	  Last_NumberOfPoints = Tree_Nbr(THEM->Points);
	  Replot();
	  DrawUI();
	  DrawUI();
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 204:
#line 1602 "Gmsh.y"
{
      FILE* ff;
      if(RecursionLevel)
	ff = yyinTab[RecursionLevel-1];
      else
	ff = yyin;
      // here, we seek remember the position in yyin
      LoopControlVariablesTab[ImbricatedLoop][0] = yyvsp[-3].d ;
      LoopControlVariablesTab[ImbricatedLoop][1] = yyvsp[-1].d ;
      LoopControlVariablesTab[ImbricatedLoop][2] = 1.0 ;
      LoopControlVariablesNameTab[ImbricatedLoop] = "" ;
      fgetpos( ff, &yyposImbricatedLoopsTab[ImbricatedLoop++]);
    ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 205:
#line 1616 "Gmsh.y"
{
      FILE* ff;
      if(RecursionLevel)
	ff = yyinTab[RecursionLevel-1];
      else
	ff = yyin;
      // here, we seek remember the position in yyin
      LoopControlVariablesTab[ImbricatedLoop][0] = yyvsp[-5].d ;
      LoopControlVariablesTab[ImbricatedLoop][1] = yyvsp[-3].d ;
      LoopControlVariablesTab[ImbricatedLoop][2] = yyvsp[-1].d ;
      LoopControlVariablesNameTab[ImbricatedLoop] = "" ;
      fgetpos( ff, &yyposImbricatedLoopsTab[ImbricatedLoop++]);
    ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 206:
#line 1630 "Gmsh.y"
{
      FILE* ff;
      if(RecursionLevel)
	ff = yyinTab[RecursionLevel-1];
      else
	ff = yyin;
      // here, we seek remember the position in yyin
      LoopControlVariablesTab[ImbricatedLoop][0] = yyvsp[-3].d ;
      LoopControlVariablesTab[ImbricatedLoop][1] = yyvsp[-1].d ;
      LoopControlVariablesTab[ImbricatedLoop][2] = 1.0 ;
      LoopControlVariablesNameTab[ImbricatedLoop] = yyvsp[-6].c ;
      
      TheSymbol.Name = yyvsp[-6].c;
      if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))){
	TheSymbol.val = List_Create(1,1,sizeof(double));
	List_Put(TheSymbol.val, 0, &yyvsp[-3].d);
	List_Add(Symbol_L, &TheSymbol);
      }
      else{
	List_Write(pSymbol->val, 0, &yyvsp[-3].d);
      }
      
      fgetpos( ff, &yyposImbricatedLoopsTab[ImbricatedLoop++]);
    ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 207:
#line 1655 "Gmsh.y"
{
      FILE* ff;
      if(RecursionLevel)
	ff = yyinTab[RecursionLevel-1];
      else
	ff = yyin;
      // here, we seek remember the position in yyin
      LoopControlVariablesTab[ImbricatedLoop][0] = yyvsp[-5].d ;
      LoopControlVariablesTab[ImbricatedLoop][1] = yyvsp[-3].d ;
      LoopControlVariablesTab[ImbricatedLoop][2] = yyvsp[-1].d ;
      LoopControlVariablesNameTab[ImbricatedLoop] = yyvsp[-8].c ;
      TheSymbol.Name = yyvsp[-8].c;
      if (!(pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols))){
	TheSymbol.val = List_Create(1,1,sizeof(double));
	List_Put(TheSymbol.val, 0, &yyvsp[-5].d);
	List_Add(Symbol_L, &TheSymbol);
      }
      else{
	List_Write(pSymbol->val, 0, &yyvsp[-5].d);
      }
      
      fgetpos( ff, &yyposImbricatedLoopsTab[ImbricatedLoop++]);
    ;
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 208:
#line 1680 "Gmsh.y"
      if(LoopControlVariablesTab[ImbricatedLoop-1][1] >  
	 LoopControlVariablesTab[ImbricatedLoop-1][0]){
	FILE* ff;
	if(RecursionLevel)
	  ff = yyinTab[RecursionLevel-1];
	else
	  ff = yyin;
	
	LoopControlVariablesTab[ImbricatedLoop-1][0] +=
	  LoopControlVariablesTab[ImbricatedLoop-1][2];
	if(strlen(LoopControlVariablesNameTab[ImbricatedLoop-1])){
	  TheSymbol.Name = LoopControlVariablesNameTab[ImbricatedLoop-1];
	  pSymbol = (Symbol*)List_PQuery(Symbol_L, &TheSymbol, CompareSymbols);
	  *(double*)List_Pointer_Fast(pSymbol->val, 0) += 
	    LoopControlVariablesTab[ImbricatedLoop-1][2] ;
	
	fsetpos( yyin, &yyposImbricatedLoopsTab[ImbricatedLoop-1]);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 209:
#line 1706 "Gmsh.y"
      if(!FunctionManager::Instance()->createFunction(yyvsp[0].c,yyin,yylineno))
	vyyerror("Redefinition of function %s",yyvsp[0].c);
      skip_until(NULL, "Return");
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 210:
#line 1712 "Gmsh.y"
      if(!FunctionManager::Instance()->leaveFunction(&yyin,yylineno))
	vyyerror("Error while exiting function");
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 211:
#line 1717 "Gmsh.y"
      if(!FunctionManager::Instance()->enterFunction(yyvsp[-1].c,&yyin,yylineno))
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	vyyerror("Unknown function %s",yyvsp[-1].c);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 212:
#line 1722 "Gmsh.y"
      if(!yyvsp[-1].d) skip_until("If", "EndIf");
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 213:
#line 1726 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 214:
#line 1737 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Curve *pc, *prc;
      Extrude_ProtudePoint(1,(int)yyvsp[-4].d,yyvsp[-2].v[0],yyvsp[-2].v[1],yyvsp[-2].v[2],0.,0.,0.,0.,&pc,&prc,NULL);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 215:
#line 1742 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Curve *pc, *prc;
      Extrude_ProtudePoint(0,(int)yyvsp[-8].d,yyvsp[-6].v[0],yyvsp[-6].v[1],yyvsp[-6].v[2],yyvsp[-4].v[0],yyvsp[-4].v[1],yyvsp[-4].v[2],yyvsp[-2].d,
			   &pc,&prc,NULL);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 216:
#line 1748 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Extrude_ProtudeCurve(1,(int)yyvsp[-4].d,yyvsp[-2].v[0],yyvsp[-2].v[1],yyvsp[-2].v[2],0.,0.,0.,0.,NULL);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 217:
#line 1752 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Extrude_ProtudeCurve(0,(int)yyvsp[-8].d,yyvsp[-6].v[0],yyvsp[-6].v[1],yyvsp[-6].v[2],yyvsp[-4].v[0],yyvsp[-4].v[1],yyvsp[-4].v[2],yyvsp[-2].d,NULL);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 218:
#line 1756 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Extrude_ProtudeSurface(1,(int)yyvsp[-4].d,yyvsp[-2].v[0],yyvsp[-2].v[1],yyvsp[-2].v[2],0.,0.,0.,0.,0,NULL);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 219:
#line 1760 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      Extrude_ProtudeSurface(0,(int)yyvsp[-8].d,yyvsp[-6].v[0],yyvsp[-6].v[1],yyvsp[-6].v[2],yyvsp[-4].v[0],yyvsp[-4].v[1],yyvsp[-4].v[2],yyvsp[-2].d,0,NULL);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 220:
#line 1764 "Gmsh.y"
      extr.mesh.ExtrudeMesh = false;
      extr.mesh.Recombine = false;
    ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 221:
#line 1769 "Gmsh.y"
      int vol = NEWREG();
      Extrude_ProtudeSurface(1,(int)yyvsp[-8].d,yyvsp[-6].v[0],yyvsp[-6].v[1],yyvsp[-6].v[2],0.,0.,0.,0.,vol,&extr);
    ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 222:
#line 1774 "Gmsh.y"
      extr.mesh.ExtrudeMesh = false;
      extr.mesh.Recombine = false;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 223:
#line 1780 "Gmsh.y"
      int vol = NEWREG();
      Extrude_ProtudeSurface(0,(int)yyvsp[-12].d,yyvsp[-10].v[0],yyvsp[-10].v[1],yyvsp[-10].v[2],yyvsp[-8].v[0],yyvsp[-8].v[1],yyvsp[-8].v[2],yyvsp[-6].d,vol,&extr);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 224:
#line 1788 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 225:
#line 1791 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 226:
#line 1797 "Gmsh.y"
{
      double d;
      int j;
      extr.mesh.ExtrudeMesh = true;
      extr.mesh.NbLayer = List_Nbr(yyvsp[-6].l);
      for(int i=0;i<List_Nbr(yyvsp[-6].l);i++){
	List_Read(yyvsp[-6].l,i,&d);
	j = (int)d;
	extr.mesh.NbElmLayer[i] = j;
	List_Read(yyvsp[-4].l,i,&d);
	j = (int)d;
	extr.mesh.ZonLayer[i] = j;
	List_Read(yyvsp[-2].l,i,&d);
	extr.mesh.hLayer[i] = d;
      List_Delete(yyvsp[-6].l);
      List_Delete(yyvsp[-4].l);
      List_Delete(yyvsp[-2].l);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 227:
#line 1817 "Gmsh.y"
      extr.mesh.Recombine = true;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 228:
#line 1828 "Gmsh.y"
      Curve *c;
      for(i=0;i<List_Nbr(yyvsp[-3].l);i++){
	List_Read(yyvsp[-3].l,i,&d);
	j = (int)fabs(d);
        c = FindCurve(j,THEM);
	if(!c)
	  Msg(WARNING, "Unkown Curve %d", j);
	  c->Method = TRANSFINI;
	  c->ipar[0] = (int)yyvsp[-1].d;
	  c->ipar[1] = sign(d);
	  c->dpar[0] = 1.0;
      List_Delete(yyvsp[-3].l);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 229:
#line 1846 "Gmsh.y"
      Curve *c;
      for(i=0;i<List_Nbr(yyvsp[-6].l);i++){
	List_Read(yyvsp[-6].l,i,&d);
	j = (int)fabs(d);
        c = FindCurve(j,THEM);
	if(!c)
	  Msg(WARNING, "Unkown Curve %d", j);
	  c->Method = TRANSFINI;
	  c->ipar[0] = (int)yyvsp[-4].d;
	  c->ipar[1] = sign(d); /* Progresion : code 1 ou -1 */
	  c->dpar[0] = fabs(yyvsp[-1].d);
      List_Delete(yyvsp[-6].l);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 230:
#line 1864 "Gmsh.y"
      Curve *c;
      for(i=0;i<List_Nbr(yyvsp[-6].l);i++){
	List_Read(yyvsp[-6].l,i,&d);
	j = (int)fabs(d);
        c = FindCurve(j,THEM);
	if(!c)
	  Msg(WARNING, "Unkown Curve %d", j);
	  c->Method = TRANSFINI;
	  c->ipar[0] = (int)yyvsp[-4].d;
	  c->ipar[1] = 2*sign(d); /* Bump : code 2 ou -2 */
	  c->dpar[0] = fabs(yyvsp[-1].d);
      List_Delete(yyvsp[-6].l);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 231:
#line 1882 "Gmsh.y"
      Surface *s = FindSurface((int)yyvsp[-4].d,THEM);
      if(!s)
	Msg(WARNING, "Unkown Surface %d", (int)yyvsp[-4].d);
	s->Method = TRANSFINI;
	k = List_Nbr(yyvsp[-1].l);
	if(k!=3 && k!=4){
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	  vyyerror("Wrong definition of Transfinite Surface %d: "
		   "%d points instead of 3 or 4" , yyvsp[-4].d, k) ;
	  for(i=0;i<k;i++){
	    List_Read(yyvsp[-1].l,i,&d);
	    j = (int)fabs(d);
	    s->ipar[i] = j;
      List_Delete(yyvsp[-1].l);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 232:
#line 1904 "Gmsh.y"
      Surface *s = FindSurface((int)yyvsp[-4].d,THEM);
      if(!s)
	Msg(WARNING, "Unkown Surface %d", (int)yyvsp[-4].d);
        s->Method = ELLIPTIC;
        k = List_Nbr(yyvsp[-1].l);
        if(k != 4)
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	  vyyerror("Wrong definition of Elliptic Surface %d: "
		   "%d points instead of 4" , yyvsp[-4].d, k) ;
        else{
	  for(i=0;i<k;i++){
	    List_Read(yyvsp[-1].l,i,&d);
	    j = (int)fabs(d);
	    s->ipar[i] = j;
      List_Delete(yyvsp[-1].l);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 233:
#line 1925 "Gmsh.y"
      Volume *v = FindVolume((int)yyvsp[-4].d,THEM);
      if(!v)
	Msg(WARNING, "Unkown Volume %d", (int)yyvsp[-4].d);
	v->Method = TRANSFINI;
	k = List_Nbr(yyvsp[-1].l);
	if(k!=6 && k!=8)
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	  vyyerror("Wrong definition of Transfinite Volume %d: "
		   "%d points instead of 6 or 8" , yyvsp[-4].d, k) ;
	  for(i=0;i<k;i++){
	    List_Read(yyvsp[-1].l,i,&d);
	    j = (int)fabs(d);
	    v->ipar[i] = j;
      List_Delete(yyvsp[-1].l);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 234:
#line 1946 "Gmsh.y"
      Surface *s;
      for(i=0;i<List_Nbr(yyvsp[-3].l);i++){
	List_Read(yyvsp[-3].l,i,&d);
	j = (int)d;
	s = FindSurface(j,THEM);
	  s->RecombineAngle = (yyvsp[-1].d > 0 && yyvsp[-1].d < 90) ? yyvsp[-1].d : 90;
      List_Delete(yyvsp[-3].l);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 235:
#line 1960 "Gmsh.y"
      Surface *s;
      for(i=0;i<List_Nbr(yyvsp[-1].l);i++){
	List_Read(yyvsp[-1].l,i,&d);
	j = (int)d;
        s = FindSurface(j,THEM);
	  s->Recombine = 1;
	  s->RecombineAngle = 30.;
        }
      List_Delete(yyvsp[-1].l);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 236:
#line 1982 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
case 237:
#line 1986 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
{ 
      IntersectAllSegmentsTogether();
    ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 1997 "Gmsh.y"
{yyval.i = 1;;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 1998 "Gmsh.y"
{yyval.i = 0;;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 1999 "Gmsh.y"
{yyval.i = -1;;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2000 "Gmsh.y"
{yyval.i = -1;;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2001 "Gmsh.y"
{yyval.i = -1;;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2005 "Gmsh.y"
{ yyval.d = yyvsp[0].d;           ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2006 "Gmsh.y"
{ yyval.d = yyvsp[-1].d ;          ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    break;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2007 "Gmsh.y"
{ yyval.d = -yyvsp[0].d ;         ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2008 "Gmsh.y"
{ yyval.d = yyvsp[0].d;           ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2009 "Gmsh.y"
{ yyval.d = !yyvsp[0].d ;         ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2010 "Gmsh.y"
{ yyval.d = yyvsp[-2].d - yyvsp[0].d ;     ;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2011 "Gmsh.y"
{ yyval.d = yyvsp[-2].d + yyvsp[0].d ;     ;
    break;}
case 250:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
#line 2012 "Gmsh.y"
{ yyval.d = yyvsp[-2].d * yyvsp[0].d ;     ;
    break;}
case 251:
#line 2014 "Gmsh.y"
{ 
      if(!yyvsp[0].d)
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	vyyerror("Division by zero in '%g / %g'", yyvsp[-2].d, yyvsp[0].d);
      else
	yyval.d = yyvsp[-2].d / yyvsp[0].d ;