Newer
Older
ViewElementIdx = 18; ViewNumNodes = 18; ViewNumComp = 1;
ViewValueList = View->SI2; ViewNumList = &View->NbSI2;
}
ViewElementIdx = 19; ViewNumNodes = 18; ViewNumComp = 3;
ViewValueList = View->VI2; ViewNumList = &View->NbVI2;
}
ViewElementIdx = 20; ViewNumNodes = 18; ViewNumComp = 9;
ViewValueList = View->TI2; ViewNumList = &View->NbTI2;
}
ViewElementIdx = 21; ViewNumNodes = 14; ViewNumComp = 1;
ViewValueList = View->SY2; ViewNumList = &View->NbSY2;
}
ViewElementIdx = 22; ViewNumNodes = 14; ViewNumComp = 3;
ViewValueList = View->VY2; ViewNumList = &View->NbVY2;
}
ViewElementIdx = 23; ViewNumNodes = 14; ViewNumComp = 9;
ViewValueList = View->TY2; ViewNumList = &View->NbTY2;
}
else{
ViewElementIdx = -1; ViewNumNodes = 0; ViewNumComp = 0;
ViewValueList = NULL; ViewNumList = NULL;
}

Christophe Geuzaine
committed
#line 484 "Gmsh.y"
if(ViewValueList){
if(ViewCoordIdx != 3 * ViewNumNodes){
yymsg(GERROR, "Wrong number of node coordinates (%d != %d)",
ViewCoordIdx, 3 * ViewNumNodes);
double d = 0;
for(int i = 0; i < 3 * ViewNumNodes; i++)
List_Add(ViewValueList, &d);
}
else{
for(int i = 0; i < 3; i++)
for(int j = 0; j < ViewNumNodes; j++)
List_Add(ViewValueList, &ViewCoord[3*j+i]);
}
ViewNumListTmp = List_Nbr(ViewValueList);
}

Christophe Geuzaine
committed
#line 502 "Gmsh.y"
if(ViewValueList){
if((List_Nbr(ViewValueList) - ViewNumListTmp) % (ViewNumComp * ViewNumNodes))
ViewErrorFlags[ViewElementIdx]++;
(*ViewNumList)++;
}

Christophe Geuzaine
committed
#line 513 "Gmsh.y"
{
for(int i = 0; i < (int)strlen(yyvsp[0].c)+1; i++) List_Add(View->T2C, &yyvsp[0].c[i]);
Free(yyvsp[0].c);
;
break;}
case 43:

Christophe Geuzaine
committed
#line 518 "Gmsh.y"
{
for(int i = 0; i < (int)strlen(yyvsp[0].c)+1; i++) List_Add(View->T2C, &yyvsp[0].c[i]);
Free(yyvsp[0].c);
;
break;}
case 44:

