Skip to content
Snippets Groups Projects
Gmsh.tab.cpp 265 KiB
Newer Older
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  new PView(PView::list[index], true);
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free(yyvsp[-4].c);
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 28:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 279 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      ViewData = new PViewDataList(true); 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 34:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 291 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ ViewCoord[ViewCoordIdx++] = yyvsp[0].d; ;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 35:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 293 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ ViewCoord[ViewCoordIdx++] = yyvsp[0].d; ;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 36:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 298 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ if(ViewValueList) List_Add(ViewValueList, &yyvsp[0].d); ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 37:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 300 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ if(ViewValueList) List_Add(ViewValueList, &yyvsp[0].d); ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 38:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 305 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
      if(!strcmp(yyvsp[0].c, "SP")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->SP; ViewNumList = &ViewData->NbSP;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VP")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->VP; ViewNumList = &ViewData->NbVP;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TP")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->TP; ViewNumList = &ViewData->NbTP;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SL")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->SL; ViewNumList = &ViewData->NbSL;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VL")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->VL; ViewNumList = &ViewData->NbVL;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TL")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->TL; ViewNumList = &ViewData->NbTL;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "ST")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->ST; ViewNumList = &ViewData->NbST;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VT")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->VT; ViewNumList = &ViewData->NbVT;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TT")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->TT; ViewNumList = &ViewData->NbTT;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SQ")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->SQ; ViewNumList = &ViewData->NbSQ;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VQ")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->VQ; ViewNumList = &ViewData->NbVQ;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TQ")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->TQ; ViewNumList = &ViewData->NbTQ;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SS")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->SS; ViewNumList = &ViewData->NbSS;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VS")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->VS; ViewNumList = &ViewData->NbVS;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TS")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->TS; ViewNumList = &ViewData->NbTS;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SH")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->SH; ViewNumList = &ViewData->NbSH;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VH")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->VH; ViewNumList = &ViewData->NbVH;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TH")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->TH; ViewNumList = &ViewData->NbTH;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SI")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->SI; ViewNumList = &ViewData->NbSI;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VI")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->VI; ViewNumList = &ViewData->NbVI;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TI")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->TI; ViewNumList = &ViewData->NbTI;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SY")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->SY; ViewNumList = &ViewData->NbSY;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VY")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->VY; ViewNumList = &ViewData->NbVY;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TY")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->TY; ViewNumList = &ViewData->NbTY;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SL2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->SL2; ViewNumList = &ViewData->NbSL2;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VL2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->VL2; ViewNumList = &ViewData->NbVL2;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TL2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->TL2; ViewNumList = &ViewData->NbTL2;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "ST2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->ST2; ViewNumList = &ViewData->NbST2;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VT2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->VT2; ViewNumList = &ViewData->NbVT2;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TT2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->TT2; ViewNumList = &ViewData->NbTT2;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SQ2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->SQ2; ViewNumList = &ViewData->NbSQ2;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VQ2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->VQ2; ViewNumList = &ViewData->NbVQ2;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TQ2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->TQ2; ViewNumList = &ViewData->NbTQ2;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SS2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->SS2; ViewNumList = &ViewData->NbSS2;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VS2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->VS2; ViewNumList = &ViewData->NbVS2;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TS2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->TS2; ViewNumList = &ViewData->NbTS2;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SH2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->SH2; ViewNumList = &ViewData->NbSH2;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VH2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->VH2; ViewNumList = &ViewData->NbVH2;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TH2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->TH2; ViewNumList = &ViewData->NbTH2;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SI2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->SI2; ViewNumList = &ViewData->NbSI2;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VI2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->VI2; ViewNumList = &ViewData->NbVI2;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TI2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->TI2; ViewNumList = &ViewData->NbTI2;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SY2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->SY2; ViewNumList = &ViewData->NbSY2;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VY2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->VY2; ViewNumList = &ViewData->NbVY2;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TY2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = ViewData->TY2; ViewNumList = &ViewData->NbTY2;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
      else{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	yymsg(GERROR, "Unknown element type '%s'", yyvsp[0].c);	
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewValueList = 0; ViewNumList = 0;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free(yyvsp[0].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      ViewCoordIdx = 0;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 39:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 449 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(ViewValueList){
	for(int i = 0; i < 3; i++)
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  for(int j = 0; j < ViewCoordIdx / 3; j++)
	    List_Add(ViewValueList, &ViewCoord[3 * j + i]);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 40:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 457 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(ViewValueList) (*ViewNumList)++;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 41:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 464 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      for(int i = 0; i < (int)strlen(yyvsp[0].c)+1; i++) List_Add(ViewData->T2C, &yyvsp[0].c[i]); 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free(yyvsp[0].c);
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 42:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 469 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      for(int i = 0; i < (int)strlen(yyvsp[0].c)+1; i++) List_Add(ViewData->T2C, &yyvsp[0].c[i]); 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free(yyvsp[0].c);
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 43:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 477 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      List_Add(ViewData->T2D, &yyvsp[-5].d); 
      List_Add(ViewData->T2D, &yyvsp[-3].d);
      List_Add(ViewData->T2D, &yyvsp[-1].d); 
      double d = List_Nbr(ViewData->T2C);
      List_Add(ViewData->T2D, &d); 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 44:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 485 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      ViewData->NbT2++;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 45:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 492 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      for(int i = 0; i < (int)strlen(yyvsp[0].c)+1; i++) List_Add(ViewData->T3C, &yyvsp[0].c[i]); 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free(yyvsp[0].c);
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 46:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 497 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      for(int i = 0; i < (int)strlen(yyvsp[0].c)+1; i++) List_Add(ViewData->T3C, &yyvsp[0].c[i]); 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free(yyvsp[0].c);
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 47:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 505 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      List_Add(ViewData->T3D, &yyvsp[-7].d); List_Add(ViewData->T3D, &yyvsp[-5].d);
      List_Add(ViewData->T3D, &yyvsp[-3].d); List_Add(ViewData->T3D, &yyvsp[-1].d); 
      double d = List_Nbr(ViewData->T3C);
      List_Add(ViewData->T3D, &d); 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 48:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 512 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      ViewData->NbT3++;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 49:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 520 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      ViewData->adaptive = new Adaptive_Post_View(ViewData, yyvsp[-5].l, yyvsp[-2].l);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 50:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 527 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      ViewData->adaptive = new Adaptive_Post_View(ViewData, yyvsp[-11].l, yyvsp[-8].l, yyvsp[-5].l, yyvsp[-2].l);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 51:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 534 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      ViewValueList = ViewData->Time;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 52:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 538 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 53:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 545 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ yyval.i = 0; ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 54:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 546 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ yyval.i = 1; ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 55:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 547 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ yyval.i = 2; ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 56:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 548 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ yyval.i = 3; ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 57:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 549 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ yyval.i = 4; ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 58:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 553 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ yyval.i = 1; ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 59:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 554 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ yyval.i = -1; ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 60:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 562 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol TheSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      TheSymbol.Name = yyvsp[-3].c;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol *pSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(!yyvsp[-2].i){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  TheSymbol.val = List_Create(1, 1, sizeof(double));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  List_Put(TheSymbol.val, 0, &yyvsp[-1].d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  Tree_Add(Symbol_T, &TheSymbol);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	else{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  yymsg(GERROR, "Unknown variable '%s'", yyvsp[-3].c);
	  Free(yyvsp[-3].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	double *pd = (double*)List_Pointer_Fast(pSymbol->val, 0); 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	switch(yyvsp[-2].i){
	case 0 : *pd = yyvsp[-1].d; break;
	case 1 : *pd += yyvsp[-1].d; break;
	case 2 : *pd -= yyvsp[-1].d; break;
	case 3 : *pd *= yyvsp[-1].d; break;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  if(yyvsp[-1].d) *pd /= yyvsp[-1].d; 
	  else yymsg(GERROR, "Division by zero in '%s /= %g'", yyvsp[-3].c, yyvsp[-1].d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	Free(yyvsp[-3].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 61:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 593 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol TheSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      TheSymbol.Name = yyvsp[-6].c;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol *pSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(!yyvsp[-2].i){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  TheSymbol.val = List_Create(5, 5, sizeof(double));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  List_Put(TheSymbol.val, (int)yyvsp[-4].d, &yyvsp[-1].d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  Tree_Add(Symbol_T, &TheSymbol);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	else{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  yymsg(GERROR, "Unknown variable '%s'", yyvsp[-6].c);
	  Free(yyvsp[-6].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	double *pd;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if((pd = (double*)List_Pointer_Test(pSymbol->val, (int)yyvsp[-4].d))){
	  switch(yyvsp[-2].i){
	  case 0 : *pd = yyvsp[-1].d; break;
	  case 1 : *pd += yyvsp[-1].d; break;
	  case 2 : *pd -= yyvsp[-1].d; break;
	  case 3 : *pd *= yyvsp[-1].d; break;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    if(yyvsp[-1].d) *pd /= yyvsp[-1].d; 
	    else yymsg(GERROR, "Division by zero in '%s[%d] /= %g'", yyvsp[-6].c, (int)yyvsp[-4].d, yyvsp[-1].d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  if(!yyvsp[-2].i)
	    List_Put(pSymbol->val, (int)yyvsp[-4].d, &yyvsp[-1].d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    yymsg(GERROR, "Uninitialized variable '%s[%d]'", yyvsp[-6].c, (int)yyvsp[-4].d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	Free(yyvsp[-6].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 62:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 632 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
      if(List_Nbr(yyvsp[-5].l) != List_Nbr(yyvsp[-1].l)){
	yymsg(GERROR, "Incompatible array dimensions in affectation");
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	Free(yyvsp[-8].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	Symbol TheSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	TheSymbol.Name = yyvsp[-8].c;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	Symbol *pSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  if(!yyvsp[-2].i){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    TheSymbol.val = List_Create(5, 5, sizeof(double));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    for(int i = 0; i < List_Nbr(yyvsp[-5].l); i++){
	      List_Put(TheSymbol.val, (int)(*(double*)List_Pointer(yyvsp[-5].l, i)),
		       (double*)List_Pointer(yyvsp[-1].l, i));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    Tree_Add(Symbol_T, &TheSymbol);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  else{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    yymsg(GERROR, "Unknown variable '%s'", yyvsp[-8].c);
	    Free(yyvsp[-8].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  for(int i = 0; i < List_Nbr(yyvsp[-5].l); i++){
	    int j = (int)(*(double*)List_Pointer(yyvsp[-5].l, i));
	    double d = *(double*)List_Pointer(yyvsp[-1].l, i);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    double *pd;
	    if((pd = (double*)List_Pointer_Test(pSymbol->val, j))){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	      switch(yyvsp[-2].i){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	      case 0 : *pd = d; break;
	      case 1 : *pd += d; break;
	      case 2 : *pd -= d; break;
	      case 3 : *pd *= d; break;
	      case 4 : 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
		if(yyvsp[-1].l) *pd /= d; 
		else yymsg(GERROR, "Division by zero in '%s[%d] /= %g'", yyvsp[-8].c, j, d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	      if(!yyvsp[-2].i)
		List_Put(pSymbol->val, j, &d);
	      else
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
		yymsg(GERROR, "Uninitialized variable '%s[%d]'", yyvsp[-8].c, j);	  
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  Free(yyvsp[-8].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      List_Delete(yyvsp[-5].l);
      List_Delete(yyvsp[-1].l);
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 63:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 686 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol TheSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      TheSymbol.Name = yyvsp[-5].c;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol *pSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))){
	TheSymbol.val = List_Create(5, 5, sizeof(double));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_Copy(yyvsp[-1].l, TheSymbol.val);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	Tree_Add(Symbol_T, &TheSymbol);
      }
      else{
	List_Reset(pSymbol->val);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_Copy(yyvsp[-1].l, pSymbol->val);
	Free(yyvsp[-5].c);
      }
      List_Delete(yyvsp[-1].l);
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 64:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 703 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      // appends to the list
      Symbol TheSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      TheSymbol.Name = yyvsp[-5].c;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol *pSymbol;
      if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))){
	TheSymbol.val = List_Create(5, 5, sizeof(double));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_Copy(yyvsp[-1].l, TheSymbol.val);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	Tree_Add(Symbol_T, &TheSymbol);
      }
      else{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	for(int i = 0; i < List_Nbr(yyvsp[-1].l); i++)
	  List_Add(pSymbol->val, List_Pointer(yyvsp[-1].l, i));
	Free(yyvsp[-5].c);
      }
      List_Delete(yyvsp[-1].l);
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 65:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 721 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol TheSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      TheSymbol.Name = yyvsp[-2].c;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol *pSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol)))
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	yymsg(GERROR, "Unknown variable '%s'", yyvsp[-2].c); 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	*(double*)List_Pointer_Fast(pSymbol->val, 0) += yyvsp[-1].i;
      Free(yyvsp[-2].c);
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 66:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 732 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol TheSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      TheSymbol.Name = yyvsp[-5].c;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol *pSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol)))
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	yymsg(GERROR, "Unknown variable '%s'", yyvsp[-5].c); 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	double *pd;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if((pd = (double*)List_Pointer_Test(pSymbol->val, (int)yyvsp[-3].d)))
	  *pd += yyvsp[-1].i;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  yymsg(GERROR, "Uninitialized variable '%s[%d]'", yyvsp[-5].c, (int)yyvsp[-3].d);
      }
      Free(yyvsp[-5].c);
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 67:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 749 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Msg(WARNING, "Named string expressions not implemented yet");
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 68:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 756 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      char* (*pStrOpt)(int num, int action, char *value);
      StringXString *pStrCat;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pStrCat = Get_StringOptionCategory(yyvsp[-5].c)))
	yymsg(GERROR, "Unknown string option class '%s'", yyvsp[-5].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(!(pStrOpt = (char *(*) (int, int, char *))Get_StringOption(yyvsp[-3].c, pStrCat)))
	  yymsg(GERROR, "Unknown string option '%s.%s'", yyvsp[-5].c, yyvsp[-3].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  pStrOpt(0, GMSH_SET|GMSH_GUI, yyvsp[-1].c);
      }
      Free(yyvsp[-5].c); Free(yyvsp[-3].c); //FIXME: somtimes leak $5
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 69:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 770 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      char* (*pStrOpt)(int num, int action, char *value);
      StringXString *pStrCat;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pStrCat = Get_StringOptionCategory(yyvsp[-8].c)))
	yymsg(GERROR, "Unknown string option class '%s'", yyvsp[-8].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(!(pStrOpt = (char *(*) (int, int, char *))Get_StringOption(yyvsp[-3].c, pStrCat)))
	  yymsg(GERROR, "Unknown string option '%s[%d].%s'", yyvsp[-8].c, (int)yyvsp[-6].d, yyvsp[-3].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  pStrOpt((int)yyvsp[-6].d, GMSH_SET|GMSH_GUI, yyvsp[-1].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free(yyvsp[-8].c); Free(yyvsp[-3].c); //FIXME: somtimes leak $8
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 70:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 787 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      double (*pNumOpt)(int num, int action, double value);
      StringXNumber *pNumCat;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-5].c)))
	yymsg(GERROR, "Unknown numeric option class '%s'", yyvsp[-5].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[-3].c, pNumCat)))
	  yymsg(GERROR, "Unknown numeric option '%s.%s'", yyvsp[-5].c, yyvsp[-3].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  double d = 0;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  switch(yyvsp[-2].i){
	  case 0 : d = yyvsp[-1].d; break;
	  case 1 : d = pNumOpt(0, GMSH_GET, 0) + yyvsp[-1].d; break;
	  case 2 : d = pNumOpt(0, GMSH_GET, 0) - yyvsp[-1].d; break;
	  case 3 : d = pNumOpt(0, GMSH_GET, 0) * yyvsp[-1].d; break;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    if(yyvsp[-1].d) d = pNumOpt(0, GMSH_GET, 0) / yyvsp[-1].d; 
	    else yymsg(GERROR, "Division by zero in '%s.%s /= %g'", yyvsp[-5].c, yyvsp[-3].c, yyvsp[-1].d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  pNumOpt(0, GMSH_SET|GMSH_GUI, d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free(yyvsp[-5].c); Free(yyvsp[-3].c);
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 71:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 813 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      double (*pNumOpt)(int num, int action, double value);
      StringXNumber *pNumCat;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-8].c)))
	yymsg(GERROR, "Unknown numeric option class '%s'", yyvsp[-8].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(!(pNumOpt =  (double (*) (int, int, double))Get_NumberOption(yyvsp[-3].c, pNumCat)))
	  yymsg(GERROR, "Unknown numeric option '%s[%d].%s'", yyvsp[-8].c, (int)yyvsp[-6].d, yyvsp[-3].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  double d = 0;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  switch(yyvsp[-2].i){
	  case 0 : d = yyvsp[-1].d; break;
	  case 1 : d = pNumOpt((int)yyvsp[-6].d, GMSH_GET, 0) + yyvsp[-1].d; break;
	  case 2 : d = pNumOpt((int)yyvsp[-6].d, GMSH_GET, 0) - yyvsp[-1].d; break;
	  case 3 : d = pNumOpt((int)yyvsp[-6].d, GMSH_GET, 0) * yyvsp[-1].d; break;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    if(yyvsp[-1].d) d = pNumOpt((int)yyvsp[-6].d, GMSH_GET, 0) / yyvsp[-1].d;
	    else yymsg(GERROR, "Division by zero in '%s[%d].%s /= %g'", 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
		       yyvsp[-8].c, (int)yyvsp[-6].d, yyvsp[-3].c, yyvsp[-1].d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  pNumOpt((int)yyvsp[-6].d, GMSH_SET|GMSH_GUI, d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free(yyvsp[-8].c); Free(yyvsp[-3].c);
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 72:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 840 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      double (*pNumOpt)(int num, int action, double value);
      StringXNumber *pNumCat;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-4].c)))
	yymsg(GERROR, "Unknown numeric option class '%s'", yyvsp[-4].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(!(pNumOpt =  (double (*) (int, int, double))Get_NumberOption(yyvsp[-2].c, pNumCat)))
	  yymsg(GERROR, "Unknown numeric option '%s.%s'", yyvsp[-4].c, yyvsp[-2].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  pNumOpt(0, GMSH_SET|GMSH_GUI, pNumOpt(0, GMSH_GET, 0)+yyvsp[-1].i);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free(yyvsp[-4].c); Free(yyvsp[-2].c);
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 73:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 854 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      double (*pNumOpt)(int num, int action, double value);
      StringXNumber *pNumCat;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-7].c)))
	yymsg(GERROR, "Unknown numeric option class '%s'", yyvsp[-7].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(!(pNumOpt =  (double (*) (int, int, double))Get_NumberOption(yyvsp[-2].c, pNumCat)))
	  yymsg(GERROR, "Unknown numeric option '%s[%d].%s'", yyvsp[-7].c, (int)yyvsp[-5].d, yyvsp[-2].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  pNumOpt((int)yyvsp[-5].d, GMSH_SET|GMSH_GUI, pNumOpt((int)yyvsp[-5].d, GMSH_GET, 0)+yyvsp[-1].i);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free(yyvsp[-7].c); Free(yyvsp[-2].c);
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 74:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 871 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      unsigned int (*pColOpt)(int num, int action, unsigned int value);
      StringXColor *pColCat;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pColCat = Get_ColorOptionCategory(yyvsp[-7].c)))
	yymsg(GERROR, "Unknown color option class '%s'", yyvsp[-7].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(!(pColOpt =  (unsigned int (*) (int, int, unsigned int))Get_ColorOption(yyvsp[-3].c, pColCat)))
	  yymsg(GERROR, "Unknown color option '%s.Color.%s'", yyvsp[-7].c, yyvsp[-3].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  pColOpt(0, GMSH_SET|GMSH_GUI, yyvsp[-1].u);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free(yyvsp[-7].c); Free(yyvsp[-3].c);
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 75:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 885 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      unsigned int (*pColOpt)(int num, int action, unsigned int value);
      StringXColor *pColCat;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pColCat = Get_ColorOptionCategory(yyvsp[-10].c)))
	yymsg(GERROR, "Unknown color option class '%s'", yyvsp[-10].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(!(pColOpt =  (unsigned int (*) (int, int, unsigned int))Get_ColorOption(yyvsp[-3].c, pColCat)))
	  yymsg(GERROR, "Unknown color option '%s[%d].Color.%s'", yyvsp[-10].c, (int)yyvsp[-8].d, yyvsp[-3].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  pColOpt((int)yyvsp[-8].d, GMSH_SET|GMSH_GUI, yyvsp[-1].u);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free(yyvsp[-10].c); Free(yyvsp[-3].c);
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 76:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 902 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
      GmshColorTable *ct = Get_ColorTable(0);
	yymsg(GERROR, "View[%d] does not exist", 0);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ct->size = List_Nbr(yyvsp[-1].l);
	if(ct->size > COLORTABLE_NBMAX_COLOR)
	  yymsg(GERROR, "Too many (%d>%d) colors in View[%d].ColorTable", 
		ct->size, COLORTABLE_NBMAX_COLOR, 0);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  for(int i = 0; i < ct->size; i++) List_Read(yyvsp[-1].l, i, &ct->table[i]);
	if(ct->size == 1){
	  ct->size = 2;
	  ct->table[1] = ct->table[0];
	}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free(yyvsp[-5].c);
      List_Delete(yyvsp[-1].l);
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 77:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 922 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
      GmshColorTable *ct = Get_ColorTable((int)yyvsp[-6].d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	yymsg(GERROR, "View[%d] does not exist", (int)yyvsp[-6].d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ct->size = List_Nbr(yyvsp[-1].l);
	  yymsg(GERROR, "Too many (%d>%d) colors in View[%d].ColorTable", 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
		   ct->size, COLORTABLE_NBMAX_COLOR, (int)yyvsp[-6].d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  for(int i = 0; i < ct->size; i++) List_Read(yyvsp[-1].l, i, &ct->table[i]);
	if(ct->size == 1){
	  ct->size = 2;
	  ct->table[1] = ct->table[0];
	}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free(yyvsp[-8].c);
      List_Delete(yyvsp[-1].l);
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 78:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 945 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      try {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	GMSH_PluginManager::instance()->setPluginOption(yyvsp[-6].c, yyvsp[-3].c, yyvsp[-1].d); 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
      catch (...) {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	yymsg(GERROR, "Unknown option '%s' or plugin '%s'", yyvsp[-3].c, yyvsp[-6].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free(yyvsp[-6].c); Free(yyvsp[-3].c);
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 79:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 955 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      try {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	GMSH_PluginManager::instance()->setPluginOption(yyvsp[-6].c, yyvsp[-3].c, yyvsp[-1].c); 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
      catch (...) {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	yymsg(GERROR, "Unknown option '%s' or plugin '%s'", yyvsp[-3].c, yyvsp[-6].c);
      }
      Free(yyvsp[-6].c); Free(yyvsp[-3].c); // FIXME: sometimes leak $8
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 80:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 970 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ 
      yyval.i = (int)yyvsp[0].d; 
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 81:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 974 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      yyval.i = GModel::current()->setPhysicalName
	(std::string(yyvsp[0].c), ++GModel::current()->getGEOInternals()->MaxPhysicalNum);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free(yyvsp[0].c);
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 82:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 987 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
      int num = (int)yyvsp[-4].d;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(FindPoint(num)){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	yymsg(GERROR, "Point %d already exists", num);
      }
      else{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	double x = CTX.geom.scaling_factor * yyvsp[-1].v[0];
	double y = CTX.geom.scaling_factor * yyvsp[-1].v[1];
	double z = CTX.geom.scaling_factor * yyvsp[-1].v[2];
	double lc = CTX.geom.scaling_factor * yyvsp[-1].v[3];
	Vertex *v;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(!myGmshSurface)
	  v = Create_Vertex(num, x, y, z, lc, 1.0);
	else
	  v = Create_Vertex(num, x, y, myGmshSurface, lc);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	Tree_Add(GModel::current()->getGEOInternals()->Points, &v);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	AddToTemporaryBoundingBox(v->Pos.X, v->Pos.Y, v->Pos.Z);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      yyval.s.Type = MSH_POINT;
      yyval.s.Num = num;
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 83:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1009 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
      int num = (int)yyvsp[-4].i;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(FindPhysicalGroup(num, MSH_PHYSICAL_POINT)){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	yymsg(GERROR, "Physical point %d already exists", num);
      }
      else{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_T *temp = ListOfDouble2ListOfInt(yyvsp[-1].l);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	PhysicalGroup *p = Create_PhysicalGroup(num, MSH_PHYSICAL_POINT, temp);
	List_Delete(temp);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_Add(GModel::current()->getGEOInternals()->PhysicalGroups, &p);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      List_Delete(yyvsp[-1].l);
      yyval.s.Type = MSH_PHYSICAL_POINT;
      yyval.s.Num = num;
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 84:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1025 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
      AttractorField *att = new AttractorField();
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      for(int i = 0; i < List_Nbr(yyvsp[-1].l); i++){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        List_Read(yyvsp[-1].l, i, &d);
        Vertex *v = FindPoint((int)d); 
        if(v)
          att->addPoint(v->Pos.X, v->Pos.Y, v->Pos.Z);
        else{
Christophe Geuzaine's avatar
Christophe Geuzaine committed
          GVertex *gv = GModel::current()->vertexByTag((int)d);
          if(gv) 
            att->addPoint(gv->x(), gv->y(), gv->z());
        }
      }
      att->buildFastSearchStructures();
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      fields.insert(att, (int)yyvsp[-4].d);
      // dummy values
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      yyval.s.Type = 0;
      yyval.s.Num = 0;
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 85:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1046 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
      fields.insert(new LatLonField(fields.get((int)yyvsp[-1].d)), (int)yyvsp[-4].d);
      // dummy values
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      yyval.s.Type = 0;
      yyval.s.Num = 0;
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 86:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1053 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      int index = (int)yyvsp[-1].d;
      if(index >= 0 && index < PView::list.size()) 
        fields.insert(new PostViewField(PView::list[index]), (int)yyvsp[-4].d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        yymsg(GERROR, "Field %i error, view %i does not exist", (int)yyvsp[-4].d, (int)yyvsp[-1].d);
      // dummy values
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      yyval.s.Type = 0;
      yyval.s.Num = 0;
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 87:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1064 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
      double pars[] = {0, CTX.lc/10, CTX.lc, CTX.lc/100, CTX.lc/20};
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      for(int i = 0; i < List_Nbr(yyvsp[-1].l); i++){
	if(i > 4)
	  yymsg(GERROR, "Too many parameters for Thresold Field (max=5)");
	else
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  List_Read(yyvsp[-1].l, i, &pars[i]);
      }
      fields.insert(new ThresholdField(fields.get((int)pars[0]), pars[1], 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
				       pars[2], pars[3], pars[4]), (int)yyvsp[-4].d);
      // dummy values
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      yyval.s.Type = 0;
      yyval.s.Num = 0;
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 88:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1079 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
      std::list<Field*> *flist = new std::list<Field*>;
      fields.insert(new FunctionField(flist,yyvsp[-1].c), (int)yyvsp[-4].d);
      // dummy values
      yyval.s.Type = 0;
      yyval.s.Num = 0;
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 89:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1087 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
      std::list<Field*> *flist = new std::list<Field*>;
      flist->resize(0);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      for(int i = 0; i < List_Nbr(yyvsp[-1].l); i++){
	double id;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_Read(yyvsp[-1].l, i, &id);
	Field *pfield = fields.get((int)id);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(pfield) flist->push_front(pfield);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      fields.insert(new FunctionField(flist,yyvsp[-2].c), (int)yyvsp[-5].d);
      // dummy values
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      yyval.s.Type = 0;
      yyval.s.Num = 0;
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 90:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1102 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
      fields.insert(new StructuredField(yyvsp[-1].c), (int)yyvsp[-4].d);
      // dummy values
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      yyval.s.Type = 0;
      yyval.s.Num = 0;
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 91:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1109 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
      for(int i = 0; i < List_Nbr(yyvsp[-1].l); i++){
	double id;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_Read(yyvsp[-1].l, i, &id);
        BGMAddField(fields.get((int)id));
      }
      // dummy values
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      yyval.s.Type = 0;
      yyval.s.Num = 0;
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 92:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1121 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
      double pars[] = { CTX.lc/10, CTX.lc/100., CTX.lc/20, 1, 3 };
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      for(int i = 0; i < List_Nbr(yyvsp[-1].l); i++){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(i > 4) 
	  yymsg(GERROR, "Too many paramaters for attractor line (max = 5)");	  
	else
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  List_Read(yyvsp[-1].l, i, &pars[i]);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
      // treshold attractor: first parameter is the treshold, next two
      // are the in and out size fields, last is transition factor
      AttractorField *attractor = new AttractorField();
      Field *threshold = new ThresholdField(attractor, pars[0], pars[0] * pars[4], 
					    pars[1], pars[2]);
      fields.insert(threshold);
      BGMAddField(threshold);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      for(int i = 0; i < List_Nbr(yyvsp[-3].l); i++){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_Read(yyvsp[-3].l, i, &d);
	Vertex *v = FindPoint((int)d); 
	if(v)
	  attractor->addPoint(v->Pos.X, v->Pos.Y, v->Pos.Z);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	  GVertex *gv = GModel::current()->vertexByTag((int)d);
	    attractor->addPoint(gv->x(), gv->y(), gv->z());
      attractor->buildFastSearchStructures();
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      // dummy values
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      yyval.s.Type = 0;
      yyval.s.Num = 0;
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 93:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1155 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
      double pars[] = { CTX.lc/10, CTX.lc/100., CTX.lc/20, 10, 3 };
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      for(int i = 0; i < List_Nbr(yyvsp[-1].l); i++){
	if(i > 4) 
	  yymsg(GERROR, "Too many paramaters for attractor line (max = 5)");	  
	else
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  List_Read(yyvsp[-1].l, i, &pars[i]);
      }
      // treshold attractor: first parameter is the treshold, next two
      // are the in and out size fields, last is transition factor
      AttractorField *att = new AttractorField();
      fields.insert(att);
      Field *threshold = new ThresholdField(att, pars[0], pars[0] * pars[4],
					    pars[1], pars[2]);
      fields.insert(threshold);
      BGMAddField(threshold);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      for(int i = 0; i < List_Nbr(yyvsp[-3].l); i++){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_Read(yyvsp[-3].l, i, &d);
	Curve *c = FindCurve((int)d); 
	if(c){
	  att->addCurve(c, (int)pars[3]);
	}
	else{
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	  GEdge *ge = GModel::current()->edgeByTag((int)d);
	  if(ge){
	    att->addGEdge(ge, (int)pars[3]);
	  }
	}
      }
      att->buildFastSearchStructures();
      // dummy values
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      yyval.s.Type = 0;
      yyval.s.Num = 0;
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 94:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1191 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{      
      for(int i = 0; i < List_Nbr(yyvsp[-3].l); i++){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	double d;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_Read(yyvsp[-3].l, i, &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	Vertex *v = FindPoint((int)d); 	 
	if(v)
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  v->lc = yyvsp[-1].d;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	else{
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	  GVertex *gv = GModel::current()->vertexByTag((int)d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  if(gv) 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    gv->setPrescribedMeshSizeAtVertex(yyvsp[-1].d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      List_Delete(yyvsp[-3].l);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      // dummy values
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      yyval.s.Type = 0;
      yyval.s.Num = 0;
    ;
    break;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
case 95:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1213 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
      int num = (int)yyvsp[-4].d;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(FindCurve(num)){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	yymsg(GERROR, "Curve %d already exists", num);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_T *temp = ListOfDouble2ListOfInt(yyvsp[-1].l);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	Curve *c = Create_Curve(num, MSH_SEGM_LINE, 1, temp, NULL,
				-1, -1, 0., 1.);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	Tree_Add(GModel::current()->getGEOInternals()->Curves, &c);