diff --git a/Common/CommandLine.cpp b/Common/CommandLine.cpp index 2ae45b59da40d0d0701ccdc13132a22f25418d4b..d173cc4983731c0b180caee93d6f97588e1d2cf4 100644 --- a/Common/CommandLine.cpp +++ b/Common/CommandLine.cpp @@ -72,7 +72,7 @@ void PrintUsage(const char *name) Msg::Direct(" -bin Use binary format when available"); Msg::Direct(" -parametric Save vertices with their parametric coordinates"); Msg::Direct(" -numsubedges Set the number of subdivisions when displaying high order elements"); - Msg::Direct(" -algo string Select mesh algorithm (iso, frontal, del2d, del3d, netgen)"); + Msg::Direct(" -algo string Select mesh algorithm (meshadapt, del2d, front2d, del3d, front3d)"); Msg::Direct(" -smooth int Set number of mesh smoothing steps"); Msg::Direct(" -optimize[_netgen] Optimize quality of tetrahedral elements"); Msg::Direct(" -order int Set mesh order (1, ..., 5)"); @@ -471,18 +471,18 @@ void GetOptions(int argc, char *argv[]) else if(!strcmp(argv[i] + 1, "algo")) { i++; if(argv[i]) { - if(!strncmp(argv[i], "del3d", 5) || !strncmp(argv[i], "tetgen", 6)) - CTX::instance()->mesh.algo2d = ALGO_3D_TETGEN_DELAUNAY; - else if(!strncmp(argv[i], "netgen", 6)) - CTX::instance()->mesh.algo3d = ALGO_3D_NETGEN; - else if(!strncmp(argv[i], "frontal", 7)) - CTX::instance()->mesh.algo2d = ALGO_2D_FRONTAL; + if(!strncmp(argv[i], "meshadapt", 9) || !strncmp(argv[i], "iso", 3)) + CTX::instance()->mesh.algo2d = ALGO_2D_MESHADAPT; + else if(!strncmp(argv[i], "bds", 3)) + CTX::instance()->mesh.algo2d = ALGO_2D_MESHADAPT_OLD; else if(!strncmp(argv[i], "del2d", 5) || !strncmp(argv[i], "tri", 3)) CTX::instance()->mesh.algo2d = ALGO_2D_DELAUNAY; - else if(!strncmp(argv[i], "bds", 3)) - CTX::instance()->mesh.algo2d = ALGO_2D_MESHADAPT; - else if(!strncmp(argv[i], "del", 3) || !strncmp(argv[i], "iso", 3)) - CTX::instance()->mesh.algo2d = ALGO_2D_MESHADAPT_DELAUNAY; + else if(!strncmp(argv[i], "front2d", 7) || !strncmp(argv[i], "frontal", 7)) + CTX::instance()->mesh.algo2d = ALGO_2D_FRONTAL; + else if(!strncmp(argv[i], "del3d", 5) || !strncmp(argv[i], "tetgen", 6)) + CTX::instance()->mesh.algo2d = ALGO_3D_DELAUNAY; + else if(!strncmp(argv[i], "front3d", 7) || !strncmp(argv[i], "netgen", 6)) + CTX::instance()->mesh.algo3d = ALGO_3D_FRONTAL; else Msg::Fatal("Unknown mesh algorithm"); i++; diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 646af460e7604e0fb0dd161268a990e2911f9073..f100c4e57af99777d47daf7c65c0e447f1cc518b 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -909,15 +909,15 @@ StringXNumber GeometryOptions_Number[] = { } ; StringXNumber MeshOptions_Number[] = { - { F|O, "Algorithm" , opt_mesh_algo2d , ALGO_2D_MESHADAPT_DELAUNAY , - "2D mesh algorithm (1=MeshAdapt+Delaunay, 4=MeshAdapt, 5=Delaunay, 6=Frontal)" }, + { F|O, "Algorithm" , opt_mesh_algo2d , ALGO_2D_MESHADAPT , + "2D mesh algorithm (1=MeshAdapt, 5=Delaunay, 6=Frontal)" }, { F|O, "Algorithm3D" , opt_mesh_algo3d , #if defined(HAVE_TETGEN) - ALGO_3D_TETGEN_DELAUNAY , + ALGO_3D_DELAUNAY , #else - ALGO_3D_NETGEN , + ALGO_3D_FRONTAL , #endif - "3D mesh algorithm (1=Tetgen+Delaunay, 4=Netgen)" }, + "3D mesh algorithm (1=Delaunay, 4=Frontal)" }, { F|O, "AngleSmoothNormals" , opt_mesh_angle_smooth_normals , 30.0 , "Threshold angle below which normals are not smoothed" }, { F|O, "AllowSwapAngle" , opt_mesh_allow_swap_edge_angle , 10.0 , diff --git a/Common/GmshDefines.h b/Common/GmshDefines.h index 497bfb063c2fdc983188a9aa099387d6d948c355..0af1dedf1e9d51af62dfeff49863092ae8e2c786 100644 --- a/Common/GmshDefines.h +++ b/Common/GmshDefines.h @@ -83,18 +83,15 @@ #define ENT_VOLUME (1<<3) #define ENT_ALL (ENT_POINT | ENT_LINE | ENT_SURFACE | ENT_VOLUME) -// 2D mesh algorithms -#define ALGO_2D_MESHADAPT_DELAUNAY 1 -#define ALGO_2D_ANISOTROPIC 2 // unused -#define ALGO_2D_TRIANGLE 3 // unused -#define ALGO_2D_MESHADAPT 4 +// 2D mesh algorithms (numbers should not be changed) +#define ALGO_2D_MESHADAPT 1 +#define ALGO_2D_MESHADAPT_OLD 4 #define ALGO_2D_DELAUNAY 5 #define ALGO_2D_FRONTAL 6 -// 3D mesh algorithms -#define ALGO_3D_TETGEN_DELAUNAY 1 -#define ALGO_3D_NETGEN 4 -#define ALGO_3D_TETGEN 5 // unused +// 3D mesh algorithms (numbers should not be changed) +#define ALGO_3D_DELAUNAY 1 +#define ALGO_3D_FRONTAL 4 // Meshing methods #define MESH_NONE 0 diff --git a/Common/Options.cpp b/Common/Options.cpp index 81bdcee78072c35f15aa9bb3f097f427db25dddc..ab2916050485a4cefa7e872120077fa746ff838c 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -5396,16 +5396,16 @@ double opt_mesh_algo2d(OPT_ARGS_NUM) #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) { switch (CTX::instance()->mesh.algo2d) { - case ALGO_2D_FRONTAL: - GUI::instance()->options->mesh.choice[2]->value(0); - break; case ALGO_2D_DELAUNAY: GUI::instance()->options->mesh.choice[2]->value(1); break; - case ALGO_2D_MESHADAPT_DELAUNAY: - default: + case ALGO_2D_FRONTAL: GUI::instance()->options->mesh.choice[2]->value(2); break; + case ALGO_2D_MESHADAPT: + default: + GUI::instance()->options->mesh.choice[2]->value(0); + break; } } #endif @@ -5438,10 +5438,10 @@ double opt_mesh_algo3d(OPT_ARGS_NUM) #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) { switch (CTX::instance()->mesh.algo3d) { - case ALGO_3D_NETGEN: + case ALGO_3D_FRONTAL: GUI::instance()->options->mesh.choice[3]->value(1); break; - case ALGO_3D_TETGEN_DELAUNAY: + case ALGO_3D_DELAUNAY: default: GUI::instance()->options->mesh.choice[3]->value(0); break; diff --git a/Fltk/optionWindow.cpp b/Fltk/optionWindow.cpp index 837770850ac4c24d885b7e4535aad8bb8289ab6a..1678359ef6247f3d14efbd57748279afe1744dad 100644 --- a/Fltk/optionWindow.cpp +++ b/Fltk/optionWindow.cpp @@ -440,12 +440,12 @@ static void mesh_options_ok_cb(Fl_Widget *w, void *data) opt_mesh_point_type(0, GMSH_SET, o->mesh.choice[0]->value()); opt_mesh_algo2d(0, GMSH_SET, - (o->mesh.choice[2]->value() == 0) ? ALGO_2D_FRONTAL : + (o->mesh.choice[2]->value() == 0) ? ALGO_2D_MESHADAPT : (o->mesh.choice[2]->value() == 1) ? ALGO_2D_DELAUNAY : - ALGO_2D_MESHADAPT_DELAUNAY); + ALGO_2D_FRONTAL); opt_mesh_algo3d(0, GMSH_SET, - (o->mesh.choice[3]->value() == 0) ? ALGO_3D_TETGEN_DELAUNAY : - ALGO_3D_NETGEN); + (o->mesh.choice[3]->value() == 0) ? ALGO_3D_DELAUNAY : + ALGO_3D_FRONTAL); opt_mesh_algo_subdivide(0, GMSH_SET, o->mesh.choice[5]->value()); opt_mesh_color_carousel(0, GMSH_SET, o->mesh.choice[4]->value()); opt_mesh_quality_type(0, GMSH_SET, o->mesh.choice[6]->value()); @@ -1865,14 +1865,14 @@ optionWindow::optionWindow(int deltaFontSize) o->hide(); static Fl_Menu_Item menu_2d_algo[] = { - {"Frontal", 0, 0, 0}, + {"MeshAdapt", 0, 0, 0}, {"Delaunay", 0, 0, 0}, - {"MeshAdapt+Delaunay", 0, 0, 0}, + {"Frontal", 0, 0, 0}, {0} }; static Fl_Menu_Item menu_3d_algo[] = { - {"Tetgen+Delaunay", 0, 0, 0}, - {"Netgen", 0, 0, 0}, + {"Delaunay", 0, 0, 0}, + {"Frontal", 0, 0, 0}, {0} }; static Fl_Menu_Item menu_subdivision_algo[] = { diff --git a/Mesh/meshGFace.cpp b/Mesh/meshGFace.cpp index 94d5c75eb2d7a3dfccb4ab400a7a31a729e86128..491eb6d21e6d6ffc4f128c94d1c83823b9fe2392 100644 --- a/Mesh/meshGFace.cpp +++ b/Mesh/meshGFace.cpp @@ -1367,10 +1367,10 @@ void meshGFace::operator() (GFace *gf) const char *algo = "Unknown"; if(AlgoDelaunay2D(gf)) algo = (CTX::instance()->mesh.algo2d == ALGO_2D_FRONTAL) ? "Frontal" : "Delaunay"; - else if(CTX::instance()->mesh.algo2d == ALGO_2D_MESHADAPT) - algo = "MeshAdapt"; + else if(CTX::instance()->mesh.algo2d == ALGO_2D_MESHADAPT_OLD) + algo = "MeshAdapt (old)"; else - algo = "MeshAdapt+Delaunay"; + algo = "MeshAdapt"; Msg::StatusBar(2, true, "Meshing surface %d (%s, %s)", gf->tag(), gf->getTypeString().c_str(), algo); diff --git a/Mesh/meshGFaceBDS.cpp b/Mesh/meshGFaceBDS.cpp index 272b7a634976ae7ca23ad80fc4eca765cf569de9..d48963a05883b153eeeed3c2524f7666e3c6f729 100644 --- a/Mesh/meshGFaceBDS.cpp +++ b/Mesh/meshGFaceBDS.cpp @@ -351,9 +351,9 @@ void swapEdgePass(GFace *gf, BDS_Mesh &m, int &nb_swap) // result = 0 => whatever // result = 1 => oblige to swap because the quality is greatly improved if (!(*it)->deleted){ - const double qual = CTX::instance()->mesh.algo2d == ALGO_2D_MESHADAPT ? 1 : 5; + double qual = CTX::instance()->mesh.algo2d == ALGO_2D_MESHADAPT_OLD ? 1 : 5; int result = edgeSwapTestQuality(*it,qual); - if (CTX::instance()->mesh.algo2d == ALGO_2D_MESHADAPT ) + if (CTX::instance()->mesh.algo2d == ALGO_2D_MESHADAPT_OLD) { if (m.swap_edge(*it, BDS_SwapEdgeTestQuality(true)))nb_swap++; } else if ( result >= 0 && edgeSwapTestDelaunay(*it,gf)) { if (m.swap_edge(*it, BDS_SwapEdgeTestQuality(false))) nb_swap++; } diff --git a/Mesh/meshGRegion.cpp b/Mesh/meshGRegion.cpp index f215ba3c160b59822e25063dbcd162e5e84d15a5..ae9eb85389245d6f984ea173b77bd490ab47bb0e 100644 --- a/Mesh/meshGRegion.cpp +++ b/Mesh/meshGRegion.cpp @@ -249,7 +249,7 @@ void MeshDelaunayVolume(std::vector<GRegion*> ®ions) #else for(unsigned int i = 0; i < regions.size(); i++) - Msg::StatusBar(2, true, "Meshing volume %d (Tetgen+Delaunay)", regions[i]->tag()); + Msg::StatusBar(2, true, "Meshing volume %d (Delaunay)", regions[i]->tag()); // put all the faces in the same model GRegion *gr = regions[0]; @@ -586,14 +586,14 @@ void meshGRegion::operator() (GRegion *gr) } } - if(CTX::instance()->mesh.algo3d == ALGO_3D_TETGEN_DELAUNAY){ + if(CTX::instance()->mesh.algo3d == ALGO_3D_DELAUNAY){ delaunay.push_back(gr); } - else if(CTX::instance()->mesh.algo3d == ALGO_3D_NETGEN ){ + else if(CTX::instance()->mesh.algo3d == ALGO_3D_FRONTAL){ #if !defined(HAVE_NETGEN) Msg::Error("Netgen is not compiled in this version of Gmsh"); #else - Msg::StatusBar(2, true, "Meshing volume %d (Netgen)", gr->tag()); + Msg::StatusBar(2, true, "Meshing volume %d (Frontal)", gr->tag()); // orient the triangles of with respect to this region meshNormalsPointOutOfTheRegion(gr); std::vector<MVertex*> numberedV; diff --git a/doc/gmsh.1 b/doc/gmsh.1 index d8ba0f8fa09438053c3b0d51cf0fb7aba84ec217..f43f3bbfd8ec226ea514e938943322eb5bbb3831 100644 --- a/doc/gmsh.1 +++ b/doc/gmsh.1 @@ -57,7 +57,7 @@ set output mesh format (msh, msh1, msh2, unv, vrml, stl, mesh, bdf, p3d, cgns, m use binary format when available. .TP 4 .B \-algo string -select mesh algorithm (iso, frontal, del2d, del3d, netgen). +select mesh algorithm (meshadapt, del2d, front2d, del3d, front3d). .TP 4 .B \-smooth int set number of mesh smoothing steps. diff --git a/doc/texinfo/command_line.texi b/doc/texinfo/command_line.texi index fd891e73e239480b8eab95a412d3c599b7958c8e..9141298311878d15998ce8dd4868779b9aa476f7 100644 --- a/doc/texinfo/command_line.texi +++ b/doc/texinfo/command_line.texi @@ -25,7 +25,7 @@ Set output mesh format (msh, msh1, msh2, unv, vrml, stl, mesh, bdf, p3d, cgns, m @item -bin Use binary format when available @item -algo string -Select mesh algorithm (iso, frontal, del2d, del3d, netgen) +Select mesh algorithm (meshadapt, del2d, front2d, del3d, front3d) @item -smooth int Set number of mesh smoothing steps @item -optimize[_netgen] diff --git a/doc/texinfo/gmsh.texi b/doc/texinfo/gmsh.texi index bea4e0791ff963b1ad3cfae4f4ef09499a47010b..76c0bec12a5db83300cca03754cafe74dd4f109e 100644 --- a/doc/texinfo/gmsh.texi +++ b/doc/texinfo/gmsh.texi @@ -366,10 +366,10 @@ line ``attractors'', etc.). For each meshing step, all structured mesh directives are executed first, and serve as additional constraints for the unstructured parts @footnote{Note that mixing structured volume grids with unstructured -volume grids generated with the default 3D isotropic Delaunay algorithm -can result, in certain cases, to non-conform surface meshes on their -shared boundary. If this happens, you may consider using the Netgen -algorithm for the unstructured part.}. +volume grids generated with the default 3D Delaunay algorithm can +result, in certain cases, to non-conform surface meshes on their shared +boundary. If this happens, you may consider using the frontal algorithm +for the unstructured part.}. @c ------------------------------------------------------------------------- @c Solver: external solver interface @@ -2222,25 +2222,25 @@ In 3D two unstructured algorithms are available: @enumerate @item -The ``Tetgen+Delaunay'' algorithm is split into two separate -steps. First, an initial mesh of the union of all the volumes in the -model is performed using the Tetgen algorithm@footnote{H. Si, -@emph{Tetgen: a quality tetrahedral mesh generator and three-dimensional -Delaunay triangulator}, 2004.}. Then a three-dimensional version of the -2D Delaunay algorithm described above is applied. +The ``Delaunay'' algorithm is split into two separate steps. First, an +initial mesh of the union of all the volumes in the model is performed +using the Tetgen algorithm@footnote{H. Si, @emph{Tetgen: a quality +tetrahedral mesh generator and three-dimensional Delaunay triangulator}, +2004.}. Then a three-dimensional version of the 2D Delaunay algorithm +described above is applied. @item -The ``Netgen'' algorithm uses J. Schoeberl's frontal +The ``Frontal'' algorithm uses J. Schoeberl's Netgen frontal algorithm@footnote{J. Schoeberl, @emph{Netgen, an advancing front 2d/3d-mesh generator based on abstract rules}, Comput. Visual. Sci., 1, pp. 41--52, 1997.}. @end enumerate -The ``Tetgen+Delaunay'' algorithm is the most robust and the -fastest. However, this algorithm will sometimes modify the surface mesh, -and is thus not suitable for producing hybrid structured/unstructured -grids. In that case the ``Netgen'' algorithm should be preferred. The -quality of the elements produced by both algorithms is comparable. If -element quality is important the mesh optimizer(s) should be applied. +The ``Delaunay'' algorithm is the most robust and the fastest. However, +this algorithm will sometimes modify the surface mesh, and is thus not +suitable for producing hybrid structured/unstructured grids. In that +case the ``Frontal'' algorithm should be preferred. The quality of the +elements produced by both algorithms is comparable. If element quality +is important the mesh optimizer(s) should be applied. @c ------------------------------------------------------------------------- @c Elementary vs. physical entities diff --git a/doc/texinfo/opt_mesh.texi b/doc/texinfo/opt_mesh.texi index 2ad929e59d604aee5810bede222654884875ace6..76c06ad68b59facc34ec0dec387644521308de40 100644 --- a/doc/texinfo/opt_mesh.texi +++ b/doc/texinfo/opt_mesh.texi @@ -5,12 +5,12 @@ @ftable @code @item Mesh.Algorithm -2D mesh algorithm (1=MeshAdapt+Delaunay, 4=MeshAdapt, 5=Delaunay, 6=Frontal)@* +2D mesh algorithm (1=MeshAdapt, 5=Delaunay, 6=Frontal)@* Default value: @code{1}@* Saved in: @code{General.OptionsFileName} @item Mesh.Algorithm3D -3D mesh algorithm (1=Tetgen+Delaunay, 4=Netgen)@* +3D mesh algorithm (1=Delaunay, 4=Frontal)@* Default value: @code{1}@* Saved in: @code{General.OptionsFileName}