Newer
Older
else if(!strcmp((yyvsp[(2) - (3)].c), "Variables")){
gmsh_yysymbols.clear();
if(gmsh_yysymbols.count((yyvsp[(2) - (3)].c)))
gmsh_yysymbols.erase((yyvsp[(2) - (3)].c));
else
yymsg(0, "Unknown object or expression to delete '%s'", (yyvsp[(2) - (3)].c));
}
case 149:
#line 2041 "Gmsh.y"

Christophe Geuzaine
committed
#if !defined(HAVE_NO_POST)
if(!strcmp((yyvsp[(2) - (4)].c), "Empty") && !strcmp((yyvsp[(3) - (4)].c), "Views")){
for(int i = PView::list.size() - 1; i >= 0; i--)
if(PView::list[i]->getData()->empty()) delete PView::list[i];
yymsg(0, "Unknown command 'Delete %s %s'", (yyvsp[(2) - (4)].c), (yyvsp[(3) - (4)].c));

Christophe Geuzaine
committed
#endif
Free((yyvsp[(2) - (4)].c)); Free((yyvsp[(3) - (4)].c));
;}
break;
case 150:
#line 2058 "Gmsh.y"
List_Read((yyvsp[(4) - (5)].l), i, &TheShape);
ColorShape(TheShape.Type, TheShape.Num, (yyvsp[(2) - (5)].u));
case 151:
#line 2072 "Gmsh.y"
VisibilityShape((yyvsp[(2) - (3)].c), i, 1);
Free((yyvsp[(2) - (3)].c));
;}
break;
case 152:
#line 2078 "Gmsh.y"
VisibilityShape((yyvsp[(2) - (3)].c), i, 0);
Free((yyvsp[(2) - (3)].c));
;}
break;
case 153:
#line 2084 "Gmsh.y"
VisibilityShape(TheShape.Type, TheShape.Num, 1);
case 154:
#line 2093 "Gmsh.y"
case 155:
#line 2107 "Gmsh.y"
// Warning: we *don't* close included files (to allow user
// functions in these files). If you need to include many many
// files and don't have functions in the files, use "Merge"
// instead: some OSes limit the number of files a process can
// open simultaneously. The right solution would be of course
// to modify FunctionManager to reopen the files instead of
// using the FILE pointer, but hey, I'm lazy...
Msg::StatusBar(2, true, "Reading '%s'", tmpstring);
ParseFile(tmpstring, false, true);
Msg::StatusBar(2, true, "Read '%s'", tmpstring);
// make sure we have the latest data from GEO_Internals in GModel
// (fixes bug where we would have no geometry in the picture if
// the print command is in the same file as the geometry)
CreateOutputFile(tmpstring, CTX::instance()->print.format);
CreateOutputFile(tmpstring, CTX::instance()->mesh.format);
else if(!strcmp((yyvsp[(1) - (3)].c), "Merge") || !strcmp((yyvsp[(1) - (3)].c), "MergeWithBoundingBox")){
MergeFile(tmpstring, true);
}
else if(!strcmp((yyvsp[(1) - (3)].c), "System"))
SystemCall((yyvsp[(2) - (3)].c));
yymsg(0, "Unknown command '%s'", (yyvsp[(1) - (3)].c));
Free((yyvsp[(1) - (3)].c)); Free((yyvsp[(2) - (3)].c));
;}
break;
case 156:
#line 2155 "Gmsh.y"

Christophe Geuzaine
committed
#if !defined(HAVE_NO_POST)
if(!strcmp((yyvsp[(1) - (7)].c), "Save") && !strcmp((yyvsp[(2) - (7)].c), "View")){
int index = (int)(yyvsp[(4) - (7)].d);
PView::list[index]->write(tmpstring, CTX::instance()->post.fileFormat);
yymsg(0, "Unknown view %d", index);
yymsg(0, "Unknown command '%s'", (yyvsp[(1) - (7)].c));

Christophe Geuzaine
committed
#endif
Free((yyvsp[(1) - (7)].c)); Free((yyvsp[(2) - (7)].c)); Free((yyvsp[(6) - (7)].c));
;}
break;
case 157:
#line 2173 "Gmsh.y"

