Skip to content
Snippets Groups Projects
Gmsh.tab.cpp 270 KiB
Newer Older
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  fprintf(fp, "%s\n", tmpstring);
	  fclose(fp);
	}
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free(yyvsp[-6].c);
      Free(yyvsp[-1].c);
      List_Delete(yyvsp[-4].l);
    ;
    break;}
case 26:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ 
      if(!strcmp(yyvsp[-5].c, "View") && !CheckViewErrorFlags(View)){
	EndView(View, 0, yyname, yyvsp[-4].c);
      }
      Free(yyvsp[-5].c); Free(yyvsp[-4].c);
    ;
    break;}
case 27:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
      if(!strcmp(yyvsp[-7].c, "View") && !CheckViewErrorFlags(View)){
	EndView(View, 0, yyname, yyvsp[-6].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free(yyvsp[-7].c); Free(yyvsp[-6].c); Free(yyvsp[-5].c);
    ;
    break;}
case 28:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      View = BeginView(1); 
      for(int i = 0; i < VIEW_NB_ELEMENT_TYPES; i++){
	ViewErrorFlags[i] = 0;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;
    break;}
case 35:
#line 283 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ ViewCoord[ViewCoordIdx] = yyvsp[0].d; ViewCoordIdx++; ;
    break;}
case 36:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ ViewCoord[ViewCoordIdx] = yyvsp[0].d; ViewCoordIdx++; ;
    break;}
case 37:
#line 290 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ if(ViewValueList) List_Add(ViewValueList, &yyvsp[0].d); ;
    break;}
case 38:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ if(ViewValueList) List_Add(ViewValueList, &yyvsp[0].d); ;
    break;}
