Newer
Older

Christophe Geuzaine
committed
if(!gmsh_yysymbols.count(name))
yymsg(0, "Unknown loop variable");
else{
gmsh_yysymbols[name][0] += step;
LoopControlVariablesTab[ImbricatedLoop - 1][0] = gmsh_yysymbols[name][0];
}
}
else{
LoopControlVariablesTab[ImbricatedLoop - 1][0] += step;
}
double x0 = LoopControlVariablesTab[ImbricatedLoop - 1][0];
double x1 = LoopControlVariablesTab[ImbricatedLoop - 1][1];

Christophe Geuzaine
committed
if((step > 0. && x0 <= x1) || (step < 0. && x0 >= x1)){
fsetpos(gmsh_yyin, &yyposImbricatedLoopsTab[ImbricatedLoop - 1]);
gmsh_yylineno = yylinenoImbricatedLoopsTab[ImbricatedLoop - 1];
}
else
ImbricatedLoop--;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2574 "Gmsh.y"
if(!FunctionManager::Instance()->createFunction
((yyvsp[(2) - (2)].c), gmsh_yyin, gmsh_yyname, gmsh_yylineno))
yymsg(0, "Redefinition of function %s", (yyvsp[(2) - (2)].c));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2582 "Gmsh.y"
if(!FunctionManager::Instance()->leaveFunction
(&gmsh_yyin, gmsh_yyname, gmsh_yylineno))
yymsg(0, "Error while exiting function");

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2588 "Gmsh.y"
if(!FunctionManager::Instance()->enterFunction
((yyvsp[(2) - (3)].c), &gmsh_yyin, gmsh_yyname, gmsh_yylineno))
yymsg(0, "Unknown function %s", (yyvsp[(2) - (3)].c));
//FIXME: wee leak $2

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2595 "Gmsh.y"
{
if(!(yyvsp[(3) - (4)].d)) skip_until("If", "EndIf");
;}
break;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2599 "Gmsh.y"

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2608 "Gmsh.y"
{
(yyval.l) = List_Create(2, 1, sizeof(Shape));
ExtrudeShapes(TRANSLATE, (yyvsp[(4) - (5)].l),
(yyvsp[(2) - (5)].v)[0], (yyvsp[(2) - (5)].v)[1], (yyvsp[(2) - (5)].v)[2], 0., 0., 0., 0., 0., 0., 0.,
NULL, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2616 "Gmsh.y"
{
(yyval.l) = List_Create(2, 1, sizeof(Shape));
ExtrudeShapes(ROTATE, (yyvsp[(10) - (11)].l),
0., 0., 0., (yyvsp[(3) - (11)].v)[0], (yyvsp[(3) - (11)].v)[1], (yyvsp[(3) - (11)].v)[2], (yyvsp[(5) - (11)].v)[0], (yyvsp[(5) - (11)].v)[1], (yyvsp[(5) - (11)].v)[2], (yyvsp[(7) - (11)].d),
NULL, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2624 "Gmsh.y"
{
(yyval.l) = List_Create(2, 1, sizeof(Shape));
ExtrudeShapes(TRANSLATE_ROTATE, (yyvsp[(12) - (13)].l),
(yyvsp[(3) - (13)].v)[0], (yyvsp[(3) - (13)].v)[1], (yyvsp[(3) - (13)].v)[2], (yyvsp[(5) - (13)].v)[0], (yyvsp[(5) - (13)].v)[1], (yyvsp[(5) - (13)].v)[2], (yyvsp[(7) - (13)].v)[0], (yyvsp[(7) - (13)].v)[1], (yyvsp[(7) - (13)].v)[2], (yyvsp[(9) - (13)].d),
NULL, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2632 "Gmsh.y"

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2637 "Gmsh.y"
{
(yyval.l) = List_Create(2, 1, sizeof(Shape));
ExtrudeShapes(TRANSLATE, (yyvsp[(4) - (7)].l),
(yyvsp[(2) - (7)].v)[0], (yyvsp[(2) - (7)].v)[1], (yyvsp[(2) - (7)].v)[2], 0., 0., 0., 0., 0., 0., 0.,
&extr, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2645 "Gmsh.y"

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2650 "Gmsh.y"
{
(yyval.l) = List_Create(2, 1, sizeof(Shape));
ExtrudeShapes(ROTATE, (yyvsp[(10) - (13)].l),
0., 0., 0., (yyvsp[(3) - (13)].v)[0], (yyvsp[(3) - (13)].v)[1], (yyvsp[(3) - (13)].v)[2], (yyvsp[(5) - (13)].v)[0], (yyvsp[(5) - (13)].v)[1], (yyvsp[(5) - (13)].v)[2], (yyvsp[(7) - (13)].d),
&extr, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2658 "Gmsh.y"

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2663 "Gmsh.y"
{
(yyval.l) = List_Create(2, 1, sizeof(Shape));
ExtrudeShapes(TRANSLATE_ROTATE, (yyvsp[(12) - (15)].l),
(yyvsp[(3) - (15)].v)[0], (yyvsp[(3) - (15)].v)[1], (yyvsp[(3) - (15)].v)[2], (yyvsp[(5) - (15)].v)[0], (yyvsp[(5) - (15)].v)[1], (yyvsp[(5) - (15)].v)[2], (yyvsp[(7) - (15)].v)[0], (yyvsp[(7) - (15)].v)[1], (yyvsp[(7) - (15)].v)[2], (yyvsp[(9) - (15)].d),
&extr, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2671 "Gmsh.y"

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2676 "Gmsh.y"

Christophe Geuzaine
committed
{
(yyval.l) = List_Create(2, 1, sizeof(Shape));
ExtrudeShapes(BOUNDARY_LAYER, (yyvsp[(3) - (6)].l), 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,

Christophe Geuzaine
committed
&extr, (yyval.l));

Christophe Geuzaine
committed
;}
break;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2684 "Gmsh.y"

Christophe Geuzaine
committed
(yyval.l) = List_Create(2, 1, sizeof(Shape));
ExtrudeShape(TRANSLATE, MSH_POINT, (int)(yyvsp[(4) - (8)].d),
(yyvsp[(6) - (8)].v)[0], (yyvsp[(6) - (8)].v)[1], (yyvsp[(6) - (8)].v)[2], 0., 0., 0., 0., 0., 0., 0.,
NULL, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2691 "Gmsh.y"

Christophe Geuzaine
committed
ExtrudeShape(TRANSLATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (8)].d),
(yyvsp[(6) - (8)].v)[0], (yyvsp[(6) - (8)].v)[1], (yyvsp[(6) - (8)].v)[2], 0., 0., 0., 0., 0., 0., 0.,
NULL, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2698 "Gmsh.y"

Christophe Geuzaine
committed
ExtrudeShape(TRANSLATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (8)].d),
(yyvsp[(6) - (8)].v)[0], (yyvsp[(6) - (8)].v)[1], (yyvsp[(6) - (8)].v)[2], 0., 0., 0., 0., 0., 0., 0.,
NULL, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2705 "Gmsh.y"

Christophe Geuzaine
committed
ExtrudeShape(ROTATE, MSH_POINT, (int)(yyvsp[(4) - (12)].d),
0., 0., 0., (yyvsp[(6) - (12)].v)[0], (yyvsp[(6) - (12)].v)[1], (yyvsp[(6) - (12)].v)[2], (yyvsp[(8) - (12)].v)[0], (yyvsp[(8) - (12)].v)[1], (yyvsp[(8) - (12)].v)[2], (yyvsp[(10) - (12)].d),
NULL, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2712 "Gmsh.y"

Christophe Geuzaine
committed
ExtrudeShape(ROTATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (12)].d),
0., 0., 0., (yyvsp[(6) - (12)].v)[0], (yyvsp[(6) - (12)].v)[1], (yyvsp[(6) - (12)].v)[2], (yyvsp[(8) - (12)].v)[0], (yyvsp[(8) - (12)].v)[1], (yyvsp[(8) - (12)].v)[2], (yyvsp[(10) - (12)].d),
NULL, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2719 "Gmsh.y"

Christophe Geuzaine
committed
ExtrudeShape(ROTATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (12)].d),
0., 0., 0., (yyvsp[(6) - (12)].v)[0], (yyvsp[(6) - (12)].v)[1], (yyvsp[(6) - (12)].v)[2], (yyvsp[(8) - (12)].v)[0], (yyvsp[(8) - (12)].v)[1], (yyvsp[(8) - (12)].v)[2], (yyvsp[(10) - (12)].d),
NULL, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2726 "Gmsh.y"

Christophe Geuzaine
committed
ExtrudeShape(TRANSLATE_ROTATE, MSH_POINT, (int)(yyvsp[(4) - (14)].d),
(yyvsp[(6) - (14)].v)[0], (yyvsp[(6) - (14)].v)[1], (yyvsp[(6) - (14)].v)[2], (yyvsp[(8) - (14)].v)[0], (yyvsp[(8) - (14)].v)[1], (yyvsp[(8) - (14)].v)[2], (yyvsp[(10) - (14)].v)[0], (yyvsp[(10) - (14)].v)[1], (yyvsp[(10) - (14)].v)[2], (yyvsp[(12) - (14)].d),
NULL, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2733 "Gmsh.y"

Christophe Geuzaine
committed
ExtrudeShape(TRANSLATE_ROTATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (14)].d),
(yyvsp[(6) - (14)].v)[0], (yyvsp[(6) - (14)].v)[1], (yyvsp[(6) - (14)].v)[2], (yyvsp[(8) - (14)].v)[0], (yyvsp[(8) - (14)].v)[1], (yyvsp[(8) - (14)].v)[2], (yyvsp[(10) - (14)].v)[0], (yyvsp[(10) - (14)].v)[1], (yyvsp[(10) - (14)].v)[2], (yyvsp[(12) - (14)].d),
NULL, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2740 "Gmsh.y"

Christophe Geuzaine
committed
ExtrudeShape(TRANSLATE_ROTATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (14)].d),
(yyvsp[(6) - (14)].v)[0], (yyvsp[(6) - (14)].v)[1], (yyvsp[(6) - (14)].v)[2], (yyvsp[(8) - (14)].v)[0], (yyvsp[(8) - (14)].v)[1], (yyvsp[(8) - (14)].v)[2], (yyvsp[(10) - (14)].v)[0], (yyvsp[(10) - (14)].v)[1], (yyvsp[(10) - (14)].v)[2], (yyvsp[(12) - (14)].d),
NULL, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2747 "Gmsh.y"

Christophe Geuzaine
committed
extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false;

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2752 "Gmsh.y"

Christophe Geuzaine
committed
ExtrudeShape(TRANSLATE, MSH_POINT, (int)(yyvsp[(4) - (12)].d),
(yyvsp[(6) - (12)].v)[0], (yyvsp[(6) - (12)].v)[1], (yyvsp[(6) - (12)].v)[2], 0., 0., 0., 0., 0., 0., 0.,
&extr, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2759 "Gmsh.y"

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2764 "Gmsh.y"

Christophe Geuzaine
committed
ExtrudeShape(TRANSLATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (12)].d),
(yyvsp[(6) - (12)].v)[0], (yyvsp[(6) - (12)].v)[1], (yyvsp[(6) - (12)].v)[2], 0., 0., 0., 0., 0., 0., 0.,
&extr, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2771 "Gmsh.y"

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2776 "Gmsh.y"

Christophe Geuzaine
committed
ExtrudeShape(TRANSLATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (12)].d),
(yyvsp[(6) - (12)].v)[0], (yyvsp[(6) - (12)].v)[1], (yyvsp[(6) - (12)].v)[2], 0., 0., 0., 0., 0., 0., 0.,
&extr, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2783 "Gmsh.y"

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2788 "Gmsh.y"

Christophe Geuzaine
committed
ExtrudeShape(ROTATE, MSH_POINT, (int)(yyvsp[(4) - (16)].d),
0., 0., 0., (yyvsp[(6) - (16)].v)[0], (yyvsp[(6) - (16)].v)[1], (yyvsp[(6) - (16)].v)[2], (yyvsp[(8) - (16)].v)[0], (yyvsp[(8) - (16)].v)[1], (yyvsp[(8) - (16)].v)[2], (yyvsp[(10) - (16)].d),
&extr, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2795 "Gmsh.y"

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2800 "Gmsh.y"

Christophe Geuzaine
committed
ExtrudeShape(ROTATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (16)].d),
0., 0., 0., (yyvsp[(6) - (16)].v)[0], (yyvsp[(6) - (16)].v)[1], (yyvsp[(6) - (16)].v)[2], (yyvsp[(8) - (16)].v)[0], (yyvsp[(8) - (16)].v)[1], (yyvsp[(8) - (16)].v)[2], (yyvsp[(10) - (16)].d),
&extr, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2807 "Gmsh.y"

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2812 "Gmsh.y"

Christophe Geuzaine
committed
ExtrudeShape(ROTATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (16)].d),
0., 0., 0., (yyvsp[(6) - (16)].v)[0], (yyvsp[(6) - (16)].v)[1], (yyvsp[(6) - (16)].v)[2], (yyvsp[(8) - (16)].v)[0], (yyvsp[(8) - (16)].v)[1], (yyvsp[(8) - (16)].v)[2], (yyvsp[(10) - (16)].d),
&extr, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2819 "Gmsh.y"

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2824 "Gmsh.y"

Christophe Geuzaine
committed
ExtrudeShape(TRANSLATE_ROTATE, MSH_POINT, (int)(yyvsp[(4) - (18)].d),
(yyvsp[(6) - (18)].v)[0], (yyvsp[(6) - (18)].v)[1], (yyvsp[(6) - (18)].v)[2], (yyvsp[(8) - (18)].v)[0], (yyvsp[(8) - (18)].v)[1], (yyvsp[(8) - (18)].v)[2], (yyvsp[(10) - (18)].v)[0], (yyvsp[(10) - (18)].v)[1], (yyvsp[(10) - (18)].v)[2], (yyvsp[(12) - (18)].d),
&extr, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2831 "Gmsh.y"

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2836 "Gmsh.y"

Christophe Geuzaine
committed
ExtrudeShape(TRANSLATE_ROTATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (18)].d),
(yyvsp[(6) - (18)].v)[0], (yyvsp[(6) - (18)].v)[1], (yyvsp[(6) - (18)].v)[2], (yyvsp[(8) - (18)].v)[0], (yyvsp[(8) - (18)].v)[1], (yyvsp[(8) - (18)].v)[2], (yyvsp[(10) - (18)].v)[0], (yyvsp[(10) - (18)].v)[1], (yyvsp[(10) - (18)].v)[2], (yyvsp[(12) - (18)].d),
&extr, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2843 "Gmsh.y"

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2848 "Gmsh.y"

Christophe Geuzaine
committed
ExtrudeShape(TRANSLATE_ROTATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (18)].d),
(yyvsp[(6) - (18)].v)[0], (yyvsp[(6) - (18)].v)[1], (yyvsp[(6) - (18)].v)[2], (yyvsp[(8) - (18)].v)[0], (yyvsp[(8) - (18)].v)[1], (yyvsp[(8) - (18)].v)[2], (yyvsp[(10) - (18)].v)[0], (yyvsp[(10) - (18)].v)[1], (yyvsp[(10) - (18)].v)[2], (yyvsp[(12) - (18)].d),
&extr, (yyval.l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2859 "Gmsh.y"

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2862 "Gmsh.y"

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2868 "Gmsh.y"
extr.mesh.ExtrudeMesh = true;
extr.mesh.NbLayer = 1;
extr.mesh.NbElmLayer.clear();
extr.mesh.hLayer.clear();

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2877 "Gmsh.y"
extr.mesh.ExtrudeMesh = true;
extr.mesh.NbLayer = List_Nbr((yyvsp[(3) - (7)].l));
if(List_Nbr((yyvsp[(3) - (7)].l)) == List_Nbr((yyvsp[(5) - (7)].l))){
extr.mesh.NbElmLayer.clear();
extr.mesh.hLayer.clear();
for(int i = 0; i < List_Nbr((yyvsp[(3) - (7)].l)); i++){
double d;
List_Read((yyvsp[(3) - (7)].l), i, &d);
extr.mesh.NbElmLayer.push_back((d > 0) ? (int)d : 1);
List_Read((yyvsp[(5) - (7)].l), i, &d);
extr.mesh.hLayer.push_back(d);
}
yymsg(0, "Wrong layer definition {%d, %d}", List_Nbr((yyvsp[(3) - (7)].l)), List_Nbr((yyvsp[(5) - (7)].l)));
List_Delete((yyvsp[(3) - (7)].l));
List_Delete((yyvsp[(5) - (7)].l));
;}
break;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2897 "Gmsh.y"
yymsg(0, "Explicit region numbers in layers are deprecated");
extr.mesh.NbLayer = List_Nbr((yyvsp[(3) - (9)].l));
if(List_Nbr((yyvsp[(3) - (9)].l)) == List_Nbr((yyvsp[(5) - (9)].l)) && List_Nbr((yyvsp[(3) - (9)].l)) == List_Nbr((yyvsp[(7) - (9)].l))){
extr.mesh.NbElmLayer.clear();
extr.mesh.hLayer.clear();
for(int i = 0; i < List_Nbr((yyvsp[(3) - (9)].l)); i++){
double d;
List_Read((yyvsp[(3) - (9)].l), i, &d);
extr.mesh.NbElmLayer.push_back((d > 0) ? (int)d : 1);
List_Read((yyvsp[(7) - (9)].l), i, &d);
extr.mesh.hLayer.push_back(d);
}
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)));
List_Delete((yyvsp[(3) - (9)].l));
List_Delete((yyvsp[(5) - (9)].l));
List_Delete((yyvsp[(7) - (9)].l));
;}
break;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2920 "Gmsh.y"

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2924 "Gmsh.y"

Christophe Geuzaine
committed
{
extr.mesh.QuadToTri = QUADTRI_DBL_1;
;}
break;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2928 "Gmsh.y"

Christophe Geuzaine
committed
{
extr.mesh.QuadToTri = QUADTRI_DBL_1_RECOMB;
;}
break;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2932 "Gmsh.y"

Christophe Geuzaine
committed
{
extr.mesh.QuadToTri = QUADTRI_SNGL_1;
;}
break;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2936 "Gmsh.y"

Christophe Geuzaine
committed
{
extr.mesh.QuadToTri = QUADTRI_SNGL_1_RECOMB;
;}
break;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2940 "Gmsh.y"
yymsg(0, "Surface %d already exists", num);
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
committed
/* Line 1464 of yacc.c */
#line 2959 "Gmsh.y"
{
if(!strcmp((yyvsp[(2) - (6)].c), "Index"))
extr.mesh.BoundaryLayerIndex = (yyvsp[(4) - (6)].d);
else if(!strcmp((yyvsp[(2) - (6)].c), "View"))
extr.mesh.ViewIndex = (yyvsp[(4) - (6)].d);
Free((yyvsp[(2) - (6)].c));
;}
break;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2971 "Gmsh.y"

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2975 "Gmsh.y"
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.;
(yyval.v)[1] = (yyvsp[(3) - (3)].d);
Free((yyvsp[(2) - (3)].c));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2990 "Gmsh.y"

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 2994 "Gmsh.y"
{
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;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 3006 "Gmsh.y"
{
(yyval.l) = List_Create(1, 1, sizeof(double));
;}
break;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 3010 "Gmsh.y"
{
(yyval.l) = (yyvsp[(2) - (2)].l);
;}
break;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 3015 "Gmsh.y"

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 3019 "Gmsh.y"

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 3026 "Gmsh.y"
int type = (int)(yyvsp[(6) - (7)].v)[0];
double coef = fabs((yyvsp[(6) - (7)].v)[1]);
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;
}
}
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;
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);

Christophe Geuzaine
committed
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;
}
else if(sign > 0)

Christophe Geuzaine
committed
yymsg(0, "Unknown line %d", j);
}
}
}
List_Delete((yyvsp[(3) - (7)].l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 3082 "Gmsh.y"
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);
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));
List_Delete((yyvsp[(4) - (6)].l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 3152 "Gmsh.y"
yymsg(1, "Elliptic Surface is deprecated: use Transfinite instead (with smoothing)");

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 3157 "Gmsh.y"
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);
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);
}
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
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));
}
}
yymsg(0, "Unknown volume %d", (int)d);
List_Delete((yyvsp[(3) - (5)].l));
List_Delete((yyvsp[(4) - (5)].l));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 3224 "Gmsh.y"

Christophe Geuzaine
committed
{
if(!(yyvsp[(2) - (3)].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->QuadTri = TRANSFINITE_QUADTRI_1;
}
}
else{
for(GModel::riter it = GModel::current()->firstRegion();
it != GModel::current()->lastRegion(); it++)
(*it)->meshAttributes.QuadTri = TRANSFINITE_QUADTRI_1;
}