Newer
Older
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
}
else if(!strcmp(yyvsp[0].c, "TH")){
ViewElementIdx = 17; ViewNumNodes = 8; ViewNumComp = 9;
ViewValueList = View->TH; ViewNumList = &View->NbTH;
}
else if(!strcmp(yyvsp[0].c, "SI")){
ViewElementIdx = 18; ViewNumNodes = 6; ViewNumComp = 1;
ViewValueList = View->SI; ViewNumList = &View->NbSI;
}
else if(!strcmp(yyvsp[0].c, "VI")){
ViewElementIdx = 19; ViewNumNodes = 6; ViewNumComp = 3;
ViewValueList = View->VI; ViewNumList = &View->NbVI;
}
else if(!strcmp(yyvsp[0].c, "TI")){
ViewElementIdx = 20; ViewNumNodes = 6; ViewNumComp = 9;
ViewValueList = View->TI; ViewNumList = &View->NbTI;
}
else if(!strcmp(yyvsp[0].c, "SY")){
ViewElementIdx = 21; ViewNumNodes = 5; ViewNumComp = 1;
ViewValueList = View->SY; ViewNumList = &View->NbSY;
}
else if(!strcmp(yyvsp[0].c, "VY")){
ViewElementIdx = 22; ViewNumNodes = 5; ViewNumComp = 3;
ViewValueList = View->VY; ViewNumList = &View->NbVY;
}
else if(!strcmp(yyvsp[0].c, "TY")){
ViewElementIdx = 23; ViewNumNodes = 5; ViewNumComp = 9;
ViewValueList = View->TY; ViewNumList = &View->NbTY;
}
else if(!strcmp(yyvsp[0].c, "SL2")){
ViewElementIdx = 3; ViewNumNodes = 3; ViewNumComp = 1;
ViewValueList = View->SL2; ViewNumList = &View->NbSL2;
}
else if(!strcmp(yyvsp[0].c, "VL2")){
ViewElementIdx = 4; ViewNumNodes = 3; ViewNumComp = 3;
ViewValueList = View->VL2; ViewNumList = &View->NbVL2;
}
else if(!strcmp(yyvsp[0].c, "TL2")){
ViewElementIdx = 5; ViewNumNodes = 3; ViewNumComp = 9;
ViewValueList = View->TL2; ViewNumList = &View->NbTL2;
}
else if(!strcmp(yyvsp[0].c, "ST2")){
ViewElementIdx = 6; ViewNumNodes = 6; ViewNumComp = 1;
ViewValueList = View->ST2; ViewNumList = &View->NbST2;
}
else if(!strcmp(yyvsp[0].c, "VT2")){
ViewElementIdx = 7; ViewNumNodes = 6; ViewNumComp = 3;
ViewValueList = View->VT2; ViewNumList = &View->NbVT2;
}
else if(!strcmp(yyvsp[0].c, "TT2")){
ViewElementIdx = 8; ViewNumNodes = 6; ViewNumComp = 9;
ViewValueList = View->TT2; ViewNumList = &View->NbTT2;
}
else if(!strcmp(yyvsp[0].c, "SQ2")){
ViewElementIdx = 9; ViewNumNodes = 9; ViewNumComp = 1;
ViewValueList = View->SQ2; ViewNumList = &View->NbSQ2;
}
else if(!strcmp(yyvsp[0].c, "VQ2")){
ViewElementIdx = 10; ViewNumNodes = 9; ViewNumComp = 3;
ViewValueList = View->VQ2; ViewNumList = &View->NbVQ2;
}
else if(!strcmp(yyvsp[0].c, "TQ2")){
ViewElementIdx = 11; ViewNumNodes = 9; ViewNumComp = 9;
ViewValueList = View->TQ2; ViewNumList = &View->NbTQ2;
}
else if(!strcmp(yyvsp[0].c, "SS2")){
ViewElementIdx = 12; ViewNumNodes = 10; ViewNumComp = 1;
ViewValueList = View->SS2; ViewNumList = &View->NbSS2;
}
else if(!strcmp(yyvsp[0].c, "VS2")){
ViewElementIdx = 13; ViewNumNodes = 10; ViewNumComp = 3;
ViewValueList = View->VS2; ViewNumList = &View->NbVS2;
}
else if(!strcmp(yyvsp[0].c, "TS2")){
ViewElementIdx = 14; ViewNumNodes = 10; ViewNumComp = 9;
ViewValueList = View->TS2; ViewNumList = &View->NbTS2;
}
else if(!strcmp(yyvsp[0].c, "SH2")){
ViewElementIdx = 15; ViewNumNodes = 27; ViewNumComp = 1;
ViewValueList = View->SH2; ViewNumList = &View->NbSH2;
}
else if(!strcmp(yyvsp[0].c, "VH2")){
ViewElementIdx = 16; ViewNumNodes = 27; ViewNumComp = 3;
ViewValueList = View->VH2; ViewNumList = &View->NbVH2;
}
else if(!strcmp(yyvsp[0].c, "TH2")){
ViewElementIdx = 17; ViewNumNodes = 27; ViewNumComp = 9;
ViewValueList = View->TH2; ViewNumList = &View->NbTH2;
}
else if(!strcmp(yyvsp[0].c, "SI2")){
ViewElementIdx = 18; ViewNumNodes = 18; ViewNumComp = 1;
ViewValueList = View->SI2; ViewNumList = &View->NbSI2;
}
else if(!strcmp(yyvsp[0].c, "VI2")){
ViewElementIdx = 19; ViewNumNodes = 18; ViewNumComp = 3;
ViewValueList = View->VI2; ViewNumList = &View->NbVI2;
}
else if(!strcmp(yyvsp[0].c, "TI2")){
ViewElementIdx = 20; ViewNumNodes = 18; ViewNumComp = 9;
ViewValueList = View->TI2; ViewNumList = &View->NbTI2;
}
else if(!strcmp(yyvsp[0].c, "SY2")){
ViewElementIdx = 21; ViewNumNodes = 14; ViewNumComp = 1;
ViewValueList = View->SY2; ViewNumList = &View->NbSY2;
}
else if(!strcmp(yyvsp[0].c, "VY2")){
ViewElementIdx = 22; ViewNumNodes = 14; ViewNumComp = 3;
ViewValueList = View->VY2; ViewNumList = &View->NbVY2;
}
else if(!strcmp(yyvsp[0].c, "TY2")){
ViewElementIdx = 23; ViewNumNodes = 14; ViewNumComp = 9;
ViewValueList = View->TY2; ViewNumList = &View->NbTY2;
}
else{
yymsg(GERROR, "Unknown element type '%s'", yyvsp[0].c);
ViewElementIdx = -1; ViewNumNodes = 0; ViewNumComp = 0;
ViewValueList = NULL; ViewNumList = NULL;
}
Free(yyvsp[0].c);
ViewCoordIdx = 0;
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);
}
if(ViewValueList){
if((List_Nbr(ViewValueList) - ViewNumListTmp) % (ViewNumComp * ViewNumNodes))
ViewErrorFlags[ViewElementIdx]++;
(*ViewNumList)++;
}
for(int i = 0; i < (int)strlen(yyvsp[0].c)+1; i++) List_Add(View->T2C, &yyvsp[0].c[i]);
for(int i = 0; i < (int)strlen(yyvsp[0].c)+1; i++) List_Add(View->T2C, &yyvsp[0].c[i]);
List_Add(View->T2D, &yyvsp[-5].d); List_Add(View->T2D, &yyvsp[-3].d);
List_Add(View->T2D, &yyvsp[-1].d);
for(int i = 0; i < (int)strlen(yyvsp[0].c)+1; i++) List_Add(View->T3C, &yyvsp[0].c[i]);
for(int i = 0; i < (int)strlen(yyvsp[0].c)+1; i++) List_Add(View->T3C, &yyvsp[0].c[i]);
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);
View->adaptive = new Adaptive_Post_View(View, yyvsp[-5].l, yyvsp[-2].l);
{
;}
break;
case 92:
{ yyval.i = 0; ;}
break;
case 93:
{ yyval.i = 1; ;}
break;
case 94:
{ yyval.i = 2; ;}
break;
case 95:
{ yyval.i = 3; ;}
break;
case 96:
{ yyval.i = 4; ;}
break;
case 97:
{ yyval.i = 1; ;}
break;
case 98:
{ yyval.i = -1; ;}
break;
case 99:
TheSymbol.Name = yyvsp[-3].c;

