Newer
Older

Christophe Geuzaine
committed
case 60:

Christophe Geuzaine
committed
#line 604 "Gmsh.y"

Christophe Geuzaine
committed
case 61:

Christophe Geuzaine
committed
#line 605 "Gmsh.y"

Christophe Geuzaine
committed
case 62:

Christophe Geuzaine
committed
#line 609 "Gmsh.y"

Christophe Geuzaine
committed
case 63:

Christophe Geuzaine
committed
#line 610 "Gmsh.y"

Christophe Geuzaine
committed
#line 621 "Gmsh.y"
if(!gmsh_yysymbols.count((yyvsp[(1) - (4)].c)) && (yyvsp[(2) - (4)].i) && List_Nbr((yyvsp[(3) - (4)].l)) == 1){
yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (4)].c));
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
gmsh_yysymbol &s(gmsh_yysymbols[(yyvsp[(1) - (4)].c)]);
if(!(yyvsp[(2) - (4)].i)) s.list = (List_Nbr((yyvsp[(3) - (4)].l)) != 1); // list if 0 or > 1 elements
if(!s.list){ // single expression
if(List_Nbr((yyvsp[(3) - (4)].l)) != 1){
yymsg(0, "Cannot assign list to variable '%s'", (yyvsp[(1) - (4)].c));
}
else{
double d;
List_Read((yyvsp[(3) - (4)].l), 0, &d);
if(s.value.empty()){
if((yyvsp[(2) - (4)].i)) yymsg(1, "Uninitialized variable '%s'", (yyvsp[(1) - (4)].c));
s.value.resize(1, 0.);
}
switch((yyvsp[(2) - (4)].i)){
case 0 : s.value[0] = d; break;
case 1 : s.value[0] += d; break;
case 2 : s.value[0] -= d; break;
case 3 : s.value[0] *= d; break;
case 4 :
if(d) s.value[0] /= d;
else yymsg(0, "Division by zero in '%s /= %g'", (yyvsp[(1) - (4)].c), d);
break;
}
}
}
else{ // list of expressions
switch((yyvsp[(2) - (4)].i)){
case 0: // affect
s.value.clear(); // fall-through
case 1: // append
for(int i = 0; i < List_Nbr((yyvsp[(3) - (4)].l)); i++){
double d;
List_Read((yyvsp[(3) - (4)].l), i, &d);
s.value.push_back(d);
}
break;
case 2: // remove
for(int i = 0; i < List_Nbr((yyvsp[(3) - (4)].l)); i++){
double d;
List_Read((yyvsp[(3) - (4)].l), i, &d);
std::vector<double>::iterator it = std::find(s.value.begin(),
s.value.end(), d);
if(it != s.value.end()) s.value.erase(it);
}
break;
default:
yymsg(0, "Operators *= and /= not available for lists");
break;
}
}
}
Free((yyvsp[(1) - (4)].c));

