Skip to content
Snippets Groups Projects
Gmsh.tab.cpp 388 KiB
Newer Older
/* Line 1806 of yacc.c  */
#line 3841 "Gmsh.y"
    { (yyval.d) = tan((yyvsp[(3) - (4)].d));      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

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

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

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

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

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

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

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

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

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

/* Line 1806 of yacc.c  */
#line 3852 "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 1806 of yacc.c  */
#line 3853 "Gmsh.y"
    { (yyval.d) = (yyvsp[(3) - (4)].d) * (double)rand() / (double)RAND_MAX; }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Line 1806 of yacc.c  */
#line 3872 "Gmsh.y"
    { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); }
/* Line 1806 of yacc.c  */
#line 3873 "Gmsh.y"
    { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); }
/* Line 1806 of yacc.c  */
#line 3874 "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 1806 of yacc.c  */
#line 3875 "Gmsh.y"
    { (yyval.d) = (yyvsp[(3) - (4)].d) * (double)rand() / (double)RAND_MAX; }
Jean-François Remacle's avatar
 
Jean-François Remacle committed
    break;

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

/* Line 1806 of yacc.c  */
#line 3885 "Gmsh.y"
    { (yyval.d) = 3.141592653589793; }
/* Line 1806 of yacc.c  */
#line 3886 "Gmsh.y"
    { (yyval.d) = Msg::GetCommRank(); }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1806 of yacc.c  */
#line 3887 "Gmsh.y"
    { (yyval.d) = Msg::GetCommSize(); }
/* Line 1806 of yacc.c  */
#line 3888 "Gmsh.y"
    { (yyval.d) = GetGmshMajorVersion(); }
/* Line 1806 of yacc.c  */
#line 3889 "Gmsh.y"
    { (yyval.d) = GetGmshMinorVersion(); }
/* Line 1806 of yacc.c  */
#line 3890 "Gmsh.y"
    { (yyval.d) = GetGmshPatchVersion(); }