Christophe Geuzaine
committed
if(!yyvsp[-2].i){

Christophe Geuzaine
committed
List_Put(TheSymbol.val, 0, &yyvsp[-1].d);

Christophe Geuzaine
committed
}

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

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

Christophe Geuzaine
committed
break;
}

Christophe Geuzaine
committed
if(!yyvsp[-2].i){

Christophe Geuzaine
committed
List_Put(TheSymbol.val, (int)yyvsp[-4].d, &yyvsp[-1].d);

Christophe Geuzaine
committed
}

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

Christophe Geuzaine
committed
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);
else
yymsg(GERROR, "Uninitialized variable '%s[%d]'", yyvsp[-6].c, (int)yyvsp[-4].d);

Christophe Geuzaine
committed
}

Christophe Geuzaine
committed
yymsg(GERROR, "Incompatible array dimensions in affectation");
List_Put(TheSymbol.val, (int)(*(double*)List_Pointer(yyvsp[-5].l, i)),
(double*)List_Pointer(yyvsp[-1].l, i));
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);
double *pd;
if((pd = (double*)List_Pointer_Test(pSymbol->val, j))){
switch(yyvsp[-2].i){
case 0 : *pd = d; break;
case 1 : *pd += d; break;
case 2 : *pd -= d; break;
case 3 : *pd *= d; break;

Christophe Geuzaine
committed
else yymsg(GERROR, "Division by zero in '%s[%d] /= %g'", yyvsp[-8].c, j, d);
break;
}
}
else{
if(!yyvsp[-2].i)
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);
TheSymbol.Name = yyvsp[-5].c;
if(!(pSymbol = (Symbol*)Tree_PQuery(Symbol_T, &TheSymbol))){
TheSymbol.val = List_Create(5, 5, sizeof(double));
List_Copy(yyvsp[-1].l, TheSymbol.val);
}
else{
List_Reset(pSymbol->val);
List_Copy(yyvsp[-1].l, pSymbol->val);

Christophe Geuzaine
committed
TheSymbol.Name = yyvsp[-2].c;
*(double*)List_Pointer_Fast(pSymbol->val, 0) += yyvsp[-1].i;
Free(yyvsp[-2].c);
Symbol TheSymbol;
TheSymbol.Name = yyvsp[-5].c;
Symbol *pSymbol;
if((pd = (double*)List_Pointer_Test(pSymbol->val, (int)yyvsp[-3].d)))
yymsg(GERROR, "Uninitialized variable '%s[%d]'", yyvsp[-5].c, (int)yyvsp[-3].d);
char* (*pStrOpt)(int num, int action, char *value);
StringXString *pStrCat;

Christophe Geuzaine
committed
if(!(pStrCat = Get_StringOptionCategory(yyvsp[-5].c)))

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown string option class '%s'", yyvsp[-5].c);

Christophe Geuzaine
committed
if(!(pStrOpt = (char *(*) (int, int, char *))Get_StringOption(yyvsp[-3].c, pStrCat)))

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown string option '%s.%s'", yyvsp[-5].c, yyvsp[-3].c);
char* (*pStrOpt)(int num, int action, char *value);
StringXString *pStrCat;

Christophe Geuzaine
committed
if(!(pStrCat = Get_StringOptionCategory(yyvsp[-8].c)))

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown string option class '%s'", yyvsp[-8].c);

Christophe Geuzaine
committed
if(!(pStrOpt = (char *(*) (int, int, char *))Get_StringOption(yyvsp[-3].c, pStrCat)))

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown string option '%s[%d].%s'", yyvsp[-8].c, (int)yyvsp[-6].d, yyvsp[-3].c);
double (*pNumOpt)(int num, int action, double value);
StringXNumber *pNumCat;

Christophe Geuzaine
committed
if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-5].c)))

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown numeric option class '%s'", yyvsp[-5].c);