case 39:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
      if(!strcmp(yyvsp[0].c, "SP")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 0; ViewNumNodes = 1; ViewNumComp = 1;
	ViewValueList = View->SP; ViewNumList = &View->NbSP;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VP")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 1; ViewNumNodes = 1; ViewNumComp = 3;
	ViewValueList = View->VP; ViewNumList = &View->NbVP;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TP")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 2; ViewNumNodes = 1; ViewNumComp = 9;
	ViewValueList = View->TP; ViewNumList = &View->NbTP;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SL")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 3; ViewNumNodes = 2; ViewNumComp = 1;
	ViewValueList = View->SL; ViewNumList = &View->NbSL;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VL")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 4; ViewNumNodes = 2; ViewNumComp = 3;
	ViewValueList = View->VL; ViewNumList = &View->NbVL;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TL")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 5; ViewNumNodes = 2; ViewNumComp = 9;
	ViewValueList = View->TL; ViewNumList = &View->NbTL;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "ST")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 6; ViewNumNodes = 3; ViewNumComp = 1;
	ViewValueList = View->ST; ViewNumList = &View->NbST;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VT")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 7; ViewNumNodes = 3; ViewNumComp = 3;
	ViewValueList = View->VT; ViewNumList = &View->NbVT;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TT")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 8; ViewNumNodes = 3; ViewNumComp = 9;
	ViewValueList = View->TT; ViewNumList = &View->NbTT;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SQ")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 9; ViewNumNodes = 4; ViewNumComp = 1;
	ViewValueList = View->SQ; ViewNumList = &View->NbSQ;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VQ")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 10; ViewNumNodes = 4; ViewNumComp = 3;
	ViewValueList = View->VQ; ViewNumList = &View->NbVQ;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TQ")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 11; ViewNumNodes = 4; ViewNumComp = 9;
	ViewValueList = View->TQ; ViewNumList = &View->NbTQ;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SS")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 12; ViewNumNodes = 4; ViewNumComp = 1;
	ViewValueList = View->SS; ViewNumList = &View->NbSS;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VS")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 13; ViewNumNodes = 4; ViewNumComp = 3;
	ViewValueList = View->VS; ViewNumList = &View->NbVS;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TS")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 14; ViewNumNodes = 4; ViewNumComp = 9;
	ViewValueList = View->TS; ViewNumList = &View->NbTS;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SH")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 15; ViewNumNodes = 8; ViewNumComp = 1;
	ViewValueList = View->SH; ViewNumList = &View->NbSH;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VH")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 16; ViewNumNodes = 8; ViewNumComp = 3;
	ViewValueList = View->VH; ViewNumList = &View->NbVH;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TH")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 17; ViewNumNodes = 8; ViewNumComp = 9;
	ViewValueList = View->TH; ViewNumList = &View->NbTH;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SI")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 18; ViewNumNodes = 6; ViewNumComp = 1;
	ViewValueList = View->SI; ViewNumList = &View->NbSI;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VI")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 19; ViewNumNodes = 6; ViewNumComp = 3;
	ViewValueList = View->VI; ViewNumList = &View->NbVI;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TI")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 20; ViewNumNodes = 6; ViewNumComp = 9;
	ViewValueList = View->TI; ViewNumList = &View->NbTI;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SY")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 21; ViewNumNodes = 5; ViewNumComp = 1;
	ViewValueList = View->SY; ViewNumList = &View->NbSY;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VY")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 22; ViewNumNodes = 5; ViewNumComp = 3;
	ViewValueList = View->VY; ViewNumList = &View->NbVY;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TY")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 23; ViewNumNodes = 5; ViewNumComp = 9;
	ViewValueList = View->TY; ViewNumList = &View->NbTY;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SL2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 3; ViewNumNodes = 3; ViewNumComp = 1;
	ViewValueList = View->SL2; ViewNumList = &View->NbSL2;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VL2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 4; ViewNumNodes = 3; ViewNumComp = 3;
	ViewValueList = View->VL2; ViewNumList = &View->NbVL2;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TL2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 5; ViewNumNodes = 3; ViewNumComp = 9;
	ViewValueList = View->TL2; ViewNumList = &View->NbTL2;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "ST2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 6; ViewNumNodes = 6; ViewNumComp = 1;
	ViewValueList = View->ST2; ViewNumList = &View->NbST2;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VT2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 7; ViewNumNodes = 6; ViewNumComp = 3;
	ViewValueList = View->VT2; ViewNumList = &View->NbVT2;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TT2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 8; ViewNumNodes = 6; ViewNumComp = 9;
	ViewValueList = View->TT2; ViewNumList = &View->NbTT2;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SQ2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 9; ViewNumNodes = 9; ViewNumComp = 1;
	ViewValueList = View->SQ2; ViewNumList = &View->NbSQ2;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VQ2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 10; ViewNumNodes = 9; ViewNumComp = 3;
	ViewValueList = View->VQ2; ViewNumList = &View->NbVQ2;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TQ2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 11; ViewNumNodes = 9; ViewNumComp = 9;
	ViewValueList = View->TQ2; ViewNumList = &View->NbTQ2;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SS2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 12; ViewNumNodes = 10; ViewNumComp = 1;
	ViewValueList = View->SS2; ViewNumList = &View->NbSS2;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VS2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 13; ViewNumNodes = 10; ViewNumComp = 3;
	ViewValueList = View->VS2; ViewNumList = &View->NbVS2;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TS2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 14; ViewNumNodes = 10; ViewNumComp = 9;
	ViewValueList = View->TS2; ViewNumList = &View->NbTS2;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SH2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 15; ViewNumNodes = 27; ViewNumComp = 1;
	ViewValueList = View->SH2; ViewNumList = &View->NbSH2;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VH2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 16; ViewNumNodes = 27; ViewNumComp = 3;
	ViewValueList = View->VH2; ViewNumList = &View->NbVH2;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TH2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 17; ViewNumNodes = 27; ViewNumComp = 9;
	ViewValueList = View->TH2; ViewNumList = &View->NbTH2;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SI2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 18; ViewNumNodes = 18; ViewNumComp = 1;
	ViewValueList = View->SI2; ViewNumList = &View->NbSI2;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VI2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 19; ViewNumNodes = 18; ViewNumComp = 3;
	ViewValueList = View->VI2; ViewNumList = &View->NbVI2;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TI2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 20; ViewNumNodes = 18; ViewNumComp = 9;
	ViewValueList = View->TI2; ViewNumList = &View->NbTI2;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "SY2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 21; ViewNumNodes = 14; ViewNumComp = 1;
	ViewValueList = View->SY2; ViewNumList = &View->NbSY2;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "VY2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 22; ViewNumNodes = 14; ViewNumComp = 3;
	ViewValueList = View->VY2; ViewNumList = &View->NbVY2;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else if(!strcmp(yyvsp[0].c, "TY2")){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = 23; ViewNumNodes = 14; ViewNumComp = 9;
	ViewValueList = View->TY2; ViewNumList = &View->NbTY2;
      }
      else{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	yymsg(GERROR, "Unknown element type '%s'", yyvsp[0].c);	
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewElementIdx = -1; ViewNumNodes = 0; ViewNumComp = 0;
	ViewValueList = NULL; ViewNumList = NULL;
      }
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;}
case 40:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(ViewValueList){
	if(ViewCoordIdx != 3 * ViewNumNodes){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
 	  // yymsg(GERROR, "Wrong number of node coordinates (%d != %d)", 
	  //       ViewCoordIdx, 3 * ViewNumNodes);
	  ViewNumNodes = ViewCoordIdx/3;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	}
	for(int i = 0; i < 3; i++)
	  for(int j = 0; j < ViewNumNodes; j++)
	    List_Add(ViewValueList, &ViewCoord[3*j+i]);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ViewNumListTmp = List_Nbr(ViewValueList);
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;
    break;}
