Skip to content
Snippets Groups Projects
Gmsh.tab.cpp 406 KiB
Newer Older
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(2) - (3)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3862 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      if(List_Nbr((yyvsp[(4) - (6)].l)) >= 2){
        double d;
        List_Read((yyvsp[(4) - (6)].l), 0, &d);
        Vertex *target = FindPoint((int)d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
        if(!target)
          yymsg(0, "Could not find Point %d", (int)d);
        else{
          double x = target->Pos.X, y = target->Pos.Y, z = target->Pos.Z;
          for(int i = 1; i < List_Nbr((yyvsp[(4) - (6)].l)); i++){
            List_Read((yyvsp[(4) - (6)].l), i, &d);
            Vertex *source = FindPoint((int)d);
            if(!source) yymsg(0, "Could not find Point %d", (int)d);
            if(target && source){
              source->Typ = target->Typ;
              source->Pos.X = x;
              source->Pos.Y = y;
              source->Pos.Z = z;
              source->boundaryLayerIndex = target->boundaryLayerIndex;
            }
Christophe Geuzaine's avatar
Christophe Geuzaine committed
          ExtrudeParams::normalsCoherence.push_back(SPoint3(x, y, z));
        }
      }
      else
        yymsg(0, "Need at least two points to merge");
      ReplaceAllDuplicates();
      List_Delete((yyvsp[(4) - (6)].l));
Matti Pellika's avatar
 
Matti Pellika committed
    break;

/* Line 1788 of yacc.c  */
#line 3896 "Gmsh.y"
    { (yyval.c) = (char*)"Homology"; }
Matti Pellika's avatar
 
Matti Pellika committed
    break;

/* Line 1788 of yacc.c  */
#line 3897 "Gmsh.y"
    { (yyval.c) = (char*)"Cohomology"; }
/* Line 1788 of yacc.c  */
#line 3902 "Gmsh.y"
Matti Pellika's avatar
 
Matti Pellika committed
    {
      std::vector<int> domain, subdomain, dim;
      GModel::current()->addHomologyRequest((yyvsp[(1) - (2)].c), domain, subdomain, dim);
Matti Pellika's avatar
 
Matti Pellika committed
    break;

/* Line 1788 of yacc.c  */
#line 3907 "Gmsh.y"
      std::vector<int> domain, subdomain, dim;
      for(int i = 0; i < List_Nbr((yyvsp[(3) - (5)].l)); i++){
        double d;
        List_Read((yyvsp[(3) - (5)].l), i, &d);
        domain.push_back((int)d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
      GModel::current()->addHomologyRequest((yyvsp[(1) - (5)].c), domain, subdomain, dim);
      List_Delete((yyvsp[(3) - (5)].l));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3918 "Gmsh.y"
      std::vector<int> domain, subdomain, dim;
      for(int i = 0; i < List_Nbr((yyvsp[(3) - (7)].l)); i++){
        double d;
        List_Read((yyvsp[(3) - (7)].l), i, &d);
        domain.push_back((int)d);
      }
      for(int i = 0; i < List_Nbr((yyvsp[(5) - (7)].l)); i++){
        double d;
        List_Read((yyvsp[(5) - (7)].l), i, &d);
        subdomain.push_back((int)d);
      }
      GModel::current()->addHomologyRequest((yyvsp[(1) - (7)].c), domain, subdomain, dim);
      List_Delete((yyvsp[(3) - (7)].l));
      List_Delete((yyvsp[(5) - (7)].l));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3935 "Gmsh.y"
Matti Pellika's avatar
Matti Pellika committed
      for(int i = 0; i < List_Nbr((yyvsp[(6) - (10)].l)); i++){
Matti Pellika's avatar
Matti Pellika committed
        List_Read((yyvsp[(6) - (10)].l), i, &d);
Matti Pellika's avatar
Matti Pellika committed
      for(int i = 0; i < List_Nbr((yyvsp[(8) - (10)].l)); i++){
Matti Pellika's avatar
Matti Pellika committed
        List_Read((yyvsp[(8) - (10)].l), i, &d);
Matti Pellika's avatar
Matti Pellika committed
      for(int i = 0; i < List_Nbr((yyvsp[(3) - (10)].l)); i++){
Matti Pellika's avatar
Matti Pellika committed
        List_Read((yyvsp[(3) - (10)].l), i, &d);
Matti Pellika's avatar
Matti Pellika committed
      GModel::current()->addHomologyRequest((yyvsp[(1) - (10)].c), domain, subdomain, dim);
      List_Delete((yyvsp[(6) - (10)].l));
      List_Delete((yyvsp[(8) - (10)].l));
      List_Delete((yyvsp[(3) - (10)].l));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3962 "Gmsh.y"
    { (yyval.d) = (yyvsp[(1) - (1)].d);           }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3963 "Gmsh.y"
    { (yyval.d) = (yyvsp[(2) - (3)].d);           }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3964 "Gmsh.y"
    { (yyval.d) = -(yyvsp[(2) - (2)].d);          }
/* Line 1788 of yacc.c  */
#line 3965 "Gmsh.y"
    { (yyval.d) = (yyvsp[(2) - (2)].d);           }
/* Line 1788 of yacc.c  */
#line 3966 "Gmsh.y"
    { (yyval.d) = !(yyvsp[(2) - (2)].d);          }
/* Line 1788 of yacc.c  */
#line 3967 "Gmsh.y"
    { (yyval.d) = (yyvsp[(1) - (3)].d) - (yyvsp[(3) - (3)].d);      }
/* Line 1788 of yacc.c  */
#line 3968 "Gmsh.y"
    { (yyval.d) = (yyvsp[(1) - (3)].d) + (yyvsp[(3) - (3)].d);      }
/* Line 1788 of yacc.c  */
#line 3969 "Gmsh.y"
    { (yyval.d) = (yyvsp[(1) - (3)].d) * (yyvsp[(3) - (3)].d);      }
/* Line 1788 of yacc.c  */
#line 3971 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(yyvsp[(3) - (3)].d))
	yymsg(0, "Division by zero in '%g / %g'", (yyvsp[(1) - (3)].d), (yyvsp[(3) - (3)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	(yyval.d) = (yyvsp[(1) - (3)].d) / (yyvsp[(3) - (3)].d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3977 "Gmsh.y"
    { (yyval.d) = (int)(yyvsp[(1) - (3)].d) % (int)(yyvsp[(3) - (3)].d);  }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3978 "Gmsh.y"
    { (yyval.d) = pow((yyvsp[(1) - (3)].d), (yyvsp[(3) - (3)].d));  }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3979 "Gmsh.y"
    { (yyval.d) = (yyvsp[(1) - (3)].d) < (yyvsp[(3) - (3)].d);      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3980 "Gmsh.y"
    { (yyval.d) = (yyvsp[(1) - (3)].d) > (yyvsp[(3) - (3)].d);      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3981 "Gmsh.y"
    { (yyval.d) = (yyvsp[(1) - (3)].d) <= (yyvsp[(3) - (3)].d);     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3982 "Gmsh.y"
    { (yyval.d) = (yyvsp[(1) - (3)].d) >= (yyvsp[(3) - (3)].d);     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3983 "Gmsh.y"
    { (yyval.d) = (yyvsp[(1) - (3)].d) == (yyvsp[(3) - (3)].d);     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3984 "Gmsh.y"
    { (yyval.d) = (yyvsp[(1) - (3)].d) != (yyvsp[(3) - (3)].d);     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3985 "Gmsh.y"
    { (yyval.d) = (yyvsp[(1) - (3)].d) && (yyvsp[(3) - (3)].d);     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3986 "Gmsh.y"
    { (yyval.d) = (yyvsp[(1) - (3)].d) || (yyvsp[(3) - (3)].d);     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3987 "Gmsh.y"
    { (yyval.d) = (yyvsp[(1) - (5)].d) ? (yyvsp[(3) - (5)].d) : (yyvsp[(5) - (5)].d); }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3988 "Gmsh.y"
    { (yyval.d) = exp((yyvsp[(3) - (4)].d));      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;
/* Line 1788 of yacc.c  */
#line 3989 "Gmsh.y"
    { (yyval.d) = log((yyvsp[(3) - (4)].d));      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3990 "Gmsh.y"
    { (yyval.d) = log10((yyvsp[(3) - (4)].d));    }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3991 "Gmsh.y"
    { (yyval.d) = sqrt((yyvsp[(3) - (4)].d));     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;
/* Line 1788 of yacc.c  */
#line 3992 "Gmsh.y"
    { (yyval.d) = sin((yyvsp[(3) - (4)].d));      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3993 "Gmsh.y"
    { (yyval.d) = asin((yyvsp[(3) - (4)].d));     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3994 "Gmsh.y"
    { (yyval.d) = cos((yyvsp[(3) - (4)].d));      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3995 "Gmsh.y"
    { (yyval.d) = acos((yyvsp[(3) - (4)].d));     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3996 "Gmsh.y"
    { (yyval.d) = tan((yyvsp[(3) - (4)].d));      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3997 "Gmsh.y"
    { (yyval.d) = atan((yyvsp[(3) - (4)].d));     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3998 "Gmsh.y"
    { (yyval.d) = atan2((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d));}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 3999 "Gmsh.y"
    { (yyval.d) = sinh((yyvsp[(3) - (4)].d));     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4000 "Gmsh.y"
    { (yyval.d) = cosh((yyvsp[(3) - (4)].d));     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4001 "Gmsh.y"
    { (yyval.d) = tanh((yyvsp[(3) - (4)].d));     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;
/* Line 1788 of yacc.c  */
#line 4002 "Gmsh.y"
    { (yyval.d) = fabs((yyvsp[(3) - (4)].d));     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4003 "Gmsh.y"
    { (yyval.d) = floor((yyvsp[(3) - (4)].d));    }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4004 "Gmsh.y"
    { (yyval.d) = ceil((yyvsp[(3) - (4)].d));     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4005 "Gmsh.y"
    { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4006 "Gmsh.y"
    { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4007 "Gmsh.y"
    { (yyval.d) = sqrt((yyvsp[(3) - (6)].d) * (yyvsp[(3) - (6)].d) + (yyvsp[(5) - (6)].d) * (yyvsp[(5) - (6)].d)); }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4008 "Gmsh.y"
    { (yyval.d) = (yyvsp[(3) - (4)].d) * (double)rand() / (double)RAND_MAX; }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4011 "Gmsh.y"
    { (yyval.d) = exp((yyvsp[(3) - (4)].d));      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4012 "Gmsh.y"
    { (yyval.d) = log((yyvsp[(3) - (4)].d));      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4013 "Gmsh.y"
    { (yyval.d) = log10((yyvsp[(3) - (4)].d));    }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4014 "Gmsh.y"
    { (yyval.d) = sqrt((yyvsp[(3) - (4)].d));     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4015 "Gmsh.y"
    { (yyval.d) = sin((yyvsp[(3) - (4)].d));      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4016 "Gmsh.y"
    { (yyval.d) = asin((yyvsp[(3) - (4)].d));     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4017 "Gmsh.y"
    { (yyval.d) = cos((yyvsp[(3) - (4)].d));      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4018 "Gmsh.y"
    { (yyval.d) = acos((yyvsp[(3) - (4)].d));     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4019 "Gmsh.y"
    { (yyval.d) = tan((yyvsp[(3) - (4)].d));      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4020 "Gmsh.y"
    { (yyval.d) = atan((yyvsp[(3) - (4)].d));     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4021 "Gmsh.y"
    { (yyval.d) = atan2((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d));}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4022 "Gmsh.y"
    { (yyval.d) = sinh((yyvsp[(3) - (4)].d));     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4023 "Gmsh.y"
    { (yyval.d) = cosh((yyvsp[(3) - (4)].d));     }
/* Line 1788 of yacc.c  */
#line 4024 "Gmsh.y"
    { (yyval.d) = tanh((yyvsp[(3) - (4)].d));     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4025 "Gmsh.y"
    { (yyval.d) = fabs((yyvsp[(3) - (4)].d));     }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4026 "Gmsh.y"
    { (yyval.d) = floor((yyvsp[(3) - (4)].d));    }
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4027 "Gmsh.y"
    { (yyval.d) = ceil((yyvsp[(3) - (4)].d));     }
/* Line 1788 of yacc.c  */
#line 4028 "Gmsh.y"
    { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); }
/* Line 1788 of yacc.c  */
#line 4029 "Gmsh.y"
    { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); }
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4030 "Gmsh.y"
    { (yyval.d) = sqrt((yyvsp[(3) - (6)].d) * (yyvsp[(3) - (6)].d) + (yyvsp[(5) - (6)].d) * (yyvsp[(5) - (6)].d)); }
Jean-François Remacle's avatar
 
Jean-François Remacle committed
    break;

/* Line 1788 of yacc.c  */
#line 4031 "Gmsh.y"
    { (yyval.d) = (yyvsp[(3) - (4)].d) * (double)rand() / (double)RAND_MAX; }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4040 "Gmsh.y"
    { (yyval.d) = (yyvsp[(1) - (1)].d); }
/* Line 1788 of yacc.c  */
#line 4041 "Gmsh.y"
    { (yyval.d) = 3.141592653589793; }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4042 "Gmsh.y"
    { (yyval.d) = Msg::GetCommRank(); }
/* Line 1788 of yacc.c  */
#line 4043 "Gmsh.y"
    { (yyval.d) = Msg::GetCommSize(); }
/* Line 1788 of yacc.c  */
#line 4044 "Gmsh.y"
    { (yyval.d) = GetGmshMajorVersion(); }
/* Line 1788 of yacc.c  */
#line 4045 "Gmsh.y"
    { (yyval.d) = GetGmshMinorVersion(); }
/* Line 1788 of yacc.c  */
#line 4046 "Gmsh.y"
    { (yyval.d) = GetGmshPatchVersion(); }
/* Line 1788 of yacc.c  */
#line 4051 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      if(!gmsh_yysymbols.count((yyvsp[(1) - (1)].c))){
	yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (1)].c));
	(yyval.d) = 0.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        gmsh_yysymbol &s(gmsh_yysymbols[(yyvsp[(1) - (1)].c)]);
        if(s.value.empty()){
          yymsg(0, "Uninitialized variable '%s'", (yyvsp[(1) - (1)].c));
          (yyval.d) = 0.;
        }
        else
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
          (yyval.d) = s.value[0];
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (1)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4072 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      char tmpstring[1024];
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      sprintf(tmpstring, "%s_%d", (yyvsp[(1) - (5)].c), (int)(yyvsp[(4) - (5)].d)) ;
      if(!gmsh_yysymbols.count(tmpstring)){
	yymsg(0, "Unknown variable '%s'", tmpstring);
	(yyval.d) = 0.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        gmsh_yysymbol &s(gmsh_yysymbols[tmpstring]);
        if(s.value.empty()){
          yymsg(0, "Uninitialized variable '%s'", tmpstring);
          (yyval.d) = 0.;
        }
        else
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
          (yyval.d) = s.value[0];
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (5)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4091 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      int index = (int)(yyvsp[(3) - (4)].d);
      if(!gmsh_yysymbols.count((yyvsp[(1) - (4)].c))){
	yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (4)].c));
	(yyval.d) = 0.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else{
        gmsh_yysymbol &s(gmsh_yysymbols[(yyvsp[(1) - (4)].c)]);
        if((int)s.value.size() < index + 1){
          yymsg(0, "Uninitialized variable '%s[%d]'", (yyvsp[(1) - (4)].c), index);
          (yyval.d) = 0.;
        }
        else
          (yyval.d) = s.value[index];
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (4)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4109 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      if(!gmsh_yysymbols.count((yyvsp[(2) - (4)].c))){
	yymsg(0, "Unknown variable '%s'", (yyvsp[(2) - (4)].c));
	(yyval.d) = 0.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else{
        gmsh_yysymbol &s(gmsh_yysymbols[(yyvsp[(2) - (4)].c)]);
	(yyval.d) = s.value.size();
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(2) - (4)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4121 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      if(!gmsh_yysymbols.count((yyvsp[(1) - (2)].c))){
	yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (2)].c));
	(yyval.d) = 0.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        gmsh_yysymbol &s(gmsh_yysymbols[(yyvsp[(1) - (2)].c)]);
        if(s.value.empty()){
          yymsg(0, "Uninitialized variable '%s'", (yyvsp[(1) - (2)].c));
          (yyval.d) = 0.;
        }
        else
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
          (yyval.d) = (s.value[0] += (yyvsp[(2) - (2)].i));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (2)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4138 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      int index = (int)(yyvsp[(3) - (5)].d);
      if(!gmsh_yysymbols.count((yyvsp[(1) - (5)].c))){
	yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (5)].c));
	(yyval.d) = 0.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else{
        gmsh_yysymbol &s(gmsh_yysymbols[(yyvsp[(1) - (5)].c)]);
        if((int)s.value.size() < index + 1){
          yymsg(0, "Uninitialized variable '%s[%d]'", (yyvsp[(1) - (5)].c), index);
          (yyval.d) = 0.;
        }
        else
          (yyval.d) = (s.value[index] += (yyvsp[(5) - (5)].i));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (5)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4159 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      NumberOption(GMSH_GET, (yyvsp[(1) - (3)].c), 0, (yyvsp[(3) - (3)].c), (yyval.d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (3)].c)); Free((yyvsp[(3) - (3)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4164 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      NumberOption(GMSH_GET, (yyvsp[(1) - (6)].c), (int)(yyvsp[(3) - (6)].d), (yyvsp[(6) - (6)].c), (yyval.d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (6)].c)); Free((yyvsp[(6) - (6)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4169 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      double d = 0.;
      if(NumberOption(GMSH_GET, (yyvsp[(1) - (4)].c), 0, (yyvsp[(3) - (4)].c), d)){
	d += (yyvsp[(4) - (4)].i);
	NumberOption(GMSH_SET|GMSH_GUI, (yyvsp[(1) - (4)].c), 0, (yyvsp[(3) - (4)].c), d);
	(yyval.d) = d;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (4)].c)); Free((yyvsp[(3) - (4)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4179 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      double d = 0.;
      if(NumberOption(GMSH_GET, (yyvsp[(1) - (7)].c), (int)(yyvsp[(3) - (7)].d), (yyvsp[(6) - (7)].c), d)){
	d += (yyvsp[(7) - (7)].i);
	NumberOption(GMSH_SET|GMSH_GUI, (yyvsp[(1) - (7)].c), (int)(yyvsp[(3) - (7)].d), (yyvsp[(6) - (7)].c), d);
	(yyval.d) = d;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (7)].c)); Free((yyvsp[(6) - (7)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4189 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.d) = Msg::GetValue((yyvsp[(3) - (6)].c), (yyvsp[(5) - (6)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(3) - (6)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4194 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      std::string s((yyvsp[(3) - (6)].c)), substr((yyvsp[(5) - (6)].c));
      if(s.find(substr) != std::string::npos)
        (yyval.d) = 1.;
      else
        (yyval.d) = 0.;
      Free((yyvsp[(3) - (6)].c)); Free((yyvsp[(5) - (6)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4206 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      memcpy((yyval.v), (yyvsp[(1) - (1)].v), 5*sizeof(double));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4210 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      for(int i = 0; i < 5; i++) (yyval.v)[i] = -(yyvsp[(2) - (2)].v)[i];
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4214 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      for(int i = 0; i < 5; i++) (yyval.v)[i] = (yyvsp[(2) - (2)].v)[i];
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4218 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      for(int i = 0; i < 5; i++) (yyval.v)[i] = (yyvsp[(1) - (3)].v)[i] - (yyvsp[(3) - (3)].v)[i];
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4222 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      for(int i = 0; i < 5; i++) (yyval.v)[i] = (yyvsp[(1) - (3)].v)[i] + (yyvsp[(3) - (3)].v)[i];
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4229 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.v)[0] = (yyvsp[(2) - (11)].d);  (yyval.v)[1] = (yyvsp[(4) - (11)].d);  (yyval.v)[2] = (yyvsp[(6) - (11)].d);  (yyval.v)[3] = (yyvsp[(8) - (11)].d); (yyval.v)[4] = (yyvsp[(10) - (11)].d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4233 "Gmsh.y"
      (yyval.v)[0] = (yyvsp[(2) - (9)].d);  (yyval.v)[1] = (yyvsp[(4) - (9)].d);  (yyval.v)[2] = (yyvsp[(6) - (9)].d);  (yyval.v)[3] = (yyvsp[(8) - (9)].d); (yyval.v)[4] = 1.0;
/* Line 1788 of yacc.c  */
#line 4237 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.v)[0] = (yyvsp[(2) - (7)].d);  (yyval.v)[1] = (yyvsp[(4) - (7)].d);  (yyval.v)[2] = (yyvsp[(6) - (7)].d);  (yyval.v)[3] = 0.0; (yyval.v)[4] = 1.0;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4241 "Gmsh.y"
    {
      (yyval.v)[0] = (yyvsp[(2) - (7)].d);  (yyval.v)[1] = (yyvsp[(4) - (7)].d);  (yyval.v)[2] = (yyvsp[(6) - (7)].d);  (yyval.v)[3] = 0.0; (yyval.v)[4] = 1.0;
/* Line 1788 of yacc.c  */
#line 4248 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = List_Create(2, 1, sizeof(List_T*));
      List_Add((yyval.l), &((yyvsp[(1) - (1)].l)));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4253 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      List_Add((yyval.l), &((yyvsp[(3) - (3)].l)));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4260 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = List_Create(2, 1, sizeof(double));
      List_Add((yyval.l), &((yyvsp[(1) - (1)].d)));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4265 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = (yyvsp[(1) - (1)].l);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4269 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      // creates an empty list
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      (yyval.l) = List_Create(2, 1, sizeof(double));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4274 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = (yyvsp[(2) - (3)].l);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4278 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = (yyvsp[(3) - (4)].l);
      for(int i = 0; i < List_Nbr((yyval.l)); i++){
	double *pd = (double*)List_Pointer((yyval.l), i);
	(*pd) = - (*pd);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4286 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = (yyvsp[(4) - (5)].l);
      for(int i = 0; i < List_Nbr((yyval.l)); i++){
	double *pd = (double*)List_Pointer((yyval.l), i);
	(*pd) *= (yyvsp[(1) - (5)].d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1788 of yacc.c  */
#line 4297 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = (yyvsp[(1) - (1)].l);
/* Line 1788 of yacc.c  */
#line 4301 "Gmsh.y"