Newer
Older
yymsg(0, "%d extra argument%s in Printf", i, (i > 1) ? "s" : "");
std::string tmp = FixRelativePath(gmsh_yyname, (yyvsp[(8) - (9)].c));
FILE *fp = fopen(tmp.c_str(), (yyvsp[(7) - (9)].c));
}
else{
fprintf(fp, "%s\n", tmpstring);
fclose(fp);
}
Free((yyvsp[(3) - (9)].c));
Free((yyvsp[(8) - (9)].c));
List_Delete((yyvsp[(5) - (9)].l));
;}
break;
case 27:

Christophe Geuzaine
committed
#if !defined(HAVE_NO_POST)
if(!strcmp((yyvsp[(1) - (6)].c), "View") && ViewData->finalize()){
ViewData->setName((yyvsp[(2) - (6)].c));
ViewData->setFileName(gmsh_yyname);
ViewData->setFileIndex(gmsh_yyviewindex++);
new PView(ViewData);

Christophe Geuzaine
committed
#endif
Free((yyvsp[(1) - (6)].c)); Free((yyvsp[(2) - (6)].c));
;}
break;
case 28:

Christophe Geuzaine
committed
#if !defined(HAVE_NO_POST)
int index = (int)(yyvsp[(4) - (6)].d);
if(index >= 0 && index < (int)PView::list.size())
new PView(PView::list[index], false);

Christophe Geuzaine
committed
#endif
case 29:

Christophe Geuzaine
committed
#if !defined(HAVE_NO_POST)
int index = (int)(yyvsp[(4) - (6)].d);
if(index >= 0 && index < (int)PView::list.size())
new PView(PView::list[index], true);

Christophe Geuzaine
committed
#endif
case 30:

Christophe Geuzaine
committed
#if !defined(HAVE_NO_POST)

Christophe Geuzaine
committed
ViewData = new PViewDataList();

Christophe Geuzaine
committed
#endif
{ ViewCoord.push_back((yyvsp[(1) - (1)].d)); ;}
{ ViewCoord.push_back((yyvsp[(3) - (3)].d)); ;}
{ if(ViewValueList) ViewValueList->push_back((yyvsp[(1) - (1)].d)); ;}
{ if(ViewValueList) ViewValueList->push_back((yyvsp[(3) - (3)].d)); ;}
break;
case 40:

Christophe Geuzaine
committed
#if !defined(HAVE_NO_POST)