Christophe Geuzaine
committed
#line 526 "Gmsh.y"
{
List_Add(View->T2D, &yyvsp[-5].d); List_Add(View->T2D, &yyvsp[-3].d);
List_Add(View->T2D, &yyvsp[-1].d);

Christophe Geuzaine
committed
#line 533 "Gmsh.y"

Christophe Geuzaine
committed
#line 540 "Gmsh.y"
{
for(int i = 0; i < (int)strlen(yyvsp[0].c)+1; i++) List_Add(View->T3C, &yyvsp[0].c[i]);
Free(yyvsp[0].c);
;
break;}
case 47:

Christophe Geuzaine
committed
#line 545 "Gmsh.y"
{
for(int i = 0; i < (int)strlen(yyvsp[0].c)+1; i++) List_Add(View->T3C, &yyvsp[0].c[i]);
Free(yyvsp[0].c);
;
break;}
case 48:

Christophe Geuzaine
committed
#line 553 "Gmsh.y"
{
List_Add(View->T3D, &yyvsp[-7].d); List_Add(View->T3D, &yyvsp[-5].d);
List_Add(View->T3D, &yyvsp[-3].d); List_Add(View->T3D, &yyvsp[-1].d);

Christophe Geuzaine
committed
#line 560 "Gmsh.y"

Christophe Geuzaine
committed
#line 568 "Gmsh.y"
{
View->adaptive = new Adaptive_Post_View(View, yyvsp[-5].l, yyvsp[-2].l);
;
break;}
case 51:

Christophe Geuzaine
committed
#line 575 "Gmsh.y"

Christophe Geuzaine
committed
#line 579 "Gmsh.y"

Christophe Geuzaine
committed
#line 584 "Gmsh.y"
{
(*View->Grains) [(int)yyvsp[-3].d] = yyvsp[-1].l;
;
break;}
case 54:

Christophe Geuzaine
committed
#line 592 "Gmsh.y"

Christophe Geuzaine
committed
#line 593 "Gmsh.y"

Christophe Geuzaine
committed
#line 594 "Gmsh.y"

Christophe Geuzaine
committed
#line 595 "Gmsh.y"

Christophe Geuzaine
committed
#line 596 "Gmsh.y"

Christophe Geuzaine
committed
#line 600 "Gmsh.y"

Christophe Geuzaine
committed
#line 601 "Gmsh.y"

Christophe Geuzaine
committed
#line 609 "Gmsh.y"

Christophe Geuzaine
committed
}
yymsg(GERROR, "Unknown variable '%s'", yyvsp[-3].c);
Free(yyvsp[-3].c);
switch(yyvsp[-2].i){
case 0 : *pd = yyvsp[-1].d; break;
case 1 : *pd += yyvsp[-1].d; break;
case 2 : *pd -= yyvsp[-1].d; break;
case 3 : *pd *= yyvsp[-1].d; break;

Christophe Geuzaine
committed
case 4 :
if(yyvsp[-1].d) *pd /= yyvsp[-1].d;
else yymsg(GERROR, "Division by zero in '%s /= %g'", yyvsp[-3].c, yyvsp[-1].d);

Christophe Geuzaine
committed
break;
}

Christophe Geuzaine
committed
#line 640 "Gmsh.y"

Christophe Geuzaine
committed
}
yymsg(GERROR, "Unknown variable '%s'", yyvsp[-6].c);
Free(yyvsp[-6].c);
if((pd = (double*)List_Pointer_Test(pSymbol->val, (int)yyvsp[-4].d))){
switch(yyvsp[-2].i){
case 0 : *pd = yyvsp[-1].d; break;
case 1 : *pd += yyvsp[-1].d; break;
case 2 : *pd -= yyvsp[-1].d; break;
case 3 : *pd *= yyvsp[-1].d; break;

Christophe Geuzaine
committed
case 4 :
if(yyvsp[-1].d) *pd /= yyvsp[-1].d;
else yymsg(GERROR, "Division by zero in '%s[%d] /= %g'", yyvsp[-6].c, (int)yyvsp[-4].d, yyvsp[-1].d);

Christophe Geuzaine
committed
break;
}
}
else{
if(!yyvsp[-2].i)
List_Put(pSymbol->val, (int)yyvsp[-4].d, &yyvsp[-1].d);

Christophe Geuzaine
committed
else
yymsg(GERROR, "Uninitialized variable '%s[%d]'", yyvsp[-6].c, (int)yyvsp[-4].d);

Christophe Geuzaine
committed
}

Christophe Geuzaine
committed
#line 679 "Gmsh.y"