Christophe Geuzaine
committed
if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[-3].c, pNumCat)))

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown numeric option '%s.%s'", yyvsp[-5].c, yyvsp[-3].c);

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

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

Christophe Geuzaine
committed
break;
}
double (*pNumOpt)(int num, int action, double value);
StringXNumber *pNumCat;

Christophe Geuzaine
committed
if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-8].c)))

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown numeric option class '%s'", yyvsp[-8].c);

Christophe Geuzaine
committed
if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[-3].c, pNumCat)))

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown numeric option '%s[%d].%s'", yyvsp[-8].c, (int)yyvsp[-6].d, yyvsp[-3].c);

Christophe Geuzaine
committed
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'",
yyvsp[-8].c, (int)yyvsp[-6].d, yyvsp[-3].c, yyvsp[-1].d);

Christophe Geuzaine
committed
break;
}
double (*pNumOpt)(int num, int action, double value);
StringXNumber *pNumCat;

Christophe Geuzaine
committed
if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-4].c)))

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown numeric option class '%s'", yyvsp[-4].c);

Christophe Geuzaine
committed
if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[-2].c, pNumCat)))

Christophe Geuzaine
committed
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);
double (*pNumOpt)(int num, int action, double value);
StringXNumber *pNumCat;

Christophe Geuzaine
committed
if(!(pNumCat = Get_NumberOptionCategory(yyvsp[-7].c)))

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown numeric option class '%s'", yyvsp[-7].c);

