Newer
Older
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);
}
case 78:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 877 "Gmsh.y"
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);
}
case 79:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 886 "Gmsh.y"
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);
}
case 80:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 898 "Gmsh.y"
ColorOption(GMSH_SET|GMSH_GUI, (yyvsp[(1) - (8)].c), 0, (yyvsp[(5) - (8)].c), (yyvsp[(7) - (8)].u));
}
case 81:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 903 "Gmsh.y"
ColorOption(GMSH_SET|GMSH_GUI, (yyvsp[(1) - (11)].c), (int)(yyvsp[(3) - (11)].d), (yyvsp[(8) - (11)].c), (yyvsp[(10) - (11)].u));
}
case 82:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 911 "Gmsh.y"
GmshColorTable *ct = GetColorTable(0);
yymsg(0, "View[%d] does not exist", 0);
ct->size = List_Nbr((yyvsp[(5) - (6)].l));
if(ct->size > COLORTABLE_NBMAX_COLOR)
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));
}
case 83:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 931 "Gmsh.y"
GmshColorTable *ct = GetColorTable((int)(yyvsp[(3) - (9)].d));

Christophe Geuzaine
committed
if(!ct)
yymsg(0, "View[%d] does not exist", (int)(yyvsp[(3) - (9)].d));
ct->size = List_Nbr((yyvsp[(8) - (9)].l));
if(ct->size > COLORTABLE_NBMAX_COLOR)
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));
}
case 84:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 954 "Gmsh.y"
if(!strcmp((yyvsp[(1) - (5)].c),"Background"))
GModel::current()->getFields()->setBackgroundFieldId((int)(yyvsp[(4) - (5)].d));
else if(!strcmp((yyvsp[(1) - (5)].c),"BoundaryLayer"))
GModel::current()->getFields()->setBoundaryLayerFieldId((int)(yyvsp[(4) - (5)].d));
yymsg(0, "Unknown command %s Field", (yyvsp[(1) - (5)].c));
}
case 85:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 965 "Gmsh.y"
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 86:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 973 "Gmsh.y"
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());
yymsg(0, "No field with id %i", (int)(yyvsp[(3) - (9)].d));
}
case 87:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 995 "Gmsh.y"
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());
yymsg(0, "No field with id %i", (int)(yyvsp[(3) - (9)].d));
Free((yyvsp[(6) - (9)].c));
Free((yyvsp[(8) - (9)].c));
}
case 88:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1018 "Gmsh.y"
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());
yymsg(0, "No field with id %i", (int)(yyvsp[(3) - (11)].d));
Free((yyvsp[(6) - (11)].c));
List_Delete((yyvsp[(9) - (11)].l));
}
case 89:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1044 "Gmsh.y"
{
#if defined(HAVE_MESH)
Field *field = GModel::current()->getFields()->get((int)(yyvsp[(3) - (7)].d));
if(field){
FieldCallback *callback = field->callbacks[(yyvsp[(6) - (7)].c)];
if(callback) {
callback->run();
}
else
yymsg(0, "Unknown callback '%s' in field %i of type '%s'",
(yyvsp[(6) - (7)].c), (int)(yyvsp[(3) - (7)].d), field->getName());
}
else
yymsg(0, "No field with id %i", (int)(yyvsp[(3) - (7)].d));
#endif
Free((yyvsp[(6) - (7)].c));
}
case 90:
/* Line 1806 of yacc.c */
#line 1065 "Gmsh.y"
#if defined(HAVE_PLUGINS)
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
}
case 91:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1077 "Gmsh.y"
#if defined(HAVE_PLUGINS)
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 95:
/* Line 1806 of yacc.c */
#line 1095 "Gmsh.y"
{
std::string key((yyvsp[(3) - (3)].c));
std::vector<double> val(1, 0.);
floatOptions.clear(); charOptions.clear();
if(!gmsh_yysymbols.count(key)){
Msg::ExchangeOnelabParameter(key, val, floatOptions, charOptions);
}
Free((yyvsp[(3) - (3)].c));
}
case 96:
/* Line 1806 of yacc.c */
#line 1106 "Gmsh.y"
{
std::string key((yyvsp[(3) - (5)].c));
std::vector<double> val(1, (yyvsp[(5) - (5)].d));
floatOptions.clear(); charOptions.clear();
if(!gmsh_yysymbols.count(key)){
Msg::ExchangeOnelabParameter(key, val, floatOptions, charOptions);
}
Free((yyvsp[(3) - (5)].c));
}
case 97:
/* Line 1806 of yacc.c */
#line 1117 "Gmsh.y"
{ floatOptions.clear(); charOptions.clear(); }
case 98:
/* Line 1806 of yacc.c */
#line 1119 "Gmsh.y"
std::string key((yyvsp[(3) - (9)].c));
std::vector<double> val(1, (yyvsp[(6) - (9)].d));
if(!gmsh_yysymbols.count(key)){
Msg::ExchangeOnelabParameter(key, val, floatOptions, charOptions);
}
case 99:
/* Line 1806 of yacc.c */
#line 1131 "Gmsh.y"