Christophe Geuzaine
committed
yymsg(GERROR, "Incompatible array dimensions in affectation");
for(int i = 0; i < List_Nbr(yyvsp[-5].l); i++){
List_Put(TheSymbol.val, (int)(*(double*)List_Pointer(yyvsp[-5].l, i)),
(double*)List_Pointer(yyvsp[-1].l, i));
yymsg(GERROR, "Unknown variable '%s'", yyvsp[-8].c);
Free(yyvsp[-8].c);
for(int i = 0; i < List_Nbr(yyvsp[-5].l); i++){
int j = (int)(*(double*)List_Pointer(yyvsp[-5].l, i));
double d = *(double*)List_Pointer(yyvsp[-1].l, i);
if((pd = (double*)List_Pointer_Test(pSymbol->val, j))){
case 0 : *pd = d; break;
case 1 : *pd += d; break;
case 2 : *pd -= d; break;
case 3 : *pd *= d; break;
if(yyvsp[-1].l) *pd /= d;
else yymsg(GERROR, "Division by zero in '%s[%d] /= %g'", yyvsp[-8].c, j, d);
List_Put(pSymbol->val, j, &d);
else
yymsg(GERROR, "Uninitialized variable '%s[%d]'", yyvsp[-8].c, j);
List_Delete(yyvsp[-5].l);
List_Delete(yyvsp[-1].l);
;
break;}
case 64:

Christophe Geuzaine
committed
#line 733 "Gmsh.y"
if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))){
TheSymbol.val = List_Create(5, 5, sizeof(double));
}
else{
List_Reset(pSymbol->val);

Christophe Geuzaine
committed
#line 750 "Gmsh.y"
Symbol *pSymbol;
if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))){
TheSymbol.val = List_Create(5, 5, sizeof(double));
for(int i = 0; i < List_Nbr(yyvsp[-1].l); i++)
List_Add(pSymbol->val, List_Pointer(yyvsp[-1].l, i));
Free(yyvsp[-5].c);
}
List_Delete(yyvsp[-1].l);
;
break;}
case 66:

Christophe Geuzaine
committed
#line 768 "Gmsh.y"
*(double*)List_Pointer_Fast(pSymbol->val, 0) += yyvsp[-1].i;
Free(yyvsp[-2].c);
;
break;}
case 67:

Christophe Geuzaine
committed
#line 779 "Gmsh.y"
if((pd = (double*)List_Pointer_Test(pSymbol->val, (int)yyvsp[-3].d)))
*pd += yyvsp[-1].i;
yymsg(GERROR, "Uninitialized variable '%s[%d]'", yyvsp[-5].c, (int)yyvsp[-3].d);

Christophe Geuzaine
committed
#line 798 "Gmsh.y"
char* (*pStrOpt)(int num, int action, char *value);
StringXString *pStrCat;
if(!(pStrCat = Get_StringOptionCategory(yyvsp[-5].c)))
yymsg(GERROR, "Unknown string option class '%s'", yyvsp[-5].c);
if(!(pStrOpt = (char *(*) (int, int, char *))Get_StringOption(yyvsp[-3].c, pStrCat)))
yymsg(GERROR, "Unknown string option '%s.%s'", yyvsp[-5].c, yyvsp[-3].c);
Free(yyvsp[-5].c); Free(yyvsp[-3].c); //FIXME: somtimes leak $5
;
break;}
case 69:

Christophe Geuzaine
committed
#line 812 "Gmsh.y"
char* (*pStrOpt)(int num, int action, char *value);
StringXString *pStrCat;
if(!(pStrCat = Get_StringOptionCategory(yyvsp[-8].c)))
yymsg(GERROR, "Unknown string option class '%s'", yyvsp[-8].c);
if(!(pStrOpt = (char *(*) (int, int, char *))Get_StringOption(yyvsp[-3].c, pStrCat)))
yymsg(GERROR, "Unknown string option '%s[%d].%s'", yyvsp[-8].c, (int)yyvsp[-6].d, yyvsp[-3].c);
Free(yyvsp[-8].c); Free(yyvsp[-3].c); //FIXME: somtimes leak $8
;
break;}
case 70:

