Skip to content
Snippets Groups Projects
Gmsh.tab.cpp 316 KiB
Newer Older
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

  case 38:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 307 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { if(ViewValueList) List_Add(ViewValueList, &(yyvsp[(3) - (3)].d)); ;}
    break;

  case 39:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 312 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      if(!strcmp((yyvsp[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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[(1) - (1)].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
#line 456 "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;

  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
      if(ViewValueList) (*ViewNumList)++;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

  case 42:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 471 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
      for(int i = 0; i < (int)strlen((yyvsp[(1) - (1)].c))+1; i++) List_Add(ViewData->T2C, &(yyvsp[(1) - (1)].c)[i]); 
      Free((yyvsp[(1) - (1)].c));
    ;}
    break;

  case 43:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 476 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
      for(int i = 0; i < (int)strlen((yyvsp[(3) - (3)].c))+1; i++) List_Add(ViewData->T2C, &(yyvsp[(3) - (3)].c)[i]); 
      Free((yyvsp[(3) - (3)].c));
    ;}
    break;

  case 44:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 484 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
      List_Add(ViewData->T2D, &(yyvsp[(3) - (8)].d)); 
      List_Add(ViewData->T2D, &(yyvsp[(5) - (8)].d));
      List_Add(ViewData->T2D, &(yyvsp[(7) - (8)].d)); 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      double d = List_Nbr(ViewData->T2C);
      List_Add(ViewData->T2D, &d); 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

  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
      ViewData->NbT2++;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

  case 46:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 499 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
      for(int i = 0; i < (int)strlen((yyvsp[(1) - (1)].c))+1; i++) List_Add(ViewData->T3C, &(yyvsp[(1) - (1)].c)[i]); 
      Free((yyvsp[(1) - (1)].c));
    ;}
    break;

  case 47:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 504 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
      for(int i = 0; i < (int)strlen((yyvsp[(3) - (3)].c))+1; i++) List_Add(ViewData->T3C, &(yyvsp[(3) - (3)].c)[i]); 
      Free((yyvsp[(3) - (3)].c));
    ;}
    break;

  case 48:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 512 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
      List_Add(ViewData->T3D, &(yyvsp[(3) - (10)].d)); List_Add(ViewData->T3D, &(yyvsp[(5) - (10)].d));
      List_Add(ViewData->T3D, &(yyvsp[(7) - (10)].d)); List_Add(ViewData->T3D, &(yyvsp[(9) - (10)].d)); 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      double d = List_Nbr(ViewData->T3C);
      List_Add(ViewData->T3D, &d); 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

  case 49:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 519 "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;

  case 50:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 527 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      ViewData->adaptive = new Adaptive_Post_View(ViewData, (yyvsp[(3) - (8)].l), (yyvsp[(6) - (8)].l));
    ;}
    break;

  case 51:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 534 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      ViewData->adaptive = new Adaptive_Post_View(ViewData, (yyvsp[(3) - (14)].l), (yyvsp[(6) - (14)].l), (yyvsp[(9) - (14)].l), (yyvsp[(12) - (14)].l));
    ;}
    break;

  case 52:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 541 "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;

  case 53:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 545 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
    ;}
    break;

  case 54:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 552 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.i) = 0; ;}
    break;

  case 55:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 553 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.i) = 1; ;}
    break;

  case 56:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 554 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.i) = 2; ;}
    break;

  case 57:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 555 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.i) = 3; ;}
    break;

  case 58:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 556 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.i) = 4; ;}
    break;

  case 59:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 560 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.i) = 1; ;}
    break;

  case 60:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 561 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.i) = -1; ;}
    break;

  case 61:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 569 "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[(1) - (4)].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) - (4)].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[(3) - (4)].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[(1) - (4)].c));
	  Free((yyvsp[(1) - (4)].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) - (4)].i)){
	case 0 : *pd = (yyvsp[(3) - (4)].d); break;
	case 1 : *pd += (yyvsp[(3) - (4)].d); break;
	case 2 : *pd -= (yyvsp[(3) - (4)].d); break;
	case 3 : *pd *= (yyvsp[(3) - (4)].d); break;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  if((yyvsp[(3) - (4)].d)) *pd /= (yyvsp[(3) - (4)].d); 
	  else yymsg(GERROR, "Division by zero in '%s /= %g'", (yyvsp[(1) - (4)].c), (yyvsp[(3) - (4)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	Free((yyvsp[(1) - (4)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

  case 62:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 600 "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[(1) - (7)].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[(5) - (7)].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[(3) - (7)].d), &(yyvsp[(6) - (7)].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[(1) - (7)].c));
	  Free((yyvsp[(1) - (7)].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[(3) - (7)].d)))){
	  switch((yyvsp[(5) - (7)].i)){
	  case 0 : *pd = (yyvsp[(6) - (7)].d); break;
	  case 1 : *pd += (yyvsp[(6) - (7)].d); break;
	  case 2 : *pd -= (yyvsp[(6) - (7)].d); break;
	  case 3 : *pd *= (yyvsp[(6) - (7)].d); break;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    if((yyvsp[(6) - (7)].d)) *pd /= (yyvsp[(6) - (7)].d); 
	    else yymsg(GERROR, "Division by zero in '%s[%d] /= %g'", (yyvsp[(1) - (7)].c), (int)(yyvsp[(3) - (7)].d), (yyvsp[(6) - (7)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  if(!(yyvsp[(5) - (7)].i))
	    List_Put(pSymbol->val, (int)(yyvsp[(3) - (7)].d), &(yyvsp[(6) - (7)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    yymsg(GERROR, "Uninitialized variable '%s[%d]'", (yyvsp[(1) - (7)].c), (int)(yyvsp[(3) - (7)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	Free((yyvsp[(1) - (7)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

  case 63:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 639 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      if(List_Nbr((yyvsp[(4) - (9)].l)) != List_Nbr((yyvsp[(8) - (9)].l))){
	yymsg(GERROR, "Incompatible array dimensions in affectation");
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	Free((yyvsp[(1) - (9)].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[(1) - (9)].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[(7) - (9)].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[(4) - (9)].l)); i++){
	      List_Put(TheSymbol.val, (int)(*(double*)List_Pointer((yyvsp[(4) - (9)].l), i)),
		       (double*)List_Pointer((yyvsp[(8) - (9)].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[(1) - (9)].c));
	    Free((yyvsp[(1) - (9)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  for(int i = 0; i < List_Nbr((yyvsp[(4) - (9)].l)); i++){
	    int j = (int)(*(double*)List_Pointer((yyvsp[(4) - (9)].l), i));
	    double d = *(double*)List_Pointer((yyvsp[(8) - (9)].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[(7) - (9)].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[(8) - (9)].l)) *pd /= d; 
		else yymsg(GERROR, "Division by zero in '%s[%d] /= %g'", (yyvsp[(1) - (9)].c), j, d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	      if(!(yyvsp[(7) - (9)].i))
		List_Put(pSymbol->val, j, &d);
	      else
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
		yymsg(GERROR, "Uninitialized variable '%s[%d]'", (yyvsp[(1) - (9)].c), j);	  
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  Free((yyvsp[(1) - (9)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      List_Delete((yyvsp[(4) - (9)].l));
      List_Delete((yyvsp[(8) - (9)].l));
    ;}
    break;

  case 64:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 693 "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[(1) - (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))){
	TheSymbol.val = List_Create(5, 5, sizeof(double));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_Copy((yyvsp[(5) - (6)].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[(5) - (6)].l), pSymbol->val);
	Free((yyvsp[(1) - (6)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      List_Delete((yyvsp[(5) - (6)].l));
    ;}
    break;

  case 65:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 710 "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[(1) - (6)].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[(5) - (6)].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[(5) - (6)].l)); i++)
	  List_Add(pSymbol->val, List_Pointer((yyvsp[(5) - (6)].l), i));
	Free((yyvsp[(1) - (6)].c));
      }
      List_Delete((yyvsp[(5) - (6)].l));
    ;}
    break;

  case 66:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 728 "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[(1) - (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
	yymsg(GERROR, "Unknown variable '%s'", (yyvsp[(1) - (3)].c)); 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	*(double*)List_Pointer_Fast(pSymbol->val, 0) += (yyvsp[(2) - (3)].i);
      Free((yyvsp[(1) - (3)].c));
    ;}
    break;

  case 67:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 739 "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[(1) - (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
	yymsg(GERROR, "Unknown variable '%s'", (yyvsp[(1) - (6)].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) - (6)].d))))
	  *pd += (yyvsp[(5) - (6)].i);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  yymsg(GERROR, "Uninitialized variable '%s[%d]'", (yyvsp[(1) - (6)].c), (int)(yyvsp[(3) - (6)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (6)].c));
    ;}
    break;

  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
      Msg(WARNING, "Named string expressions not implemented yet");
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

  case 69:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 763 "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[(1) - (6)].c))))
	yymsg(GERROR, "Unknown string option class '%s'", (yyvsp[(1) - (6)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(!(pStrOpt = (char *(*) (int, int, char *))Get_StringOption((yyvsp[(3) - (6)].c), pStrCat)))
	  yymsg(GERROR, "Unknown string option '%s.%s'", (yyvsp[(1) - (6)].c), (yyvsp[(3) - (6)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  pStrOpt(0, GMSH_SET|GMSH_GUI, (yyvsp[(5) - (6)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (6)].c)); Free((yyvsp[(3) - (6)].c)); //FIXME: somtimes leak $5
    ;}
    break;

  case 70:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 777 "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[(1) - (9)].c))))
	yymsg(GERROR, "Unknown string option class '%s'", (yyvsp[(1) - (9)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(!(pStrOpt = (char *(*) (int, int, char *))Get_StringOption((yyvsp[(6) - (9)].c), pStrCat)))
	  yymsg(GERROR, "Unknown string option '%s[%d].%s'", (yyvsp[(1) - (9)].c), (int)(yyvsp[(3) - (9)].d), (yyvsp[(6) - (9)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  pStrOpt((int)(yyvsp[(3) - (9)].d), GMSH_SET|GMSH_GUI, (yyvsp[(8) - (9)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (9)].c)); Free((yyvsp[(6) - (9)].c)); //FIXME: somtimes leak $8
    ;}
    break;

  case 71:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 794 "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[(1) - (6)].c))))
	yymsg(GERROR, "Unknown numeric option class '%s'", (yyvsp[(1) - (6)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption((yyvsp[(3) - (6)].c), pNumCat)))
	  yymsg(GERROR, "Unknown numeric option '%s.%s'", (yyvsp[(1) - (6)].c), (yyvsp[(3) - (6)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  double d = 0;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  switch((yyvsp[(4) - (6)].i)){
	  case 0 : d = (yyvsp[(5) - (6)].d); break;
	  case 1 : d = pNumOpt(0, GMSH_GET, 0) + (yyvsp[(5) - (6)].d); break;
	  case 2 : d = pNumOpt(0, GMSH_GET, 0) - (yyvsp[(5) - (6)].d); break;
	  case 3 : d = pNumOpt(0, GMSH_GET, 0) * (yyvsp[(5) - (6)].d); break;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    if((yyvsp[(5) - (6)].d)) d = pNumOpt(0, GMSH_GET, 0) / (yyvsp[(5) - (6)].d); 
	    else yymsg(GERROR, "Division by zero in '%s.%s /= %g'", (yyvsp[(1) - (6)].c), (yyvsp[(3) - (6)].c), (yyvsp[(5) - (6)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  pNumOpt(0, GMSH_SET|GMSH_GUI, d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (6)].c)); Free((yyvsp[(3) - (6)].c));
    ;}
    break;

  case 72:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 820 "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[(1) - (9)].c))))
	yymsg(GERROR, "Unknown numeric option class '%s'", (yyvsp[(1) - (9)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(!(pNumOpt =  (double (*) (int, int, double))Get_NumberOption((yyvsp[(6) - (9)].c), pNumCat)))
	  yymsg(GERROR, "Unknown numeric option '%s[%d].%s'", (yyvsp[(1) - (9)].c), (int)(yyvsp[(3) - (9)].d), (yyvsp[(6) - (9)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  double d = 0;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  switch((yyvsp[(7) - (9)].i)){
	  case 0 : d = (yyvsp[(8) - (9)].d); break;
	  case 1 : d = pNumOpt((int)(yyvsp[(3) - (9)].d), GMSH_GET, 0) + (yyvsp[(8) - (9)].d); break;
	  case 2 : d = pNumOpt((int)(yyvsp[(3) - (9)].d), GMSH_GET, 0) - (yyvsp[(8) - (9)].d); break;
	  case 3 : d = pNumOpt((int)(yyvsp[(3) - (9)].d), GMSH_GET, 0) * (yyvsp[(8) - (9)].d); break;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    if((yyvsp[(8) - (9)].d)) d = pNumOpt((int)(yyvsp[(3) - (9)].d), GMSH_GET, 0) / (yyvsp[(8) - (9)].d);
	    else yymsg(GERROR, "Division by zero in '%s[%d].%s /= %g'", 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
		       (yyvsp[(1) - (9)].c), (int)(yyvsp[(3) - (9)].d), (yyvsp[(6) - (9)].c), (yyvsp[(8) - (9)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  pNumOpt((int)(yyvsp[(3) - (9)].d), GMSH_SET|GMSH_GUI, d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (9)].c)); Free((yyvsp[(6) - (9)].c));
    ;}
    break;

  case 73:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 847 "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[(1) - (5)].c))))
	yymsg(GERROR, "Unknown numeric option class '%s'", (yyvsp[(1) - (5)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(!(pNumOpt =  (double (*) (int, int, double))Get_NumberOption((yyvsp[(3) - (5)].c), pNumCat)))
	  yymsg(GERROR, "Unknown numeric option '%s.%s'", (yyvsp[(1) - (5)].c), (yyvsp[(3) - (5)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  pNumOpt(0, GMSH_SET|GMSH_GUI, pNumOpt(0, GMSH_GET, 0)+(yyvsp[(4) - (5)].i));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (5)].c)); Free((yyvsp[(3) - (5)].c));
    ;}
    break;

  case 74:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 861 "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[(1) - (8)].c))))
	yymsg(GERROR, "Unknown numeric option class '%s'", (yyvsp[(1) - (8)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(!(pNumOpt =  (double (*) (int, int, double))Get_NumberOption((yyvsp[(6) - (8)].c), pNumCat)))
	  yymsg(GERROR, "Unknown numeric option '%s[%d].%s'", (yyvsp[(1) - (8)].c), (int)(yyvsp[(3) - (8)].d), (yyvsp[(6) - (8)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  pNumOpt((int)(yyvsp[(3) - (8)].d), GMSH_SET|GMSH_GUI, pNumOpt((int)(yyvsp[(3) - (8)].d), GMSH_GET, 0)+(yyvsp[(7) - (8)].i));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (8)].c)); Free((yyvsp[(6) - (8)].c));
    ;}
    break;

  case 75:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 878 "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[(1) - (8)].c))))
	yymsg(GERROR, "Unknown color option class '%s'", (yyvsp[(1) - (8)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(!(pColOpt =  (unsigned int (*) (int, int, unsigned int))Get_ColorOption((yyvsp[(5) - (8)].c), pColCat)))
	  yymsg(GERROR, "Unknown color option '%s.Color.%s'", (yyvsp[(1) - (8)].c), (yyvsp[(5) - (8)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  pColOpt(0, GMSH_SET|GMSH_GUI, (yyvsp[(7) - (8)].u));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (8)].c)); Free((yyvsp[(5) - (8)].c));
    ;}
    break;

  case 76:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 892 "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[(1) - (11)].c))))
	yymsg(GERROR, "Unknown color option class '%s'", (yyvsp[(1) - (11)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(!(pColOpt =  (unsigned int (*) (int, int, unsigned int))Get_ColorOption((yyvsp[(8) - (11)].c), pColCat)))
	  yymsg(GERROR, "Unknown color option '%s[%d].Color.%s'", (yyvsp[(1) - (11)].c), (int)(yyvsp[(3) - (11)].d), (yyvsp[(8) - (11)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  pColOpt((int)(yyvsp[(3) - (11)].d), GMSH_SET|GMSH_GUI, (yyvsp[(10) - (11)].u));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (11)].c)); Free((yyvsp[(8) - (11)].c));
    ;}
    break;

  case 77:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 909 "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[(5) - (6)].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[(5) - (6)].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[(1) - (6)].c));
      List_Delete((yyvsp[(5) - (6)].l));
    ;}
    break;

  case 78:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 929 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      GmshColorTable *ct = Get_ColorTable((int)(yyvsp[(3) - (9)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	yymsg(GERROR, "View[%d] does not exist", (int)(yyvsp[(3) - (9)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	ct->size = List_Nbr((yyvsp[(8) - (9)].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[(3) - (9)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  for(int i = 0; i < ct->size; i++) List_Read((yyvsp[(8) - (9)].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[(1) - (9)].c));
      List_Delete((yyvsp[(8) - (9)].l));
    ;}
    break;

  case 79:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 952 "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[(3) - (9)].c), (yyvsp[(6) - (9)].c), (yyvsp[(8) - (9)].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[(6) - (9)].c), (yyvsp[(3) - (9)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(3) - (9)].c)); Free((yyvsp[(6) - (9)].c));
    ;}
    break;

  case 80:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 962 "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[(3) - (9)].c), (yyvsp[(6) - (9)].c), (yyvsp[(8) - (9)].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[(6) - (9)].c), (yyvsp[(3) - (9)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(3) - (9)].c)); Free((yyvsp[(6) - (9)].c)); // FIXME: sometimes leak $8
    ;}
    break;

  case 81:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 977 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
      (yyval.i) = (int)(yyvsp[(1) - (1)].d); 
    ;}
    break;

  case 82:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 981 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
      (yyval.i) = GModel::current()->setPhysicalName
	(std::string((yyvsp[(1) - (1)].c)), ++GModel::current()->getGEOInternals()->MaxPhysicalNum);
      Free((yyvsp[(1) - (1)].c));
    ;}
    break;

  case 83:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 994 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      int num = (int)(yyvsp[(3) - (7)].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[(6) - (7)].v)[0];
	double y = CTX.geom.scaling_factor * (yyvsp[(6) - (7)].v)[1];
	double z = CTX.geom.scaling_factor * (yyvsp[(6) - (7)].v)[2];
	double lc = CTX.geom.scaling_factor * (yyvsp[(6) - (7)].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;

  case 84:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1016 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      int num = (int)(yyvsp[(4) - (8)].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[(7) - (8)].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[(7) - (8)].l));
      (yyval.s).Type = MSH_PHYSICAL_POINT;
      (yyval.s).Num = num;
    ;}
    break;

  case 85:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1032 "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[(8) - (9)].l)); i++){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        List_Read((yyvsp[(8) - (9)].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[(5) - (9)].d));
      // dummy values
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      (yyval.s).Type = 0;
      (yyval.s).Num = 0;
    ;}
    break;

  case 86:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1053 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      fields.insert(new LatLonField(fields.get((int)(yyvsp[(7) - (8)].d))), (int)(yyvsp[(4) - (8)].d));
      // dummy values
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      (yyval.s).Type = 0;
      (yyval.s).Num = 0;
    ;}
    break;

  case 87:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1060 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      int index = (int)(yyvsp[(7) - (8)].d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(index >= 0 && index < (int)PView::list.size()) 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        fields.insert(new PostViewField(PView::list[index]), (int)(yyvsp[(4) - (8)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        yymsg(GERROR, "Field %i error, view %i does not exist", (int)(yyvsp[(4) - (8)].d), (int)(yyvsp[(7) - (8)].d));
      // dummy values
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      (yyval.s).Type = 0;
      (yyval.s).Num = 0;
    ;}
    break;

  case 88:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1071 "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[(7) - (8)].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[(7) - (8)].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) - (8)].d));
      // dummy values
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      (yyval.s).Type = 0;
      (yyval.s).Num = 0;
    ;}
    break;

  case 89:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1086 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      std::list<Field*> *flist = new std::list<Field*>;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      fields.insert(new FunctionField(flist,(yyvsp[(7) - (8)].c)), (int)(yyvsp[(4) - (8)].d));
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;

  case 90:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1094 "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[(8) - (9)].l)); i++){
	double id;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_Read((yyvsp[(8) - (9)].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[(7) - (9)].c)), (int)(yyvsp[(4) - (9)].d));
      // dummy values
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      (yyval.s).Type = 0;
      (yyval.s).Num = 0;
    ;}
    break;

  case 91:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1109 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      fields.insert(new StructuredField((yyvsp[(7) - (8)].c)), (int)(yyvsp[(4) - (8)].d));
      // dummy values
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      (yyval.s).Type = 0;
      (yyval.s).Num = 0;
    ;}
    break;

  case 92:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1116 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      for(int i = 0; i < List_Nbr((yyvsp[(4) - (5)].l)); i++){
	double id;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_Read((yyvsp[(4) - (5)].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:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1128 "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[(5) - (6)].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[(5) - (6)].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) - (6)].l)); i++){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_Read((yyvsp[(3) - (6)].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;

  case 94:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 1162 "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[(5) - (6)].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[(5) - (6)].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) - (6)].l)); i++){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	List_Read((yyvsp[(3) - (6)].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;