Christophe Geuzaine
committed
if(!strncmp((yyvsp[(1) - (1)].c), "SP", 2)){

Christophe Geuzaine
committed
else if(!strncmp((yyvsp[(1) - (1)].c), "VP", 2)){

Christophe Geuzaine
committed
else if(!strncmp((yyvsp[(1) - (1)].c), "TP", 2)){

Christophe Geuzaine
committed
else if(!strncmp((yyvsp[(1) - (1)].c), "SL", 2)){

Jean-François Remacle
committed
if(strlen((yyvsp[(1) - (1)].c)) > 2) ViewData->setOrder2(TYPE_LIN);

Christophe Geuzaine
committed
else if(!strncmp((yyvsp[(1) - (1)].c), "VL", 2)){

Jean-François Remacle
committed
if(strlen((yyvsp[(1) - (1)].c)) > 2) ViewData->setOrder2(TYPE_LIN);

Christophe Geuzaine
committed
else if(!strncmp((yyvsp[(1) - (1)].c), "TL", 2)){

Jean-François Remacle
committed
if(strlen((yyvsp[(1) - (1)].c)) > 2) ViewData->setOrder2(TYPE_LIN);

Christophe Geuzaine
committed
else if(!strncmp((yyvsp[(1) - (1)].c), "ST", 2)){

Jean-François Remacle
committed
if(strlen((yyvsp[(1) - (1)].c)) > 2) ViewData->setOrder2(TYPE_TRI);

Christophe Geuzaine
committed
else if(!strncmp((yyvsp[(1) - (1)].c), "VT", 2)){

Jean-François Remacle
committed
if(strlen((yyvsp[(1) - (1)].c)) > 2) ViewData->setOrder2(TYPE_TRI);

Christophe Geuzaine
committed
else if(!strncmp((yyvsp[(1) - (1)].c), "TT", 2)){

Jean-François Remacle
committed
if(strlen((yyvsp[(1) - (1)].c)) > 2) ViewData->setOrder2(TYPE_TRI);

Christophe Geuzaine
committed
else if(!strncmp((yyvsp[(1) - (1)].c), "SQ", 2)){

Jean-François Remacle
committed
if(strlen((yyvsp[(1) - (1)].c)) > 2) ViewData->setOrder2(TYPE_QUA);

Christophe Geuzaine
committed
else if(!strncmp((yyvsp[(1) - (1)].c), "VQ", 2)){

Jean-François Remacle
committed
if(strlen((yyvsp[(1) - (1)].c)) > 2) ViewData->setOrder2(TYPE_QUA);

Christophe Geuzaine
committed
else if(!strncmp((yyvsp[(1) - (1)].c), "TQ", 2)){

Jean-François Remacle
committed
if(strlen((yyvsp[(1) - (1)].c)) > 2) ViewData->setOrder2(TYPE_QUA);

Christophe Geuzaine
committed
else if(!strncmp((yyvsp[(1) - (1)].c), "SS", 2)){

Jean-François Remacle
committed
if(strlen((yyvsp[(1) - (1)].c)) > 2) ViewData->setOrder2(TYPE_TET);

Christophe Geuzaine
committed
else if(!strncmp((yyvsp[(1) - (1)].c), "VS", 2)){

Jean-François Remacle
committed
if(strlen((yyvsp[(1) - (1)].c)) > 2) ViewData->setOrder2(TYPE_TET);

Christophe Geuzaine
committed
else if(!strncmp((yyvsp[(1) - (1)].c), "TS", 2)){

Jean-François Remacle
committed
if(strlen((yyvsp[(1) - (1)].c)) > 2) ViewData->setOrder2(TYPE_TET);

Christophe Geuzaine
committed
else if(!strncmp((yyvsp[(1) - (1)].c), "SH", 2)){

Jean-François Remacle
committed
if(strlen((yyvsp[(1) - (1)].c)) > 2) ViewData->setOrder2(TYPE_HEX);

Christophe Geuzaine
committed
else if(!strncmp((yyvsp[(1) - (1)].c), "VH", 2)){

Jean-François Remacle
committed
if(strlen((yyvsp[(1) - (1)].c)) > 2) ViewData->setOrder2(TYPE_HEX);

Christophe Geuzaine
committed
else if(!strncmp((yyvsp[(1) - (1)].c), "TH", 2)){

Jean-François Remacle
committed
if(strlen((yyvsp[(1) - (1)].c)) > 2) ViewData->setOrder2(TYPE_HEX);

Christophe Geuzaine
committed
else if(!strncmp((yyvsp[(1) - (1)].c), "SI", 2)){

Jean-François Remacle
committed
if(strlen((yyvsp[(1) - (1)].c)) > 2) ViewData->setOrder2(TYPE_PRI);

Christophe Geuzaine
committed
else if(!strncmp((yyvsp[(1) - (1)].c), "VI", 2)){

Jean-François Remacle
committed
if(strlen((yyvsp[(1) - (1)].c)) > 2) ViewData->setOrder2(TYPE_PRI);

Christophe Geuzaine
committed
else if(!strncmp((yyvsp[(1) - (1)].c), "TI", 2)){

Jean-François Remacle
committed
if(strlen((yyvsp[(1) - (1)].c)) > 2) ViewData->setOrder2(TYPE_PRI);

Christophe Geuzaine
committed
else if(!strncmp((yyvsp[(1) - (1)].c), "SY", 2)){

Jean-François Remacle
committed
if(strlen((yyvsp[(1) - (1)].c)) > 2) ViewData->setOrder2(TYPE_PYR);

Christophe Geuzaine
committed
else if(!strncmp((yyvsp[(1) - (1)].c), "VY", 2)){

Jean-François Remacle
committed
if(strlen((yyvsp[(1) - (1)].c)) > 2) ViewData->setOrder2(TYPE_PYR);

Christophe Geuzaine
committed
else if(!strncmp((yyvsp[(1) - (1)].c), "TY", 2)){

Jean-François Remacle
committed
if(strlen((yyvsp[(1) - (1)].c)) > 2) ViewData->setOrder2(TYPE_PYR);
yymsg(0, "Unknown element type '%s'", (yyvsp[(1) - (1)].c));
ViewValueList = 0; ViewNumList = 0;

Christophe Geuzaine
committed
#endif
case 41:

Christophe Geuzaine
committed
#if !defined(HAVE_NO_POST)
for(int i = 0; i < 3; i++)
for(unsigned int j = 0; j < ViewCoord.size() / 3; j++)
ViewValueList->push_back(ViewCoord[3 * j + i]);

Christophe Geuzaine
committed
#endif
case 42:

Christophe Geuzaine
committed
#if !defined(HAVE_NO_POST)

Christophe Geuzaine
committed
#endif
case 43:

Christophe Geuzaine
committed
#if !defined(HAVE_NO_POST)

Christophe Geuzaine
committed
for(int i = 0; i < (int)strlen((yyvsp[(1) - (1)].c)) + 1; i++) ViewData->T2C.push_back((yyvsp[(1) - (1)].c)[i]);

Christophe Geuzaine
committed
#endif
case 44:

Christophe Geuzaine
committed
#if !defined(HAVE_NO_POST)

Christophe Geuzaine
committed
for(int i = 0; i < (int)strlen((yyvsp[(3) - (3)].c)) + 1; i++) ViewData->T2C.push_back((yyvsp[(3) - (3)].c)[i]);

Christophe Geuzaine
committed
#endif
case 45:

Christophe Geuzaine
committed
#if !defined(HAVE_NO_POST)

Christophe Geuzaine
committed
ViewData->T2D.push_back((yyvsp[(3) - (8)].d));
ViewData->T2D.push_back((yyvsp[(5) - (8)].d));
ViewData->T2D.push_back((yyvsp[(7) - (8)].d));
ViewData->T2D.push_back(ViewData->T2C.size());

Christophe Geuzaine
committed
#endif
case 46:

Christophe Geuzaine
committed
#if !defined(HAVE_NO_POST)

Christophe Geuzaine
committed
#endif
case 47:

Christophe Geuzaine
committed
#if !defined(HAVE_NO_POST)

Christophe Geuzaine
committed
for(int i = 0; i < (int)strlen((yyvsp[(1) - (1)].c)) + 1; i++) ViewData->T3C.push_back((yyvsp[(1) - (1)].c)[i]);

Christophe Geuzaine
committed
#endif
case 48:

Christophe Geuzaine
committed
#if !defined(HAVE_NO_POST)

Christophe Geuzaine
committed
for(int i = 0; i < (int)strlen((yyvsp[(3) - (3)].c)) + 1; i++) ViewData->T3C.push_back((yyvsp[(3) - (3)].c)[i]);

Christophe Geuzaine
committed
#endif
case 49:

Christophe Geuzaine
committed
#if !defined(HAVE_NO_POST)

Christophe Geuzaine
committed
ViewData->T3D.push_back((yyvsp[(3) - (10)].d)); ViewData->T3D.push_back((yyvsp[(5) - (10)].d));
ViewData->T3D.push_back((yyvsp[(7) - (10)].d)); ViewData->T3D.push_back((yyvsp[(9) - (10)].d));
ViewData->T3D.push_back(ViewData->T3C.size());

Christophe Geuzaine
committed
#endif
case 50:

Christophe Geuzaine
committed
#if !defined(HAVE_NO_POST)

Christophe Geuzaine
committed
#endif
case 51:

Christophe Geuzaine
committed
#if !defined(HAVE_NO_POST)
(ViewData->NbSL || ViewData->NbVL) ? TYPE_LIN :
(ViewData->NbST || ViewData->NbVT) ? TYPE_TRI :
(ViewData->NbSQ || ViewData->NbVQ) ? TYPE_QUA :
(ViewData->NbSS || ViewData->NbVS) ? TYPE_TET :
(ViewData->NbSY || ViewData->NbVY) ? TYPE_PYR :
(ViewData->NbSI || ViewData->NbVI) ? TYPE_PRI :
(ViewData->NbSH || ViewData->NbVH) ? TYPE_HEX :
0;
ViewData->setInterpolationMatrices(type, ListOfListOfDouble2Matrix((yyvsp[(3) - (8)].l)),
ListOfListOfDouble2Matrix((yyvsp[(6) - (8)].l)));

Christophe Geuzaine
committed
#endif
case 52:

Christophe Geuzaine
committed
#if !defined(HAVE_NO_POST)
(ViewData->NbSL || ViewData->NbVL) ? TYPE_LIN :
(ViewData->NbST || ViewData->NbVT) ? TYPE_TRI :
(ViewData->NbSQ || ViewData->NbVQ) ? TYPE_QUA :
(ViewData->NbSS || ViewData->NbVS) ? TYPE_TET :
(ViewData->NbSH || ViewData->NbVH) ? TYPE_HEX :
0;
ViewData->setInterpolationMatrices(type, ListOfListOfDouble2Matrix((yyvsp[(3) - (14)].l)),
ListOfListOfDouble2Matrix((yyvsp[(6) - (14)].l)),
ListOfListOfDouble2Matrix((yyvsp[(9) - (14)].l)),
ListOfListOfDouble2Matrix((yyvsp[(12) - (14)].l)));

Christophe Geuzaine
committed
#endif
case 53:

Christophe Geuzaine
committed
#if !defined(HAVE_NO_POST)

Christophe Geuzaine
committed
ViewValueList = &ViewData->Time;

Christophe Geuzaine
committed
#endif
case 54:
case 55:
case 56:
case 57:
case 58:
case 59:
case 60:
case 61:
case 62:
{
if(!gmsh_yysymbols.count((yyvsp[(1) - (4)].c))){
if(!(yyvsp[(2) - (4)].i))
gmsh_yysymbols[(yyvsp[(1) - (4)].c)].push_back((yyvsp[(3) - (4)].d));
else
yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (4)].c));
switch((yyvsp[(2) - (4)].i)){
case 0 : gmsh_yysymbols[(yyvsp[(1) - (4)].c)][0] = (yyvsp[(3) - (4)].d); break;
case 1 : gmsh_yysymbols[(yyvsp[(1) - (4)].c)][0] += (yyvsp[(3) - (4)].d); break;
case 2 : gmsh_yysymbols[(yyvsp[(1) - (4)].c)][0] -= (yyvsp[(3) - (4)].d); break;
case 3 : gmsh_yysymbols[(yyvsp[(1) - (4)].c)][0] *= (yyvsp[(3) - (4)].d); break;
case 4 :
if((yyvsp[(3) - (4)].d)) gmsh_yysymbols[(yyvsp[(1) - (4)].c)][0] /= (yyvsp[(3) - (4)].d);
else yymsg(0, "Division by zero in '%s /= %g'", (yyvsp[(1) - (4)].c), (yyvsp[(3) - (4)].d));
break;
}
Free((yyvsp[(1) - (4)].c));
case 63:
int index = (int)(yyvsp[(3) - (7)].d);
if(!gmsh_yysymbols.count((yyvsp[(1) - (7)].c))){
if(!(yyvsp[(5) - (7)].i)){
gmsh_yysymbols[(yyvsp[(1) - (7)].c)].resize(index + 1, 0.);
gmsh_yysymbols[(yyvsp[(1) - (7)].c)][index] = (yyvsp[(6) - (7)].d);
}
else
yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (7)].c));
if((int)gmsh_yysymbols[(yyvsp[(1) - (7)].c)].size() < index + 1)
gmsh_yysymbols[(yyvsp[(1) - (7)].c)].resize(index + 1, 0.);
switch((yyvsp[(5) - (7)].i)){
case 0 : gmsh_yysymbols[(yyvsp[(1) - (7)].c)][index] = (yyvsp[(6) - (7)].d); break;
case 1 : gmsh_yysymbols[(yyvsp[(1) - (7)].c)][index] += (yyvsp[(6) - (7)].d); break;
case 2 : gmsh_yysymbols[(yyvsp[(1) - (7)].c)][index] -= (yyvsp[(6) - (7)].d); break;
case 3 : gmsh_yysymbols[(yyvsp[(1) - (7)].c)][index] *= (yyvsp[(6) - (7)].d); break;
case 4 :
if((yyvsp[(6) - (7)].d)) gmsh_yysymbols[(yyvsp[(1) - (7)].c)][index] /= (yyvsp[(6) - (7)].d);
else yymsg(0, "Division by zero in '%s[%d] /= %g'", (yyvsp[(1) - (7)].c), index, (yyvsp[(6) - (7)].d));
break;
}
Free((yyvsp[(1) - (7)].c));
case 64:
{
if(List_Nbr((yyvsp[(4) - (9)].l)) != List_Nbr((yyvsp[(8) - (9)].l))){
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
if(!gmsh_yysymbols.count((yyvsp[(1) - (9)].c))){
if(!(yyvsp[(7) - (9)].i)){
for(int i = 0; i < List_Nbr((yyvsp[(4) - (9)].l)); i++){
int index = (int)(*(double*)List_Pointer((yyvsp[(4) - (9)].l), i));
gmsh_yysymbols[(yyvsp[(1) - (9)].c)].resize(index + 1, 0.);
gmsh_yysymbols[(yyvsp[(1) - (9)].c)][index] = *(double*)List_Pointer((yyvsp[(8) - (9)].l), i);
}
}
else
yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (9)].c));
}
else{
for(int i = 0; i < List_Nbr((yyvsp[(4) - (9)].l)); i++){
int index = (int)(*(double*)List_Pointer((yyvsp[(4) - (9)].l), i));
double d = *(double*)List_Pointer((yyvsp[(8) - (9)].l), i);
if((int)gmsh_yysymbols[(yyvsp[(1) - (9)].c)].size() < index + 1)
gmsh_yysymbols[(yyvsp[(1) - (9)].c)].resize(index + 1, 0.);
switch((yyvsp[(7) - (9)].i)){
case 0 : gmsh_yysymbols[(yyvsp[(1) - (9)].c)][index] = d; break;
case 1 : gmsh_yysymbols[(yyvsp[(1) - (9)].c)][index] += d; break;
case 2 : gmsh_yysymbols[(yyvsp[(1) - (9)].c)][index] -= d; break;
case 3 : gmsh_yysymbols[(yyvsp[(1) - (9)].c)][index] *= d; break;
case 4 :
if((yyvsp[(8) - (9)].l)) gmsh_yysymbols[(yyvsp[(1) - (9)].c)][index] /= d;
else yymsg(0, "Division by zero in '%s[%d] /= %g'", (yyvsp[(1) - (9)].c), index, d);
break;
}
}
}
Free((yyvsp[(1) - (9)].c));
List_Delete((yyvsp[(4) - (9)].l));
List_Delete((yyvsp[(8) - (9)].l));
;}
break;
case 65:
if(gmsh_yysymbols.count((yyvsp[(1) - (6)].c)))
gmsh_yysymbols[(yyvsp[(1) - (6)].c)] = std::vector<double>();
for(int i = 0; i < List_Nbr((yyvsp[(5) - (6)].l)); i++)
gmsh_yysymbols[(yyvsp[(1) - (6)].c)].push_back(*(double*)List_Pointer((yyvsp[(5) - (6)].l), i));
Free((yyvsp[(1) - (6)].c));
case 66:
for(int i = 0; i < List_Nbr((yyvsp[(5) - (6)].l)); i++)
gmsh_yysymbols[(yyvsp[(1) - (6)].c)].push_back(*(double*)List_Pointer((yyvsp[(5) - (6)].l), i));
Free((yyvsp[(1) - (6)].c));
case 67:
if(!gmsh_yysymbols.count((yyvsp[(1) - (3)].c)))
case 68:
if(!gmsh_yysymbols.count((yyvsp[(1) - (6)].c)))
int index = (int)(yyvsp[(3) - (6)].d);
if((int)gmsh_yysymbols[(yyvsp[(1) - (6)].c)].size() < index + 1)
gmsh_yysymbols[(yyvsp[(1) - (6)].c)].resize(index + 1, 0.);
gmsh_yysymbols[(yyvsp[(1) - (6)].c)][index] += (yyvsp[(5) - (6)].i);
case 69:
gmsh_yystringsymbols[(yyvsp[(1) - (4)].c)] = std::string((yyvsp[(3) - (4)].c));
Free((yyvsp[(1) - (4)].c));
Free((yyvsp[(3) - (4)].c));
case 70:
std::string tmp((yyvsp[(5) - (6)].c));
StringOption(GMSH_SET|GMSH_GUI, (yyvsp[(1) - (6)].c), 0, (yyvsp[(3) - (6)].c), tmp);
Free((yyvsp[(1) - (6)].c)); Free((yyvsp[(3) - (6)].c)); Free((yyvsp[(5) - (6)].c))
case 71:
std::string tmp((yyvsp[(8) - (9)].c));
StringOption(GMSH_SET|GMSH_GUI, (yyvsp[(1) - (9)].c), (int)(yyvsp[(3) - (9)].d), (yyvsp[(6) - (9)].c), tmp);
Free((yyvsp[(1) - (9)].c)); Free((yyvsp[(6) - (9)].c)); Free((yyvsp[(8) - (9)].c))
case 72:
{
double d = 0.;
if(NumberOption(GMSH_GET, (yyvsp[(1) - (6)].c), 0, (yyvsp[(3) - (6)].c), d)){
switch((yyvsp[(4) - (6)].i)){
case 0 : d = (yyvsp[(5) - (6)].d); break;
case 1 : d += (yyvsp[(5) - (6)].d); break;
case 2 : d -= (yyvsp[(5) - (6)].d); break;
case 3 : d *= (yyvsp[(5) - (6)].d); break;
case 4 :
if((yyvsp[(5) - (6)].d)) d /= (yyvsp[(5) - (6)].d);
else yymsg(0, "Division by zero in '%s.%s /= %g'", (yyvsp[(1) - (6)].c), (yyvsp[(3) - (6)].c), (yyvsp[(5) - (6)].d));
break;
}
NumberOption(GMSH_SET|GMSH_GUI, (yyvsp[(1) - (6)].c), 0, (yyvsp[(3) - (6)].c), d);
Free((yyvsp[(1) - (6)].c)); Free((yyvsp[(3) - (6)].c));
;}
break;
case 73:
{
double d = 0.;
if(NumberOption(GMSH_GET, (yyvsp[(1) - (9)].c), (int)(yyvsp[(3) - (9)].d), (yyvsp[(6) - (9)].c), d)){
switch((yyvsp[(7) - (9)].i)){
case 0 : d = (yyvsp[(8) - (9)].d); break;
case 1 : d += (yyvsp[(8) - (9)].d); break;
case 2 : d -= (yyvsp[(8) - (9)].d); break;
case 3 : d *= (yyvsp[(8) - (9)].d); break;
case 4 :
if((yyvsp[(8) - (9)].d)) d /= (yyvsp[(8) - (9)].d);
else yymsg(0, "Division by zero in '%s[%d].%s /= %g'", (yyvsp[(1) - (9)].c), (int)(yyvsp[(3) - (9)].d), (yyvsp[(6) - (9)].c), (yyvsp[(8) - (9)].d));
break;
}
NumberOption(GMSH_SET|GMSH_GUI, (yyvsp[(1) - (9)].c), (int)(yyvsp[(3) - (9)].d), (yyvsp[(6) - (9)].c), d);
Free((yyvsp[(1) - (9)].c)); Free((yyvsp[(6) - (9)].c));
;}
break;
case 74:
double d = 0.;
if(NumberOption(GMSH_GET, (yyvsp[(1) - (5)].c), 0, (yyvsp[(3) - (5)].c), d)){
d += (yyvsp[(4) - (5)].i);
NumberOption(GMSH_SET|GMSH_GUI, (yyvsp[(1) - (5)].c), 0, (yyvsp[(3) - (5)].c), d);
Free((yyvsp[(1) - (5)].c)); Free((yyvsp[(3) - (5)].c));
;}
break;
case 75:
double d = 0.;
if(NumberOption(GMSH_GET, (yyvsp[(1) - (8)].c), (int)(yyvsp[(3) - (8)].d), (yyvsp[(6) - (8)].c), d)){
d += (yyvsp[(7) - (8)].i);
NumberOption(GMSH_SET|GMSH_GUI, (yyvsp[(1) - (8)].c), (int)(yyvsp[(3) - (8)].d), (yyvsp[(6) - (8)].c), d);
Free((yyvsp[(1) - (8)].c)); Free((yyvsp[(6) - (8)].c));
;}
break;
case 76:
ColorOption(GMSH_SET|GMSH_GUI, (yyvsp[(1) - (8)].c), 0, (yyvsp[(5) - (8)].c), (yyvsp[(7) - (8)].u));
Free((yyvsp[(1) - (8)].c)); Free((yyvsp[(5) - (8)].c));
;}
break;
case 77:
ColorOption(GMSH_SET|GMSH_GUI, (yyvsp[(1) - (11)].c), (int)(yyvsp[(3) - (11)].d), (yyvsp[(8) - (11)].c), (yyvsp[(10) - (11)].u));
Free((yyvsp[(1) - (11)].c)); Free((yyvsp[(8) - (11)].c));
;}
break;
case 78:
GmshColorTable *ct = GetColorTable(0);
ct->size = List_Nbr((yyvsp[(5) - (6)].l));
if(ct->size > COLORTABLE_NBMAX_COLOR)
yymsg(0, "Too many (%d>%d) colors in View[%d].ColorTable",
ct->size, COLORTABLE_NBMAX_COLOR, 0);
else
for(int i = 0; i < ct->size; i++) List_Read((yyvsp[(5) - (6)].l), i, &ct->table[i]);
if(ct->size == 1){
ct->size = 2;
ct->table[1] = ct->table[0];
}
Free((yyvsp[(1) - (6)].c));
List_Delete((yyvsp[(5) - (6)].l));
;}
break;
case 79:
GmshColorTable *ct = GetColorTable((int)(yyvsp[(3) - (9)].d));

Christophe Geuzaine
committed
if(!ct)
ct->size = List_Nbr((yyvsp[(8) - (9)].l));
if(ct->size > COLORTABLE_NBMAX_COLOR)
yymsg(0, "Too many (%d>%d) colors in View[%d].ColorTable",
ct->size, COLORTABLE_NBMAX_COLOR, (int)(yyvsp[(3) - (9)].d));
else
for(int i = 0; i < ct->size; i++) List_Read((yyvsp[(8) - (9)].l), i, &ct->table[i]);
if(ct->size == 1){
ct->size = 2;
ct->table[1] = ct->table[0];
}
}
Free((yyvsp[(1) - (9)].c));
List_Delete((yyvsp[(8) - (9)].l));
;}
break;
case 80:
if(!strcmp((yyvsp[(1) - (5)].c),"Background"))
GModel::current()->getFields()->background_field = (int)(yyvsp[(4) - (5)].d);
case 81:
if(!GModel::current()->getFields()->newField((int)(yyvsp[(3) - (7)].d), (yyvsp[(6) - (7)].c)))
yymsg(0, "Cannot create field %i of type '%s'", (int)(yyvsp[(3) - (7)].d), (yyvsp[(6) - (7)].c));
case 82:
{
Field *field = GModel::current()->getFields()->get((int)(yyvsp[(3) - (9)].d));
if(field){
FieldOption *option = field->options[(yyvsp[(6) - (9)].c)];
if(option){
try { option->numericalValue((yyvsp[(8) - (9)].d)); }
catch(...){
yymsg(0, "Cannot assign a numerical value to option '%s' "
"in field %i of type '%s'", (yyvsp[(6) - (9)].c), (int)(yyvsp[(3) - (9)].d), field->getName());
}
}
else
yymsg(0, "Unknown option '%s' in field %i of type '%s'",
(yyvsp[(6) - (9)].c), (int)(yyvsp[(3) - (9)].d), field->getName());
case 83:
{
Field *field = GModel::current()->getFields()->get((int)(yyvsp[(3) - (9)].d));
if(field){
FieldOption *option = field->options[(yyvsp[(6) - (9)].c)];
if(option){
try { option->string() = (yyvsp[(8) - (9)].c); }
catch (...){
yymsg(0, "Cannot assign a string value to option '%s' "
"in field %i of type '%s'", (yyvsp[(6) - (9)].c), (int)(yyvsp[(3) - (9)].d), field->getName());
}
}
else
yymsg(0, "Unknown option '%s' in field %i of type '%s'",
(yyvsp[(6) - (9)].c), (int)(yyvsp[(3) - (9)].d), field->getName());
Free((yyvsp[(6) - (9)].c));
Free((yyvsp[(8) - (9)].c));
case 84:
{
Field *field = GModel::current()->getFields()->get((int)(yyvsp[(3) - (11)].d));
if(field){
FieldOption *option = field->options[(yyvsp[(6) - (11)].c)];
if(option){
std::list<int> &vl = option->list();
vl.clear();
for(int i = 0; i < List_Nbr((yyvsp[(9) - (11)].l)); i++){
double id;
List_Read((yyvsp[(9) - (11)].l), i, &id);
vl.push_back((int)id);
}
}
else
yymsg(0, "Unknown option '%s' in field %i of type '%s'",
(yyvsp[(6) - (11)].c), (int)(yyvsp[(3) - (11)].d), field->getName());
Free((yyvsp[(6) - (11)].c));
List_Delete((yyvsp[(9) - (11)].l));
case 85:

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

Christophe Geuzaine
committed
#endif
Free((yyvsp[(3) - (9)].c)); Free((yyvsp[(6) - (9)].c));
;}
break;
case 86:

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

Christophe Geuzaine
committed
#endif
Free((yyvsp[(3) - (9)].c)); Free((yyvsp[(6) - (9)].c)); Free((yyvsp[(8) - (9)].c));
case 87:
{
(yyval.i) = (int)(yyvsp[(1) - (1)].d);
;}
break;
case 88:

Christophe Geuzaine
committed
(std::string((yyvsp[(1) - (1)].c)), curPhysDim,
++GModel::current()->getGEOInternals()->MaxPhysicalNum);
case 89:

Christophe Geuzaine
committed
{
(yyval.l) = 0;
;}
break;
case 90:

Christophe Geuzaine
committed
{

Christophe Geuzaine
committed
Vertex *v = FindPoint((int)(yyvsp[(4) - (5)].d));
if(!v)

Christophe Geuzaine
committed
else{

Christophe Geuzaine
committed
}
;}
break;
case 91:
{
for(int i = 0; i < 4; i++) (yyval.v)[i] = 0.;
;}
break;
case 92:
{
for(int i = 0; i < 4; i++) (yyval.v)[i] = (yyvsp[(2) - (2)].v)[i];
;}
break;
case 93:
double x = CTX::instance()->geom.scalingFactor * (yyvsp[(6) - (7)].v)[0];
double y = CTX::instance()->geom.scalingFactor * (yyvsp[(6) - (7)].v)[1];
double z = CTX::instance()->geom.scalingFactor * (yyvsp[(6) - (7)].v)[2];
double lc = CTX::instance()->geom.scalingFactor * (yyvsp[(6) - (7)].v)[3];
if(lc == 0.) lc = MAX_LC; // no mesh size given at the point
Vertex *v;
if(!myGmshSurface)
v = Create_Vertex(num, x, y, z, lc, 1.0);
else
v = Create_Vertex(num, x, y, myGmshSurface, lc);
Tree_Add(GModel::current()->getGEOInternals()->Points, &v);
AddToTemporaryBoundingBox(v->Pos.X, v->Pos.Y, v->Pos.Z);
(yyval.s).Type = MSH_POINT;
(yyval.s).Num = num;
;}
break;
case 94:

Christophe Geuzaine
committed
{
curPhysDim = 0;
;}
break;
case 95:

Christophe Geuzaine
committed
int num = (int)(yyvsp[(5) - (9)].i);
List_T *temp = ListOfDouble2ListOfInt((yyvsp[(8) - (9)].l));
PhysicalGroup *p = Create_PhysicalGroup(num, MSH_PHYSICAL_POINT, temp);
List_Delete(temp);
List_Add(GModel::current()->getGEOInternals()->PhysicalGroups, &p);

Christophe Geuzaine
committed
List_Delete((yyvsp[(8) - (9)].l));
(yyval.s).Type = MSH_PHYSICAL_POINT;
(yyval.s).Num = num;
;}
break;
case 96:
double d;
List_Read((yyvsp[(3) - (6)].l), i, &d);
Vertex *v = FindPoint((int)d);
if(v)
v->lc = (yyvsp[(5) - (6)].d);
else{
GVertex *gv = GModel::current()->getVertexByTag((int)d);
if(gv)
gv->setPrescribedMeshSizeAtVertex((yyvsp[(5) - (6)].d));
}
(yyval.s).Type = 0;
(yyval.s).Num = 0;
;}
break;
case 97:
List_T *temp = ListOfDouble2ListOfInt((yyvsp[(6) - (7)].l));
Curve *c = Create_Curve(num, MSH_SEGM_LINE, 1, temp, NULL,
-1, -1, 0., 1.);
Tree_Add(GModel::current()->getGEOInternals()->Curves, &c);
CreateReversedCurve(c);
List_Delete(temp);
List_Delete((yyvsp[(6) - (7)].l));
(yyval.s).Type = MSH_SEGM_LINE;
(yyval.s).Num = num;
;}
break;
case 98:
{
for (int i = 0; i < List_Nbr((yyvsp[(3) - (4)].l)); i++){
double dnum;
List_Read((yyvsp[(3) - (4)].l), i, &dnum);
int num = (int) fabs(dnum);
Curve *c = FindCurve(num);
if (c){
c->degenerated = true;
}
else{
GEdge *ge = GModel::current()->getEdgeByTag(num);
if (!ge){
yymsg(0, "Curve %d does not exist", num);
}
else{
ge->setTooSmall(true);
}
}
}
;}
break;
case 99:
List_T *temp = ListOfDouble2ListOfInt((yyvsp[(6) - (7)].l));
Curve *c = Create_Curve(num, MSH_SEGM_SPLN, 3, temp, NULL,
-1, -1, 0., 1.);
Tree_Add(GModel::current()->getGEOInternals()->Curves, &c);
CreateReversedCurve(c);
List_Delete(temp);