Christophe Geuzaine
committed
{
(yyval.l) = List_Create(20,20,sizeof(doubleXstring));
doubleXstring v = {(yyvsp[(1) - (3)].d), (yyvsp[(3) - (3)].c)};
List_Add((yyval.l), &v);
}

Christophe Geuzaine
committed
break;
case 100:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1137 "Gmsh.y"

Christophe Geuzaine
committed
{
doubleXstring v = {(yyvsp[(3) - (5)].d), (yyvsp[(5) - (5)].c)};
List_Add((yyval.l), &v);
}

Christophe Geuzaine
committed
break;
case 103:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1149 "Gmsh.y"
{
std::string key((yyvsp[(2) - (3)].c));
for(int i = 0; i < List_Nbr((yyvsp[(3) - (3)].l)); i++){
List_Read((yyvsp[(3) - (3)].l), i, &v);
floatOptions[key].push_back(v);
}
Free((yyvsp[(2) - (3)].c));
List_Delete((yyvsp[(3) - (3)].l));
}
case 104:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1160 "Gmsh.y"

Christophe Geuzaine
committed
{
std::string key((yyvsp[(2) - (5)].c));
for(int i = 0; i < List_Nbr((yyvsp[(4) - (5)].l)); i++){
doubleXstring v;
List_Read((yyvsp[(4) - (5)].l), i, &v);
floatOptions[key].push_back(v.d);
charOptions[key].push_back(v.s);
}
Free((yyvsp[(2) - (5)].c));
for(int i = 0; i < List_Nbr((yyvsp[(4) - (5)].l)); i++)
Free(((doubleXstring*)List_Pointer((yyvsp[(4) - (5)].l), i))->s);
List_Delete((yyvsp[(4) - (5)].l));
}

Christophe Geuzaine
committed
break;
case 105:
/* Line 1806 of yacc.c */
#line 1175 "Gmsh.y"
{
std::string key((yyvsp[(2) - (3)].c));
std::string val((yyvsp[(3) - (3)].c));
charOptions[key].push_back(val);
Free((yyvsp[(2) - (3)].c));
Free((yyvsp[(3) - (3)].c));
}
case 106:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1188 "Gmsh.y"
}
case 107:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1192 "Gmsh.y"

Christophe Geuzaine
committed
++GModel::current()->getGEOInternals()->MaxPhysicalNum);
}
case 108:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1202 "Gmsh.y"

Christophe Geuzaine
committed
{
(yyval.l) = 0;
}

Christophe Geuzaine
committed
break;
case 109:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1206 "Gmsh.y"

Christophe Geuzaine
committed
{

Christophe Geuzaine
committed
Vertex *v = FindPoint((int)(yyvsp[(4) - (5)].d));
if(!v)
yymsg(0, "Unknown point %d", (int)(yyvsp[(4) - (5)].d));

Christophe Geuzaine
committed
else{
List_Add((yyval.l), &v);

Christophe Geuzaine
committed
}
}

Christophe Geuzaine
committed
break;
case 110:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1218 "Gmsh.y"
}
case 111:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1222 "Gmsh.y"
{
for(int i = 0; i < 4; i++) (yyval.v)[i] = (yyvsp[(2) - (2)].v)[i];
}
case 112:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1232 "Gmsh.y"
yymsg(0, "Point %d already exists", num);
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);
}
case 113:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1255 "Gmsh.y"

Christophe Geuzaine
committed
{
curPhysDim = 0;
}