Christophe Geuzaine
committed
#if !defined(HAVE_NO_POST)
if(!strcmp((yyvsp[(1) - (7)].c), "Background") && !strcmp((yyvsp[(2) - (7)].c), "Mesh") && !strcmp((yyvsp[(3) - (7)].c), "View")){
int index = (int)(yyvsp[(5) - (7)].d);
if(index >= 0 && index < (int)PView::list.size())
GModel::current()->getFields()->setBackgroundMesh(index);
yymsg(0, "Unknown view %d", index);
yymsg(0, "Unknown command '%s'", (yyvsp[(1) - (7)].c));

Christophe Geuzaine
committed
#endif
Free((yyvsp[(1) - (7)].c)); Free((yyvsp[(2) - (7)].c)); Free((yyvsp[(3) - (7)].c));
;}
break;
case 158:
#line 2188 "Gmsh.y"
{
if(!strcmp((yyvsp[(1) - (3)].c), "Sleep")){
SleepInSeconds((yyvsp[(2) - (3)].d));
int lock = CTX::instance()->lock;
CTX::instance()->lock = 0;
GModel::current()->importGEOInternals();
GModel::current()->mesh((int)(yyvsp[(2) - (3)].d));
CTX::instance()->lock = lock;
yymsg(0, "Unknown command '%s'", (yyvsp[(1) - (3)].c));
case 159:
#line 2207 "Gmsh.y"

Christophe Geuzaine
committed
#if !defined(HAVE_NO_POST)
PluginManager::instance()->action((yyvsp[(3) - (7)].c), (yyvsp[(6) - (7)].c), 0);
yymsg(0, "Unknown action '%s' or plugin '%s'", (yyvsp[(6) - (7)].c), (yyvsp[(3) - (7)].c));

Christophe Geuzaine
committed
#endif
Free((yyvsp[(3) - (7)].c)); Free((yyvsp[(6) - (7)].c));
;}
break;
case 160:
#line 2219 "Gmsh.y"

Christophe Geuzaine
committed
#if !defined(HAVE_NO_POST)
PView::combine(false, 1, CTX::instance()->post.combineRemoveOrig);
else if(!strcmp((yyvsp[(2) - (3)].c), "ElementsFromVisibleViews"))
PView::combine(false, 0, CTX::instance()->post.combineRemoveOrig);
PView::combine(false, 2, CTX::instance()->post.combineRemoveOrig);
PView::combine(true, 1, CTX::instance()->post.combineRemoveOrig);
else if(!strcmp((yyvsp[(2) - (3)].c), "TimeStepsFromVisibleViews"))
PView::combine(true, 0, CTX::instance()->post.combineRemoveOrig);
PView::combine(true, 2, CTX::instance()->post.combineRemoveOrig);
PView::combine(false, 1, CTX::instance()->post.combineRemoveOrig);
PView::combine(true, 2, CTX::instance()->post.combineRemoveOrig);
yymsg(0, "Unknown 'Combine' command");

Christophe Geuzaine
committed
#endif
case 161:
#line 2243 "Gmsh.y"
case 162:
#line 2247 "Gmsh.y"
{
// FIXME: this is a hack to force a transfer from the old DB to
// the new DB. This will become unnecessary if/when we fill the
// GModel directly during parsing.
GModel::current()->importGEOInternals();
;}
break;
case 163:
#line 2254 "Gmsh.y"
CTX::instance()->forcedBBox = 0;
case 164:
#line 2260 "Gmsh.y"
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));
;}
break;
case 165:
#line 2265 "Gmsh.y"
case 166:
#line 2271 "Gmsh.y"

