Skip to content
Snippets Groups Projects
Gmsh.tab.cpp 337 KiB
Newer Older
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      else
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	yymsg(0, "Wrong layer definition {%d, %d, %d}", List_Nbr((yyvsp[(3) - (9)].l)), 
	      List_Nbr((yyvsp[(5) - (9)].l)), List_Nbr((yyvsp[(7) - (9)].l)));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      List_Delete((yyvsp[(3) - (9)].l));
      List_Delete((yyvsp[(5) - (9)].l));
      List_Delete((yyvsp[(7) - (9)].l));
    ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 226:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      extr.mesh.Recombine = true;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 227:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      int num = (int)(yyvsp[(3) - (9)].d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(FindSurface(num)){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	yymsg(0, "Surface %d already exists", num);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
      else{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	Surface *s = Create_Surface(num, MSH_SURF_DISCRETE);
	Tree_Add(GModel::current()->getGEOInternals()->Surfaces, &s);
	extr.mesh.Holes[num].first = (yyvsp[(8) - (9)].d);
	extr.mesh.Holes[num].second.clear();
	for(int i = 0; i < List_Nbr((yyvsp[(6) - (9)].l)); i++){
	  double d;
	  List_Read((yyvsp[(6) - (9)].l), i, &d);
	  extr.mesh.Holes[num].second.push_back((int)d);
	}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      List_Delete((yyvsp[(6) - (9)].l));
    ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 228:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      (yyval.v)[0] = (yyval.v)[1] = 1.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 229:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!strcmp((yyvsp[(2) - (3)].c), "Progression") || !strcmp((yyvsp[(2) - (3)].c), "Power"))
        (yyval.v)[0] = 1.;
      else if(!strcmp((yyvsp[(2) - (3)].c), "Bump"))
        (yyval.v)[0] = 2.;
      else{
        yymsg(0, "Unknown transfinite mesh type");
        (yyval.v)[0] = 1.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      (yyval.v)[1] = (yyvsp[(3) - (3)].d);
      Free((yyvsp[(2) - (3)].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 230:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      (yyval.i) = -1; // left
    ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 231:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      if(!strcmp((yyvsp[(1) - (1)].c), "Right"))
        (yyval.i) = 1;
      else if(!strcmp((yyvsp[(1) - (1)].c), "Left"))
        (yyval.i) = -1;
      else // alternated
        (yyval.i) = 0;
      Free((yyvsp[(1) - (1)].c));
    ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 232:
    {
     (yyval.l) = List_Create(1, 1, sizeof(double));
   ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 233:
    {
     (yyval.l) = (yyvsp[(2) - (2)].l);
   ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 234:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    {
      (yyval.i) = 45;
    ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 235:
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    {
      (yyval.i) = (int)(yyvsp[(2) - (2)].d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 236:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      int type = (int)(yyvsp[(6) - (7)].v)[0];
      double coef = fabs((yyvsp[(6) - (7)].v)[1]);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      if(!(yyvsp[(3) - (7)].l)){
        List_T *tmp = Tree2List(GModel::current()->getGEOInternals()->Curves);
        if(List_Nbr(tmp)){
          for(int i = 0; i < List_Nbr(tmp); i++){
            Curve *c;
            List_Read(tmp, i, &c);
            c->Method = MESH_TRANSFINITE;
            c->nbPointsTransfinite = ((yyvsp[(5) - (7)].d) > 2) ? (int)(yyvsp[(5) - (7)].d) : 2;
            c->typeTransfinite = type;
            c->coeffTransfinite = coef;
          }
        }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        else{
Christophe Geuzaine's avatar
Christophe Geuzaine committed
          for(GModel::eiter it = GModel::current()->firstEdge(); 
              it != GModel::current()->lastEdge(); it++){
            (*it)->meshAttributes.Method = MESH_TRANSFINITE;
            (*it)->meshAttributes.nbPointsTransfinite = ((yyvsp[(5) - (7)].d) > 2) ? (int)(yyvsp[(5) - (7)].d) : 2;
            (*it)->meshAttributes.typeTransfinite = type;
            (*it)->meshAttributes.coeffTransfinite = coef;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
          }
        }
Christophe Geuzaine's avatar
Christophe Geuzaine committed
        List_Delete(tmp);
      }
      else{
        for(int i = 0; i < List_Nbr((yyvsp[(3) - (7)].l)); i++){
          double d;
          List_Read((yyvsp[(3) - (7)].l), i, &d);
          int j = (int)fabs(d);
          for(int sign = -1; sign <= 1; sign += 2){
            Curve *c = FindCurve(sign * j);
            if(c){
              c->Method = MESH_TRANSFINITE;
              c->nbPointsTransfinite = ((yyvsp[(5) - (7)].d) > 2) ? (int)(yyvsp[(5) - (7)].d) : 2;
              c->typeTransfinite = type * sign(d);
              c->coeffTransfinite = coef;
            }
            else{
              GEdge *ge = GModel::current()->getEdgeByTag(sign * j);
              if(ge){
                ge->meshAttributes.Method = MESH_TRANSFINITE;
                ge->meshAttributes.nbPointsTransfinite = ((yyvsp[(5) - (7)].d) > 2) ? (int)(yyvsp[(5) - (7)].d) : 2;
                ge->meshAttributes.typeTransfinite = type * sign(d);
                ge->meshAttributes.coeffTransfinite = coef;
              }
Christophe Geuzaine's avatar
Christophe Geuzaine committed
            }
          }
        }
        List_Delete((yyvsp[(3) - (7)].l));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 237:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      int k = List_Nbr((yyvsp[(4) - (6)].l));
      if(k != 0 && k != 3 && k != 4){
        yymsg(0, "Wrong definition of Transfinite Surface: 0, 3 or 4 points needed");
        if(!(yyvsp[(3) - (6)].l)){
          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->Method = MESH_TRANSFINITE;
              s->Recombine_Dir = (yyvsp[(5) - (6)].i);
              List_Reset(s->TrsfPoints);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
            }
          }
            for(GModel::fiter it = GModel::current()->firstFace(); 
                it != GModel::current()->lastFace(); it++){
              (*it)->meshAttributes.Method = MESH_TRANSFINITE;
              (*it)->meshAttributes.transfiniteArrangement = (yyvsp[(5) - (6)].i);
            }
          }
          List_Delete(tmp);
        }
        else{
          for(int i = 0; i < List_Nbr((yyvsp[(3) - (6)].l)); i++){
            double d;
            List_Read((yyvsp[(3) - (6)].l), i, &d);
            Surface *s = FindSurface((int)d);
            if(s){
              s->Method = MESH_TRANSFINITE;
              s->Recombine_Dir = (yyvsp[(5) - (6)].i);
              List_Reset(s->TrsfPoints);
              for(int j = 0; j < k; j++){
                double p;
                List_Read((yyvsp[(4) - (6)].l), j, &p);
                Vertex *v = FindPoint((int)fabs(p));
                if(v)
                  List_Add(s->TrsfPoints, &v);
                else
                  yymsg(0, "Unknown point %d", (int)fabs(p));
              }
            }
            else{
              GFace *gf = GModel::current()->getFaceByTag((int)d);
              if(gf){
                gf->meshAttributes.Method = MESH_TRANSFINITE;
                gf->meshAttributes.transfiniteArrangement = (yyvsp[(5) - (6)].i);
                for(int j = 0; j < k; j++){
                  double p;
                  List_Read((yyvsp[(4) - (6)].l), j, &p);
                  GVertex *gv = GModel::current()->getVertexByTag((int)fabs(p));
                  if(gv)
                    gf->meshAttributes.corners.push_back(gv);
                  else
                    yymsg(0, "Unknown point %d", (int)fabs(p));
                }
              }
              else
                yymsg(0, "Unknown surface %d", (int)d);
            }
          List_Delete((yyvsp[(3) - (6)].l));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        }
      List_Delete((yyvsp[(4) - (6)].l));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 238:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      yymsg(1, "Elliptic Surface is deprecated: use Transfinite instead (with smoothing)");
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      List_Delete((yyvsp[(7) - (8)].l));
    ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 239:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      int k = List_Nbr((yyvsp[(4) - (5)].l));
      if(k != 0 && k != 6 && k != 8){
        yymsg(0, "Wrong definition of Transfinite Volume: "
              "%d points instead of 6 or 8", k);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
        if(!(yyvsp[(3) - (5)].l)){
          List_T *tmp = Tree2List(GModel::current()->getGEOInternals()->Volumes);
          if(List_Nbr(tmp)){
            for(int i = 0; i < List_Nbr(tmp); i++){
              Volume *v;
              List_Read(tmp, i, &v);
              v->Method = MESH_TRANSFINITE;
              List_Reset(v->TrsfPoints);
            }
          }
          else{
            for(GModel::riter it = GModel::current()->firstRegion(); 
                it != GModel::current()->lastRegion(); it++){
              (*it)->meshAttributes.Method = MESH_TRANSFINITE;
            }
          }
          List_Delete(tmp);
        }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        else{
          for(int i = 0; i < List_Nbr((yyvsp[(3) - (5)].l)); i++){
            double d;
            List_Read((yyvsp[(3) - (5)].l), i, &d);
            Volume *v = FindVolume((int)d);
            if(v){
              v->Method = MESH_TRANSFINITE;
              List_Reset(v->TrsfPoints);
              for(int i = 0; i < k; i++){
                double p;
                List_Read((yyvsp[(4) - (5)].l), i, &p);
                Vertex *vert = FindPoint((int)fabs(p));
                if(vert)
                  List_Add(v->TrsfPoints, &vert);
                else
                  yymsg(0, "Unknown point %d", (int)fabs(p));
              }
            }
            else{
              GRegion *gr = GModel::current()->getRegionByTag((int)d);
              if(gr){
                gr->meshAttributes.Method = MESH_TRANSFINITE;
                for(int i = 0; i < k; i++){
                  double p;
                  List_Read((yyvsp[(4) - (5)].l), i, &p);
                  GVertex *gv = GModel::current()->getVertexByTag((int)fabs(p));
                  if(gv)
                    gr->meshAttributes.corners.push_back(gv);
                  else
                    yymsg(0, "Unknown point %d", (int)fabs(p));
                }
              }
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
              else
                yymsg(0, "Unknown volume %d", (int)d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
            }
          }
          List_Delete((yyvsp[(3) - (5)].l));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
        }
      List_Delete((yyvsp[(4) - (5)].l));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 240:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
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;

Matti Pellika's avatar
 
Matti Pellika committed
  case 241:
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
	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{
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  GFace *gf = GModel::current()->getFaceByTag(j);
	  if(gf)
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
            gf->meshAttributes.transfiniteSmoothing = (int)(yyvsp[(5) - (6)].d);
          else
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    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;

Matti Pellika's avatar
 
Matti Pellika committed
  case 242:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
      Surface *s = FindSurface((int)(yyvsp[(8) - (10)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(s){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	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;

Matti Pellika's avatar
 
Matti Pellika committed
  case 243:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      Surface *s = FindSurface((int)(yyvsp[(8) - (10)].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(s){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	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;

Matti Pellika's avatar
 
Matti Pellika committed
  case 244:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
    ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 245:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
    ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 246:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 247:
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;

Matti Pellika's avatar
 
Matti Pellika committed
  case 248:
Matti Pellika's avatar
 
Matti Pellika committed
    {
Matti Pellika's avatar
 
Matti Pellika committed
    
    List_T *temp = ListOfDouble2ListOfInt((yyvsp[(3) - (7)].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[(3) - (7)].l));
Matti Pellika's avatar
 
Matti Pellika committed
    List_Delete(temp);
    
Matti Pellika's avatar
 
Matti Pellika committed
    List_T *temp2 = ListOfDouble2ListOfInt((yyvsp[(5) - (7)].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[(5) - (7)].l));
Matti Pellika's avatar
 
Matti Pellika committed
    List_Delete(temp2);
    
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->computeBettiNumbers();
Matti Pellika's avatar
 
Matti Pellika committed
    delete homology;
    #else
    yymsg(0, "Gmsh needs to be configured with option Kbipack to use homology computation.");    
Matti Pellika's avatar
 
Matti Pellika committed
    #endif
    ;}
    break;

  case 249:
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);
    
Matti Pellika's avatar
 
Matti Pellika committed
    std::string 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->findGenerators(fileName);
    delete homology;
Matti Pellika's avatar
 
Matti Pellika committed
    #else
    yymsg(0, "Gmsh needs to be configured with option Kbipack to use homology computation.");
Matti Pellika's avatar
 
Matti Pellika committed
    #endif
    ;}
    break;

  case 250:
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);
    
Matti Pellika's avatar
 
Matti Pellika committed
    std::string 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->findDualGenerators(fileName);
    delete homology;
Matti Pellika's avatar
 
Matti Pellika committed
    #else
    yymsg(0, "Gmsh needs to be configured with option Kbipack to use homology computation.");
Matti Pellika's avatar
 
Matti Pellika committed
    #endif
    ;}
    break;

  case 251:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = (yyvsp[(1) - (1)].d);           ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 252:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = (yyvsp[(2) - (3)].d);           ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 253:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = -(yyvsp[(2) - (2)].d);          ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 254:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = (yyvsp[(2) - (2)].d);           ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 255:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = !(yyvsp[(2) - (2)].d);          ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 256:
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;

Matti Pellika's avatar
 
Matti Pellika committed
  case 257:
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;

Matti Pellika's avatar
 
Matti Pellika committed
  case 258:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = (yyvsp[(1) - (3)].d) * (yyvsp[(3) - (3)].d);      ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 259:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { 
      if(!(yyvsp[(3) - (3)].d))
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	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;

Matti Pellika's avatar
 
Matti Pellika committed
  case 260:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = (int)(yyvsp[(1) - (3)].d) % (int)(yyvsp[(3) - (3)].d);  ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 261:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = pow((yyvsp[(1) - (3)].d), (yyvsp[(3) - (3)].d));  ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 262:
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;

Matti Pellika's avatar
 
Matti Pellika committed
  case 263:
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;

Matti Pellika's avatar
 
Matti Pellika committed
  case 264:
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;

Matti Pellika's avatar
 
Matti Pellika committed
  case 265:
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;

Matti Pellika's avatar
 
Matti Pellika committed
  case 266:
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;

Matti Pellika's avatar
 
Matti Pellika committed
  case 267:
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;

Matti Pellika's avatar
 
Matti Pellika committed
  case 268:
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;

Matti Pellika's avatar
 
Matti Pellika committed
  case 269:
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;

Matti Pellika's avatar
 
Matti Pellika committed
  case 270:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = (yyvsp[(1) - (5)].d) ? (yyvsp[(3) - (5)].d) : (yyvsp[(5) - (5)].d); ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 271:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = exp((yyvsp[(3) - (4)].d));      ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 272:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = log((yyvsp[(3) - (4)].d));      ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 273:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = log10((yyvsp[(3) - (4)].d));    ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 274:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = sqrt((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 275:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = sin((yyvsp[(3) - (4)].d));      ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 276:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = asin((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;
Matti Pellika's avatar
 
Matti Pellika committed
  case 277:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = cos((yyvsp[(3) - (4)].d));      ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 278:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = acos((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 279:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = tan((yyvsp[(3) - (4)].d));      ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;
Matti Pellika's avatar
 
Matti Pellika committed
  case 280:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = atan((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 281:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = atan2((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d));;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 282:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = sinh((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 283:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = cosh((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 284:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = tanh((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 285:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = fabs((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 286:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = floor((yyvsp[(3) - (4)].d));    ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 287:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = ceil((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 288:
    { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 289:
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;

Matti Pellika's avatar
 
Matti Pellika committed
  case 290:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (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;

Matti Pellika's avatar
 
Matti Pellika committed
  case 291:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = (yyvsp[(3) - (4)].d) * (double)rand() / (double)RAND_MAX; ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 292:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = exp((yyvsp[(3) - (4)].d));      ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 293:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = log((yyvsp[(3) - (4)].d));      ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 294:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = log10((yyvsp[(3) - (4)].d));    ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 295:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = sqrt((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 296:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = sin((yyvsp[(3) - (4)].d));      ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 297:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = asin((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 298:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = cos((yyvsp[(3) - (4)].d));      ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 299:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = acos((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 300:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = tan((yyvsp[(3) - (4)].d));      ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 301:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = atan((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 302:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = atan2((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d));;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 303:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = sinh((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 304:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = cosh((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 305:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = tanh((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 306:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = fabs((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 307:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = floor((yyvsp[(3) - (4)].d));    ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 308:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = ceil((yyvsp[(3) - (4)].d));     ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 309:
    { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); ;}
Matti Pellika's avatar
 
Matti Pellika committed
  case 310:
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;

Matti Pellika's avatar
 
Matti Pellika committed
  case 311:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (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;

Matti Pellika's avatar
 
Matti Pellika committed
  case 312:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = (yyvsp[(3) - (4)].d) * (double)rand() / (double)RAND_MAX; ;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 313:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = (yyvsp[(1) - (1)].d); ;}
Matti Pellika's avatar
 
Matti Pellika committed
  case 314:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = 3.141592653589793; ;}
Matti Pellika's avatar
 
Matti Pellika committed
  case 315:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = Msg::GetCommRank(); ;}
Christophe Geuzaine's avatar
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 316:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = Msg::GetCommSize(); ;}
Jean-François Remacle's avatar
 
Jean-François Remacle committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 317:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = GetGmshMajorVersion(); ;}
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 318:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = GetGmshMinorVersion(); ;}
Matti Pellika's avatar
 
Matti Pellika committed
  case 319:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    { (yyval.d) = GetGmshPatchVersion(); ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 320:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      if(!gmsh_yysymbols.count((yyvsp[(1) - (1)].c))){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (1)].c));
	(yyval.d) = 0.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	(yyval.d) = gmsh_yysymbols[(yyvsp[(1) - (1)].c)][0];
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (1)].c));
    ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 321:
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)){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	yymsg(0, "Unknown variable '%s'", tmpstring);
	(yyval.d) = 0.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
      else
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	(yyval.d) = gmsh_yysymbols[tmpstring][0];
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (5)].c));
    ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 322:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      int index = (int)(yyvsp[(3) - (4)].d);
      if(!gmsh_yysymbols.count((yyvsp[(1) - (4)].c))){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (4)].c));
	(yyval.d) = 0.;
      else if((int)gmsh_yysymbols[(yyvsp[(1) - (4)].c)].size() < index + 1){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	yymsg(0, "Uninitialized variable '%s[%d]'", (yyvsp[(1) - (4)].c), index);
	(yyval.d) = 0.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	(yyval.d) = gmsh_yysymbols[(yyvsp[(1) - (4)].c)][index];
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (4)].c));
    ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 323:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      if(!gmsh_yysymbols.count((yyvsp[(2) - (4)].c))){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	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
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	(yyval.d) = gmsh_yysymbols[(yyvsp[(2) - (4)].c)].size();
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(2) - (4)].c));
    ;}
    break;

Matti Pellika's avatar
 
Matti Pellika committed
  case 324:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
    {
      if(!gmsh_yysymbols.count((yyvsp[(1) - (2)].c))){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (2)].c));
	(yyval.d) = 0.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	(yyval.d) = (gmsh_yysymbols[(yyvsp[(1) - (2)].c)][0] += (yyvsp[(2) - (2)].i));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Free((yyvsp[(1) - (2)].c));