Christophe Geuzaine
committed
break;
case 114:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1259 "Gmsh.y"

Christophe Geuzaine
committed
int num = (int)(yyvsp[(5) - (9)].i);
yymsg(0, "Physical point %d already exists", num);
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));
}
case 115:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1275 "Gmsh.y"
double d;
List_Read((yyvsp[(3) - (6)].l), i, &d);
if(v)
v->lc = (yyvsp[(5) - (6)].d);
else{
GVertex *gv = GModel::current()->getVertexByTag((int)d);
gv->setPrescribedMeshSizeAtVertex((yyvsp[(5) - (6)].d));
}
}
case 116:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1297 "Gmsh.y"
yymsg(0, "Curve %d already exists", num);
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;
}
case 117:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1315 "Gmsh.y"
{
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);
}
}
}
case 118:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1336 "Gmsh.y"
yymsg(0, "Curve %d already exists", num);
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);
List_Delete((yyvsp[(6) - (7)].l));
(yyval.s).Type = MSH_SEGM_SPLN;
(yyval.s).Num = num;
}
case 119:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1354 "Gmsh.y"
yymsg(0, "Curve %d already exists", num);
List_T *temp = ListOfDouble2ListOfInt((yyvsp[(6) - (8)].l));
Curve *c = Create_Curve(num, MSH_SEGM_CIRC, 2, temp, NULL,
-1, -1, 0., 1.);
if((yyvsp[(7) - (8)].v)[0] || (yyvsp[(7) - (8)].v)[1] || (yyvsp[(7) - (8)].v)[2]){
c->Circle.n[0] = (yyvsp[(7) - (8)].v)[0];
c->Circle.n[1] = (yyvsp[(7) - (8)].v)[1];
c->Circle.n[2] = (yyvsp[(7) - (8)].v)[2];
End_Curve(c);
}
Tree_Add(GModel::current()->getGEOInternals()->Curves, &c);
Curve *rc = CreateReversedCurve(c);
if((yyvsp[(7) - (8)].v)[0] || (yyvsp[(7) - (8)].v)[1] || (yyvsp[(7) - (8)].v)[2]){
rc->Circle.n[0] = (yyvsp[(7) - (8)].v)[0];
rc->Circle.n[1] = (yyvsp[(7) - (8)].v)[1];
rc->Circle.n[2] = (yyvsp[(7) - (8)].v)[2];
End_Curve(rc);
}
}
case 120:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1384 "Gmsh.y"
yymsg(0, "Curve %d already exists", num);
List_T *temp = ListOfDouble2ListOfInt((yyvsp[(6) - (8)].l));
Curve *c = Create_Curve(num, MSH_SEGM_ELLI, 2, temp, NULL,
-1, -1, 0., 1.);
if((yyvsp[(7) - (8)].v)[0] || (yyvsp[(7) - (8)].v)[1] || (yyvsp[(7) - (8)].v)[2]){
c->Circle.n[0] = (yyvsp[(7) - (8)].v)[0];
c->Circle.n[1] = (yyvsp[(7) - (8)].v)[1];
c->Circle.n[2] = (yyvsp[(7) - (8)].v)[2];
End_Curve(c);
}
Tree_Add(GModel::current()->getGEOInternals()->Curves, &c);
Curve *rc = CreateReversedCurve(c);
if((yyvsp[(7) - (8)].v)[0] || (yyvsp[(7) - (8)].v)[1] || (yyvsp[(7) - (8)].v)[2]){
rc->Circle.n[0] = (yyvsp[(7) - (8)].v)[0];
rc->Circle.n[1] = (yyvsp[(7) - (8)].v)[1];
rc->Circle.n[2] = (yyvsp[(7) - (8)].v)[2];
End_Curve(rc);
}
}
case 121:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1414 "Gmsh.y"
yymsg(0, "Curve %d already exists", num);
List_T *temp = ListOfDouble2ListOfInt((yyvsp[(6) - (7)].l));
Curve *c = Create_Curve(num, MSH_SEGM_BSPLN, 2, 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_BSPLN;
(yyval.s).Num = num;
}
case 122:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1432 "Gmsh.y"
yymsg(0, "Curve %d already exists", num);
List_T *temp = ListOfDouble2ListOfInt((yyvsp[(6) - (7)].l));
Curve *c = Create_Curve(num, MSH_SEGM_BEZIER, 2, 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_BEZIER;
(yyval.s).Num = num;
}
case 123:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1450 "Gmsh.y"
{
int num = (int)(yyvsp[(3) - (11)].d);
if(List_Nbr((yyvsp[(6) - (11)].l)) + (int)(yyvsp[(10) - (11)].d) + 1 != List_Nbr((yyvsp[(8) - (11)].l))){
yymsg(0, "Wrong definition of Nurbs Curve %d: "
"got %d knots, need N + D + 1 = %d + %d + 1 = %d",
(int)(yyvsp[(3) - (11)].d), List_Nbr((yyvsp[(8) - (11)].l)), List_Nbr((yyvsp[(6) - (11)].l)), (int)(yyvsp[(10) - (11)].d), List_Nbr((yyvsp[(6) - (11)].l)) + (int)(yyvsp[(10) - (11)].d) + 1);
if(FindCurve(num)){
yymsg(0, "Curve %d already exists", num);
}
else{
List_T *temp = ListOfDouble2ListOfInt((yyvsp[(6) - (11)].l));
Curve *c = Create_Curve(num, MSH_SEGM_NURBS, (int)(yyvsp[(10) - (11)].d), temp, (yyvsp[(8) - (11)].l),
-1, -1, 0., 1.);
Tree_Add(GModel::current()->getGEOInternals()->Curves, &c);
CreateReversedCurve(c);
List_Delete(temp);
}
List_Delete((yyvsp[(6) - (11)].l));
List_Delete((yyvsp[(8) - (11)].l));
(yyval.s).Type = MSH_SEGM_NURBS;
(yyval.s).Num = num;
}
case 124:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1476 "Gmsh.y"
yymsg(0, "Line loop %d already exists", num);
List_T *temp = ListOfDouble2ListOfInt((yyvsp[(7) - (8)].l));
sortEdgesInLoop(num, temp);
EdgeLoop *l = Create_EdgeLoop(num, temp);
Tree_Add(GModel::current()->getGEOInternals()->EdgeLoops, &l);
List_Delete(temp);
}
case 125:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1494 "Gmsh.y"
int num = (int)(yyvsp[(4) - (8)].d);
if(FindCurve(num)){
yymsg(0, "Curve %d already exists", num);
}
else{
Curve *c = Create_Curve(num, MSH_SEGM_COMPOUND, 1, NULL, NULL, -1, -1, 0., 1.);
for(int i = 0; i < List_Nbr((yyvsp[(7) - (8)].l)); i++)
c->compound.push_back((int)*(double*)List_Pointer((yyvsp[(7) - (8)].l), i));
End_Curve(c);
Tree_Add(GModel::current()->getGEOInternals()->Curves, &c);
CreateReversedCurve(c);
}
List_Delete((yyvsp[(7) - (8)].l));
(yyval.s).Type = MSH_SEGM_COMPOUND;
(yyval.s).Num = num;
}

