Newer
Older
List_Read((yyvsp[(3) - (6)].l), i, &d);
Surface *s = FindSurface((int)d);
if(s){
s->Method = MESH_TRANSFINITE;
s->Recombine_Dir = (yyvsp[(5) - (6)].i);
List_Reset(s->TrsfPoints);
for(int j = 0; j < k; j++){
double p;
List_Read((yyvsp[(4) - (6)].l), j, &p);
Vertex *v = FindPoint((int)fabs(p));
if(v)
List_Add(s->TrsfPoints, &v);
else
yymsg(0, "Unknown point %d", (int)fabs(p));
}
}
else{
GFace *gf = GModel::current()->getFaceByTag((int)d);
if(gf){
gf->meshAttributes.Method = MESH_TRANSFINITE;
gf->meshAttributes.transfiniteArrangement = (yyvsp[(5) - (6)].i);
for(int j = 0; j < k; j++){
double p;
List_Read((yyvsp[(4) - (6)].l), j, &p);
GVertex *gv = GModel::current()->getVertexByTag((int)fabs(p));
if(gv)
gf->meshAttributes.corners.push_back(gv);
else
yymsg(0, "Unknown point %d", (int)fabs(p));
}
}
else
yymsg(0, "Unknown surface %d", (int)d);
}
List_Delete((yyvsp[(3) - (6)].l));
List_Delete((yyvsp[(4) - (6)].l));

Christophe Geuzaine
committed
yymsg(1, "Elliptic Surface is deprecated: use Transfinite instead (with smoothing)");