Christophe Geuzaine
committed
GModel::current()->createTopologyFromMesh();
case 167:
#line 2280 "Gmsh.y"
{
LoopControlVariablesTab[ImbricatedLoop][0] = (yyvsp[(3) - (6)].d);
LoopControlVariablesTab[ImbricatedLoop][1] = (yyvsp[(5) - (6)].d);
fgetpos(gmsh_yyin, &yyposImbricatedLoopsTab[ImbricatedLoop]);
yylinenoImbricatedLoopsTab[ImbricatedLoop] = gmsh_yylineno;
if((yyvsp[(3) - (6)].d) > (yyvsp[(5) - (6)].d))
skip_until("For", "EndFor");
else
ImbricatedLoop++;
if(ImbricatedLoop > MAX_RECUR_LOOPS - 1){
yymsg(0, "Reached maximum number of imbricated loops");
case 168:
#line 2297 "Gmsh.y"
{
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");
else
ImbricatedLoop++;
if(ImbricatedLoop > MAX_RECUR_LOOPS - 1){
yymsg(0, "Reached maximum number of imbricated loops");
case 169:
#line 2314 "Gmsh.y"
{
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;
if((yyvsp[(5) - (8)].d) > (yyvsp[(7) - (8)].d))
skip_until("For", "EndFor");
else
ImbricatedLoop++;
if(ImbricatedLoop > MAX_RECUR_LOOPS - 1){
yymsg(0, "Reached maximum number of imbricated loops");
case 170:
#line 2333 "Gmsh.y"
{
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");
else
ImbricatedLoop++;
if(ImbricatedLoop > MAX_RECUR_LOOPS - 1){
yymsg(0, "Reached maximum number of imbricated loops");
case 171:
#line 2352 "Gmsh.y"
yymsg(0, "Invalid For/EndFor loop");
double x0 = LoopControlVariablesTab[ImbricatedLoop - 1][0];
double x1 = LoopControlVariablesTab[ImbricatedLoop - 1][1];
double step = LoopControlVariablesTab[ImbricatedLoop - 1][2];
int do_next = (step > 0.) ? (x0 + step <= x1) : (x0 + step >= x1);
LoopControlVariablesTab[ImbricatedLoop - 1][0] +=
LoopControlVariablesTab[ImbricatedLoop - 1][2];
if(LoopControlVariablesNameTab[ImbricatedLoop - 1]){
if(!gmsh_yysymbols.count(LoopControlVariablesNameTab[ImbricatedLoop - 1]))
yymsg(0, "Unknown loop variable");
gmsh_yysymbols[LoopControlVariablesNameTab[ImbricatedLoop - 1]][0] +=
LoopControlVariablesTab[ImbricatedLoop - 1][2];
fsetpos(gmsh_yyin, &yyposImbricatedLoopsTab[ImbricatedLoop - 1]);
gmsh_yylineno = yylinenoImbricatedLoopsTab[ImbricatedLoop - 1];
case 172:
#line 2380 "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));
case 173:
#line 2388 "Gmsh.y"
if(!FunctionManager::Instance()->leaveFunction
(&gmsh_yyin, gmsh_yyname, gmsh_yylineno))
yymsg(0, "Error while exiting function");
case 174:
#line 2394 "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
case 175:
#line 2401 "Gmsh.y"
{
if(!(yyvsp[(3) - (4)].d)) skip_until("If", "EndIf");
;}
break;
case 176:
#line 2405 "Gmsh.y"
case 177:
#line 2414 "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));
List_Delete((yyvsp[(4) - (5)].l));
;}
break;
case 178:
#line 2422 "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));
List_Delete((yyvsp[(10) - (11)].l));
;}
break;
case 179:
#line 2430 "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));
List_Delete((yyvsp[(12) - (13)].l));
;}
break;
case 180:
#line 2438 "Gmsh.y"
case 181:
#line 2442 "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));
List_Delete((yyvsp[(4) - (7)].l));
;}
break;
case 182:
#line 2450 "Gmsh.y"
case 183:
#line 2454 "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));
List_Delete((yyvsp[(10) - (13)].l));
;}
break;
case 184:
#line 2462 "Gmsh.y"
case 185:
#line 2466 "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));
List_Delete((yyvsp[(12) - (15)].l));
;}
break;
case 186:
#line 2474 "Gmsh.y"
case 187:
#line 2478 "Gmsh.y"
{
(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.,
&extr, (yyval.l));
List_Delete((yyvsp[(3) - (6)].l));
;}
break;
case 188:
#line 2487 "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));
case 189:
#line 2494 "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));
case 190:
#line 2501 "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));
;}
break;
case 191:
#line 2508 "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),
case 192:
#line 2515 "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),
case 193:
#line 2522 "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));
;}
break;
case 194:
#line 2529 "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),
case 195:
#line 2536 "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),
case 196:
#line 2543 "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));
;}
break;
case 197:
#line 2550 "Gmsh.y"

Christophe Geuzaine
committed
extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false;
case 198:
#line 2554 "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));
case 199:
#line 2561 "Gmsh.y"
case 200:
#line 2565 "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));
;}
break;
case 201:
#line 2572 "Gmsh.y"
case 202:
#line 2576 "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));
;}
break;
case 203:
#line 2583 "Gmsh.y"
case 204:
#line 2587 "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),
case 205:
#line 2594 "Gmsh.y"
case 206:
#line 2598 "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));
;}
break;
case 207:
#line 2605 "Gmsh.y"
case 208:
#line 2609 "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));
;}
break;
case 209:
#line 2616 "Gmsh.y"
case 210:
#line 2620 "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),
case 211:
#line 2627 "Gmsh.y"
case 212:
#line 2631 "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));
;}
break;
case 213:
#line 2638 "Gmsh.y"
case 214:
#line 2642 "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));
;}
break;
case 215:
#line 2653 "Gmsh.y"
case 216:
#line 2656 "Gmsh.y"
case 217:
#line 2662 "Gmsh.y"
extr.mesh.ExtrudeMesh = true;
extr.mesh.NbLayer = 1;
extr.mesh.NbElmLayer.clear();
extr.mesh.hLayer.clear();
case 218:
#line 2671 "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))){
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;
case 219:
#line 2691 "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))){
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;
case 220:
#line 2714 "Gmsh.y"
case 221:
#line 2718 "Gmsh.y"
yymsg(0, "Surface %d already exists", num);
}
else{
Surface *s = Create_Surface(num, MSH_SURF_DISCRETE);
case 222:
#line 2741 "Gmsh.y"
case 223:
#line 2745 "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));
case 224:
#line 2760 "Gmsh.y"
case 225:
#line 2764 "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;
case 226:
#line 2776 "Gmsh.y"
{
(yyval.l) = List_Create(1, 1, sizeof(double));
;}
break;
case 227:
#line 2780 "Gmsh.y"
{
(yyval.l) = (yyvsp[(2) - (2)].l);
;}
break;
case 228:
#line 2785 "Gmsh.y"
case 229:
#line 2789 "Gmsh.y"
case 230:
#line 2796 "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){