Newer
Older

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 908 "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));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 931 "Gmsh.y"
if(!strcmp((yyvsp[(1) - (5)].c),"Background"))
GModel::current()->getFields()->background_field = (int)(yyvsp[(4) - (5)].d);
else if(!strcmp((yyvsp[(1) - (5)].c),"BoundaryLayer"))
GModel::current()->getFields()->boundaryLayer_field = (int)(yyvsp[(4) - (5)].d);
yymsg(0, "Unknown command %s Field", (yyvsp[(1) - (5)].c));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 942 "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));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 950 "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));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 972 "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));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 995 "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));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1023 "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

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1035 "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));
/* Line 1464 of yacc.c */
#line 1053 "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));
/* Line 1464 of yacc.c */
#line 1064 "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));
/* Line 1464 of yacc.c */
#line 1075 "Gmsh.y"
{ floatOptions.clear(); charOptions.clear(); ;}
/* Line 1464 of yacc.c */
#line 1077 "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);
/* Line 1464 of yacc.c */
#line 1093 "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));
/* Line 1464 of yacc.c */
#line 1104 "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));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1117 "Gmsh.y"

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1121 "Gmsh.y"

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

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1131 "Gmsh.y"

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

Christophe Geuzaine
committed
break;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1135 "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;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1147 "Gmsh.y"

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

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1161 "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);

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1184 "Gmsh.y"

Christophe Geuzaine
committed
{
curPhysDim = 0;

Christophe Geuzaine
committed
break;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1188 "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));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1204 "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));
}

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1226 "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;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1244 "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);
}
}

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1265 "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;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1283 "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);
}

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1313 "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);
}

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1343 "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;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1361 "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;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1379 "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;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1405 "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);

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1423 "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;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1441 "Gmsh.y"

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1445 "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));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1464 "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;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1482 "Gmsh.y"

Christophe Geuzaine
committed
int num = (int)(yyvsp[(4) - (9)].d), type = 0;
yymsg(0, "Surface %d already exists", num);
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
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));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1521 "Gmsh.y"

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

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1533 "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;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1540 "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)));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1565 "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) +
(v2->Pos.Z - v1->Pos.Z) * (v2->Pos.Z - v1->Pos.Z)));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1590 "Gmsh.y"
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);

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1607 "Gmsh.y"
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
/* Line 1464 of yacc.c */
#line 1625 "Gmsh.y"
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));

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1655 "Gmsh.y"

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1659 "Gmsh.y"
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;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1679 "Gmsh.y"
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;

Christophe Geuzaine
committed
/* Line 1464 of yacc.c */
#line 1697 "Gmsh.y"
yymsg(0, "Volume %d already exists", num);