Christophe Geuzaine
committed
int k = List_Nbr((yyvsp[(4) - (5)].l));
if(k != 0 && k != 6 && k != 8){
yymsg(0, "Wrong definition of Transfinite Volume: "
"%d points instead of 6 or 8", k);
if(!(yyvsp[(3) - (5)].l)){
List_T *tmp = Tree2List(GModel::current()->getGEOInternals()->Volumes);
if(List_Nbr(tmp)){
for(int i = 0; i < List_Nbr(tmp); i++){
Volume *v;
List_Read(tmp, i, &v);
v->Method = MESH_TRANSFINITE;
List_Reset(v->TrsfPoints);
}
}
else{
for(GModel::riter it = GModel::current()->firstRegion();
it != GModel::current()->lastRegion(); it++){
(*it)->meshAttributes.Method = MESH_TRANSFINITE;
}
}
List_Delete(tmp);
}
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
for(int i = 0; i < List_Nbr((yyvsp[(3) - (5)].l)); i++){
double d;
List_Read((yyvsp[(3) - (5)].l), i, &d);
Volume *v = FindVolume((int)d);
if(v){
v->Method = MESH_TRANSFINITE;
List_Reset(v->TrsfPoints);
for(int i = 0; i < k; i++){
double p;
List_Read((yyvsp[(4) - (5)].l), i, &p);
Vertex *vert = FindPoint((int)fabs(p));
if(vert)
List_Add(v->TrsfPoints, &vert);
else
yymsg(0, "Unknown point %d", (int)fabs(p));
}
}
else{
GRegion *gr = GModel::current()->getRegionByTag((int)d);
if(gr){
gr->meshAttributes.Method = MESH_TRANSFINITE;
for(int i = 0; i < k; i++){
double p;
List_Read((yyvsp[(4) - (5)].l), i, &p);
GVertex *gv = GModel::current()->getVertexByTag((int)fabs(p));
if(gv)
gr->meshAttributes.corners.push_back(gv);
else
yymsg(0, "Unknown point %d", (int)fabs(p));
}
}
yymsg(0, "Unknown volume %d", (int)d);
List_Delete((yyvsp[(3) - (5)].l));
List_Delete((yyvsp[(4) - (5)].l));

Christophe Geuzaine
committed

Christophe Geuzaine
committed
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
{
if(!(yyvsp[(2) - (3)].l)){
List_T *tmp = Tree2List(GModel::current()->getGEOInternals()->Volumes);
if(List_Nbr(tmp)){
for(int i = 0; i < List_Nbr(tmp); i++){
Volume *v;
List_Read(tmp, i, &v);
v->QuadTri = TRANSFINITE_QUADTRI_1;
}
}
else{
for(GModel::riter it = GModel::current()->firstRegion();
it != GModel::current()->lastRegion(); it++)
(*it)->meshAttributes.QuadTri = TRANSFINITE_QUADTRI_1;
}
List_Delete(tmp);
}
else{
for(int i = 0; i < List_Nbr((yyvsp[(2) - (3)].l)); i++){
double d;
List_Read((yyvsp[(2) - (3)].l), i, &d);
Volume *v = FindVolume((int)d);
if(v)
v->QuadTri = TRANSFINITE_QUADTRI_1;
else{
GRegion *gr = GModel::current()->getRegionByTag((int)d);
if(gr)
gr->meshAttributes.QuadTri = TRANSFINITE_QUADTRI_1;
else
yymsg(1, "Unknown region %d", (int)d);
}
}
List_Delete((yyvsp[(2) - (3)].l));
}
;}
break;

Christophe Geuzaine
committed
if(!(yyvsp[(3) - (5)].l)){
List_T *tmp = Tree2List(GModel::current()->getGEOInternals()->Surfaces);
if(List_Nbr(tmp)){
for(int i = 0; i < List_Nbr(tmp); i++){
Surface *s;
List_Read(tmp, i, &s);
s->Recombine = 1;
s->RecombineAngle = (yyvsp[(4) - (5)].i);
}
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
for(GModel::fiter it = GModel::current()->firstFace();
it != GModel::current()->lastFace(); it++){
(*it)->meshAttributes.recombine = 1;
(*it)->meshAttributes.recombineAngle = (yyvsp[(4) - (5)].i);
}
}
List_Delete(tmp);
}
else{
for(int i = 0; i < List_Nbr((yyvsp[(3) - (5)].l)); i++){
double d;
List_Read((yyvsp[(3) - (5)].l), i, &d);
Surface *s = FindSurface((int)d);
if(s){
s->Recombine = 1;
s->RecombineAngle = (yyvsp[(4) - (5)].i);
}
else{
GFace *gf = GModel::current()->getFaceByTag((int)d);
if(gf){
gf->meshAttributes.recombine = 1;
gf->meshAttributes.recombineAngle = (yyvsp[(4) - (5)].i);
}
else
yymsg(1, "Unknown surface %d", (int)d);
List_Delete((yyvsp[(3) - (5)].l));

Christophe Geuzaine
committed
double d;
List_Read((yyvsp[(3) - (6)].l), i, &d);
int j = (int)d;
Surface *s = FindSurface(j);
if(s){
s->TransfiniteSmoothing = (int)(yyvsp[(5) - (6)].d);
}
else{
GFace *gf = GModel::current()->getFaceByTag(j);
if(gf)
gf->meshAttributes.transfiniteSmoothing = (int)(yyvsp[(5) - (6)].d);
else
yymsg(1, "Unknown surface %d", (int)(yyvsp[(5) - (6)].d));
}
List_Delete((yyvsp[(3) - (6)].l));
;}
break;

Christophe Geuzaine
committed
if(List_Nbr((yyvsp[(5) - (6)].l)) != List_Nbr((yyvsp[(3) - (6)].l))){
yymsg(0, "Number of master (%d) different from number of slave (%d) lines",
List_Nbr((yyvsp[(5) - (6)].l)), List_Nbr((yyvsp[(3) - (6)].l)));
else{
for(int i = 0; i < List_Nbr((yyvsp[(3) - (6)].l)); i++){
double d_master, d_slave;
List_Read((yyvsp[(5) - (6)].l), i, &d_master);
List_Read((yyvsp[(3) - (6)].l), i, &d_slave);
int j_master = (int)d_master;
int j_slave = (int)d_slave;
Curve *c_slave = FindCurve(abs(j_slave));
if(c_slave){
c_slave->meshMaster = j_master;
}
else{
GEdge *ge = GModel::current()->getEdgeByTag(abs(j_slave));
if(ge) ge->setMeshMaster(j_master);
else yymsg(0, "Unknown line %d", j_slave);
}
}
}
List_Delete((yyvsp[(3) - (6)].l));
List_Delete((yyvsp[(5) - (6)].l));
;}
break;

Christophe Geuzaine
committed
if (List_Nbr((yyvsp[(5) - (12)].l)) != List_Nbr((yyvsp[(10) - (12)].l))){
yymsg(0, "Number of master surface edges (%d) different from number of "
"slave (%d) edges", List_Nbr((yyvsp[(10) - (12)].l)), List_Nbr((yyvsp[(5) - (12)].l)));
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
int j_master = (int)(yyvsp[(8) - (12)].d);
int j_slave = (int)(yyvsp[(3) - (12)].d);
Surface *s_slave = FindSurface(abs(j_slave));
if(s_slave){
s_slave->meshMaster = j_master;
for (int i = 0; i < List_Nbr((yyvsp[(5) - (12)].l)); i++){
double dm, ds;
List_Read((yyvsp[(5) - (12)].l), i, &ds);
List_Read((yyvsp[(10) - (12)].l), i, &dm);
s_slave->edgeCounterparts[(int)ds] = (int)dm;
}
}
else{
GFace *gf = GModel::current()->getFaceByTag(abs(j_slave));
if(gf){
gf->setMeshMaster(j_master);
for (int i = 0; i < List_Nbr((yyvsp[(5) - (12)].l)); i++){
double dm, ds;
List_Read((yyvsp[(5) - (12)].l), i, &ds);
List_Read((yyvsp[(10) - (12)].l), i, &dm);
gf->edgeCounterparts[(int)ds] = (int)dm;
}
}
else yymsg(0, "Unknown surface %d", j_slave);
}
List_Delete((yyvsp[(5) - (12)].l));
List_Delete((yyvsp[(10) - (12)].l));

Christophe Geuzaine
committed
setSurfaceEmbeddedPoints(s, (yyvsp[(3) - (10)].l));
}
else{
GFace *gf = GModel::current()->getFaceByTag((int)(yyvsp[(8) - (10)].d));
if(gf){
for(int i = 0; i < List_Nbr((yyvsp[(3) - (10)].l)); i++){
int iPoint;
List_Read((yyvsp[(3) - (10)].l), i, &iPoint);
GVertex *gv = GModel::current()->getVertexByTag(iPoint);
if(gv)
gf->addEmbeddedVertex(gv);
else
yymsg(0, "Unknown point %d", iPoint);
}
}
else
yymsg(0, "Unknown surface %d", (int)(yyvsp[(8) - (10)].d));
}

Christophe Geuzaine
committed
setSurfaceEmbeddedCurves(s, (yyvsp[(3) - (10)].l));
}
else{
GFace *gf = GModel::current()->getFaceByTag((int)(yyvsp[(8) - (10)].d));
if(gf){
for(int i = 0; i < List_Nbr((yyvsp[(3) - (10)].l)); i++){
int iCurve;
List_Read((yyvsp[(3) - (10)].l), i, &iCurve);
GEdge *ge = GModel::current()->getEdgeByTag(iCurve);
if(ge)
gf->addEmbeddedEdge(ge);
else
yymsg(0, "Unknown line %d", iCurve);
}
}
else
yymsg(0, "Unknown surface %d", (int)(yyvsp[(8) - (10)].d));
}

Christophe Geuzaine
committed

Christophe Geuzaine
committed

Christophe Geuzaine
committed
ReplaceAllDuplicates();

Christophe Geuzaine
committed
{
if(!strcmp((yyvsp[(2) - (3)].c), "Geometry"))
ReplaceAllDuplicates();
else if(!strcmp((yyvsp[(2) - (3)].c), "Mesh"))
GModel::current()->removeDuplicateMeshVertices(CTX::instance()->geom.tolerance);
else
yymsg(0, "Unknown coherence command");
Free((yyvsp[(2) - (3)].c));
;}

Christophe Geuzaine
committed
{
if(List_Nbr((yyvsp[(4) - (6)].l)) >= 2){
double d;
List_Read((yyvsp[(4) - (6)].l), 0, &d);
Vertex *target = FindPoint((int)d);
if(!target)
yymsg(0, "Could not find Point %d", (int)d);
else{
double x = target->Pos.X, y = target->Pos.Y, z = target->Pos.Z;
for(int i = 1; i < List_Nbr((yyvsp[(4) - (6)].l)); i++){
List_Read((yyvsp[(4) - (6)].l), i, &d);
Vertex *source = FindPoint((int)d);
if(!source) yymsg(0, "Could not find Point %d", (int)d);
if(target && source){
source->Typ = target->Typ;
source->Pos.X = x;
source->Pos.Y = y;
source->Pos.Z = z;
source->boundaryLayerIndex = target->boundaryLayerIndex;
}
ExtrudeParams::normalsCoherence.push_back(SPoint3(x, y, z));
}
}
else
yymsg(0, "Need at least two points to merge");
ReplaceAllDuplicates();
List_Delete((yyvsp[(4) - (6)].l));
;}
break;

Christophe Geuzaine
committed
List_T *temp = ListOfDouble2ListOfInt((yyvsp[(7) - (11)].l));
int item = 0;
List_Read(temp, i, &item);
domain.push_back(item);
}
List_Delete((yyvsp[(7) - (11)].l));
List_T *temp2 = ListOfDouble2ListOfInt((yyvsp[(9) - (11)].l));
int item = 0;
List_Read(temp2, i, &item);
subdomain.push_back(item);
}
List_Delete((yyvsp[(9) - (11)].l));
std::string fileName = "";
fileName = (yyvsp[(3) - (11)].c);
Homology* homology = new Homology(GModel::current(), domain, subdomain);
yymsg(0, "Gmsh needs to be configured with option Kbipack to use homology computation");

Christophe Geuzaine
committed
int item = 0;
List_Read(temp, i, &item);
domain.push_back(item);
}
int item = 0;
List_Read(temp2, i, &item);
subdomain.push_back(item);
}
std::string fileName = "";
fileName = (yyvsp[(3) - (11)].c);
Homology* homology = new Homology(GModel::current(), domain, subdomain);
homology->setFileName(fileName);
homology->findGenerators();
yymsg(0, "Gmsh needs to be configured with option Kbipack to use homology computation");

Christophe Geuzaine
committed
int item = 0;
List_Read(temp, i, &item);
domain.push_back(item);
}
int item = 0;
List_Read(temp2, i, &item);
subdomain.push_back(item);
}
std::string fileName = "";
fileName = (yyvsp[(3) - (11)].c);
Homology* homology = new Homology(GModel::current(), domain, subdomain);
homology->setFileName(fileName);
homology->findDualGenerators();
yymsg(0, "Gmsh needs to be configured with option Kbipack to use homology computation");

