Newer
Older

Christophe Geuzaine
committed
CTX::instance()->forcedBBox = 0;

Christophe Geuzaine
committed
CTX::instance()->forcedBBox = 1;
SetBoundingBox((yyvsp[(3) - (15)].d), (yyvsp[(5) - (15)].d), (yyvsp[(7) - (15)].d), (yyvsp[(9) - (15)].d), (yyvsp[(11) - (15)].d), (yyvsp[(13) - (15)].d));

Christophe Geuzaine
committed
#if defined(HAVE_OPENGL)

Christophe Geuzaine
committed
GModel::current()->createTopologyFromMesh();

Christophe Geuzaine
committed
{
GModel::current()->createTopologyFromMesh(1);
{
GModel::current()->importGEOInternals();
GModel::current()->refineMesh(CTX::instance()->mesh.secondOrderLinear);
{
LoopControlVariablesTab[ImbricatedLoop][0] = (yyvsp[(3) - (6)].d);
LoopControlVariablesTab[ImbricatedLoop][1] = (yyvsp[(5) - (6)].d);
fgetpos(gmsh_yyin, &yyposImbricatedLoopsTab[ImbricatedLoop]);
yylinenoImbricatedLoopsTab[ImbricatedLoop] = gmsh_yylineno;
skip_until("For", "EndFor");
if(ImbricatedLoop > MAX_RECUR_LOOPS - 1){
yymsg(0, "Reached maximum number of imbricated loops");
ImbricatedLoop = MAX_RECUR_LOOPS - 1;

Christophe Geuzaine
committed
{
LoopControlVariablesTab[ImbricatedLoop][0] = (yyvsp[(3) - (8)].d);
LoopControlVariablesTab[ImbricatedLoop][1] = (yyvsp[(5) - (8)].d);
LoopControlVariablesTab[ImbricatedLoop][2] = (yyvsp[(7) - (8)].d);
fgetpos(gmsh_yyin, &yyposImbricatedLoopsTab[ImbricatedLoop]);
yylinenoImbricatedLoopsTab[ImbricatedLoop] = gmsh_yylineno;
if(((yyvsp[(7) - (8)].d) > 0. && (yyvsp[(3) - (8)].d) > (yyvsp[(5) - (8)].d)) || ((yyvsp[(7) - (8)].d) < 0. && (yyvsp[(3) - (8)].d) < (yyvsp[(5) - (8)].d)))
skip_until("For", "EndFor");
if(ImbricatedLoop > MAX_RECUR_LOOPS - 1){
yymsg(0, "Reached maximum number of imbricated loops");
ImbricatedLoop = MAX_RECUR_LOOPS - 1;

Christophe Geuzaine
committed
{
LoopControlVariablesTab[ImbricatedLoop][0] = (yyvsp[(5) - (8)].d);
LoopControlVariablesTab[ImbricatedLoop][1] = (yyvsp[(7) - (8)].d);
LoopControlVariablesNameTab[ImbricatedLoop] = (yyvsp[(2) - (8)].c);
gmsh_yysymbols[(yyvsp[(2) - (8)].c)].resize(1);
gmsh_yysymbols[(yyvsp[(2) - (8)].c)][0] = (yyvsp[(5) - (8)].d);
fgetpos(gmsh_yyin, &yyposImbricatedLoopsTab[ImbricatedLoop]);
yylinenoImbricatedLoopsTab[ImbricatedLoop] = gmsh_yylineno;
skip_until("For", "EndFor");
if(ImbricatedLoop > MAX_RECUR_LOOPS - 1){
yymsg(0, "Reached maximum number of imbricated loops");
ImbricatedLoop = MAX_RECUR_LOOPS - 1;

Christophe Geuzaine
committed
{
LoopControlVariablesTab[ImbricatedLoop][0] = (yyvsp[(5) - (10)].d);
LoopControlVariablesTab[ImbricatedLoop][1] = (yyvsp[(7) - (10)].d);
LoopControlVariablesTab[ImbricatedLoop][2] = (yyvsp[(9) - (10)].d);
LoopControlVariablesNameTab[ImbricatedLoop] = (yyvsp[(2) - (10)].c);
gmsh_yysymbols[(yyvsp[(2) - (10)].c)].resize(1);
gmsh_yysymbols[(yyvsp[(2) - (10)].c)][0] = (yyvsp[(5) - (10)].d);
fgetpos(gmsh_yyin, &yyposImbricatedLoopsTab[ImbricatedLoop]);
yylinenoImbricatedLoopsTab[ImbricatedLoop] = gmsh_yylineno;
if(((yyvsp[(9) - (10)].d) > 0. && (yyvsp[(5) - (10)].d) > (yyvsp[(7) - (10)].d)) || ((yyvsp[(9) - (10)].d) < 0. && (yyvsp[(5) - (10)].d) < (yyvsp[(7) - (10)].d)))
skip_until("For", "EndFor");
if(ImbricatedLoop > MAX_RECUR_LOOPS - 1){
yymsg(0, "Reached maximum number of imbricated loops");
ImbricatedLoop = MAX_RECUR_LOOPS - 1;

Christophe Geuzaine
committed
yymsg(0, "Invalid For/EndFor loop");
ImbricatedLoop = 0;
double step = LoopControlVariablesTab[ImbricatedLoop - 1][2];

Christophe Geuzaine
committed
const char *name = LoopControlVariablesNameTab[ImbricatedLoop - 1];
if(name){
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
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
if(!FunctionManager::Instance()->leaveFunction
(&gmsh_yyin, gmsh_yyname, gmsh_yylineno))
yymsg(0, "Error while exiting function");

Christophe Geuzaine
committed
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

Christophe Geuzaine
committed

Christophe Geuzaine
committed
{
(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
{
(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
{
(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

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed
{
(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

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed
{
(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

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed
{
(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

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed

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

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

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

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

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

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

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

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

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

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

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

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed

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

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed

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

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed

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

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed

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

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed

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

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed

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

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed

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

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed

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

Christophe Geuzaine
committed
extr.mesh.QuadToTri = NO_QUADTRI;

Christophe Geuzaine
committed

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

Christophe Geuzaine
committed

Christophe Geuzaine
committed
extr.mesh.ExtrudeMesh = true;
extr.mesh.NbLayer = 1;
extr.mesh.NbElmLayer.clear();
extr.mesh.hLayer.clear();

Christophe Geuzaine
committed
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));

Christophe Geuzaine
committed
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));

Christophe Geuzaine
committed

Christophe Geuzaine
committed

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

Christophe Geuzaine
committed
break;

Christophe Geuzaine
committed

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

Christophe Geuzaine
committed
break;

Christophe Geuzaine
committed

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

Christophe Geuzaine
committed
break;

Christophe Geuzaine
committed

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

Christophe Geuzaine
committed
break;

Christophe Geuzaine
committed
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
{
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));

Christophe Geuzaine
committed

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.;
(yyval.v)[1] = (yyvsp[(3) - (3)].d);
Free((yyvsp[(2) - (3)].c));

Christophe Geuzaine
committed

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));

Christophe Geuzaine
committed
{
(yyval.l) = List_Create(1, 1, sizeof(double));

Christophe Geuzaine
committed
{
(yyval.l) = (yyvsp[(2) - (2)].l);

Christophe Geuzaine
committed

Christophe Geuzaine
committed

Christophe Geuzaine
committed
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
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)){