Christophe Geuzaine
committed
#line 829 "Gmsh.y"
double (*pNumOpt)(int num, int action, double value);
StringXNumber *pNumCat;
if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-5].c)))
yymsg(GERROR, "Unknown numeric option class '%s'", yyvsp[-5].c);
if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[-3].c, pNumCat)))
yymsg(GERROR, "Unknown numeric option '%s.%s'", yyvsp[-5].c, yyvsp[-3].c);
switch(yyvsp[-2].i){
case 0 : d = yyvsp[-1].d; break;
case 1 : d = pNumOpt(0, GMSH_GET, 0) + yyvsp[-1].d; break;
case 2 : d = pNumOpt(0, GMSH_GET, 0) - yyvsp[-1].d; break;
case 3 : d = pNumOpt(0, GMSH_GET, 0) * yyvsp[-1].d; break;

Christophe Geuzaine
committed
case 4 :
if(yyvsp[-1].d) d = pNumOpt(0, GMSH_GET, 0) / yyvsp[-1].d;
else yymsg(GERROR, "Division by zero in '%s.%s /= %g'", yyvsp[-5].c, yyvsp[-3].c, yyvsp[-1].d);

Christophe Geuzaine
committed
break;
}
Free(yyvsp[-5].c); Free(yyvsp[-3].c);
;
break;}
case 71:

Christophe Geuzaine
committed
#line 855 "Gmsh.y"
double (*pNumOpt)(int num, int action, double value);
StringXNumber *pNumCat;
if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-8].c)))
yymsg(GERROR, "Unknown numeric option class '%s'", yyvsp[-8].c);
if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[-3].c, pNumCat)))
yymsg(GERROR, "Unknown numeric option '%s[%d].%s'", yyvsp[-8].c, (int)yyvsp[-6].d, yyvsp[-3].c);
switch(yyvsp[-2].i){
case 0 : d = yyvsp[-1].d; break;
case 1 : d = pNumOpt((int)yyvsp[-6].d, GMSH_GET, 0) + yyvsp[-1].d; break;
case 2 : d = pNumOpt((int)yyvsp[-6].d, GMSH_GET, 0) - yyvsp[-1].d; break;
case 3 : d = pNumOpt((int)yyvsp[-6].d, GMSH_GET, 0) * yyvsp[-1].d; break;

Christophe Geuzaine
committed
case 4 :
if(yyvsp[-1].d) d = pNumOpt((int)yyvsp[-6].d, GMSH_GET, 0) / yyvsp[-1].d;

Christophe Geuzaine
committed
else yymsg(GERROR, "Division by zero in '%s[%d].%s /= %g'",

Christophe Geuzaine
committed
break;
}
Free(yyvsp[-8].c); Free(yyvsp[-3].c);
;
break;}
case 72:

Christophe Geuzaine
committed
#line 882 "Gmsh.y"
double (*pNumOpt)(int num, int action, double value);
StringXNumber *pNumCat;
if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-4].c)))
yymsg(GERROR, "Unknown numeric option class '%s'", yyvsp[-4].c);
if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[-2].c, pNumCat)))
yymsg(GERROR, "Unknown numeric option '%s.%s'", yyvsp[-4].c, yyvsp[-2].c);

Christophe Geuzaine
committed
else
pNumOpt(0, GMSH_SET|GMSH_GUI, pNumOpt(0, GMSH_GET, 0)+yyvsp[-1].i);
Free(yyvsp[-4].c); Free(yyvsp[-2].c);
;
break;}
case 73:

Christophe Geuzaine
committed
#line 896 "Gmsh.y"
double (*pNumOpt)(int num, int action, double value);
StringXNumber *pNumCat;
if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-7].c)))
yymsg(GERROR, "Unknown numeric option class '%s'", yyvsp[-7].c);
if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[-2].c, pNumCat)))
yymsg(GERROR, "Unknown numeric option '%s[%d].%s'", yyvsp[-7].c, (int)yyvsp[-5].d, yyvsp[-2].c);