Christophe Geuzaine
committed
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
{
List_T *temp = ListOfDouble2ListOfInt((yyvsp[(7) - (11)].l));
std::vector<int> domain;
for (int i = 0; i < List_Nbr(temp); i++){
int item = 0;
List_Read(temp, i, &item);
domain.push_back(item);
}
List_Delete((yyvsp[(7) - (11)].l));
List_Delete(temp);
List_T *temp2 = ListOfDouble2ListOfInt((yyvsp[(9) - (11)].l));
std::vector<int> subdomain;
for (int i = 0; i < List_Nbr(temp2); i++){
int item = 0;
List_Read(temp2, i, &item);
subdomain.push_back(item);
}
List_Delete((yyvsp[(9) - (11)].l));
List_Delete(temp2);
std::string fileName = "";
fileName = (yyvsp[(3) - (11)].c);
#if defined(HAVE_KBIPACK)
Homology* homology = new Homology(GModel::current(), domain, subdomain);
homology->setFileName(fileName);
homology->findHomSequence();
delete homology;
#else
yymsg(0, "Gmsh needs to be configured with option Kbipack to use homology computation");
#endif
;}

Christophe Geuzaine
committed
{ (yyval.d) = (yyvsp[(1) - (1)].d); ;}

Christophe Geuzaine
committed
{ (yyval.d) = (yyvsp[(2) - (3)].d); ;}