Christophe Geuzaine
committed
if(!(pNumOpt = (double (*) (int, int, double))Get_NumberOption(yyvsp[-2].c, pNumCat)))

Christophe Geuzaine
committed
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);
unsigned int (*pColOpt)(int num, int action, unsigned int value);
StringXColor *pColCat;

Christophe Geuzaine
committed
if(!(pColCat = Get_ColorOptionCategory(yyvsp[-7].c)))

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown color option class '%s'", yyvsp[-7].c);

Christophe Geuzaine
committed
if(!(pColOpt = (unsigned int (*) (int, int, unsigned int))Get_ColorOption(yyvsp[-3].c, pColCat)))

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown color option '%s.Color.%s'", yyvsp[-7].c, yyvsp[-3].c);

Christophe Geuzaine
committed
else
unsigned int (*pColOpt)(int num, int action, unsigned int value);
StringXColor *pColCat;

Christophe Geuzaine
committed
if(!(pColCat = Get_ColorOptionCategory(yyvsp[-10].c)))

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown color option class '%s'", yyvsp[-10].c);

Christophe Geuzaine
committed
if(!(pColOpt = (unsigned int (*) (int, int, unsigned int))Get_ColorOption(yyvsp[-3].c, pColCat)))

Christophe Geuzaine
committed
yymsg(GERROR, "Unknown color option '%s[%d].Color.%s'", yyvsp[-10].c, (int)yyvsp[-8].d, yyvsp[-3].c);

Christophe Geuzaine
committed
else
}
GmshColorTable *ct = Get_ColorTable(0);

Christophe Geuzaine
committed
yymsg(GERROR, "View[%d] does not exist", 0);
else{
ct->size = List_Nbr(yyvsp[-1].l);
if(ct->size > COLORTABLE_NBMAX_COLOR)

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];
}
GmshColorTable *ct = Get_ColorTable((int)yyvsp[-6].d);

Christophe Geuzaine
committed
if(!ct)

Christophe Geuzaine
committed
yymsg(GERROR, "View[%d] does not exist", (int)yyvsp[-6].d);

