Skip to content
Snippets Groups Projects
Gmsh.tab.cpp 368 KiB
Newer Older
        List_Delete(tmp);
      }
      else{
        for(int i = 0; i < List_Nbr((yyvsp[(2) - (3)].l)); i++){
          double d;
          List_Read((yyvsp[(2) - (3)].l), i, &d);
          Volume *v = FindVolume((int)d);
          if(v)
            v->QuadTri = TRANSFINITE_QUADTRI_1;
          else{
            GRegion *gr = GModel::current()->getRegionByTag((int)d);
            if(gr)
              gr->meshAttributes.QuadTri = TRANSFINITE_QUADTRI_1;
            else
              yymsg(1, "Unknown region %d", (int)d);
          }
        }
        List_Delete((yyvsp[(2) - (3)].l));
      }
    ;}
    break;

  case 250:
/* Line 1464 of yacc.c  */
#line 3260 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
	List_T *tmp = Tree2List(GModel::current()->getGEOInternals()->Surfaces);
        if(List_Nbr(tmp)){
          for(int i = 0; i < List_Nbr(tmp); i++){
            Surface *s;
            List_Read(tmp, i, &s);
            s->Recombine = 1;
            s->RecombineAngle = (yyvsp[(4) - (5)].i);
          }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        else{
          for(GModel::fiter it = GModel::current()->firstFace(); 
              it != GModel::current()->lastFace(); it++){
            (*it)->meshAttributes.recombine = 1;
            (*it)->meshAttributes.recombineAngle = (yyvsp[(4) - (5)].i);
          }
        }
        List_Delete(tmp);
      }
      else{
        for(int i = 0; i < List_Nbr((yyvsp[(3) - (5)].l)); i++){
          double d;
          List_Read((yyvsp[(3) - (5)].l), i, &d);
          Surface *s = FindSurface((int)d);
          if(s){
            s->Recombine = 1;
            s->RecombineAngle = (yyvsp[(4) - (5)].i);
          }
          else{
            GFace *gf = GModel::current()->getFaceByTag((int)d);
            if(gf){
              gf->meshAttributes.recombine = 1;
              gf->meshAttributes.recombineAngle = (yyvsp[(4) - (5)].i);
            }
            else
              yymsg(1, "Unknown surface %d", (int)d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
          }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

  case 251:
/* Line 1464 of yacc.c  */
#line 3303 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      for(int i = 0; i < List_Nbr((yyvsp[(3) - (6)].l)); i++){
	double d;
	List_Read((yyvsp[(3) - (6)].l), i, &d);
	int j = (int)d;
	Surface *s = FindSurface(j);
	if(s){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
          s->TransfiniteSmoothing = (int)(yyvsp[(5) - (6)].d);
        }
        else{
	  GFace *gf = GModel::current()->getFaceByTag(j);
	  if(gf)
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
            gf->meshAttributes.transfiniteSmoothing = (int)(yyvsp[(5) - (6)].d);
          else
	    yymsg(1, "Unknown surface %d", (int)(yyvsp[(5) - (6)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
      List_Delete((yyvsp[(3) - (6)].l));
    ;}
    break;

  case 252:
/* Line 1464 of yacc.c  */
#line 3328 "Gmsh.y"
      if(List_Nbr((yyvsp[(5) - (6)].l)) != List_Nbr((yyvsp[(3) - (6)].l))){
	yymsg(0, "Number of master (%d) different from number of slave (%d) lines",
              List_Nbr((yyvsp[(5) - (6)].l)), List_Nbr((yyvsp[(3) - (6)].l)));
      else{
        for(int i = 0; i < List_Nbr((yyvsp[(3) - (6)].l)); i++){
          double d_master, d_slave;
          List_Read((yyvsp[(5) - (6)].l), i, &d_master);
          List_Read((yyvsp[(3) - (6)].l), i, &d_slave);
          int j_master = (int)d_master;
          int j_slave  = (int)d_slave;
          Curve *c_slave = FindCurve(abs(j_slave));
          if(c_slave){
            c_slave->meshMaster = j_master;	  
          }
          else{
            GEdge *ge = GModel::current()->getEdgeByTag(abs(j_slave));
            if(ge) ge->setMeshMaster(j_master);
            else yymsg(0, "Unknown line %d", j_slave);
          }
        }
      }
      List_Delete((yyvsp[(3) - (6)].l));
      List_Delete((yyvsp[(5) - (6)].l));
    ;}
    break;

  case 253:
/* Line 1464 of yacc.c  */
#line 3356 "Gmsh.y"
      if (List_Nbr((yyvsp[(5) - (12)].l)) != List_Nbr((yyvsp[(10) - (12)].l))){
	yymsg(0, "Number of master surface edges (%d) different from number of "
              "slave (%d) edges", List_Nbr((yyvsp[(10) - (12)].l)), List_Nbr((yyvsp[(5) - (12)].l)));
        int j_master = (int)(yyvsp[(8) - (12)].d);
        int j_slave = (int)(yyvsp[(3) - (12)].d);
        Surface *s_slave = FindSurface(abs(j_slave));
        if(s_slave){
          s_slave->meshMaster = j_master;
          for (int i = 0; i < List_Nbr((yyvsp[(5) - (12)].l)); i++){
            double dm, ds;
            List_Read((yyvsp[(5) - (12)].l), i, &ds);
            List_Read((yyvsp[(10) - (12)].l), i, &dm);	  
            s_slave->edgeCounterparts[(int)ds] = (int)dm;
          }
        }
        else{
          GFace *gf = GModel::current()->getFaceByTag(abs(j_slave));
          if(gf){
            gf->setMeshMaster(j_master);
            for (int i = 0; i < List_Nbr((yyvsp[(5) - (12)].l)); i++){
              double dm, ds;
              List_Read((yyvsp[(5) - (12)].l), i, &ds);
              List_Read((yyvsp[(10) - (12)].l), i, &dm);
              gf->edgeCounterparts[(int)ds] = (int)dm;
            }
          }
          else yymsg(0, "Unknown surface %d", j_slave);
        }
      List_Delete((yyvsp[(5) - (12)].l));
      List_Delete((yyvsp[(10) - (12)].l));
  case 254:
/* Line 1464 of yacc.c  */
#line 3399 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
      Surface *s = FindSurface((int)(yyvsp[(8) - (10)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(s){
	setSurfaceEmbeddedPoints(s, (yyvsp[(3) - (10)].l));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
      else{
        GFace *gf = GModel::current()->getFaceByTag((int)(yyvsp[(8) - (10)].d));
        if(gf){
          for(int i = 0; i < List_Nbr((yyvsp[(3) - (10)].l)); i++){
            int iPoint;
            List_Read((yyvsp[(3) - (10)].l), i, &iPoint);
            GVertex *gv = GModel::current()->getVertexByTag(iPoint);
            if(gv)
              gf->addEmbeddedVertex(gv);
            else
              yymsg(0, "Unknown point %d", iPoint);
          }
        }
        else
          yymsg(0, "Unknown surface %d", (int)(yyvsp[(8) - (10)].d));
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

  case 255:
/* Line 1464 of yacc.c  */
#line 3422 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      Surface *s = FindSurface((int)(yyvsp[(8) - (10)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(s){
	setSurfaceEmbeddedCurves(s, (yyvsp[(3) - (10)].l));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
      else{
        GFace *gf = GModel::current()->getFaceByTag((int)(yyvsp[(8) - (10)].d));
        if(gf){
          for(int i = 0; i < List_Nbr((yyvsp[(3) - (10)].l)); i++){
            int iCurve;
            List_Read((yyvsp[(3) - (10)].l), i, &iCurve);
            GEdge *ge = GModel::current()->getEdgeByTag(iCurve);
            if(ge)
              gf->addEmbeddedEdge(ge);
            else
              yymsg(0, "Unknown line %d", iCurve);
          }
        }
        else
          yymsg(0, "Unknown surface %d", (int)(yyvsp[(8) - (10)].d));
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

  case 256:
/* Line 1464 of yacc.c  */
#line 3445 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
    ;}
    break;

  case 257:
/* Line 1464 of yacc.c  */
#line 3448 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
    ;}
    break;

  case 258:
/* Line 1464 of yacc.c  */
#line 3457 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

  case 259:
/* Line 1464 of yacc.c  */
#line 3461 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
      if(!strcmp((yyvsp[(2) - (3)].c), "Geometry"))
        ReplaceAllDuplicates();
      else if(!strcmp((yyvsp[(2) - (3)].c), "Mesh"))
        GModel::current()->removeDuplicateMeshVertices(CTX::instance()->geom.tolerance);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else
        yymsg(0, "Unknown coherence command");
      Free((yyvsp[(2) - (3)].c));
    ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

  case 260:
/* Line 1464 of yacc.c  */
#line 3471 "Gmsh.y"
    { 
      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));
    ;}
    break;

  case 261:
/* Line 1464 of yacc.c  */
#line 3508 "Gmsh.y"
Matti Pellika's avatar
 
Matti Pellika committed
    {
Matti Pellika's avatar
 
Matti Pellika committed
    
    List_T *temp = ListOfDouble2ListOfInt((yyvsp[(7) - (11)].l));
Matti Pellika's avatar
 
Matti Pellika committed
    std::vector<int> domain;
    
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    for (int i = 0; i < List_Nbr(temp); i++){
Matti Pellika's avatar
 
Matti Pellika committed
      int item = 0;
      List_Read(temp, i, &item);
      domain.push_back(item);
    }
    List_Delete((yyvsp[(7) - (11)].l));
Matti Pellika's avatar
 
Matti Pellika committed
    List_Delete(temp);
    
    List_T *temp2 = ListOfDouble2ListOfInt((yyvsp[(9) - (11)].l));
Matti Pellika's avatar
 
Matti Pellika committed
    std::vector<int> subdomain;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    for (int i = 0; i < List_Nbr(temp2); i++){
Matti Pellika's avatar
 
Matti Pellika committed
      int item = 0;
      List_Read(temp2, i, &item);
      subdomain.push_back(item);
    }
    List_Delete((yyvsp[(9) - (11)].l));
Matti Pellika's avatar
 
Matti Pellika committed
    List_Delete(temp2);
    
    std::string fileName = "";
    fileName = (yyvsp[(3) - (11)].c);
    
Matti Pellika's avatar
 
Matti Pellika committed
    #if defined(HAVE_KBIPACK)
Matti Pellika's avatar
 
Matti Pellika committed
    Homology* homology = new Homology(GModel::current(), domain, subdomain);
    homology->setFileName(fileName);
    homology->computeRanks();
Matti Pellika's avatar
 
Matti Pellika committed
    delete homology;
    #else
Christophe Geuzaine's avatar
pp  
Christophe Geuzaine committed
    yymsg(0, "Gmsh needs to be configured with option Kbipack to use homology computation");
Matti Pellika's avatar
 
Matti Pellika committed
    #endif
    ;}
    break;

  case 262:
/* Line 1464 of yacc.c  */
#line 3545 "Gmsh.y"
Matti Pellika's avatar
 
Matti Pellika committed
    {
Matti Pellika's avatar
 
Matti Pellika committed
    List_T *temp = ListOfDouble2ListOfInt((yyvsp[(7) - (11)].l));
Matti Pellika's avatar
 
Matti Pellika committed
    std::vector<int> domain;
    
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    for (int i = 0; i < List_Nbr(temp); i++){
Matti Pellika's avatar
 
Matti Pellika committed
      int item = 0;
      List_Read(temp, i, &item);
      domain.push_back(item);
    }
Matti Pellika's avatar
 
Matti Pellika committed
    List_Delete((yyvsp[(7) - (11)].l));
Matti Pellika's avatar
 
Matti Pellika committed
    List_Delete(temp);
    
Matti Pellika's avatar
 
Matti Pellika committed
    List_T *temp2 = ListOfDouble2ListOfInt((yyvsp[(9) - (11)].l));
Matti Pellika's avatar
 
Matti Pellika committed
    std::vector<int> subdomain;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    for (int i = 0; i < List_Nbr(temp2); i++){
Matti Pellika's avatar
 
Matti Pellika committed
      int item = 0;
      List_Read(temp2, i, &item);
      subdomain.push_back(item);
    }
Matti Pellika's avatar
 
Matti Pellika committed
    List_Delete((yyvsp[(9) - (11)].l));
Matti Pellika's avatar
 
Matti Pellika committed
    List_Delete(temp2);
    
    std::string fileName = "";
    fileName = (yyvsp[(3) - (11)].c);
Matti Pellika's avatar
 
Matti Pellika committed
    
Matti Pellika's avatar
 
Matti Pellika committed
    #if defined(HAVE_KBIPACK)
Matti Pellika's avatar
 
Matti Pellika committed
    Homology* homology = new Homology(GModel::current(), domain, subdomain);
    homology->setFileName(fileName);
    homology->findGenerators();  
Matti Pellika's avatar
 
Matti Pellika committed
    delete homology;
Matti Pellika's avatar
 
Matti Pellika committed
    #else
Christophe Geuzaine's avatar
pp  
Christophe Geuzaine committed
    yymsg(0, "Gmsh needs to be configured with option Kbipack to use homology computation");
Matti Pellika's avatar
 
Matti Pellika committed
    #endif
    ;}
    break;

  case 263:
/* Line 1464 of yacc.c  */
#line 3581 "Gmsh.y"
Matti Pellika's avatar
 
Matti Pellika committed
    {
Matti Pellika's avatar
 
Matti Pellika committed
    List_T *temp = ListOfDouble2ListOfInt((yyvsp[(7) - (11)].l));
Matti Pellika's avatar
 
Matti Pellika committed
    std::vector<int> domain;
    
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    for (int i = 0; i < List_Nbr(temp); i++){
Matti Pellika's avatar
 
Matti Pellika committed
      int item = 0;
      List_Read(temp, i, &item);
      domain.push_back(item);
    }
Matti Pellika's avatar
 
Matti Pellika committed
    List_Delete((yyvsp[(7) - (11)].l));
Matti Pellika's avatar
 
Matti Pellika committed
    List_Delete(temp);
    
Matti Pellika's avatar
 
Matti Pellika committed
    List_T *temp2 = ListOfDouble2ListOfInt((yyvsp[(9) - (11)].l));
Matti Pellika's avatar
 
Matti Pellika committed
    std::vector<int> subdomain;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    for (int i = 0; i < List_Nbr(temp2); i++){
Matti Pellika's avatar
 
Matti Pellika committed
      int item = 0;
      List_Read(temp2, i, &item);
      subdomain.push_back(item);
    }
Matti Pellika's avatar
 
Matti Pellika committed
    List_Delete((yyvsp[(9) - (11)].l));
Matti Pellika's avatar
 
Matti Pellika committed
    List_Delete(temp2);
    
    std::string fileName = "";
    fileName = (yyvsp[(3) - (11)].c);
Matti Pellika's avatar
 
Matti Pellika committed
    
Matti Pellika's avatar
 
Matti Pellika committed
    #if defined(HAVE_KBIPACK)
Matti Pellika's avatar
 
Matti Pellika committed
    Homology* homology = new Homology(GModel::current(), domain, subdomain);
    homology->setFileName(fileName);
    homology->findDualGenerators();
Matti Pellika's avatar
 
Matti Pellika committed
    delete homology;
Matti Pellika's avatar
 
Matti Pellika committed
    #else
Christophe Geuzaine's avatar
pp  
Christophe Geuzaine committed
    yymsg(0, "Gmsh needs to be configured with option Kbipack to use homology computation");
Matti Pellika's avatar
 
Matti Pellika committed
    #endif
    ;}
    break;

  case 264:
/* Line 1464 of yacc.c  */
#line 3616 "Gmsh.y"
    {
    List_T *temp = ListOfDouble2ListOfInt((yyvsp[(7) - (11)].l));
    std::vector<int> domain;
    
    for (int i = 0; i < List_Nbr(temp); i++){
      int item = 0;
      List_Read(temp, i, &item);
      domain.push_back(item);
    }
    List_Delete((yyvsp[(7) - (11)].l));
    List_Delete(temp);
    
    List_T *temp2 = ListOfDouble2ListOfInt((yyvsp[(9) - (11)].l));
    std::vector<int> subdomain;
    for (int i = 0; i < List_Nbr(temp2); i++){
      int item = 0;
      List_Read(temp2, i, &item);
      subdomain.push_back(item);
    }
    List_Delete((yyvsp[(9) - (11)].l));
    List_Delete(temp2);
    
    std::string fileName = "";
    fileName = (yyvsp[(3) - (11)].c);
    
    #if defined(HAVE_KBIPACK)
    Homology* homology = new Homology(GModel::current(), domain, subdomain);
    homology->setFileName(fileName);
    homology->findHomSequence();
    delete homology;
    #else
Christophe Geuzaine's avatar
pp  
Christophe Geuzaine committed
    yymsg(0, "Gmsh needs to be configured with option Kbipack to use homology computation");
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

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

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

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

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

  case 269:
/* Line 1464 of yacc.c  */
#line 3659 "Gmsh.y"
    { (yyval.d) = !(yyvsp[(2) - (2)].d);          ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

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

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

  case 272:
/* Line 1464 of yacc.c  */
#line 3662 "Gmsh.y"
    { (yyval.d) = (yyvsp[(1) - (3)].d) * (yyvsp[(3) - (3)].d);      ;}
    break;

  case 273:
/* Line 1464 of yacc.c  */
#line 3664 "Gmsh.y"
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));
	(yyval.d) = (yyvsp[(1) - (3)].d) / (yyvsp[(3) - (3)].d);     
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  case 289:
/* Line 1464 of yacc.c  */
#line 3685 "Gmsh.y"
    { (yyval.d) = sin((yyvsp[(3) - (4)].d));      ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;
  case 290:
/* Line 1464 of yacc.c  */
#line 3686 "Gmsh.y"
    { (yyval.d) = asin((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

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

  case 292:
/* Line 1464 of yacc.c  */
#line 3688 "Gmsh.y"
    { (yyval.d) = acos((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;
  case 293:
/* Line 1464 of yacc.c  */
#line 3689 "Gmsh.y"
    { (yyval.d) = tan((yyvsp[(3) - (4)].d));      ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

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

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

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

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

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

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

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

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

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

  case 304:
/* Line 1464 of yacc.c  */
#line 3700 "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;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  case 322:
/* Line 1464 of yacc.c  */
#line 3719 "Gmsh.y"
    { (yyval.d) = ceil((yyvsp[(3) - (4)].d));     ;}
  case 323:
/* Line 1464 of yacc.c  */
#line 3720 "Gmsh.y"
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

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

  case 325:
/* Line 1464 of yacc.c  */
#line 3722 "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;

  case 326:
/* Line 1464 of yacc.c  */
#line 3723 "Gmsh.y"
    { (yyval.d) = (yyvsp[(3) - (4)].d) * (double)rand() / (double)RAND_MAX; ;}
  case 327:
/* Line 1464 of yacc.c  */
#line 3732 "Gmsh.y"
    { (yyval.d) = (yyvsp[(1) - (1)].d); ;}
  case 328:
/* Line 1464 of yacc.c  */
#line 3733 "Gmsh.y"
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    break;

  case 329:
/* Line 1464 of yacc.c  */
#line 3734 "Gmsh.y"
    { (yyval.d) = Msg::GetCommRank(); ;}
Jean-François Remacle's avatar
 
Jean-François Remacle committed
    break;

  case 330:
/* Line 1464 of yacc.c  */
#line 3735 "Gmsh.y"
    { (yyval.d) = Msg::GetCommSize(); ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

  case 331:
/* Line 1464 of yacc.c  */
#line 3736 "Gmsh.y"
    { (yyval.d) = GetGmshMajorVersion(); ;}
  case 332:
/* Line 1464 of yacc.c  */
#line 3737 "Gmsh.y"
    { (yyval.d) = GetGmshMinorVersion(); ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

  case 333:
/* Line 1464 of yacc.c  */
#line 3738 "Gmsh.y"
    { (yyval.d) = GetGmshPatchVersion(); ;}
    break;

  case 334:
/* Line 1464 of yacc.c  */
#line 3743 "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.;
      else{
        if(gmsh_yysymbols[(yyvsp[(1) - (1)].c)].empty()){
          yymsg(0, "Uninitialized variable '%s'", (yyvsp[(1) - (1)].c));
          (yyval.d) = 0.;
        }
        else
          (yyval.d) = gmsh_yysymbols[(yyvsp[(1) - (1)].c)][0];
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (1)].c));
    ;}
    break;

  case 335:
/* Line 1464 of yacc.c  */
#line 3762 "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
      }
      else{
        if(gmsh_yysymbols[tmpstring].empty()){
          yymsg(0, "Uninitialized variable '%s'", tmpstring);
          (yyval.d) = 0.;
        }
        else
          (yyval.d) = gmsh_yysymbols[tmpstring][0];
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (5)].c));
    ;}
    break;

  case 336:
/* Line 1464 of yacc.c  */
#line 3780 "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));