Christophe Geuzaine
committed
{ (yyval.d) = -(yyvsp[(2) - (2)].d); ;}

Christophe Geuzaine
committed
{ (yyval.d) = (yyvsp[(2) - (2)].d); ;}

Christophe Geuzaine
committed
{ (yyval.d) = !(yyvsp[(2) - (2)].d); ;}

Christophe Geuzaine
committed
{ (yyval.d) = (yyvsp[(1) - (3)].d) - (yyvsp[(3) - (3)].d); ;}

Christophe Geuzaine
committed
{ (yyval.d) = (yyvsp[(1) - (3)].d) + (yyvsp[(3) - (3)].d); ;}

Christophe Geuzaine
committed
{ (yyval.d) = (yyvsp[(1) - (3)].d) * (yyvsp[(3) - (3)].d); ;}
break;

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

Christophe Geuzaine
committed
{ (yyval.d) = (int)(yyvsp[(1) - (3)].d) % (int)(yyvsp[(3) - (3)].d); ;}

Christophe Geuzaine
committed
{ (yyval.d) = pow((yyvsp[(1) - (3)].d), (yyvsp[(3) - (3)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = (yyvsp[(1) - (3)].d) < (yyvsp[(3) - (3)].d); ;}

Christophe Geuzaine
committed
{ (yyval.d) = (yyvsp[(1) - (3)].d) > (yyvsp[(3) - (3)].d); ;}

Christophe Geuzaine
committed
{ (yyval.d) = (yyvsp[(1) - (3)].d) <= (yyvsp[(3) - (3)].d); ;}

Christophe Geuzaine
committed
{ (yyval.d) = (yyvsp[(1) - (3)].d) >= (yyvsp[(3) - (3)].d); ;}

Christophe Geuzaine
committed
{ (yyval.d) = (yyvsp[(1) - (3)].d) == (yyvsp[(3) - (3)].d); ;}

Christophe Geuzaine
committed
{ (yyval.d) = (yyvsp[(1) - (3)].d) != (yyvsp[(3) - (3)].d); ;}

Christophe Geuzaine
committed
{ (yyval.d) = (yyvsp[(1) - (3)].d) && (yyvsp[(3) - (3)].d); ;}

Christophe Geuzaine
committed
{ (yyval.d) = (yyvsp[(1) - (3)].d) || (yyvsp[(3) - (3)].d); ;}

Christophe Geuzaine
committed
{ (yyval.d) = (yyvsp[(1) - (5)].d) ? (yyvsp[(3) - (5)].d) : (yyvsp[(5) - (5)].d); ;}

Christophe Geuzaine
committed
{ (yyval.d) = exp((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = log((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = log10((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = sqrt((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = sin((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = asin((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = cos((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = acos((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed

Christophe Geuzaine
committed
{ (yyval.d) = tan((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = atan((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = atan2((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d));;}

Christophe Geuzaine
committed
{ (yyval.d) = sinh((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = cosh((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = tanh((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = fabs((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = floor((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = ceil((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); ;}

Christophe Geuzaine
committed

Christophe Geuzaine
committed
{ (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = sqrt((yyvsp[(3) - (6)].d) * (yyvsp[(3) - (6)].d) + (yyvsp[(5) - (6)].d) * (yyvsp[(5) - (6)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = (yyvsp[(3) - (4)].d) * (double)rand() / (double)RAND_MAX; ;}

Christophe Geuzaine
committed
{ (yyval.d) = exp((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = log((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = log10((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = sqrt((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = sin((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = asin((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = cos((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = acos((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = tan((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = atan((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = atan2((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d));;}

Christophe Geuzaine
committed
{ (yyval.d) = sinh((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = cosh((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = tanh((yyvsp[(3) - (4)].d)); ;}

Christophe Geuzaine
committed
{ (yyval.d) = fabs((yyvsp[(3) - (4)].d)); ;}