Christophe Geuzaine
committed
else
pNumOpt((int)yyvsp[-5].d, GMSH_SET|GMSH_GUI, pNumOpt((int)yyvsp[-5].d, GMSH_GET, 0)+yyvsp[-1].i);
Free(yyvsp[-7].c); Free(yyvsp[-2].c);
;
break;}
case 74:

Christophe Geuzaine
committed
#line 913 "Gmsh.y"
unsigned int (*pColOpt)(int num, int action, unsigned int value);
StringXColor *pColCat;
if(!(pColCat = Get_ColorOptionCategory(yyvsp[-7].c)))
yymsg(GERROR, "Unknown color option class '%s'", yyvsp[-7].c);
if(!(pColOpt = (unsigned int (*) (int, int, unsigned int))Get_ColorOption(yyvsp[-3].c, pColCat)))
yymsg(GERROR, "Unknown color option '%s.Color.%s'", yyvsp[-7].c, yyvsp[-3].c);

Christophe Geuzaine
committed
else
Free(yyvsp[-7].c); Free(yyvsp[-3].c);
;
break;}
case 75:

Christophe Geuzaine
committed
#line 927 "Gmsh.y"
unsigned int (*pColOpt)(int num, int action, unsigned int value);
StringXColor *pColCat;
if(!(pColCat = Get_ColorOptionCategory(yyvsp[-10].c)))
yymsg(GERROR, "Unknown color option class '%s'", yyvsp[-10].c);
if(!(pColOpt = (unsigned int (*) (int, int, unsigned int))Get_ColorOption(yyvsp[-3].c, pColCat)))
yymsg(GERROR, "Unknown color option '%s[%d].Color.%s'", yyvsp[-10].c, (int)yyvsp[-8].d, yyvsp[-3].c);

Christophe Geuzaine
committed
else
}
Free(yyvsp[-10].c); Free(yyvsp[-3].c);
;
break;}
case 76:

Christophe Geuzaine
committed
#line 944 "Gmsh.y"
GmshColorTable *ct = Get_ColorTable(0);

Christophe Geuzaine
committed
yymsg(GERROR, "View[%d] does not exist", 0);

Christophe Geuzaine
committed
yymsg(GERROR, "Too many (%d>%d) colors in View[%d].ColorTable",
ct->size, COLORTABLE_NBMAX_COLOR, 0);
for(int i = 0; i < ct->size; i++) List_Read(yyvsp[-1].l, i, &ct->table[i]);
if(ct->size == 1){
ct->size = 2;
ct->table[1] = ct->table[0];
}
Free(yyvsp[-5].c);
List_Delete(yyvsp[-1].l);
;
break;}
case 77:

Christophe Geuzaine
committed
#line 964 "Gmsh.y"

Christophe Geuzaine
committed
if(!ct)

Christophe Geuzaine
committed
if(ct->size > COLORTABLE_NBMAX_COLOR)

Christophe Geuzaine
committed
yymsg(GERROR, "Too many (%d>%d) colors in View[%d].ColorTable",

Christophe Geuzaine
committed
else
for(int i = 0; i < ct->size; i++) List_Read(yyvsp[-1].l, i, &ct->table[i]);
if(ct->size == 1){
ct->size = 2;
ct->table[1] = ct->table[0];
}
}
Free(yyvsp[-8].c);
List_Delete(yyvsp[-1].l);
;
break;}
case 78:

Christophe Geuzaine
committed
#line 987 "Gmsh.y"
GMSH_PluginManager::instance()->setPluginOption(yyvsp[-6].c, yyvsp[-3].c, yyvsp[-1].d);
yymsg(GERROR, "Unknown option '%s' or plugin '%s'", yyvsp[-3].c, yyvsp[-6].c);
Free(yyvsp[-6].c); Free(yyvsp[-3].c);
;
break;}
case 79:

Christophe Geuzaine
committed
#line 997 "Gmsh.y"
GMSH_PluginManager::instance()->setPluginOption(yyvsp[-6].c, yyvsp[-3].c, yyvsp[-1].c);
yymsg(GERROR, "Unknown option '%s' or plugin '%s'", yyvsp[-3].c, yyvsp[-6].c);
Free(yyvsp[-6].c); Free(yyvsp[-3].c); // FIXME: sometimes leak $8
;
break;}
case 80:

Christophe Geuzaine
committed
#line 1012 "Gmsh.y"

Christophe Geuzaine
committed
#line 1016 "Gmsh.y"
{
yyval.i = GMODEL->setPhysicalName(std::string(yyvsp[0].c), ++THEM->MaxPhysicalNum);
Free(yyvsp[0].c);
;
break;}

Christophe Geuzaine
committed
#line 1028 "Gmsh.y"
double x = CTX.geom.scaling_factor * yyvsp[-1].v[0];
double y = CTX.geom.scaling_factor * yyvsp[-1].v[1];
double z = CTX.geom.scaling_factor * yyvsp[-1].v[2];
double lc = CTX.geom.scaling_factor * yyvsp[-1].v[3];
Vertex *v = Create_Vertex(num, x, y, z, lc, 1.0);
yyval.s.Type = MSH_POINT;
yyval.s.Num = num;
;
break;}

Christophe Geuzaine
committed
#line 1046 "Gmsh.y"
{
int num = (int)yyvsp[-9].d;
if(FindPoint(num)){
yymsg(GERROR, "Point %d already exists", num);
}
else{
double u = CTX.geom.scaling_factor * yyvsp[-1].v[0];
double v = CTX.geom.scaling_factor * yyvsp[-1].v[1];
double lc = CTX.geom.scaling_factor * yyvsp[-1].v[2];
yymsg(GERROR, "gmshSurface %d does not exist", (int)yyvsp[-4].d);
}
else{
Vertex *vt = Create_Vertex(num, u, v, surf, lc);
Tree_Add(THEM->Points, &vt);
AddToTemporaryBoundingBox(vt->Pos.X,vt->Pos.Y,vt->Pos.Z);
}
}
yyval.s.Type = MSH_POINT;
yyval.s.Num = num;
;
break;}

Christophe Geuzaine
committed
#line 1069 "Gmsh.y"
yymsg(GERROR, "Physical point %d already exists", num);
}
else{
PhysicalGroup *p = Create_PhysicalGroup(num, MSH_PHYSICAL_POINT, temp);
List_Delete(temp);
List_Add(THEM->PhysicalGroups, &p);
}
List_Delete(yyvsp[-1].l);
yyval.s.Type = MSH_PHYSICAL_POINT;
yyval.s.Num = num;
;
break;}

Christophe Geuzaine
committed
#line 1085 "Gmsh.y"
double pars[] = { CTX.lc/10, CTX.lc/100., CTX.lc/20, 10, 3 };
for(int i = 0; i < List_Nbr(yyvsp[-1].l); i++){
if(i > 4)
yymsg(GERROR, "Too many paramaters for attractor line (max = 5)");
else
List_Read(yyvsp[-1].l, i, &pars[i]);
}
// treshold attractor: first parameter is the treshold, next two
// are the in and out size fields, last is transition factor
Attractor *att = tresholdAttractor::New(pars[0], pars[1], pars[2], pars[4]);
for(int i = 0; i < List_Nbr(yyvsp[-3].l); i++){
double d;
List_Read(yyvsp[-3].l, i, &d);
Vertex *v = FindPoint((int)d);
if(v)
att->addPoint(v->Pos.X,v->Pos.Y,v->Pos.Z);
else{
GVertex *gv = GMODEL->vertexByTag((int)d);
if(gv)
att->addPoint(gv->x(),gv->y(),gv->z());
}
}
att->buildFastSearchStructures();
yyval.s.Type = MSH_POINT_ATTRACTOR;

