Skip to content
Snippets Groups Projects
Gmsh.tab.cpp 280 KiB
Newer Older
	    if(!v)
	      yymsg(WARNING, "Unknown point %d", j);
	    else
	      List_Add(s->TrsfPoints, &v);
	  }
	}
      }
      List_Delete((yyvsp[-2].l));
      Free((yyvsp[-1].c));
    ;}
    break;

  case 195:
#line 2486 "Gmsh.y"
    {
      Surface *s = FindSurface((int)(yyvsp[-4].d), THEM);
	yymsg(WARNING, "Unknown surface %d", (int)(yyvsp[-4].d));
        int k = List_Nbr((yyvsp[-1].l));
	  yymsg(GERROR, "Wrong definition of Elliptic Surface %d: "
		"%d points instead of 4" , (int)(yyvsp[-4].d), k);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  List_Reset(s->TrsfPoints);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  for(int i = 0; i < k; i++){
	    double d;
	    List_Read((yyvsp[-1].l), i, &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    int j = (int)fabs(d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    Vertex *v = FindPoint(j, THEM);
	    if(!v)
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	      yymsg(WARNING, "Unknown point %d", j);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    else
	      List_Add(s->TrsfPoints, &v);
      List_Delete((yyvsp[-1].l));
    ;}
    break;

  case 196:
#line 2513 "Gmsh.y"
    {
      Volume *v = FindVolume((int)(yyvsp[-4].d), THEM);
	yymsg(WARNING, "Unknown volume %d", (int)(yyvsp[-4].d));
	int k = List_Nbr((yyvsp[-1].l));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	if(k != 6 && k != 8)
	  yymsg(GERROR, "Wrong definition of Transfinite Volume %d: "
		"%d points instead of 6 or 8" , (int)(yyvsp[-4].d), k);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  List_Reset(v->TrsfPoints);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  for(int i = 0; i < k; i++){
	    double d;
	    List_Read((yyvsp[-1].l), i, &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    int j = (int)fabs(d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    Vertex *vert = FindPoint(j, THEM);
	    if(!vert)
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	      yymsg(WARNING, "Unknown point %d", j);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    else
	      List_Add(v->TrsfPoints, &vert);
      List_Delete((yyvsp[-1].l));
    ;}
    break;

  case 197:
#line 2540 "Gmsh.y"
    {
      for(int i = 0; i < List_Nbr((yyvsp[-3].l)); i++){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	double d;
	List_Read((yyvsp[-3].l), i, &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	int j = (int)d;
	Surface *s = FindSurface(j, THEM);
	  s->RecombineAngle = ((yyvsp[-1].d) > 0 && (yyvsp[-1].d) < 90) ? (yyvsp[-1].d) : 90;
      List_Delete((yyvsp[-3].l));
    ;}
    break;

  case 198:
#line 2554 "Gmsh.y"
    {
      for(int i = 0; i < List_Nbr((yyvsp[-1].l)); i++){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	double d;
	List_Read((yyvsp[-1].l), i, &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	int j = (int)d;
        Surface *s = FindSurface(j, THEM);
      List_Delete((yyvsp[-1].l));
    ;}
    break;

  case 199:
#line 2573 "Gmsh.y"
    { 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      ReplaceAllDuplicates(THEM);
    ;}
    break;

  case 200:
#line 2577 "Gmsh.y"
    { 
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      IntersectAllSegmentsTogether();
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 2586 "Gmsh.y"
    { (yyval.d) = (yyvsp[0].d);           ;}
    break;

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

  case 203:
#line 2588 "Gmsh.y"
    { (yyval.d) = -(yyvsp[0].d);          ;}
    break;

  case 204:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 2589 "Gmsh.y"
    { (yyval.d) = (yyvsp[0].d);           ;}
    break;

  case 205:
#line 2590 "Gmsh.y"
    { (yyval.d) = !(yyvsp[0].d);          ;}
    break;

  case 206:
#line 2591 "Gmsh.y"
    { (yyval.d) = (yyvsp[-2].d) - (yyvsp[0].d);      ;}
    break;

  case 207:
#line 2592 "Gmsh.y"
    { (yyval.d) = (yyvsp[-2].d) + (yyvsp[0].d);      ;}
    break;

  case 208:
#line 2593 "Gmsh.y"
    { (yyval.d) = (yyvsp[-2].d) * (yyvsp[0].d);      ;}
    break;

  case 209:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 2595 "Gmsh.y"
    { 
      if(!(yyvsp[0].d))
	yymsg(GERROR, "Division by zero in '%g / %g'", (yyvsp[-2].d), (yyvsp[0].d));
      else
	(yyval.d) = (yyvsp[-2].d) / (yyvsp[0].d);     
    ;}
    break;

  case 210:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 2601 "Gmsh.y"
    { (yyval.d) = (int)(yyvsp[-2].d) % (int)(yyvsp[0].d);  ;}
    break;

  case 211:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 2602 "Gmsh.y"
    { (yyval.d) = pow((yyvsp[-2].d), (yyvsp[0].d));  ;}
    break;

  case 212:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 2603 "Gmsh.y"
    { (yyval.d) = (yyvsp[-2].d) < (yyvsp[0].d);      ;}
    break;

  case 213:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 2604 "Gmsh.y"
    { (yyval.d) = (yyvsp[-2].d) > (yyvsp[0].d);      ;}
    break;

  case 214:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 2605 "Gmsh.y"
    { (yyval.d) = (yyvsp[-2].d) <= (yyvsp[0].d);     ;}
    break;

  case 215:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 2606 "Gmsh.y"
    { (yyval.d) = (yyvsp[-2].d) >= (yyvsp[0].d);     ;}
    break;

  case 216:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 2607 "Gmsh.y"
    { (yyval.d) = (yyvsp[-2].d) == (yyvsp[0].d);     ;}
    break;

  case 217:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 2608 "Gmsh.y"
    { (yyval.d) = (yyvsp[-2].d) != (yyvsp[0].d);     ;}
    break;

  case 218:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 2609 "Gmsh.y"
    { (yyval.d) = (yyvsp[-2].d) && (yyvsp[0].d);     ;}
    break;

  case 219:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 2610 "Gmsh.y"
    { (yyval.d) = (yyvsp[-2].d) || (yyvsp[0].d);     ;}
    break;

  case 220:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 2611 "Gmsh.y"
    { (yyval.d) = (yyvsp[-4].d)? (yyvsp[-2].d) : (yyvsp[0].d);  ;}
    break;

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

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

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

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

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

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

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

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

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

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

  case 231:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 2622 "Gmsh.y"
    { (yyval.d) = atan2((yyvsp[-3].d), (yyvsp[-1].d));;}
    break;

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

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

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

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

  case 236:
#line 2627 "Gmsh.y"
    { (yyval.d) = floor((yyvsp[-1].d));    ;}
    break;

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

  case 238:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 2629 "Gmsh.y"
    { (yyval.d) = fmod((yyvsp[-3].d), (yyvsp[-1].d)); ;}
    break;

  case 239:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 2630 "Gmsh.y"
    { (yyval.d) = fmod((yyvsp[-3].d), (yyvsp[-1].d)); ;}
    break;

  case 240:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 2631 "Gmsh.y"
    { (yyval.d) = sqrt((yyvsp[-3].d)*(yyvsp[-3].d)+(yyvsp[-1].d)*(yyvsp[-1].d)); ;}
    break;

  case 241:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 2632 "Gmsh.y"
    { (yyval.d) = (yyvsp[-1].d)*(double)rand()/(double)RAND_MAX; ;}
    break;

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

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

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

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

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

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

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

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

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

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

  case 252:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 2644 "Gmsh.y"
    { (yyval.d) = atan2((yyvsp[-3].d), (yyvsp[-1].d));;}
    break;

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

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

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

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

  case 257:
#line 2649 "Gmsh.y"
    { (yyval.d) = floor((yyvsp[-1].d));    ;}
    break;

  case 258:
#line 2650 "Gmsh.y"
    { (yyval.d) = ceil((yyvsp[-1].d));     ;}
    break;

  case 259:
#line 2651 "Gmsh.y"
    { (yyval.d) = fmod((yyvsp[-3].d), (yyvsp[-1].d)); ;}
    break;

  case 260:
#line 2652 "Gmsh.y"
    { (yyval.d) = fmod((yyvsp[-3].d), (yyvsp[-1].d)); ;}
    break;

  case 261:
#line 2653 "Gmsh.y"
    { (yyval.d) = sqrt((yyvsp[-3].d)*(yyvsp[-3].d)+(yyvsp[-1].d)*(yyvsp[-1].d)); ;}
    break;

  case 262:
#line 2654 "Gmsh.y"
    { (yyval.d) = (yyvsp[-1].d)*(double)rand()/(double)RAND_MAX; ;}
    break;

  case 263:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 2663 "Gmsh.y"
    { (yyval.d) = (yyvsp[0].d); ;}
    break;

  case 264:
#line 2664 "Gmsh.y"
    { (yyval.d) = 3.141592653589793; ;}
    break;

  case 265:
#line 2665 "Gmsh.y"
    { (yyval.d) = ParUtil::Instance()->rank(); ;}
    break;

  case 266:
#line 2666 "Gmsh.y"
    { (yyval.d) = ParUtil::Instance()->size(); ;}
    break;

  case 267:
#line 2667 "Gmsh.y"
    { (yyval.d) = GMSH_MAJOR_VERSION; ;}
    break;

  case 268:
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 2668 "Gmsh.y"
    { (yyval.d) = GMSH_MINOR_VERSION; ;}
    break;

  case 269:
#line 2669 "Gmsh.y"
    { (yyval.d) = GMSH_PATCH_VERSION; ;}
    break;

  case 270:
#line 2674 "Gmsh.y"
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol TheSymbol;
      TheSymbol.Name = (yyvsp[0].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol *pSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))) {
	yymsg(GERROR, "Unknown variable '%s'", (yyvsp[0].c));
	(yyval.d) = 0.;
	(yyval.d) = *(double*)List_Pointer_Fast(pSymbol->val, 0);
      Free((yyvsp[0].c));
    ;}
    break;

  case 271:
#line 2687 "Gmsh.y"
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol TheSymbol;
      TheSymbol.Name = (yyvsp[-3].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol *pSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))) {
	yymsg(GERROR, "Unknown variable '%s'", (yyvsp[-3].c));
	(yyval.d) = 0.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	double *pd;
	if((pd = (double*)List_Pointer_Test(pSymbol->val, (int)(yyvsp[-1].d))))
	  (yyval.d) = *pd;
	  yymsg(GERROR, "Uninitialized variable '%s[%d]'", (yyvsp[-3].c), (int)(yyvsp[-1].d));
	  (yyval.d) = 0.;
      Free((yyvsp[-3].c));
    ;}
    break;

  case 272:
#line 2707 "Gmsh.y"
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol TheSymbol;
      TheSymbol.Name = (yyvsp[-2].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol *pSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))) {
	yymsg(GERROR, "Unknown variable '%s'", (yyvsp[-2].c));
	(yyval.d) = 0.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
      else{
	(yyval.d) = List_Nbr(pSymbol->val);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
      Free((yyvsp[-2].c));
    ;}
    break;

  case 273:
#line 2721 "Gmsh.y"
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol TheSymbol;
      TheSymbol.Name = (yyvsp[-1].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol *pSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))) {
	yymsg(GERROR, "Unknown variable '%s'", (yyvsp[-1].c));
	(yyval.d) = 0.;
	(yyval.d) = (*(double*)List_Pointer_Fast(pSymbol->val, 0) += (yyvsp[0].i));
      Free((yyvsp[-1].c));
    ;}
    break;

  case 274:
#line 2734 "Gmsh.y"
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol TheSymbol;
      TheSymbol.Name = (yyvsp[-4].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol *pSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))) {
	yymsg(GERROR, "Unknown variable '%s'", (yyvsp[-4].c));
	(yyval.d) = 0.;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	double *pd;
	if((pd = (double*)List_Pointer_Test(pSymbol->val, (int)(yyvsp[-2].d))))
	  (yyval.d) = (*pd += (yyvsp[0].i));
	  yymsg(GERROR, "Uninitialized variable '%s[%d]'", (yyvsp[-4].c), (int)(yyvsp[-2].d));
	  (yyval.d) = 0.;
      Free((yyvsp[-4].c));
    ;}
    break;

  case 275:
#line 2757 "Gmsh.y"
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      double (*pNumOpt)(int num, int action, double value);
      StringXNumber *pNumCat;
      if(!(pNumCat = Get_NumberOptionCategory((yyvsp[-2].c)))){
	yymsg(GERROR, "Unknown numeric option class '%s'", (yyvsp[-2].c));
	(yyval.d) = 0.;
	if(!(pNumOpt =  (double (*) (int, int, double))Get_NumberOption((yyvsp[0].c), pNumCat))){
	  yymsg(GERROR, "Unknown numeric option '%s.%s'", (yyvsp[-2].c), (yyvsp[0].c));
	  (yyval.d) = 0.;
	  (yyval.d) = pNumOpt(0, GMSH_GET, 0);
      Free((yyvsp[-2].c)); Free((yyvsp[0].c));
    ;}
    break;

  case 276:
#line 2775 "Gmsh.y"
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      double (*pNumOpt)(int num, int action, double value);
      StringXNumber *pNumCat;
      if(!(pNumCat = Get_NumberOptionCategory((yyvsp[-5].c)))){
	yymsg(GERROR, "Unknown numeric option class '%s'", (yyvsp[-5].c));
	(yyval.d) = 0.;
	if(!(pNumOpt =  (double (*) (int, int, double))Get_NumberOption((yyvsp[0].c), pNumCat))){
	  yymsg(GERROR, "Unknown numeric option '%s[%d].%s'", (yyvsp[-5].c), (int)(yyvsp[-3].d), (yyvsp[0].c));
	  (yyval.d) = 0.;
	  (yyval.d) = pNumOpt((int)(yyvsp[-3].d), GMSH_GET, 0);
      Free((yyvsp[-5].c)); Free((yyvsp[0].c));
    ;}
    break;

  case 277:
#line 2793 "Gmsh.y"
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      double (*pNumOpt)(int num, int action, double value);
      StringXNumber *pNumCat;
      if(!(pNumCat = Get_NumberOptionCategory((yyvsp[-3].c)))){
	yymsg(GERROR, "Unknown numeric option class '%s'", (yyvsp[-3].c));
	(yyval.d) = 0.;
	if(!(pNumOpt =  (double (*) (int, int, double))Get_NumberOption((yyvsp[-1].c), pNumCat))){
	  yymsg(GERROR, "Unknown numeric option '%s.%s'", (yyvsp[-3].c), (yyvsp[-1].c));
	  (yyval.d) = 0.;
	  (yyval.d) = pNumOpt(0, GMSH_SET|GMSH_GUI, pNumOpt(0, GMSH_GET, 0)+(yyvsp[0].i));
      Free((yyvsp[-3].c)); Free((yyvsp[-1].c));
    ;}
    break;

  case 278:
#line 2811 "Gmsh.y"
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      double (*pNumOpt)(int num, int action, double value);
      StringXNumber *pNumCat;
      if(!(pNumCat = Get_NumberOptionCategory((yyvsp[-6].c)))){
	yymsg(GERROR, "Unknown numeric option class '%s'", (yyvsp[-6].c));
	(yyval.d) = 0.;
	if(!(pNumOpt =  (double (*) (int, int, double))Get_NumberOption((yyvsp[-1].c), pNumCat))){
	  yymsg(GERROR, "Unknown numeric option '%s[%d].%s'", (yyvsp[-6].c), (int)(yyvsp[-4].d), (yyvsp[-1].c));
	  (yyval.d) = 0.;
	  (yyval.d) = pNumOpt((int)(yyvsp[-4].d), GMSH_SET|GMSH_GUI, pNumOpt((int)(yyvsp[-4].d), GMSH_GET, 0)+(yyvsp[0].i));
      }
      Free((yyvsp[-6].c)); Free((yyvsp[-1].c));
    ;}
    break;

  case 279:
#line 2829 "Gmsh.y"
    { 
      (yyval.d) = GetValue((yyvsp[-3].c), (yyvsp[-1].d));
      Free((yyvsp[-3].c));
    ;}
    break;

  case 280:
#line 2837 "Gmsh.y"
    {
      memcpy((yyval.v), (yyvsp[0].v), 5*sizeof(double));
    ;}
    break;

  case 281:
#line 2841 "Gmsh.y"
    {
      for(int i = 0; i < 5; i++) (yyval.v)[i] = -(yyvsp[0].v)[i];
    ;}
    break;

  case 282:
#line 2845 "Gmsh.y"
    { 
      for(int i = 0; i < 5; i++) (yyval.v)[i] = (yyvsp[0].v)[i];
    ;}
    break;

  case 283:
#line 2849 "Gmsh.y"
    { 
      for(int i = 0; i < 5; i++) (yyval.v)[i] = (yyvsp[-2].v)[i] - (yyvsp[0].v)[i];
    ;}
    break;

  case 284:
#line 2853 "Gmsh.y"
    {
      for(int i = 0; i < 5; i++) (yyval.v)[i] = (yyvsp[-2].v)[i] + (yyvsp[0].v)[i];
    ;}
    break;

  case 285:
#line 2860 "Gmsh.y"
    { 
      (yyval.v)[0] = (yyvsp[-9].d);  (yyval.v)[1] = (yyvsp[-7].d);  (yyval.v)[2] = (yyvsp[-5].d);  (yyval.v)[3] = (yyvsp[-3].d); (yyval.v)[4] = (yyvsp[-1].d);
    ;}
    break;

  case 286:
#line 2864 "Gmsh.y"
    { 
      (yyval.v)[0] = (yyvsp[-7].d);  (yyval.v)[1] = (yyvsp[-5].d);  (yyval.v)[2] = (yyvsp[-3].d);  (yyval.v)[3] = (yyvsp[-1].d); (yyval.v)[4] = 1.0;
    ;}
    break;

  case 287:
#line 2868 "Gmsh.y"
    {
      (yyval.v)[0] = (yyvsp[-5].d);  (yyval.v)[1] = (yyvsp[-3].d);  (yyval.v)[2] = (yyvsp[-1].d);  (yyval.v)[3] = 0.0; (yyval.v)[4] = 1.0;
    ;}
    break;

  case 288:
#line 2872 "Gmsh.y"
    {
      (yyval.v)[0] = (yyvsp[-5].d);  (yyval.v)[1] = (yyvsp[-3].d);  (yyval.v)[2] = (yyvsp[-1].d);  (yyval.v)[3] = 0.0; (yyval.v)[4] = 1.0;
    ;}
    break;

  case 289:
#line 2879 "Gmsh.y"
    {
    ;}
    break;

  case 290:
#line 2882 "Gmsh.y"
    {
       (yyval.l) = (yyvsp[-1].l);
    ;}
    break;

  case 291:
#line 2886 "Gmsh.y"
    {
       (yyval.l) = (yyvsp[-1].l);
    ;}
    break;

  case 292:
#line 2893 "Gmsh.y"
    {
      (yyval.l) = List_Create(2, 1, sizeof(List_T*));
      List_Add((yyval.l), &((yyvsp[0].l)));
    ;}
    break;

  case 293:
#line 2898 "Gmsh.y"
    {
      List_Add((yyval.l), &((yyvsp[0].l)));
    ;}
    break;

  case 294:
#line 2906 "Gmsh.y"
    {
      (yyval.l) = List_Create(2, 1, sizeof(double));
      List_Add((yyval.l), &((yyvsp[0].d)));
    ;}
    break;

  case 295:
#line 2911 "Gmsh.y"
    {
      (yyval.l) = (yyvsp[0].l);
    ;}
    break;

  case 296:
#line 2915 "Gmsh.y"
    {
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      // creates an empty list
      (yyval.l) = List_Create(2, 1, sizeof(double));
    ;}
    break;

  case 297:
#line 2920 "Gmsh.y"
    {
      (yyval.l) = (yyvsp[-1].l);
    ;}
    break;

  case 298:
#line 2924 "Gmsh.y"
    {
      (yyval.l) = (yyvsp[-1].l);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      double *pd;
      for(int i = 0; i < List_Nbr((yyval.l)); i++){
	pd = (double*)List_Pointer((yyval.l), i);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	(*pd) = - (*pd);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
#line 2936 "Gmsh.y"
    { 
      (yyval.l) = List_Create(2, 1, sizeof(double)); 
      for(double d = (yyvsp[-2].d); ((yyvsp[-2].d) < (yyvsp[0].d)) ? (d <= (yyvsp[0].d)) : (d >= (yyvsp[0].d)); ((yyvsp[-2].d) < (yyvsp[0].d)) ? (d += 1.) : (d -= 1.)) 
	List_Add((yyval.l), &d);
    ;}
    break;

  case 300:
#line 2942 "Gmsh.y"
    {
      (yyval.l) = List_Create(2, 1, sizeof(double)); 
      if(!(yyvsp[0].d) || ((yyvsp[-4].d) < (yyvsp[-2].d) && (yyvsp[0].d) < 0) || ((yyvsp[-4].d) > (yyvsp[-2].d) && (yyvsp[0].d) > 0)){
        yymsg(GERROR, "Wrong increment in '%g:%g:%g'", (yyvsp[-4].d), (yyvsp[-2].d), (yyvsp[0].d));
	List_Add((yyval.l), &((yyvsp[-4].d)));
	for(double d = (yyvsp[-4].d); ((yyvsp[0].d) > 0) ? (d <= (yyvsp[-2].d)) : (d >= (yyvsp[-2].d)); d += (yyvsp[0].d))
	  List_Add((yyval.l), &d);
   ;}
    break;

  case 301:
#line 2953 "Gmsh.y"
    {
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
      Vertex *v = FindPoint((int)(yyvsp[-1].d), THEM);
      (yyval.l) = List_Create(3, 1, sizeof(double));      
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!v) {
	yymsg(GERROR, "Unknown point '%d'", (int) (yyvsp[-1].d));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	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);
      }
    ;}
    break;

  case 302:
#line 2973 "Gmsh.y"
    {
      (yyval.l) = List_Create(List_Nbr((yyvsp[0].l)), 1, sizeof(double));
      for(int i = 0; i < List_Nbr((yyvsp[0].l)); i++){
	Shape *s = (Shape*) List_Pointer((yyvsp[0].l), i);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	double d = s->Num;
	List_Add((yyval.l), &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
      List_Delete((yyvsp[0].l));
    ;}
    break;

  case 303:
#line 2983 "Gmsh.y"
    {
      (yyval.l) = List_Create(List_Nbr((yyvsp[0].l)), 1, sizeof(double));
      for(int i = 0; i < List_Nbr((yyvsp[0].l)); i++){
	Shape *s = (Shape*) List_Pointer((yyvsp[0].l), i);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	double d = s->Num;
	List_Add((yyval.l), &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
      List_Delete((yyvsp[0].l));
    ;}
    break;

  case 304:
#line 2993 "Gmsh.y"
    {
      (yyval.l) = List_Create(List_Nbr((yyvsp[0].l)), 1, sizeof(double));
      for(int i = 0; i < List_Nbr((yyvsp[0].l)); i++){
	Shape *s = (Shape*) List_Pointer((yyvsp[0].l), i);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	double d = s->Num;
	List_Add((yyval.l), &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      }
      List_Delete((yyvsp[0].l));
    ;}
    break;

  case 305:
#line 3003 "Gmsh.y"
    {
      (yyval.l) = List_Create(2, 1, sizeof(double));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol TheSymbol;
      TheSymbol.Name = (yyvsp[-2].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol *pSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))) {
	yymsg(GERROR, "Unknown variable '%s'", (yyvsp[-2].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	double d = 0.0;
	List_Add((yyval.l), &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	for(int i = 0; i < List_Nbr(pSymbol->val); i++)
	  List_Add((yyval.l), (double*)List_Pointer_Fast(pSymbol->val, i));
      Free((yyvsp[-2].c));
    ;}
    break;

  case 306:
#line 3020 "Gmsh.y"
    {
      (yyval.l) = List_Create(2, 1, sizeof(double));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol TheSymbol;
      TheSymbol.Name = (yyvsp[-2].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol *pSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))) {
	yymsg(GERROR, "Unknown variable '%s'", (yyvsp[-2].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	double d = 0.0;
	List_Add((yyval.l), &d);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	for(int i = 0; i < List_Nbr(pSymbol->val); i++){
	  double d = - *(double*)List_Pointer_Fast(pSymbol->val, i);
	  List_Add((yyval.l), &d);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
	}
      Free((yyvsp[-2].c));
    ;}
    break;

  case 307:
#line 3039 "Gmsh.y"
    {
      (yyval.l) = List_Create(2, 1, sizeof(double));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol TheSymbol;
      TheSymbol.Name = (yyvsp[-5].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol *pSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))) {
	yymsg(GERROR, "Unknown variable '%s'", (yyvsp[-5].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	double d = 0.0;
	List_Add((yyval.l), &d);
	for(int i = 0; i < List_Nbr((yyvsp[-2].l)); i++){
	  int j = (int)(*(double*)List_Pointer_Fast((yyvsp[-2].l), i));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  double *pd;
	  if((pd = (double*)List_Pointer_Test(pSymbol->val, j)))
	    List_Add((yyval.l), pd);
	    yymsg(GERROR, "Uninitialized variable '%s[%d]'", (yyvsp[-5].c), j);	  
      Free((yyvsp[-5].c));
      List_Delete((yyvsp[-2].l));
    ;}
    break;

  case 308:
#line 3063 "Gmsh.y"
    {
      (yyval.l) = List_Create(2, 1, sizeof(double));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol TheSymbol;
      TheSymbol.Name = (yyvsp[-5].c);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      Symbol *pSymbol;
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
      if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))) {
	yymsg(GERROR, "Unknown variable '%s'", (yyvsp[-5].c));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	double d = 0.0;
	List_Add((yyval.l), &d);
	for(int i = 0; i < List_Nbr((yyvsp[-2].l)); i++){
	  int j = (int)(*(double*)List_Pointer_Fast((yyvsp[-2].l), i));
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	  double *pd;
	  if((pd = (double*)List_Pointer_Test(pSymbol->val, j))){
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
	    double d = - *pd;
	    List_Add((yyval.l), &d);
	    yymsg(GERROR, "Uninitialized variable '%s[%d]'", (yyvsp[-5].c), j);	  
      Free((yyvsp[-5].c));
      List_Delete((yyvsp[-2].l));
    ;}
    break;

  case 309:
#line 3092 "Gmsh.y"
    {
      (yyval.l) = List_Create(2, 1, sizeof(double));
      List_Add((yyval.l), &((yyvsp[0].d)));
    ;}
    break;

  case 310:
#line 3097 "Gmsh.y"
    {
      (yyval.l) = (yyvsp[0].l);
    ;}
    break;

  case 311:
#line 3101 "Gmsh.y"
    {
      List_Add((yyval.l), &((yyvsp[0].d)));
    ;}
    break;