Christophe Geuzaine
committed
break;
case 126:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1512 "Gmsh.y"
}
case 127:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1516 "Gmsh.y"

Christophe Geuzaine
committed
{
int num = (int)(yyvsp[(5) - (9)].i);
yymsg(0, "Physical line %d already exists", num);
else{
List_T *temp = ListOfDouble2ListOfInt((yyvsp[(8) - (9)].l));
PhysicalGroup *p = Create_PhysicalGroup(num, MSH_PHYSICAL_LINE, temp);
List_Delete(temp);
List_Add(GModel::current()->getGEOInternals()->PhysicalGroups, &p);

Christophe Geuzaine
committed
List_Delete((yyvsp[(8) - (9)].l));
}
case 128:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1535 "Gmsh.y"
yymsg(0, "Surface %d already exists", num);
Surface *s = Create_Surface(num, MSH_SURF_PLAN);
List_T *temp = ListOfDouble2ListOfInt((yyvsp[(7) - (8)].l));
setSurfaceGeneratrices(s, temp);
List_Delete(temp);
End_Surface(s);
Tree_Add(GModel::current()->getGEOInternals()->Surfaces, &s);
List_Delete((yyvsp[(7) - (8)].l));
(yyval.s).Type = MSH_SURF_PLAN;
(yyval.s).Num = num;
}
case 129:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1553 "Gmsh.y"

Christophe Geuzaine
committed
int num = (int)(yyvsp[(4) - (9)].d), type = 0;
yymsg(0, "Surface %d already exists", num);
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
double d;
List_Read((yyvsp[(7) - (9)].l), 0, &d);
EdgeLoop *el = FindEdgeLoop((int)fabs(d));
if(!el){
yymsg(0, "Unknown line loop %d", (int)d);
}
else{
int j = List_Nbr(el->Curves);
if(j == 4){
type = MSH_SURF_REGL;
}
else if(j == 3){
type = MSH_SURF_TRIC;
}
else{
yymsg(0, "Wrong definition of Ruled Surface %d: "
"%d borders instead of 3 or 4", num, j);
type = MSH_SURF_PLAN;
}
Surface *s = Create_Surface(num, type);
List_T *temp = ListOfDouble2ListOfInt((yyvsp[(7) - (9)].l));
setSurfaceGeneratrices(s, temp);
List_Delete(temp);
End_Surface(s);
s->InSphereCenter = (yyvsp[(8) - (9)].l);
Tree_Add(GModel::current()->getGEOInternals()->Surfaces, &s);
}

Christophe Geuzaine
committed
List_Delete((yyvsp[(7) - (9)].l));
}
case 130:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1592 "Gmsh.y"
}
case 131:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1598 "Gmsh.y"
myGmshSurface = gmshSurface::getSurface((int)(yyvsp[(3) - (4)].d));
}
case 132:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1604 "Gmsh.y"
int num = (int)(yyvsp[(4) - (10)].d);
myGmshSurface = gmshParametricSurface::NewParametricSurface(num, (yyvsp[(7) - (10)].c), (yyvsp[(8) - (10)].c), (yyvsp[(9) - (10)].c));
(yyval.s).Type = 0;
(yyval.s).Num = num;
}
case 133:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1611 "Gmsh.y"
yymsg(0, "Sphere %d has to be defined using 2 points (center + "
"any point) and not %d", num, List_Nbr((yyvsp[(6) - (7)].l)));
double p1,p2;
List_Read((yyvsp[(6) - (7)].l), 0, &p1);
List_Read((yyvsp[(6) - (7)].l), 1, &p2);
Vertex *v1 = FindPoint((int)p1);
Vertex *v2 = FindPoint((int)p2);
if(!v1) yymsg(0, "Sphere %d : unknown point %d", num, (int)p1);
if(!v2) yymsg(0, "Sphere %d : unknown point %d", num, (int)p2);
if(v1 && v2)
myGmshSurface = gmshSphere::NewSphere
(num, v1->Pos.X, v1->Pos.Y, v1->Pos.Z,
sqrt((v2->Pos.X - v1->Pos.X) * (v2->Pos.X - v1->Pos.X) +
(v2->Pos.Y - v1->Pos.Y) * (v2->Pos.Y - v1->Pos.Y) +
(v2->Pos.Z - v1->Pos.Z) * (v2->Pos.Z - v1->Pos.Z)));
}
case 134:

Christophe Geuzaine
committed
/* Line 1806 of yacc.c */
#line 1636 "Gmsh.y"
yymsg(0, "PolarSphere %d has to be defined using 2 points (center + "
"any point) and not %d", num, List_Nbr((yyvsp[(6) - (7)].l)));
double p1,p2;
List_Read((yyvsp[(6) - (7)].l), 0, &p1);
List_Read((yyvsp[(6) - (7)].l), 1, &p2);
Vertex *v1 = FindPoint((int)p1);
Vertex *v2 = FindPoint((int)p2);
if(!v1) yymsg(0, "PolarSphere %d : unknown point %d", num, (int)p1);
if(!v2) yymsg(0, "PolarSphere %d : unknown point %d", num, (int)p2);
if(v1 && v2)
myGmshSurface = gmshPolarSphere::NewPolarSphere
(num, v1->Pos.X, v1->Pos.Y, v1->Pos.Z,
sqrt((v2->Pos.X - v1->Pos.X) * (v2->Pos.X - v1->Pos.X) +
(v2->Pos.Y - v1->Pos.Y) * (v2->Pos.Y - v1->Pos.Y) +