diff --git a/Common/Context.h b/Common/Context.h index c4ebf39cfba5a5135a4ed37d6b114f9c82254688..6ddae285112c8878223de934d8a839441718ee6b 100644 --- a/Common/Context.h +++ b/Common/Context.h @@ -132,7 +132,7 @@ public : int hidden, shade; int format, nb_smoothing, algo, degree; int point_insertion, speed_max, min_circ_points, constrained_bgmesh; - int histogram; + int histogram, initial_only; double normals, tangents, explode; int color_scheme, color_carousel ; int use_cut_plane; diff --git a/Common/GetOptions.cpp b/Common/GetOptions.cpp index fb8f33ff0d5733fa88e35f257fab07ca5049fee4..a341e2a80209665979befcd1cfbd50f1dee695c5 100644 --- a/Common/GetOptions.cpp +++ b/Common/GetOptions.cpp @@ -1,4 +1,4 @@ -// $Id: GetOptions.cpp,v 1.36 2001-08-20 07:38:29 geuzaine Exp $ +// $Id: GetOptions.cpp,v 1.37 2001-08-24 06:58:19 geuzaine Exp $ #include <unistd.h> #include "Gmsh.h" @@ -190,6 +190,14 @@ void Get_Options (int argc, char *argv[], int *nbfiles) { else if(!strcmp(argv[i]+1, "old")){ CTX.geom.old_circle = 1; i++; } + else if(!strcmp(argv[i]+1, "initial")){ + i++; + if(argv[i]!=NULL) CTX.mesh.initial_only = atoi(argv[i++]); + else { + fprintf(stderr, ERROR_STR "Missing number\n"); + exit(1); + } + } else if(!strcmp(argv[i]+1, "quality")){ i++; if(argv[i]!=NULL) CTX.mesh.quality = atof(argv[i++]); diff --git a/Common/Options.cpp b/Common/Options.cpp index aa38b13ffabb7e2f77489f1b4bedfdba1765cc29..35f60d020cc328ed3eb90b8dbcc037fbc23d6ab6 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -1,4 +1,4 @@ -// $Id: Options.cpp,v 1.42 2001-08-23 18:03:45 geuzaine Exp $ +// $Id: Options.cpp,v 1.43 2001-08-24 06:58:19 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" @@ -73,6 +73,7 @@ void Init_Options(int num){ // The following defaults cannot be set by the user CTX.batch = 0 ; + CTX.mesh.initial_only = 0 ; CTX.output_filename = NULL ; CTX.expose = 0 ; CTX.stream = TO_SCREEN ; diff --git a/Mesh/2D_Mesh.cpp b/Mesh/2D_Mesh.cpp index fee1ba49e6c1978985e81b34cf519af615c9d16b..06dd5866a23e5d6e968e1e9cb9cd918cfa4d0146 100644 --- a/Mesh/2D_Mesh.cpp +++ b/Mesh/2D_Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: 2D_Mesh.cpp,v 1.33 2001-08-20 07:38:30 geuzaine Exp $ +// $Id: 2D_Mesh.cpp,v 1.34 2001-08-24 06:58:19 geuzaine Exp $ /* Maillage Delaunay d'une surface (Point insertion Technique) @@ -705,7 +705,7 @@ void Maillage_Automatique_VieuxCode (Surface * pS, Mesh * m, int ori){ } if (pS->Method) - mesh_domain (liste, List_Nbr (pS->Contours), &M, &N, 0); + mesh_domain (liste, List_Nbr (pS->Contours), &M, &N, (CTX.mesh.initial_only==2)); for (i = 0; i < M.numpoints; i++){ if (gPointArray[i].initial < 0){ diff --git a/Mesh/2D_Mesh_Shewchuk.cpp b/Mesh/2D_Mesh_Shewchuk.cpp index a9aeebea9a652b13373bf578fb6e9010daf2b042..f7b7cf9541108a3593d948951ddd95136d1a4671 100644 --- a/Mesh/2D_Mesh_Shewchuk.cpp +++ b/Mesh/2D_Mesh_Shewchuk.cpp @@ -1,4 +1,4 @@ -// $Id: 2D_Mesh_Shewchuk.cpp,v 1.4 2001-08-21 10:43:25 geuzaine Exp $ +// $Id: 2D_Mesh_Shewchuk.cpp,v 1.5 2001-08-24 06:58:19 geuzaine Exp $ #include "Gmsh.h" #include "Mesh.h" @@ -156,6 +156,11 @@ int Mesh_Shewchuk(Surface *s){ Free(in.segmentmarkerlist); Free(in.holelist); + if(CTX.mesh.initial_only==2){ + AddInMesh(s, NbPts, vtable, &mid); + return 0; + } + #ifndef BGMESH mid.trianglearealist = (REAL *) Malloc(mid.numberoftriangles * sizeof(REAL)); diff --git a/Mesh/3D_Coherence.cpp b/Mesh/3D_Coherence.cpp index c493d0eeeea72201e9f11cb9344734aba4a16fd0..53f0701511030048e7c4e847284aee183889deb0 100644 --- a/Mesh/3D_Coherence.cpp +++ b/Mesh/3D_Coherence.cpp @@ -1,4 +1,4 @@ -// $Id: 3D_Coherence.cpp,v 1.16 2001-08-11 23:28:32 geuzaine Exp $ +// $Id: 3D_Coherence.cpp,v 1.17 2001-08-24 06:58:19 geuzaine Exp $ #include "Gmsh.h" #include "Numeric.h" @@ -487,7 +487,6 @@ int Edge_Node (Edge * e, Vertex * v){ return 1; if (!compareVertex (&e->V[1], &v)) return 1; - lc = myhypot (myhypot (e->V[0]->Pos.X - e->V[1]->Pos.X, e->V[0]->Pos.Y - e->V[1]->Pos.Y), e->V[0]->Pos.Z - e->V[1]->Pos.Z); @@ -1304,6 +1303,14 @@ int Coherence (Volume * v, Mesh * m){ for (j = 0; j < List_Nbr (v->Surfaces); j++){ List_Read (v->Surfaces, j, &s); if (Tree_Search (s->Simplexes, &simp)){ + /* + if(List_Nbr(ListFaces)>2){ + printf("suppressed tri %d\n", simp->Num); + printf(" (%g %g %g)\n", simp->V[0]->Pos.X, simp->V[0]->Pos.Y,simp->V[0]->Pos.Z); + printf(" (%g %g %g)\n", simp->V[1]->Pos.X, simp->V[1]->Pos.Y,simp->V[1]->Pos.Z); + printf(" (%g %g %g)\n", simp->V[2]->Pos.X, simp->V[2]->Pos.Y,simp->V[2]->Pos.Z); + } + */ for (k = 0; k < List_Nbr (ListFaces); k++){ List_Read (ListFaces, k, &Face); simp1 = Create_Simplex_MemeSens (simp, Face.V[0], Face.V[1], Face.V[2]); @@ -1314,9 +1321,18 @@ int Coherence (Volume * v, Mesh * m){ Tree_Replace (v->Vertices, &Face.V[0]); Tree_Replace (v->Vertices, &Face.V[1]); Tree_Replace (v->Vertices, &Face.V[2]); + /* + if(List_Nbr(ListFaces)>2){ + printf("replaced by tri %d\n", simp1->Num); + printf(" (%g %g %g)\n", simp1->V[0]->Pos.X, simp1->V[0]->Pos.Y,simp1->V[0]->Pos.Z); + printf(" (%g %g %g)\n", simp1->V[1]->Pos.X, simp1->V[1]->Pos.Y,simp1->V[1]->Pos.Z); + printf(" (%g %g %g)\n", simp1->V[2]->Pos.X, simp1->V[2]->Pos.Y,simp1->V[2]->Pos.Z); + } + */ } Tree_Suppress (s->Simplexes, &simp); } + } } else{ diff --git a/Mesh/3D_Mesh.cpp b/Mesh/3D_Mesh.cpp index 5d91a4a6600ca9d509a9f9f9fba7bdda3a260673..98d88808b5a68fa4f30a7d2ec178a045c7e1919d 100644 --- a/Mesh/3D_Mesh.cpp +++ b/Mesh/3D_Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: 3D_Mesh.cpp,v 1.27 2001-08-13 18:38:55 geuzaine Exp $ +// $Id: 3D_Mesh.cpp,v 1.28 2001-08-24 06:58:19 geuzaine Exp $ /* @@ -761,6 +761,14 @@ void Maillage_Volume (void *data, void *dum){ Link_Simplexes (NULL, LOCAL->Simplexes); + if(CTX.mesh.initial_only==3){ + POINTS_TREE = THEM->Vertices; + Tree_Action (v->Vertices, add_points); + POINTS_TREE = THEM->Simplexes; + Tree_Action (v->Simplexes, add_points); + return; + } + /* Suppression des noeuds de num < 0 */ Suppress = List_Create (10, 10, sizeof (Vertex *)); diff --git a/benchmarks/3d/Sphere.geo b/benchmarks/3d/Sphere.geo index 2efe1e02c31f30607d108abf75c176a3ebd2bbd2..a507718634db0c1ccbd8402f748da206a12e846b 100644 --- a/benchmarks/3d/Sphere.geo +++ b/benchmarks/3d/Sphere.geo @@ -38,5 +38,5 @@ Ruled Surface(28) = {27}; Surface Loop(29) = {28,26,16,14,20,24,22,18}; Complex Volume(30) = {29}; -Physical Volume(1) = 30; +Physical Volume(1) = {0,30}; Physical Surface(2) = {14:28:2};