Christophe Geuzaine
committed
#line 683 "Gmsh.y"
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
{
gmsh_yysymbol &s(gmsh_yysymbols[(yyvsp[(1) - (6)].c)]);
s.list = true;
double d;
switch((yyvsp[(4) - (6)].i)){
case 0: // affect
s.value.clear(); // fall-through
case 1: // append
for(int i = 0; i < List_Nbr((yyvsp[(5) - (6)].l)); i++){
List_Read((yyvsp[(5) - (6)].l), i, &d);
s.value.push_back(d);
}
break;
case 2: // remove
for(int i = 0; i < List_Nbr((yyvsp[(5) - (6)].l)); i++){
List_Read((yyvsp[(5) - (6)].l), i, &d);
std::vector<double>::iterator it = std::find(s.value.begin(),
s.value.end(), d);
if(it != s.value.end()) s.value.erase(it);
}
break;
default:
yymsg(0, "Operators *= and /= not available for lists");
break;
}
Free((yyvsp[(1) - (6)].c));
List_Delete((yyvsp[(5) - (6)].l));

Christophe Geuzaine
committed
#line 713 "Gmsh.y"
int index = (int)(yyvsp[(3) - (7)].d);
if(!gmsh_yysymbols.count((yyvsp[(1) - (7)].c))){
if(!(yyvsp[(5) - (7)].i)){
gmsh_yysymbol &s(gmsh_yysymbols[(yyvsp[(1) - (7)].c)]);
s.list = true;
s.value.resize(index + 1, 0.);
s.value[index] = (yyvsp[(6) - (7)].d);
}
else
yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (7)].c));
gmsh_yysymbol &s(gmsh_yysymbols[(yyvsp[(1) - (7)].c)]);
if(s.list){
if((int)s.value.size() < index + 1) s.value.resize(index + 1, 0.);
switch((yyvsp[(5) - (7)].i)){
case 0 : s.value[index] = (yyvsp[(6) - (7)].d); break;
case 1 : s.value[index] += (yyvsp[(6) - (7)].d); break;
case 2 : s.value[index] -= (yyvsp[(6) - (7)].d); break;
case 3 : s.value[index] *= (yyvsp[(6) - (7)].d); break;
case 4 :
if((yyvsp[(6) - (7)].d)) s.value[index] /= (yyvsp[(6) - (7)].d);
else yymsg(0, "Division by zero in '%s[%d] /= %g'", (yyvsp[(1) - (7)].c), index, (yyvsp[(6) - (7)].d));
break;
}
}
else
yymsg(0, "Variable '%s' is not a list", (yyvsp[(1) - (7)].c));
Free((yyvsp[(1) - (7)].c));

Christophe Geuzaine
committed
#line 748 "Gmsh.y"
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
{
int index = (int)(yyvsp[(3) - (7)].d);
if(!gmsh_yysymbols.count((yyvsp[(1) - (7)].c))){
if(!(yyvsp[(5) - (7)].i)){
gmsh_yysymbol &s(gmsh_yysymbols[(yyvsp[(1) - (7)].c)]);
s.list = true;
s.value.resize(index + 1, 0.);
s.value[index] = (yyvsp[(6) - (7)].d);
}
else
yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (7)].c));
}
else{
gmsh_yysymbol &s(gmsh_yysymbols[(yyvsp[(1) - (7)].c)]);
if(s.list){
if((int)s.value.size() < index + 1) s.value.resize(index + 1, 0.);
switch((yyvsp[(5) - (7)].i)){
case 0 : s.value[index] = (yyvsp[(6) - (7)].d); break;
case 1 : s.value[index] += (yyvsp[(6) - (7)].d); break;
case 2 : s.value[index] -= (yyvsp[(6) - (7)].d); break;
case 3 : s.value[index] *= (yyvsp[(6) - (7)].d); break;
case 4 :
if((yyvsp[(6) - (7)].d)) s.value[index] /= (yyvsp[(6) - (7)].d);
else yymsg(0, "Division by zero in '%s[%d] /= %g'", (yyvsp[(1) - (7)].c), index, (yyvsp[(6) - (7)].d));
break;
}
}
else
yymsg(0, "Variable '%s' is not a list", (yyvsp[(1) - (7)].c));
}
Free((yyvsp[(1) - (7)].c));

Christophe Geuzaine
committed
#line 782 "Gmsh.y"
{
if(List_Nbr((yyvsp[(4) - (9)].l)) != List_Nbr((yyvsp[(8) - (9)].l))){
yymsg(0, "Incompatible array dimensions in affectation");
if(!gmsh_yysymbols.count((yyvsp[(1) - (9)].c))){
if(!(yyvsp[(7) - (9)].i)){
gmsh_yysymbol &s(gmsh_yysymbols[(yyvsp[(1) - (9)].c)]);
s.list = true;
for(int i = 0; i < List_Nbr((yyvsp[(4) - (9)].l)); i++){
int index = (int)(*(double*)List_Pointer((yyvsp[(4) - (9)].l), i));
s.value.resize(index + 1, 0.);
s.value[index] = *(double*)List_Pointer((yyvsp[(8) - (9)].l), i);
}
}
else
yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (9)].c));
}
else{
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
gmsh_yysymbol &s(gmsh_yysymbols[(yyvsp[(1) - (9)].c)]);
if(s.list){
for(int i = 0; i < List_Nbr((yyvsp[(4) - (9)].l)); i++){
int index = (int)(*(double*)List_Pointer((yyvsp[(4) - (9)].l), i));
double d = *(double*)List_Pointer((yyvsp[(8) - (9)].l), i);
if((int)s.value.size() < index + 1) s.value.resize(index + 1, 0.);
switch((yyvsp[(7) - (9)].i)){
case 0 : s.value[index] = d; break;
case 1 : s.value[index] += d; break;
case 2 : s.value[index] -= d; break;
case 3 : s.value[index] *= d; break;
case 4 :
if((yyvsp[(8) - (9)].l)) s.value[index] /= d;
else yymsg(0, "Division by zero in '%s[%d] /= %g'", (yyvsp[(1) - (9)].c), index, d);
break;
}
}
}
else
yymsg(0, "Variable '%s' is not a list", (yyvsp[(1) - (9)].c));
}
Free((yyvsp[(1) - (9)].c));
List_Delete((yyvsp[(4) - (9)].l));
List_Delete((yyvsp[(8) - (9)].l));

Christophe Geuzaine
committed
#line 830 "Gmsh.y"
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
{
if(List_Nbr((yyvsp[(4) - (9)].l)) != List_Nbr((yyvsp[(8) - (9)].l))){
yymsg(0, "Incompatible array dimensions in affectation");
}
else{
if(!gmsh_yysymbols.count((yyvsp[(1) - (9)].c))){
if(!(yyvsp[(7) - (9)].i)){
gmsh_yysymbol &s(gmsh_yysymbols[(yyvsp[(1) - (9)].c)]);
s.list = true;
for(int i = 0; i < List_Nbr((yyvsp[(4) - (9)].l)); i++){
int index = (int)(*(double*)List_Pointer((yyvsp[(4) - (9)].l), i));
s.value.resize(index + 1, 0.);
s.value[index] = *(double*)List_Pointer((yyvsp[(8) - (9)].l), i);
}
}
else
yymsg(0, "Unknown variable '%s'", (yyvsp[(1) - (9)].c));
}
else{
gmsh_yysymbol &s(gmsh_yysymbols[(yyvsp[(1) - (9)].c)]);
if(s.list){
for(int i = 0; i < List_Nbr((yyvsp[(4) - (9)].l)); i++){
int index = (int)(*(double*)List_Pointer((yyvsp[(4) - (9)].l), i));
double d = *(double*)List_Pointer((yyvsp[(8) - (9)].l), i);
if((int)s.value.size() < index + 1) s.value.resize(index + 1, 0.);
switch((yyvsp[(7) - (9)].i)){
case 0 : s.value[index] = d; break;
case 1 : s.value[index] += d; break;
case 2 : s.value[index] -= d; break;
case 3 : s.value[index] *= d; break;
case 4 :
if((yyvsp[(8) - (9)].l)) s.value[index] /= d;
else yymsg(0, "Division by zero in '%s[%d] /= %g'", (yyvsp[(1) - (9)].c), index, d);
break;
}
}
}
else
yymsg(0, "Variable '%s' is not a list", (yyvsp[(1) - (9)].c));
}
}
Free((yyvsp[(1) - (9)].c));
List_Delete((yyvsp[(4) - (9)].l));
List_Delete((yyvsp[(8) - (9)].l));

Christophe Geuzaine
committed
#line 877 "Gmsh.y"
if(!gmsh_yysymbols.count((yyvsp[(1) - (3)].c)))

Christophe Geuzaine
committed
else{
gmsh_yysymbol &s(gmsh_yysymbols[(yyvsp[(1) - (3)].c)]);
if(!s.list && s.value.empty())

Christophe Geuzaine
committed
yymsg(0, "Uninitialized variable '%s'", (yyvsp[(1) - (3)].c));

Christophe Geuzaine
committed
else
Matti Pellika
committed
yymsg(0, "Variable '%s' is a list", (yyvsp[(1) - (3)].c));

Christophe Geuzaine
committed
}

Christophe Geuzaine
committed
#line 892 "Gmsh.y"
if(!gmsh_yysymbols.count((yyvsp[(1) - (6)].c)))
gmsh_yysymbol &s(gmsh_yysymbols[(yyvsp[(1) - (6)].c)]);
if(s.list){
int index = (int)(yyvsp[(3) - (6)].d);
if((int)s.value.size() < index + 1) s.value.resize(index + 1, 0.);
s.value[index] += (yyvsp[(5) - (6)].i);
}
else
yymsg(0, "Variable '%s' is not a list", (yyvsp[(1) - (6)].c));

Christophe Geuzaine
committed
#line 908 "Gmsh.y"
gmsh_yystringsymbols[(yyvsp[(1) - (4)].c)] = std::string((yyvsp[(3) - (4)].c));
Free((yyvsp[(1) - (4)].c));
Free((yyvsp[(3) - (4)].c));

Christophe Geuzaine
committed
#line 917 "Gmsh.y"
std::string tmp((yyvsp[(5) - (6)].c));
StringOption(GMSH_SET|GMSH_GUI, (yyvsp[(1) - (6)].c), 0, (yyvsp[(3) - (6)].c), tmp);
Free((yyvsp[(1) - (6)].c)); Free((yyvsp[(3) - (6)].c)); Free((yyvsp[(5) - (6)].c));

Christophe Geuzaine
committed
#line 923 "Gmsh.y"
std::string tmp((yyvsp[(8) - (9)].c));
StringOption(GMSH_SET|GMSH_GUI, (yyvsp[(1) - (9)].c), (int)(yyvsp[(3) - (9)].d), (yyvsp[(6) - (9)].c), tmp);
Free((yyvsp[(1) - (9)].c)); Free((yyvsp[(6) - (9)].c)); Free((yyvsp[(8) - (9)].c));

Christophe Geuzaine
committed
#line 932 "Gmsh.y"
{
double d = 0.;
if(NumberOption(GMSH_GET, (yyvsp[(1) - (6)].c), 0, (yyvsp[(3) - (6)].c), d)){
switch((yyvsp[(4) - (6)].i)){
case 0 : d = (yyvsp[(5) - (6)].d); break;
case 1 : d += (yyvsp[(5) - (6)].d); break;
case 2 : d -= (yyvsp[(5) - (6)].d); break;
case 3 : d *= (yyvsp[(5) - (6)].d); break;
case 4 :
if((yyvsp[(5) - (6)].d)) d /= (yyvsp[(5) - (6)].d);
else yymsg(0, "Division by zero in '%s.%s /= %g'", (yyvsp[(1) - (6)].c), (yyvsp[(3) - (6)].c), (yyvsp[(5) - (6)].d));
break;
}
NumberOption(GMSH_SET|GMSH_GUI, (yyvsp[(1) - (6)].c), 0, (yyvsp[(3) - (6)].c), d);

Christophe Geuzaine
committed
#line 950 "Gmsh.y"
{
double d = 0.;
if(NumberOption(GMSH_GET, (yyvsp[(1) - (9)].c), (int)(yyvsp[(3) - (9)].d), (yyvsp[(6) - (9)].c), d)){
switch((yyvsp[(7) - (9)].i)){
case 0 : d = (yyvsp[(8) - (9)].d); break;
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);

Christophe Geuzaine
committed
#line 968 "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);

Christophe Geuzaine
committed
#line 977 "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);

Christophe Geuzaine
committed
#line 989 "Gmsh.y"
ColorOption(GMSH_SET|GMSH_GUI, (yyvsp[(1) - (8)].c), 0, (yyvsp[(5) - (8)].c), (yyvsp[(7) - (8)].u));

Christophe Geuzaine
committed
#line 994 "Gmsh.y"
ColorOption(GMSH_SET|GMSH_GUI, (yyvsp[(1) - (11)].c), (int)(yyvsp[(3) - (11)].d), (yyvsp[(8) - (11)].c), (yyvsp[(10) - (11)].u));

Christophe Geuzaine
committed
#line 1002 "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));

Christophe Geuzaine
committed
#line 1022 "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 1045 "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));

Christophe Geuzaine
committed
#line 1056 "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 1064 "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 1086 "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 1109 "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 1135 "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));

Christophe Geuzaine
committed
#line 1156 "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 1168 "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));

Christophe Geuzaine
committed
#line 1186 "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));

Christophe Geuzaine
committed
#line 1197 "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));

Christophe Geuzaine
committed
#line 1208 "Gmsh.y"
{ floatOptions.clear(); charOptions.clear(); ;}

Christophe Geuzaine
committed
#line 1210 "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);
Free((yyvsp[(3) - (9)].c));

Christophe Geuzaine
committed
#line 1220 "Gmsh.y"
{
std::string key((yyvsp[(3) - (5)].c)), val((yyvsp[(5) - (5)].c));
floatOptions.clear(); charOptions.clear();
if(!gmsh_yystringsymbols.count(key)){
Msg::ExchangeOnelabParameter(key, val, floatOptions, charOptions);
gmsh_yystringsymbols[key] = val;
}
Free((yyvsp[(3) - (5)].c));
Free((yyvsp[(5) - (5)].c));

Christophe Geuzaine
committed
#line 1231 "Gmsh.y"
{ floatOptions.clear(); charOptions.clear(); ;}

Christophe Geuzaine
committed
#line 1233 "Gmsh.y"
{
std::string key((yyvsp[(3) - (9)].c)), val((yyvsp[(6) - (9)].c));
if(!gmsh_yysymbols.count(key)){
Msg::ExchangeOnelabParameter(key, val, floatOptions, charOptions);
gmsh_yystringsymbols[key] = val;
}
Free((yyvsp[(3) - (9)].c));
Free((yyvsp[(6) - (9)].c));

Christophe Geuzaine
committed
#line 1247 "Gmsh.y"
{
std::string name((yyvsp[(3) - (3)].c));
Msg::UndefineOnelabParameter(name);
Free((yyvsp[(3) - (3)].c));
;}
break;
case 105:

Christophe Geuzaine
committed
#line 1255 "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;

Christophe Geuzaine
committed
#line 1261 "Gmsh.y"

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

Christophe Geuzaine
committed
break;

Christophe Geuzaine
committed
#line 1273 "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));

Christophe Geuzaine
committed
#line 1284 "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;

Christophe Geuzaine
committed
#line 1299 "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 1315 "Gmsh.y"
{
std::string key((yyvsp[(2) - (3)].c));
double val = (yyvsp[(3) - (3)].d);
floatOptions[key].push_back(val);
Free((yyvsp[(2) - (3)].c));

Christophe Geuzaine
committed
#line 1323 "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 1332 "Gmsh.y"
{
std::string key((yyvsp[(2) - (5)].c));
for(int i = 0; i < List_Nbr((yyvsp[(4) - (5)].l)); i++){
char *s;
List_Read((yyvsp[(4) - (5)].l), i, &s);
std::string val(s);
Free(s);
charOptions[key].push_back(val);
}
Free((yyvsp[(2) - (5)].c));
List_Delete((yyvsp[(4) - (5)].l));

Christophe Geuzaine
committed
#line 1350 "Gmsh.y"

Christophe Geuzaine
committed
#line 1354 "Gmsh.y"

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

Christophe Geuzaine
committed
#line 1364 "Gmsh.y"

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

Christophe Geuzaine
committed
break;

Christophe Geuzaine
committed
#line 1368 "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 1380 "Gmsh.y"

Christophe Geuzaine
committed
#line 1384 "Gmsh.y"
{
for(int i = 0; i < 4; i++) (yyval.v)[i] = (yyvsp[(2) - (2)].v)[i];

Christophe Geuzaine
committed
#line 1394 "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 1417 "Gmsh.y"

Christophe Geuzaine
committed
{
curPhysDim = 0;

Christophe Geuzaine
committed
break;

Christophe Geuzaine
committed
#line 1421 "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 1437 "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 1459 "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 1477 "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 1498 "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);