diff --git a/Common/CommandLine.cpp b/Common/CommandLine.cpp index 09b8c78e0c84f55ffd0424a6333290ef411fe361..05830de95a31ccf4fa79ea4ce728fc7833c85305 100644 --- a/Common/CommandLine.cpp +++ b/Common/CommandLine.cpp @@ -1,4 +1,4 @@ -// $Id: CommandLine.cpp,v 1.100 2007-05-05 02:08:57 geuzaine Exp $ +// $Id: CommandLine.cpp,v 1.101 2007-05-24 17:34:03 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -433,20 +433,16 @@ void Get_Options(int argc, char *argv[]) else if(!strcmp(argv[i] + 1, "algo")) { i++; if(argv[i] != NULL) { - if(!strncmp(argv[i], "del3d", 5)) - CTX.mesh.algo2d = ALGO_3D_DELAUNAY; + if(!strncmp(argv[i], "del3d", 5) || !strncmp(argv[i], "tetgen", 6)) + CTX.mesh.algo2d = ALGO_3D_TETGEN_DELAUNAY; else if(!strncmp(argv[i], "netgen", 6)) CTX.mesh.algo3d = ALGO_3D_NETGEN; - else if(!strncmp(argv[i], "tetgen", 6)) - CTX.mesh.algo3d = ALGO_3D_TETGEN; - else if(!strncmp(argv[i], "del2d", 5) || - !strncmp(argv[i], "del", 3)) + else if(!strncmp(argv[i], "del2d", 5) || !strncmp(argv[i], "tri", 3)) CTX.mesh.algo2d = ALGO_2D_DELAUNAY; - else if(!strncmp(argv[i], "bds", 3) || - !strncmp(argv[i], "iso", 3)) + else if(!strncmp(argv[i], "bds", 3)) CTX.mesh.algo2d = ALGO_2D_MESHADAPT; - else if(!strncmp(argv[i], "tri", 3)) - CTX.mesh.algo2d = ALGO_2D_TRIANGLE; + else if(!strncmp(argv[i], "del", 3) || !strncmp(argv[i], "iso", 3)) + CTX.mesh.algo2d = ALGO_2D_MESHADAPT_DELAUNAY; else { fprintf(stderr, ERROR_STR "Unknown mesh algorithm\n"); exit(1); diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 04db67efb995cf82e3eb5d6531944b9e68f2d949..5468a724169c04e1dbe1ef4ef186073e41a24272 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -874,15 +874,15 @@ StringXNumber GeometryOptions_Number[] = { } ; StringXNumber MeshOptions_Number[] = { - { F|O, "Algorithm" , opt_mesh_algo2d , ALGO_2D_MESHADAPT , - "2D mesh algorithm (1=meshadapt, 2=delaunay)" }, + { F|O, "Algorithm" , opt_mesh_algo2d , ALGO_2D_MESHADAPT_DELAUNAY , + "2D mesh algorithm (1=MeshAdapt, 2=Delaunay, 3=MeshAdapt+Delaunay)" }, { F|O, "Algorithm3D" , opt_mesh_algo3d , #if defined(HAVE_TETGEN) - ALGO_3D_DELAUNAY , + ALGO_3D_TETGEN_DELAUNAY , #else ALGO_3D_NETGEN , #endif - "3D mesh algorithm (1=delaunay, 4=netgen, 5=tetgen)" }, + "3D mesh algorithm (1=Tetgen+Delaunay, 4=Netgen)" }, { F|O, "AngleSmoothNormals" , opt_mesh_angle_smooth_normals , 30.0 , "Threshold angle below which normals are not smoothed" }, diff --git a/Common/GmshDefines.h b/Common/GmshDefines.h index 67931a1175decd213ffe9495663c2306f55b91b4..9a224eb6ec5e64b3b028591ad2a3878a69c4e885 100644 --- a/Common/GmshDefines.h +++ b/Common/GmshDefines.h @@ -71,14 +71,13 @@ #define ENT_ALL (ENT_POINT | ENT_LINE | ENT_SURFACE | ENT_VOLUME) // 2D mesh algorithms -#define ALGO_2D_MESHADAPT 1 -#define ALGO_2D_DELAUNAY 2 -#define ALGO_2D_TRIANGLE 3 +#define ALGO_2D_MESHADAPT 1 +#define ALGO_2D_DELAUNAY 2 +#define ALGO_2D_MESHADAPT_DELAUNAY 3 // 3D mesh algorithms -#define ALGO_3D_DELAUNAY 1 -#define ALGO_3D_NETGEN 4 -#define ALGO_3D_TETGEN 5 +#define ALGO_3D_TETGEN_DELAUNAY 1 +#define ALGO_3D_NETGEN 4 #define TRANSFINI 1 #define LIBRE 2 diff --git a/Common/Options.cpp b/Common/Options.cpp index a7b5077fae567d516fb132f15caca997cd8a1a3a..9ec23026a9b01e4e8fb0d134176b2f77dec2e8f5 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -1,4 +1,4 @@ -// $Id: Options.cpp,v 1.344 2007-05-13 10:37:01 geuzaine Exp $ +// $Id: Options.cpp,v 1.345 2007-05-24 17:34:03 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -4753,12 +4753,15 @@ double opt_mesh_algo2d(OPT_ARGS_NUM) #if defined(HAVE_FLTK) if(WID && (action & GMSH_GUI)) { switch (CTX.mesh.algo2d) { + case ALGO_2D_MESHADAPT: + WID->mesh_choice[2]->value(0); + break; case ALGO_2D_DELAUNAY: WID->mesh_choice[2]->value(1); break; - case ALGO_2D_MESHADAPT: + case ALGO_2D_MESHADAPT_DELAUNAY: default: - WID->mesh_choice[2]->value(0); + WID->mesh_choice[2]->value(2); break; } } @@ -4804,7 +4807,7 @@ double opt_mesh_algo3d(OPT_ARGS_NUM) case ALGO_3D_NETGEN: WID->mesh_choice[3]->value(1); break; - case ALGO_3D_DELAUNAY: + case ALGO_3D_TETGEN_DELAUNAY: default: WID->mesh_choice[3]->value(0); break; diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp index 3785df3702b930fa25d0d5ef51b230b228102e3d..83e30ad9a20fe30a655cc075ec0475525c53c494 100644 --- a/Fltk/Callbacks.cpp +++ b/Fltk/Callbacks.cpp @@ -1,4 +1,4 @@ -// $Id: Callbacks.cpp,v 1.531 2007-05-19 16:40:03 geuzaine Exp $ +// $Id: Callbacks.cpp,v 1.532 2007-05-24 17:34:03 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -1150,9 +1150,10 @@ void mesh_options_ok_cb(CALLBACK_ARGS) opt_mesh_point_type(0, GMSH_SET, WID->mesh_choice[0]->value()); opt_mesh_algo2d(0, GMSH_SET, (WID->mesh_choice[2]->value() == 0) ? ALGO_2D_MESHADAPT : - ALGO_2D_DELAUNAY); + (WID->mesh_choice[2]->value() == 1) ? ALGO_2D_DELAUNAY : + ALGO_2D_MESHADAPT_DELAUNAY); opt_mesh_algo3d(0, GMSH_SET, - (WID->mesh_choice[3]->value() == 0) ? ALGO_3D_DELAUNAY : + (WID->mesh_choice[3]->value() == 0) ? ALGO_3D_TETGEN_DELAUNAY : ALGO_3D_NETGEN); opt_mesh_recombine_algo(0, GMSH_SET, (WID->mesh_choice[5]->value() == 0) ? 1 : 2); diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index 193011e9375dd81290d9a938a1689b142db8e78d..8d510b473ceeedd3d7fb621d76cc047620c873d2 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -1,4 +1,4 @@ -// $Id: GUI.cpp,v 1.618 2007-05-23 22:05:17 geuzaine Exp $ +// $Id: GUI.cpp,v 1.619 2007-05-24 17:34:03 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -2332,10 +2332,11 @@ void GUI::create_option_window() static Fl_Menu_Item menu_2d_algo[] = { {"MeshAdapt", 0, 0, 0}, {"Delaunay", 0, 0, 0}, + {"MeshAdapt+Delaunay", 0, 0, 0}, {0} }; static Fl_Menu_Item menu_3d_algo[] = { - {"Delaunay", 0, 0, 0}, + {"Tetgen+Delaunay", 0, 0, 0}, {"Netgen", 0, 0, 0}, {0} }; @@ -2349,8 +2350,6 @@ void GUI::create_option_window() mesh_choice[2]->menu(menu_2d_algo); mesh_choice[2]->align(FL_ALIGN_RIGHT); mesh_choice[2]->callback(mesh_options_ok_cb); - // not reimplemented yet - ((Fl_Menu_Item*)mesh_choice[2]->menu())[1].deactivate(); mesh_choice[3] = new Fl_Choice(L + 2 * WB, 2 * WB + 2 * BH, IW, BH, "3D algorithm"); mesh_choice[3]->menu(menu_3d_algo); diff --git a/Mesh/meshGFace.cpp b/Mesh/meshGFace.cpp index e7c7acb2aa830108ea9fbd368c309fab2ff4f417..73543921df14a89eabd500a8b0bb97dfaf4d875a 100644 --- a/Mesh/meshGFace.cpp +++ b/Mesh/meshGFace.cpp @@ -1,4 +1,4 @@ -// $Id: meshGFace.cpp,v 1.79 2007-05-24 14:44:06 remacle Exp $ +// $Id: meshGFace.cpp,v 1.80 2007-05-24 17:34:04 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -900,7 +900,7 @@ bool gmsh2DMeshGenerator ( GFace *gf , bool debug = true) m->del_point(m->find_point(-4)); // start mesh generation - if (CTX.mesh.algo2d == ALGO_2D_MESHADAPT || gf->geomType() != GEntity::Plane) + if (CTX.mesh.algo2d != ALGO_2D_DELAUNAY || gf->geomType() != GEntity::Plane) { RefineMesh (gf,*m,10); OptimizeMesh(gf, *m, 2); @@ -960,10 +960,8 @@ bool gmsh2DMeshGenerator ( GFace *gf , bool debug = true) // the delaunay algo is based directly on internal gmsh structures // BDS mesh is passed in order not to recompute local coordinates // of vertices - if ((CTX.mesh.algo2d == ALGO_2D_DELAUNAY || CTX.mesh.algo2d == ALGO_2D_DELAUNAY) && - gf->geomType() == GEntity::Plane) + if (CTX.mesh.algo2d == ALGO_2D_DELAUNAY && gf->geomType() == GEntity::Plane) { - printf("coucou\n"); insertVerticesInFace (gf,m) ; } @@ -1534,8 +1532,6 @@ void meshGFace::operator() (GFace *gf) if(gf->geomType() == GEntity::BoundaryLayerSurface) return; if(gf->geomType() == GEntity::ProjectionSurface) return; - Msg(STATUS2, "Meshing surface %d (%s)", gf->tag(), gf->getTypeString().c_str()); - // destroy the mesh if it exists deMeshGFace dem; dem(gf); @@ -1543,6 +1539,27 @@ void meshGFace::operator() (GFace *gf) if(MeshTransfiniteSurface(gf)) return; if(MeshExtrudedSurface(gf)) return; + char *algo = "Unknown"; + switch(CTX.mesh.algo2d){ + case ALGO_2D_MESHADAPT: + algo = "MeshAdapt"; + break; + case ALGO_2D_DELAUNAY: + // FIXME: Delaunay not available in all cases at the moment + if(gf->geomType() == GEntity::Plane && + (gf->getNativeType() == GEntity::GmshModel || gf->edgeLoops.empty())) + algo = "Delaunay"; + else + algo = "MeshAdapt+Delaunay"; + break; + case ALGO_2D_MESHADAPT_DELAUNAY: + algo = "MeshAdapt+Delaunay"; + break; + } + + Msg(STATUS2, "Meshing surface %d (%s, %s)", gf->tag(), + gf->getTypeString().c_str(), algo); + // compute loops on the fly (indices indicate start and end points // of a loop; loops are not yet oriented) Msg(DEBUG1, "Computing edge loops"); diff --git a/Mesh/meshGFaceExtruded.cpp b/Mesh/meshGFaceExtruded.cpp index eca6f0556c78e13131bc0d9bbd5b509c44c5bd39..97003f1c714a88002ed46e9c8a1e9b8966fc3556 100644 --- a/Mesh/meshGFaceExtruded.cpp +++ b/Mesh/meshGFaceExtruded.cpp @@ -1,4 +1,4 @@ -// $Id: meshGFaceExtruded.cpp,v 1.18 2007-03-11 20:18:58 geuzaine Exp $ +// $Id: meshGFaceExtruded.cpp,v 1.19 2007-05-24 17:34:04 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -179,6 +179,8 @@ int MeshExtrudedSurface(GFace *gf, if(!ep || !ep->mesh.ExtrudeMesh) return 0; + Msg(STATUS2, "Meshing surface %d (extruded)", gf->tag()); + // build a set with all the vertices on the boundary of gf double old_tol = MVertexLessThanLexicographic::tolerance; MVertexLessThanLexicographic::tolerance = 1.e-12 * CTX.lc; diff --git a/Mesh/meshGFaceTransfinite.cpp b/Mesh/meshGFaceTransfinite.cpp index 116a3e7ea90a8bdb92095e166d5d5c9b443dbbbd..1d3ecca0e067282089b48602fa85dc8d5fba8013 100644 --- a/Mesh/meshGFaceTransfinite.cpp +++ b/Mesh/meshGFaceTransfinite.cpp @@ -1,4 +1,4 @@ -// $Id: meshGFaceTransfinite.cpp,v 1.19 2007-03-11 20:18:58 geuzaine Exp $ +// $Id: meshGFaceTransfinite.cpp,v 1.20 2007-05-24 17:34:04 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -54,6 +54,8 @@ int MeshTransfiniteSurface(GFace *gf) { if(gf->meshAttributes.Method != TRANSFINI) return 0; + Msg(STATUS2, "Meshing surface %d (transfinite)", gf->tag()); + std::vector <MVertex *> corners, d_vertices; std::vector <int> indices; diff --git a/Mesh/meshGRegion.cpp b/Mesh/meshGRegion.cpp index 8b07351f4b87c6d90165d172c5ebb741e8b40c7d..a5eae532983e01f0cf6cb36d9567527756dd6c1b 100644 --- a/Mesh/meshGRegion.cpp +++ b/Mesh/meshGRegion.cpp @@ -1,4 +1,4 @@ -// $Id: meshGRegion.cpp,v 1.30 2007-05-10 22:08:04 geuzaine Exp $ +// $Id: meshGRegion.cpp,v 1.31 2007-05-24 17:34:04 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -516,7 +516,7 @@ void meshGRegion::operator() (GRegion *gr) } } - if(CTX.mesh.algo3d == ALGO_3D_DELAUNAY || CTX.mesh.algo3d == ALGO_3D_TETGEN){ + if(CTX.mesh.algo3d == ALGO_3D_TETGEN_DELAUNAY){ delaunay.push_back(gr); } else if(CTX.mesh.algo3d == ALGO_3D_NETGEN ){