diff --git a/Mesh/3D_Transfinite.cpp b/Mesh/3D_Transfinite.cpp index 5c2e6396d04db5080a7ff2045808be6184e29886..6b0fb6d83ff995734ae5a9c8d8efd362c2bee83b 100644 --- a/Mesh/3D_Transfinite.cpp +++ b/Mesh/3D_Transfinite.cpp @@ -1,4 +1,4 @@ -// $Id: 3D_Transfinite.cpp,v 1.2 2005-01-01 19:35:30 geuzaine Exp $ +// $Id: 3D_Transfinite.cpp,v 1.3 2005-11-28 19:13:49 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -24,7 +24,7 @@ // /* - Maillage transfini volumique + Volume trasfinite meshes a0 s0 s1 f0 s0 s1 s5 s4 s6 s7 s6 a1 s1 s2 f1 s1 s2 s6 s4 * @@ -41,9 +41,14 @@ *--u - Remarque : La definition d'un volume prismatique doit se faire dans l'ordre - donne sur le schema. (degenerescence obligatoirement en s0/s4) + Warning: + 1) the definition of a prismatic volume has to follow the ordering + given in the fig (degenerescence has to be in s0/s4) + + 2) meshing a hex volume with prisms assumes that the surface mesh + has been oriented in a certain way ('left' and 'alternate' + transf. surfaces are not supported) */ #include "Gmsh.h" @@ -235,10 +240,6 @@ int MeshTransfiniteVolume(Volume * vol) S[6] = Stmp[5]; } - /* - for(i=0;i<8;i++) printf("S[%d]=%d \n", i, S[i]->Num); - */ - for(i = 0; i < nbs; i++) List_Read(vol->Surfaces, i, &GG[i]); @@ -263,14 +264,13 @@ int MeshTransfiniteVolume(Volume * vol) G[k] = GG[i]; F_flag[k] = flag; NbFacesFound++; - /* - printf("TR3D: (k=%d) face trouvee %d (flag = %d) : nodes %d %d %d %d \n", - k,GG[i]->Num, flag, - S[tab1hex[4*k ]]->Num, - S[tab1hex[4*k+1]]->Num, - S[tab1hex[4*k+2]]->Num, - S[tab1hex[4*k+3]]->Num); - */ + + if(GG[i]->Recombine_Dir != 1){ + Msg(GERROR, "Transfinite Volume not available yet with left- or alternate-" + "oriented transfinite surfaces"); + return 0; + } + } } } @@ -303,10 +303,8 @@ int MeshTransfiniteVolume(Volume * vol) for(i = 0; i < 6; i++) { if(i != 3) { if(G[i] == NULL) { - Msg(WARNING1, "Wrong definition of prismatic Transfinite Volume %d", - vol->Num); - Msg(WARNING2, - "Possibly because the first and fourth points are not the"); + Msg(WARNING1, "Wrong definition of prismatic Transfinite Volume %d", vol->Num); + Msg(WARNING2, "Possibly because the first and fourth points are not the"); Msg(WARNING3, "degenerated ones"); return 0; } @@ -314,15 +312,10 @@ int MeshTransfiniteVolume(Volume * vol) } } - N1 = (F_flag[4] % 2 == 0) ? G[4]->Nu : G[4]->Nv; N2 = (F_flag[4] % 2 == 0) ? G[4]->Nv : G[4]->Nu; N3 = (F_flag[0] % 2 == 0) ? G[0]->Nv : G[0]->Nu; - /* - printf("N1(%d) N2(%d) N3(%d)\n", N1,N2,N3); - */ - list = (Vertex **) Malloc(N1 * N2 * N3 * sizeof(Vertex *)); for(i = 0; i < N1; i++) { @@ -368,13 +361,8 @@ int MeshTransfiniteVolume(Volume * vol) *S[7], u, v, w); list[i + N1 * j + N1 * N2 * k] = Create_Vertex(++THEM->MaxPointNum, V.Pos.X, V.Pos.Y, V.Pos.Z, - V.lc, 0.0); - /* - printf(" NEW node : %f %f %f\n", list[i+N1*j+N1*N2*k]->Pos.X, - list[i+N1*j+N1*N2*k]->Pos.Y, list[i+N1*j+N1*N2*k]->Pos.Z); - */ + V.lc, 0.0); } - else if(!i) { list[i + N1 * j + N1 * N2 * k] = F[3]; } @@ -452,13 +440,12 @@ int MeshTransfiniteVolume(Volume * vol) prism->iEnt = vol->Num; Tree_Add(vol->Prisms, &prism); - prism = - Create_Prism(list[(i + 1) + N1 * (j + 1) + N1 * N2 * (k + 1)], - list[(i + 1) + N1 * (j) + N1 * N2 * (k + 1)], - list[(i + 1) + N1 * (j + 1) + N1 * N2 * (k)], - list[(i) + N1 * (j + 1) + N1 * N2 * (k + 1)], - list[(i) + N1 * (j) + N1 * N2 * (k + 1)], - list[(i) + N1 * (j + 1) + N1 * N2 * (k)]); + prism = Create_Prism(list[(i + 1) + N1 * (j + 1) + N1 * N2 * (k + 1)], + list[(i + 1) + N1 * (j) + N1 * N2 * (k + 1)], + list[(i + 1) + N1 * (j + 1) + N1 * N2 * (k)], + list[(i) + N1 * (j + 1) + N1 * N2 * (k + 1)], + list[(i) + N1 * (j) + N1 * N2 * (k + 1)], + list[(i) + N1 * (j + 1) + N1 * N2 * (k)]); prism->iEnt = vol->Num; Tree_Add(vol->Prisms, &prism); @@ -613,5 +600,4 @@ int MeshTransfiniteVolume(Volume * vol) } return 1; - } diff --git a/Mesh/Create.cpp b/Mesh/Create.cpp index 81f5220cf93a2ce7f949ab0067691c19391c5792..1df8e6ed8ab12acf88bf3652fcb241f057ae7a3d 100644 --- a/Mesh/Create.cpp +++ b/Mesh/Create.cpp @@ -1,4 +1,4 @@ -// $Id: Create.cpp,v 1.78 2005-09-07 14:36:45 remacle Exp $ +// $Id: Create.cpp,v 1.79 2005-11-28 19:13:49 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -660,7 +660,7 @@ Surface *Create_Surface(int Num, int Typ) for(int i = 0; i < 5; i++) pS->ipar[i] = 0; pS->Recombine = 0; - pS->Recombine_Dir = 0; + pS->Recombine_Dir = 1; pS->RecombineAngle = 75; pS->TrsfPoints = List_Create(4, 4, sizeof(Vertex *)); pS->Simplexes = Tree_Create(sizeof(Simplex *), compareQuality); diff --git a/Mesh/Vertex.cpp b/Mesh/Vertex.cpp index 20f76b2f577ff31f903aa2e61740f9dae48ecfcb..ed810296fa30dc498c5fad72fad9d33fd88acd4b 100644 --- a/Mesh/Vertex.cpp +++ b/Mesh/Vertex.cpp @@ -1,4 +1,4 @@ -// $Id: Vertex.cpp,v 1.27 2005-04-15 14:32:40 remacle Exp $ +// $Id: Vertex.cpp,v 1.28 2005-11-28 19:13:49 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -159,7 +159,9 @@ int comparePosition(const void *a, const void *b) int i, j; Vertex **q, **w; // TOLERANCE ! WARNING WARNING - double eps = 1.e-6 * CTX.lc; + double eps = 1.e-6 * CTX.lc; + // the above tol was changed in 1.61 (before 1.61, it was set to + // double eps = 1.e-10 * CTX.lc; q = (Vertex **) a; w = (Vertex **) b; diff --git a/Parser/Gmsh.tab.cpp b/Parser/Gmsh.tab.cpp index e255241cb9d531d06e37e0822f0fe5d6ab87cd8f..2dc394cd377ad19b8188195bd59c0a1f84112fa3 100644 --- a/Parser/Gmsh.tab.cpp +++ b/Parser/Gmsh.tab.cpp @@ -168,7 +168,7 @@ #line 1 "Gmsh.y" -// $Id: Gmsh.tab.cpp,v 1.244 2005-11-19 04:01:13 geuzaine Exp $ +// $Id: Gmsh.tab.cpp,v 1.245 2005-11-28 19:13:49 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -5722,7 +5722,7 @@ case 223: yymsg(WARNING, "Unknown surface %d", (int)yyvsp[-4].d); else{ s->Method = TRANSFINI; - s->Recombine_Dir = -1; + s->Recombine_Dir = 1; int k = List_Nbr(yyvsp[-1].l); if(k != 3 && k != 4){ yymsg(GERROR, "Wrong definition of Transfinite Surface %d: " diff --git a/Parser/Gmsh.y b/Parser/Gmsh.y index 1216ecf0221ba9fa8cfb538645c9300a0dad533d..b1f3d164e4e37075367e15c45120616a64e6e659 100644 --- a/Parser/Gmsh.y +++ b/Parser/Gmsh.y @@ -1,5 +1,5 @@ %{ -// $Id: Gmsh.y,v 1.212 2005-11-19 04:01:18 geuzaine Exp $ +// $Id: Gmsh.y,v 1.213 2005-11-28 19:13:50 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -2771,7 +2771,7 @@ Transfinite : yymsg(WARNING, "Unknown surface %d", (int)$4); else{ s->Method = TRANSFINI; - s->Recombine_Dir = -1; + s->Recombine_Dir = 1; int k = List_Nbr($7); if(k != 3 && k != 4){ yymsg(GERROR, "Wrong definition of Transfinite Surface %d: " diff --git a/Parser/Gmsh.yy.cpp b/Parser/Gmsh.yy.cpp index f13a2229a5b1d33ca1d5f2b78107d96401f2957a..599860550bc790f71d3a7488f17db497839cb10d 100644 --- a/Parser/Gmsh.yy.cpp +++ b/Parser/Gmsh.yy.cpp @@ -2,7 +2,7 @@ /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /cvsroot/gmsh/Parser/Gmsh.yy.cpp,v 1.243 2005-11-19 04:01:18 geuzaine Exp $ + * $Header: /cvsroot/gmsh/Parser/Gmsh.yy.cpp,v 1.244 2005-11-28 19:13:51 geuzaine Exp $ */ #define FLEX_SCANNER @@ -1026,7 +1026,7 @@ char *yytext; #line 1 "Gmsh.l" #define INITIAL 0 #line 2 "Gmsh.l" -// $Id: Gmsh.yy.cpp,v 1.243 2005-11-19 04:01:18 geuzaine Exp $ +// $Id: Gmsh.yy.cpp,v 1.244 2005-11-28 19:13:51 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle //