Newer
Older

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

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

Christophe Geuzaine
committed
#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
Free((yyvsp[(3) - (9)].c)); Free((yyvsp[(6) - (9)].c));
;}
break;

Christophe Geuzaine
committed
#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));
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
case 94:
/* Line 1464 of yacc.c */
#line 997 "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);
gmsh_yysymbols[key] = val;
}
Free((yyvsp[(3) - (3)].c));
;}
break;
case 95:
/* Line 1464 of yacc.c */
#line 1008 "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);
gmsh_yysymbols[key] = val;
}
Free((yyvsp[(3) - (5)].c));
;}
break;
case 96:
/* Line 1464 of yacc.c */
#line 1019 "Gmsh.y"
{ floatOptions.clear(); charOptions.clear(); ;}
break;
case 97:
/* Line 1464 of yacc.c */
#line 1021 "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);
gmsh_yysymbols[key] = val;
}
;}
break;
case 100:
/* Line 1464 of yacc.c */
#line 1037 "Gmsh.y"
{
std::string key((yyvsp[(2) - (3)].c));
for(int i = 0; i < List_Nbr((yyvsp[(3) - (3)].l)); i++){
double v;
List_Read((yyvsp[(3) - (3)].l), i, &v);
floatOptions[key].push_back(v);
}
Free((yyvsp[(2) - (3)].c));
List_Delete((yyvsp[(3) - (3)].l));
;}
break;
case 101:
/* Line 1464 of yacc.c */
#line 1048 "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));
;}
break;
case 102:

Christophe Geuzaine
committed
{
(yyval.i) = (int)(yyvsp[(1) - (1)].d);
;}
break;

Christophe Geuzaine
committed

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

Christophe Geuzaine
committed

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

Christophe Geuzaine
committed

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
}
;}
break;

Christophe Geuzaine
committed
{
for(int i = 0; i < 4; i++) (yyval.v)[i] = 0.;
;}
break;

Christophe Geuzaine
committed
{
for(int i = 0; i < 4; i++) (yyval.v)[i] = (yyvsp[(2) - (2)].v)[i];
;}
break;

Christophe Geuzaine
committed
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);
(yyval.s).Type = MSH_POINT;
(yyval.s).Num = num;
;}
break;

Christophe Geuzaine
committed

Christophe Geuzaine
committed
{
curPhysDim = 0;
;}
break;

Christophe Geuzaine
committed

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));
(yyval.s).Type = MSH_PHYSICAL_POINT;
(yyval.s).Num = num;
;}
break;

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

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

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

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

Christophe Geuzaine
committed
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);
}
(yyval.s).Type = MSH_SEGM_CIRC;
(yyval.s).Num = num;
;}
break;

Christophe Geuzaine
committed
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);
}
(yyval.s).Type = MSH_SEGM_ELLI;
(yyval.s).Num = num;
;}
break;

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

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

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

Christophe Geuzaine
committed
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);
List_Delete((yyvsp[(7) - (8)].l));
(yyval.s).Type = MSH_SEGM_LOOP;
(yyval.s).Num = num;
;}
break;

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

Christophe Geuzaine
committed
{
curPhysDim = 1;
;}
break;

Christophe Geuzaine
committed

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));
(yyval.s).Type = MSH_PHYSICAL_LINE;
(yyval.s).Num = num;
;}
break;

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

Christophe Geuzaine
committed

Christophe Geuzaine
committed
int num = (int)(yyvsp[(4) - (9)].d), type = 0;
yymsg(0, "Surface %d already exists", num);
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
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));
(yyval.s).Type = type;
(yyval.s).Num = num;
;}
break;

Christophe Geuzaine
committed

Christophe Geuzaine
committed
myGmshSurface = gmshSurface::getSurface((int)(yyvsp[(3) - (4)].d));

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

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

Christophe Geuzaine
committed
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) +
(v2->Pos.Z - v1->Pos.Z) * (v2->Pos.Z - v1->Pos.Z)));

Christophe Geuzaine
committed
yymsg(0, "Surface loop %d already exists", num);
List_T *temp = ListOfDouble2ListOfInt((yyvsp[(7) - (8)].l));
SurfaceLoop *l = Create_SurfaceLoop(num, temp);
Tree_Add(GModel::current()->getGEOInternals()->SurfaceLoops, &l);
List_Delete(temp);
List_Delete((yyvsp[(7) - (8)].l));
(yyval.s).Type = MSH_SURF_LOOP;
(yyval.s).Num = num;
;}
break;

Christophe Geuzaine
committed
int num = (int)(yyvsp[(4) - (8)].d);
yymsg(0, "Surface %d already exists", num);
Emilie Marchandise
committed
Surface *s = Create_Surface(num, MSH_SURF_COMPOUND);
for(int i = 0; i < List_Nbr((yyvsp[(7) - (8)].l)); i++){
s->compound.push_back((int)*(double*)List_Pointer((yyvsp[(7) - (8)].l), i));
}
Tree_Add(GModel::current()->getGEOInternals()->Surfaces, &s);
List_Delete((yyvsp[(7) - (8)].l));

Christophe Geuzaine
committed
int num = (int)(yyvsp[(4) - (12)].d);
yymsg(0, "Surface %d already exists", num);
for(int i = 0; i < List_Nbr((yyvsp[(7) - (12)].l)); i++)
s->compound.push_back((int)*(double*)List_Pointer((yyvsp[(7) - (12)].l), i));
for (int i = 0; i < List_Nbr((yyvsp[(10) - (12)].l)); i++){
if(i > 3){
yymsg(0, "Too many boundary specifiers in compound surface");
break;
}
List_T *l = *(List_T**)List_Pointer((yyvsp[(10) - (12)].l), i);
s->compoundBoundary[i].push_back((int)*(double*)List_Pointer(l, j));
}
}
Tree_Add(GModel::current()->getGEOInternals()->Surfaces, &s);
List_Delete((yyvsp[(7) - (12)].l));
for (int i = 0; i < List_Nbr((yyvsp[(10) - (12)].l)); i++)
List_Delete(*(List_T**)List_Pointer((yyvsp[(10) - (12)].l), i));
List_Delete((yyvsp[(10) - (12)].l));
Free((yyvsp[(8) - (12)].c));
(yyval.s).Num = num;
;}
break;

Christophe Geuzaine
committed

Christophe Geuzaine
committed
int num = (int)(yyvsp[(5) - (9)].i);
if(FindPhysicalGroup(num, MSH_PHYSICAL_SURFACE)){
yymsg(0, "Physical surface %d already exists", num);
List_T *temp = ListOfDouble2ListOfInt((yyvsp[(8) - (9)].l));
PhysicalGroup *p = Create_PhysicalGroup(num, MSH_PHYSICAL_SURFACE, temp);
List_Delete(temp);
List_Add(GModel::current()->getGEOInternals()->PhysicalGroups, &p);
List_Delete((yyvsp[(8) - (9)].l));
(yyval.s).Type = MSH_PHYSICAL_SURFACE;
(yyval.s).Num = num;
;}
break;

Christophe Geuzaine
committed
yymsg(0, "'Complex Volume' command is deprecated: use 'Volume' instead");
yymsg(0, "Volume %d already exists", num);
Volume *v = Create_Volume(num, MSH_VOLUME);
List_T *temp = ListOfDouble2ListOfInt((yyvsp[(7) - (8)].l));
setVolumeSurfaces(v, temp);
List_Delete(temp);
Tree_Add(GModel::current()->getGEOInternals()->Volumes, &v);
List_Delete((yyvsp[(7) - (8)].l));
(yyval.s).Type = MSH_VOLUME;
(yyval.s).Num = num;
;}
break;

Christophe Geuzaine
committed
yymsg(0, "Volume %d already exists", num);
Volume *v = Create_Volume(num, MSH_VOLUME);
List_T *temp = ListOfDouble2ListOfInt((yyvsp[(6) - (7)].l));
setVolumeSurfaces(v, temp);
List_Delete(temp);
Tree_Add(GModel::current()->getGEOInternals()->Volumes, &v);
List_Delete((yyvsp[(6) - (7)].l));
(yyval.s).Type = MSH_VOLUME;
(yyval.s).Num = num;
;}
break;

Christophe Geuzaine
committed
{
int num = (int)(yyvsp[(4) - (8)].d);
if(FindVolume(num)){
yymsg(0, "Volume %d already exists", num);
Volume *v = Create_Volume(num, MSH_VOLUME_COMPOUND);
for(int i = 0; i < List_Nbr((yyvsp[(7) - (8)].l)); i++)
v->compound.push_back((int)*(double*)List_Pointer((yyvsp[(7) - (8)].l), i));
Tree_Add(GModel::current()->getGEOInternals()->Volumes, &v);
}
List_Delete((yyvsp[(7) - (8)].l));
(yyval.s).Type = MSH_VOLUME_COMPOUND;
(yyval.s).Num = num;
;}
break;

Christophe Geuzaine
committed

Christophe Geuzaine
committed
{
curPhysDim = 3;
;}
break;

Christophe Geuzaine
committed

Christophe Geuzaine
committed
int num = (int)(yyvsp[(5) - (9)].i);
yymsg(0, "Physical volume %d already exists", num);
List_T *temp = ListOfDouble2ListOfInt((yyvsp[(8) - (9)].l));
PhysicalGroup *p = Create_PhysicalGroup(num, MSH_PHYSICAL_VOLUME, 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_VOLUME;
(yyval.s).Num = num;
;}
break;

Christophe Geuzaine
committed
{
TranslateShapes((yyvsp[(2) - (5)].v)[0], (yyvsp[(2) - (5)].v)[1], (yyvsp[(2) - (5)].v)[2], (yyvsp[(4) - (5)].l));
(yyval.l) = (yyvsp[(4) - (5)].l);
;}
break;

Christophe Geuzaine
committed
{
RotateShapes((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), (yyvsp[(10) - (11)].l));
(yyval.l) = (yyvsp[(10) - (11)].l);
;}
break;