case 41:
#line 501 "Gmsh.y"
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(ViewValueList){  
	if((List_Nbr(ViewValueList) - ViewNumListTmp) % (ViewNumComp * ViewCoordIdx/3)) 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  ViewErrorFlags[ViewElementIdx]++;
	(*ViewNumList)++;
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;
    break;}
case 42:
#line 512 "Gmsh.y"
{ 
      for(int i = 0; i < (int)strlen(yyvsp[0].c)+1; i++) List_Add(View->T2C, &yyvsp[0].c[i]); 
      Free(yyvsp[0].c);
    ;
    break;}
case 43:
#line 517 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ 
      for(int i = 0; i < (int)strlen(yyvsp[0].c)+1; i++) List_Add(View->T2C, &yyvsp[0].c[i]); 
      Free(yyvsp[0].c);
    ;
    break;}
case 44:
#line 525 "Gmsh.y"
{ 
      List_Add(View->T2D, &yyvsp[-5].d); List_Add(View->T2D, &yyvsp[-3].d);
      List_Add(View->T2D, &yyvsp[-1].d); 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      double d = List_Nbr(View->T2C);
      List_Add(View->T2D, &d); 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;
    break;}
case 45:
#line 532 "Gmsh.y"
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      View->NbT2++;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;
    break;}
case 46:
#line 539 "Gmsh.y"
{ 
      for(int i = 0; i < (int)strlen(yyvsp[0].c)+1; i++) List_Add(View->T3C, &yyvsp[0].c[i]); 
      Free(yyvsp[0].c);
    ;
    break;}
case 47:
#line 544 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ 
      for(int i = 0; i < (int)strlen(yyvsp[0].c)+1; i++) List_Add(View->T3C, &yyvsp[0].c[i]); 
      Free(yyvsp[0].c);
    ;
    break;}
case 48:
#line 552 "Gmsh.y"
{ 
      List_Add(View->T3D, &yyvsp[-7].d); List_Add(View->T3D, &yyvsp[-5].d);
      List_Add(View->T3D, &yyvsp[-3].d); List_Add(View->T3D, &yyvsp[-1].d); 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      double d = List_Nbr(View->T3C);
      List_Add(View->T3D, &d); 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;
    break;}
case 49:
#line 559 "Gmsh.y"
{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      View->NbT3++;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;
    break;}
case 50:
#line 567 "Gmsh.y"
{
      View->adaptive = new Adaptive_Post_View(View, yyvsp[-5].l, yyvsp[-2].l);
    ;
    break;}
case 51:
#line 575 "Gmsh.y"
{
      View->adaptive = new Adaptive_Post_View(View, yyvsp[-11].l, yyvsp[-8].l, yyvsp[-5].l, yyvsp[-2].l);
    ;
    break;}