Christophe Geuzaine
committed
ct->size = List_Nbr(yyvsp[-1].l);
if(ct->size > COLORTABLE_NBMAX_COLOR)

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

Christophe Geuzaine
committed
ct->size, COLORTABLE_NBMAX_COLOR, (int)yyvsp[-6].d);
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];
}
}
try {
GMSH_PluginManager::instance()->setPluginOption(yyvsp[-6].c, yyvsp[-3].c, yyvsp[-1].d);
}
catch (...) {
yymsg(GERROR, "Unknown option '%s' or plugin '%s'", yyvsp[-3].c, yyvsp[-6].c);
try {
GMSH_PluginManager::instance()->setPluginOption(yyvsp[-6].c, yyvsp[-3].c, yyvsp[-1].c);
}
catch (...) {
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
int num = (int)yyvsp[-4].d;
if(FindPoint(num, THEM)){
yymsg(GERROR, "Point %d already exists", num);
}
else{
Vertex *v = Create_Vertex(num, CTX.geom.scaling_factor * yyvsp[-1].v[0],
CTX.geom.scaling_factor * yyvsp[-1].v[1],
CTX.geom.scaling_factor * yyvsp[-1].v[2],
CTX.geom.scaling_factor * yyvsp[-1].v[3], 1.0);
Tree_Add(THEM->Points, &v);
}

Christophe Geuzaine
committed
yyval.s.Type = MSH_POINT;
int num = (int)yyvsp[-4].d;
if(FindPhysicalGroup(num, MSH_PHYSICAL_POINT, THEM)){
yymsg(GERROR, "Physical point %d already exists", num);
}
else{
List_T *temp = ListOfDouble2ListOfInt(yyvsp[-1].l);
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;
Attractor *a = Create_Attractor(List_Nbr(THEM->Metric->Attractors)+1,
yyvsp[-6].d, yyvsp[-4].d, yyvsp[-2].d, v, NULL, NULL);
List_Delete(yyvsp[-9].l);
// dummy values
yyval.s.Type = 0;
yyval.s.Num = 0;
List_Read(yyvsp[-3].l, i, &d);
Vertex *v = FindPoint((int)d, THEM);
else
v->lc = yyvsp[-1].d;
}
List_Delete(yyvsp[-3].l);
// dummy values
yyval.s.Type = 0;
yyval.s.Num = 0;
int num = (int)yyvsp[-4].d;
if(FindCurve(num, THEM)){
yymsg(GERROR, "Curve %d already exists", num);
else{
List_T *temp = ListOfDouble2ListOfInt(yyvsp[-1].l);
Curve *c = Create_Curve(num, MSH_SEGM_LINE, 1, temp, NULL,
-1, -1, 0., 1.);
Tree_Add(THEM->Curves, &c);
CreateReversedCurve(THEM, c);
List_Delete(temp);
}
List_Delete(yyvsp[-1].l);
yyval.s.Type = MSH_SEGM_LINE;
yyval.s.Num = num;
int num = (int)yyvsp[-4].d;
if(FindCurve(num, THEM)){
yymsg(GERROR, "Curve %d already exists", num);
}
else{
List_T *temp = ListOfDouble2ListOfInt(yyvsp[-1].l);
Curve *c = Create_Curve(num, MSH_SEGM_SPLN, 3, temp, NULL,
-1, -1, 0., 1.);
Tree_Add(THEM->Curves, &c);
CreateReversedCurve(THEM, c);
List_Delete(temp);
}
List_Delete(yyvsp[-1].l);
yyval.s.Type = MSH_SEGM_SPLN;
yyval.s.Num = num;
int num = (int)yyvsp[-4].d;
if(FindCurve(num, THEM)){
yymsg(GERROR, "Curve %d already exists", num);
}
else{
List_T *temp = ListOfDouble2ListOfInt(yyvsp[-1].l);
Curve *c = Create_Curve(num, MSH_SEGM_CIRC, 2, temp, NULL,
-1, -1, 0., 1.);
Tree_Add(THEM->Curves, &c);
CreateReversedCurve(THEM, c);
List_Delete(temp);
}
List_Delete(yyvsp[-1].l);
yyval.s.Type = MSH_SEGM_CIRC;
yyval.s.Num = num;
int num = (int)yyvsp[-6].d;
if(FindCurve(num, THEM)){
yymsg(GERROR, "Curve %d already exists", num);
}
else{
List_T *temp = ListOfDouble2ListOfInt(yyvsp[-3].l);
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];
End_Curve(c);
Tree_Add(THEM->Curves, &c);
Curve *rc = CreateReversedCurve(THEM, c);
rc->Circle.n[0] = yyvsp[-1].v[0];
rc->Circle.n[1] = yyvsp[-1].v[1];
rc->Circle.n[2] = yyvsp[-1].v[2];
End_Curve(rc);
List_Delete(temp);
List_Delete(yyvsp[-3].l);
yyval.s.Type = MSH_SEGM_CIRC;
yyval.s.Num = num;
int num = (int)yyvsp[-4].d;
if(FindCurve(num, THEM)){
yymsg(GERROR, "Curve %d already exists", num);
}
else{
List_T *temp = ListOfDouble2ListOfInt(yyvsp[-1].l);
Curve *c = Create_Curve(num, MSH_SEGM_ELLI, 2, temp, NULL,
-1, -1, 0., 1.);
Tree_Add(THEM->Curves, &c);
CreateReversedCurve(THEM, c);
List_Delete(temp);
}
List_Delete(yyvsp[-1].l);
yyval.s.Type = MSH_SEGM_ELLI;
yyval.s.Num = num;
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
int num = (int)yyvsp[-6].d;
if(FindCurve(num, THEM)){
yymsg(GERROR, "Curve %d already exists", num);
}
else{
List_T *temp = ListOfDouble2ListOfInt(yyvsp[-3].l);
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];
End_Curve(c);
Tree_Add(THEM->Curves, &c);
Curve *rc = CreateReversedCurve(THEM, c);
rc->Circle.n[0] = yyvsp[-1].v[0];
rc->Circle.n[1] = yyvsp[-1].v[1];
rc->Circle.n[2] = yyvsp[-1].v[2];
End_Curve(c);
List_Delete(temp);
}
List_Delete(yyvsp[-3].l);
yyval.s.Type = MSH_SEGM_ELLI;
yyval.s.Num = num;
int num = (int)yyvsp[-14].d;
if(FindCurve(num, THEM)){
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);
Tree_Add(THEM->Curves, &c);
CreateReversedCurve(THEM, c);
}
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
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,
List_Nbr(yyvsp[-1].l));
}
else{
if(FindCurve(num, THEM)){
yymsg(GERROR, "Curve %d already exists", num);
}
else{
List_T *temp = ListOfDouble2ListOfInt(yyvsp[-1].l);
Curve *c = Create_Curve(num, MSH_SEGM_BSPLN, 2, temp, NULL,
-1, -1, 0., 1.);
Tree_Add(THEM->Curves, &c);
CreateReversedCurve(THEM, c);
List_Delete(temp);
}
}
List_Delete(yyvsp[-1].l);
yyval.s.Type = MSH_SEGM_BSPLN;
yyval.s.Num = num;
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,

Christophe Geuzaine
committed
List_Nbr(yyvsp[-1].l));
}
else{
if(FindCurve(num, THEM)){
yymsg(GERROR, "Curve %d already exists", num);
}
else{
List_T *temp = ListOfDouble2ListOfInt(yyvsp[-1].l);
Curve *c = Create_Curve(num, MSH_SEGM_BEZIER, 2, temp, NULL,
-1, -1, 0., 1.);
Tree_Add(THEM->Curves, &c);
CreateReversedCurve(THEM, c);
List_Delete(temp);
}
}
List_Delete(yyvsp[-1].l);
yyval.s.Type = MSH_SEGM_BEZIER;
yyval.s.Num = num;
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);