Christophe Geuzaine
committed
#line 1113 "Gmsh.y"
double pars[] = { CTX.lc/10, CTX.lc/100., CTX.lc/20, 10, 3 };
for(int i = 0; i < List_Nbr(yyvsp[-1].l); i++){
if(i > 4)
yymsg(GERROR, "Too many paramaters for attractor line (max = 5)");
else
List_Read(yyvsp[-1].l, i, &pars[i]);
}
// treshold attractor: first parameter is the treshold, next two
// are the in and out size fields, last is transition factor
Attractor *att = tresholdAttractor::New(pars[0], pars[1], pars[2], pars[4]);
for(int i = 0; i < List_Nbr(yyvsp[-3].l); i++){
double d;
List_Read(yyvsp[-3].l, i, &d);
Curve *c = FindCurve((int)d);
else{
GEdge *ge = GMODEL->edgeByTag((int)d);
if(ge){
buildListOfPoints( att , ge , (int) pars[3] );
}
}
}
att->buildFastSearchStructures();
yyval.s.Type = MSH_LINE_ATTRACTOR;
yyval.s.Num = 0;
;
break;}
case 87:

Christophe Geuzaine
committed
#line 1143 "Gmsh.y"
List_Read(yyvsp[-3].l, i, &d);
Vertex *v = FindPoint((int)d);
if(v)
v->lc = yyvsp[-1].d;
else{
GVertex *gv = GMODEL->vertexByTag((int)d);
if(gv)
gv->setPrescribedMeshSizeAtVertex(yyvsp[-1].d);
}

Christophe Geuzaine
committed
#line 1165 "Gmsh.y"
Curve *c = Create_Curve(num, MSH_SEGM_LINE, 1, temp, NULL,
-1, -1, 0., 1.);
Tree_Add(THEM->Curves, &c);
List_Delete(yyvsp[-1].l);
yyval.s.Type = MSH_SEGM_LINE;
yyval.s.Num = num;
;
break;}

Christophe Geuzaine
committed
#line 1183 "Gmsh.y"
Curve *c = Create_Curve(num, MSH_SEGM_SPLN, 3, temp, NULL,
-1, -1, 0., 1.);
Tree_Add(THEM->Curves, &c);
List_Delete(yyvsp[-1].l);
yyval.s.Type = MSH_SEGM_SPLN;
yyval.s.Num = num;
;
break;}

Christophe Geuzaine
committed
#line 1201 "Gmsh.y"
Curve *c = Create_Curve(num, MSH_SEGM_CIRC, 2, temp, NULL,
-1, -1, 0., 1.);
Tree_Add(THEM->Curves, &c);
List_Delete(yyvsp[-1].l);
yyval.s.Type = MSH_SEGM_CIRC;
yyval.s.Num = num;
;
break;}

Christophe Geuzaine
committed
#line 1219 "Gmsh.y"
Curve *c = Create_Curve(num, MSH_SEGM_CIRC, 2, temp, NULL,
-1, -1, 0., 1.);
c->Circle.n[0] = yyvsp[-1].v[0];
c->Circle.n[1] = yyvsp[-1].v[1];
c->Circle.n[2] = yyvsp[-1].v[2];
rc->Circle.n[0] = yyvsp[-1].v[0];
rc->Circle.n[1] = yyvsp[-1].v[1];
rc->Circle.n[2] = yyvsp[-1].v[2];
List_Delete(yyvsp[-3].l);
yyval.s.Type = MSH_SEGM_CIRC;
yyval.s.Num = num;
;
break;}

Christophe Geuzaine
committed
#line 1245 "Gmsh.y"
Curve *c = Create_Curve(num, MSH_SEGM_ELLI, 2, temp, NULL,
-1, -1, 0., 1.);
Tree_Add(THEM->Curves, &c);
List_Delete(yyvsp[-1].l);
yyval.s.Type = MSH_SEGM_ELLI;
yyval.s.Num = num;
;
break;}