case 52:
#line 582 "Gmsh.y"
{
      ViewValueList = View->Time;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;
    break;}
case 53:
#line 586 "Gmsh.y"
{
    ;
    break;}
case 54:
#line 591 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{
      (*View->Grains) [(int)yyvsp[-3].d] = yyvsp[-1].l;
    ;
    break;}
case 55:
#line 599 "Gmsh.y"
{ yyval.i = 0; ;
    break;}
case 56:
#line 600 "Gmsh.y"
{ yyval.i = 1; ;
    break;}
case 57:
#line 601 "Gmsh.y"
{ yyval.i = 2; ;
    break;}
case 58:
#line 602 "Gmsh.y"
{ yyval.i = 3; ;
    break;}
case 59:
#line 603 "Gmsh.y"
{ yyval.i = 4; ;
    break;}
case 60:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ yyval.i = 1; ;
    break;}
case 61:
#line 608 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
{ yyval.i = -1; ;
    break;}
case 62:
#line 616 "Gmsh.y"
{
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;}
case 63:
#line 647 "Gmsh.y"
{
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;}
case 64:
#line 686 "Gmsh.y"
{
      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;}
case 65:
#line 740 "Gmsh.y"
{
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;}
case 66:
#line 757 "Gmsh.y"
{
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;}
case 67:
#line 775 "Gmsh.y"
{
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;}
case 68:
#line 786 "Gmsh.y"
{
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;}
case 69:
#line 803 "Gmsh.y"
{ 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Msg(WARNING, "Named string expressions not implemented yet");
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;
    break;}
case 70:
#line 810 "Gmsh.y"
{ 
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;}
case 71:
#line 824 "Gmsh.y"
{ 
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;}
case 72:
#line 841 "Gmsh.y"
{
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;}
case 73:
#line 867 "Gmsh.y"
{
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;}
case 74:
#line 894 "Gmsh.y"
{
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;}
case 75:
#line 908 "Gmsh.y"
{
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;}
case 76:
#line 925 "Gmsh.y"
{
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;}
case 77:
#line 939 "Gmsh.y"
{
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;}
case 78:
#line 956 "Gmsh.y"
{
      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;}
case 79:
#line 976 "Gmsh.y"
{
      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;}
case 80:
#line 999 "Gmsh.y"
{
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;}
case 81:
#line 1009 "Gmsh.y"
{
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;}
case 82:
#line 1024 "Gmsh.y"
{ 
      yyval.i = (int)yyvsp[0].d; 
    ;
    break;}
case 83:
#line 1028 "Gmsh.y"
{ 
      yyval.i = GMODEL->setPhysicalName(std::string(yyvsp[0].c), ++THEM->MaxPhysicalNum);
      Free(yyvsp[0].c);
    ;
    break;}
case 84:
#line 1040 "Gmsh.y"
{
      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(THEM->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;}
case 85:
#line 1062 "Gmsh.y"
{
      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);
	List_Add(THEM->PhysicalGroups, &p);
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      List_Delete(yyvsp[-1].l);
      yyval.s.Type = MSH_PHYSICAL_POINT;
      yyval.s.Num = num;
    ;
    break;}
case 86:
#line 1078 "Gmsh.y"
{
      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{
          GVertex *gv = GMODEL->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;}
case 87:
#line 1099 "Gmsh.y"
{
      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;}
case 88:
#line 1106 "Gmsh.y"
{
      Post_View **vv = (Post_View **)List_Pointer_Test(CTX.post.list, (int)yyvsp[-1].d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        fields.insert(new PostViewField(*vv), (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;}
case 89:
#line 1117 "Gmsh.y"
{
      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;}
case 90:
#line 1132 "Gmsh.y"
{
      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);
	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;}
case 91:
#line 1147 "Gmsh.y"
{
      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;}
case 92:
#line 1154 "Gmsh.y"
{
      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;}
case 93:
#line 1166 "Gmsh.y"
{
      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);
	else{
	  GVertex *gv = GMODEL->vertexByTag((int)d);
	  if(gv) 
	    attractor->addPoint(gv->x(), gv->y(), gv->z());
      attractor->buildFastSearchStructures();
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      // dummy values