/* Line 1806 of yacc.c  */
#line 3895 "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 1806 of yacc.c  */
#line 3915 "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 1806 of yacc.c  */
#line 3934 "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 1806 of yacc.c  */
#line 3952 "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 1806 of yacc.c  */
#line 3964 "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 1806 of yacc.c  */
#line 3981 "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 1806 of yacc.c  */
#line 4002 "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 1806 of yacc.c  */
#line 4007 "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 1806 of yacc.c  */
#line 4012 "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 1806 of yacc.c  */
#line 4022 "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 1806 of yacc.c  */
#line 4032 "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 1806 of yacc.c  */
#line 4040 "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 1806 of yacc.c  */
#line 4044 "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 1806 of yacc.c  */
#line 4048 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
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 1806 of yacc.c  */
#line 4052 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
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 1806 of yacc.c  */
#line 4056 "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 1806 of yacc.c  */
#line 4063 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
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 1806 of yacc.c  */
#line 4067 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      (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;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1806 of yacc.c  */
#line 4071 "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 1806 of yacc.c  */
#line 4075 "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 1806 of yacc.c  */
#line 4082 "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 1806 of yacc.c  */
#line 4087 "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 1806 of yacc.c  */
#line 4094 "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 1806 of yacc.c  */
#line 4099 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = (yyvsp[(1) - (1)].l);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1806 of yacc.c  */
#line 4103 "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 1806 of yacc.c  */
#line 4108 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = (yyvsp[(2) - (3)].l);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1806 of yacc.c  */
#line 4112 "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 1806 of yacc.c  */
#line 4120 "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 1806 of yacc.c  */
#line 4131 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = (yyvsp[(1) - (1)].l);
/* Line 1806 of yacc.c  */
#line 4135 "Gmsh.y"
    {
      if(!strcmp((yyvsp[(1) - (1)].c), "*") || !strcmp((yyvsp[(1) - (1)].c), "all"))
        (yyval.l) = 0;
      else{
        yyerror("Unknown special string for list replacement");
        (yyval.l) = List_Create(2, 1, sizeof(double));
      }
/* Line 1806 of yacc.c  */
#line 4147 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = (yyvsp[(2) - (2)].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
    break;

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

/* Line 1806 of yacc.c  */
#line 4163 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = List_Create(2, 1, sizeof(double));
      for(double d = (yyvsp[(1) - (3)].d); ((yyvsp[(1) - (3)].d) < (yyvsp[(3) - (3)].d)) ? (d <= (yyvsp[(3) - (3)].d)) : (d >= (yyvsp[(3) - (3)].d));
          ((yyvsp[(1) - (3)].d) < (yyvsp[(3) - (3)].d)) ? (d += 1.) : (d -= 1.))
	List_Add((yyval.l), &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1806 of yacc.c  */
#line 4170 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      (yyval.l) = List_Create(2, 1, sizeof(double));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(yyvsp[(5) - (5)].d) || ((yyvsp[(1) - (5)].d) < (yyvsp[(3) - (5)].d) && (yyvsp[(5) - (5)].d) < 0) || ((yyvsp[(1) - (5)].d) > (yyvsp[(3) - (5)].d) && (yyvsp[(5) - (5)].d) > 0)){
        yymsg(0, "Wrong increment in '%g:%g:%g'", (yyvsp[(1) - (5)].d), (yyvsp[(3) - (5)].d), (yyvsp[(5) - (5)].d));
	List_Add((yyval.l), &((yyvsp[(1) - (5)].d)));
	for(double d = (yyvsp[(1) - (5)].d); ((yyvsp[(5) - (5)].d) > 0) ? (d <= (yyvsp[(3) - (5)].d)) : (d >= (yyvsp[(3) - (5)].d)); d += (yyvsp[(5) - (5)].d))
	  List_Add((yyval.l), &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1806 of yacc.c  */
#line 4181 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      // Returns the coordinates of a point and fills a list with it.
      // This allows to ensure e.g. that relative point positions are
      // always conserved
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Vertex *v = FindPoint((int)(yyvsp[(3) - (4)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      (yyval.l) = List_Create(3, 1, sizeof(double));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!v) {
	yymsg(0, "Unknown point '%d'", (int)(yyvsp[(3) - (4)].d));
	double d = 0.0;
	List_Add((yyval.l), &d);
	List_Add((yyval.l), &d);
	List_Add((yyval.l), &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
      else{
	List_Add((yyval.l), &v->Pos.X);
	List_Add((yyval.l), &v->Pos.Y);
	List_Add((yyval.l), &v->Pos.Z);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1806 of yacc.c  */
#line 4201 "Gmsh.y"
/* Line 1806 of yacc.c  */
#line 4205 "Gmsh.y"
/* Line 1806 of yacc.c  */
#line 4209 "Gmsh.y"
/* Line 1806 of yacc.c  */
#line 4213 "Gmsh.y"
/* Line 1806 of yacc.c  */
#line 4217 "Gmsh.y"
    {
      (yyval.l) = List_Create(10, 1, sizeof(double));
      for(int i = 0; i < List_Nbr((yyvsp[(4) - (5)].l)); i++){
        double num;
        List_Read((yyvsp[(4) - (5)].l), i, &num);
        PhysicalGroup *p = FindPhysicalGroup((int)num, MSH_PHYSICAL_POINT);
        if(p){
          for(int j = 0; j < List_Nbr(p->Entities); j++){
            int nume;
            List_Read(p->Entities, j, &nume);
            double d = nume;
            List_Add((yyval.l), &d);
          }
        }
      }
      List_Delete((yyvsp[(4) - (5)].l));
/* Line 1806 of yacc.c  */
#line 4235 "Gmsh.y"
    {
      (yyval.l) = List_Create(10, 1, sizeof(double));
      for(int i = 0; i < List_Nbr((yyvsp[(4) - (5)].l)); i++){
        double num;
        List_Read((yyvsp[(4) - (5)].l), i, &num);
        PhysicalGroup *p = FindPhysicalGroup((int)num, MSH_PHYSICAL_LINE);
        if(p){
          for(int j = 0; j < List_Nbr(p->Entities); j++){
            int nume;
            List_Read(p->Entities, j, &nume);
            double d = nume;
            List_Add((yyval.l), &d);
          }
        }
      }
      List_Delete((yyvsp[(4) - (5)].l));
/* Line 1806 of yacc.c  */
#line 4253 "Gmsh.y"
    {
      (yyval.l) = List_Create(10, 1, sizeof(double));
      for(int i = 0; i < List_Nbr((yyvsp[(4) - (5)].l)); i++){
        double num;
        List_Read((yyvsp[(4) - (5)].l), i, &num);
        PhysicalGroup *p = FindPhysicalGroup((int)num, MSH_PHYSICAL_SURFACE);
        if(p){
          for(int j = 0; j < List_Nbr(p->Entities); j++){
            int nume;
            List_Read(p->Entities, j, &nume);
            double d = nume;
            List_Add((yyval.l), &d);
          }
        }
      }
      List_Delete((yyvsp[(4) - (5)].l));
/* Line 1806 of yacc.c  */
#line 4271 "Gmsh.y"
    {
      (yyval.l) = List_Create(10, 1, sizeof(double));
      for(int i = 0; i < List_Nbr((yyvsp[(4) - (5)].l)); i++){
        double num;
        List_Read((yyvsp[(4) - (5)].l), i, &num);
        PhysicalGroup *p = FindPhysicalGroup((int)num, MSH_PHYSICAL_VOLUME);
        if(p){
          for(int j = 0; j < List_Nbr(p->Entities); j++){
            int nume;
            List_Read(p->Entities, j, &nume);
            double d = nume;
            List_Add((yyval.l), &d);
          }
        }
      }
      List_Delete((yyvsp[(4) - (5)].l));
/* Line 1806 of yacc.c  */
#line 4289 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = List_Create(List_Nbr((yyvsp[(1) - (1)].l)), 1, sizeof(double));
      for(int i = 0; i < List_Nbr((yyvsp[(1) - (1)].l)); i++){
	Shape *s = (Shape*) List_Pointer((yyvsp[(1) - (1)].l), i);
	double d = s->Num;
	List_Add((yyval.l), &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      List_Delete((yyvsp[(1) - (1)].l));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1806 of yacc.c  */
#line 4299 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = List_Create(List_Nbr((yyvsp[(1) - (1)].l)), 1, sizeof(double));
      for(int i = 0; i < List_Nbr((yyvsp[(1) - (1)].l)); i++){
	Shape *s = (Shape*) List_Pointer((yyvsp[(1) - (1)].l), i);
	double d = s->Num;
	List_Add((yyval.l), &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      List_Delete((yyvsp[(1) - (1)].l));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1806 of yacc.c  */
#line 4309 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = List_Create(2, 1, sizeof(double));
      if(!gmsh_yysymbols.count((yyvsp[(1) - (3)].c)))
	yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (3)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else{
        gmsh_yysymbol &s(gmsh_yysymbols[(yyvsp[(1) - (3)].c)]);
	for(unsigned int i = 0; i < s.value.size(); i++)
	  List_Add((yyval.l), &s.value[i]);
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (3)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Christophe Geuzaine's avatar
 
Christophe Geuzaine committed

/* Line 1806 of yacc.c  */
#line 4321 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = List_Create(2, 1, sizeof(double));
      if(!gmsh_yysymbols.count((yyvsp[(3) - (4)].c)))
	yymsg(0, "Unknown variable '%s'", (yyvsp[(3) - (4)].c));
      else{
        gmsh_yysymbol &s(gmsh_yysymbols[(yyvsp[(3) - (4)].c)]);
	for(unsigned int i = 0; i < s.value.size(); i++)
	  List_Add((yyval.l), &s.value[i]);
      }
      Free((yyvsp[(3) - (4)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1806 of yacc.c  */
#line 4333 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = List_Create(2, 1, sizeof(double));
      if(!gmsh_yysymbols.count((yyvsp[(1) - (6)].c)))
	yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (6)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        gmsh_yysymbol &s(gmsh_yysymbols[(yyvsp[(1) - (6)].c)]);
	for(int i = 0; i < List_Nbr((yyvsp[(4) - (6)].l)); i++){
	  int index = (int)(*(double*)List_Pointer_Fast((yyvsp[(4) - (6)].l), i));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  if((int)s.value.size() < index + 1)
	    yymsg(0, "Uninitialized variable '%s[%d]'", (yyvsp[(1) - (6)].c), index);
	  else
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    List_Add((yyval.l), &s.value[index]);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (6)].c));
      List_Delete((yyvsp[(4) - (6)].l));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

/* Line 1806 of yacc.c  */
#line 4354 "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 1806 of yacc.c  */
#line 4359 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.l) = (yyvsp[(1) - (1)].l);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

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

/* Line 1806 of yacc.c  */
#line 4367 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      for(int i = 0; i < List_Nbr((yyvsp[(3) - (3)].l)); i++){
	double d;
	List_Read((yyvsp[(3) - (3)].l), i, &d);
	List_Add((yyval.l), &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      List_Delete((yyvsp[(3) - (3)].l));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;