Christophe Geuzaine
committed
#line 1263 "Gmsh.y"
Curve *c = Create_Curve(num, MSH_SEGM_ELLI, 2, temp, NULL,
-1, -1, 0., 1.);
c->Circle.n[0] = yyvsp[-1].v[0];
c->Circle.n[1] = yyvsp[-1].v[1];
c->Circle.n[2] = yyvsp[-1].v[2];
rc->Circle.n[0] = yyvsp[-1].v[0];
rc->Circle.n[1] = yyvsp[-1].v[1];
rc->Circle.n[2] = yyvsp[-1].v[2];
List_Delete(yyvsp[-3].l);
yyval.s.Type = MSH_SEGM_ELLI;
yyval.s.Num = num;
;
break;}

Christophe Geuzaine
committed
#line 1290 "Gmsh.y"
yymsg(GERROR, "Curve %d already exists", num);
}
else{
Curve *c = Create_Curve(num, MSH_SEGM_PARAMETRIC, 2, NULL, NULL,
-1, -1, yyvsp[-10].d, yyvsp[-8].d);
strcpy(c->functu, yyvsp[-6].c);
strcpy(c->functv, yyvsp[-4].c);
strcpy(c->functw, yyvsp[-2].c);
Free(yyvsp[-6].c); Free(yyvsp[-4].c); Free(yyvsp[-2].c);
yyval.s.Type = MSH_SEGM_PARAMETRIC;
yyval.s.Num = num;
;
break;}

Christophe Geuzaine
committed
#line 1309 "Gmsh.y"
{
int num = (int)yyvsp[-4].d;
if(List_Nbr(yyvsp[-1].l) < 4){
yymsg(GERROR, "Too few control points for BSpline %d (%d < 4)", num,
Curve *c = Create_Curve(num, MSH_SEGM_BSPLN, 2, temp, NULL,
-1, -1, 0., 1.);
Tree_Add(THEM->Curves, &c);
List_Delete(yyvsp[-1].l);
yyval.s.Type = MSH_SEGM_BSPLN;
yyval.s.Num = num;
;
break;}

Christophe Geuzaine
committed
#line 1333 "Gmsh.y"
{
int num = (int)yyvsp[-4].d;
if(List_Nbr(yyvsp[-1].l) < 4){
yymsg(GERROR, "Too few control points for Bezier curve %d (%d < 4)", num,
Curve *c = Create_Curve(num, MSH_SEGM_BEZIER, 2, temp, NULL,
-1, -1, 0., 1.);
Tree_Add(THEM->Curves, &c);
List_Delete(yyvsp[-1].l);
yyval.s.Type = MSH_SEGM_BEZIER;
yyval.s.Num = num;
;
break;}

Christophe Geuzaine
committed
#line 1357 "Gmsh.y"
{
int num = (int)yyvsp[-8].d;
if(List_Nbr(yyvsp[-5].l) + (int)yyvsp[-1].d + 1 != List_Nbr(yyvsp[-3].l)){
yymsg(GERROR, "Wrong definition of Nurbs Curve %d: "
"got %d knots, need N + D + 1 = %d + %d + 1 = %d",
(int)yyvsp[-8].d, List_Nbr(yyvsp[-3].l), List_Nbr(yyvsp[-5].l), (int)yyvsp[-1].d, List_Nbr(yyvsp[-5].l) + (int)yyvsp[-1].d + 1);
List_T *temp = ListOfDouble2ListOfInt(yyvsp[-5].l);
Curve *c = Create_Curve(num, MSH_SEGM_NURBS, (int)yyvsp[-1].d, temp, yyvsp[-3].l,
List_Delete(yyvsp[-5].l);
List_Delete(yyvsp[-3].l);
yyval.s.Type = MSH_SEGM_NURBS;
yyval.s.Num = num;
;
break;}

Christophe Geuzaine
committed
#line 1383 "Gmsh.y"
sortEdgesInLoop(num, temp);
EdgeLoop *l = Create_EdgeLoop(num, temp);
Tree_Add(THEM->EdgeLoops, &l);