Newer
Older
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
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));
break;
case 71:
#line 776 "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{
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
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));
5083
5084
5085
5086
5087
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
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
#line 824 "Gmsh.y"
{
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));
break;
case 73:

Christophe Geuzaine
committed
#line 871 "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 886 "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 902 "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 911 "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 917 "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 926 "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 944 "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 962 "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 971 "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 983 "Gmsh.y"
ColorOption(GMSH_SET|GMSH_GUI, (yyvsp[(1) - (8)].c), 0, (yyvsp[(5) - (8)].c), (yyvsp[(7) - (8)].u));

Christophe Geuzaine
committed
#line 988 "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 996 "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 1016 "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 1039 "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 1050 "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 1058 "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 1080 "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 1103 "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 1129 "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));
#line 1150 "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 1162 "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 1180 "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 1191 "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 1202 "Gmsh.y"
{ floatOptions.clear(); charOptions.clear(); }
#line 1204 "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));
#line 1214 "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));
#line 1225 "Gmsh.y"
{ floatOptions.clear(); charOptions.clear(); }
#line 1227 "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));
#line 1240 "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 1246 "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 1258 "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 1269 "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;
#line 1284 "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));
#line 1300 "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));
#line 1308 "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));
#line 1317 "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 1336 "Gmsh.y"

Christophe Geuzaine
committed
#line 1340 "Gmsh.y"

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

Christophe Geuzaine
committed
#line 1350 "Gmsh.y"

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

Christophe Geuzaine
committed
break;

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

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

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

Christophe Geuzaine
committed
{
curPhysDim = 0;

Christophe Geuzaine
committed
break;

Christophe Geuzaine
committed
#line 1407 "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 1423 "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 1445 "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 1463 "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 1484 "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 1502 "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 1532 "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];