diff --git a/Makefile b/Makefile index 07aa94d1d2bab1aa985297f4b40702ed78f510c2..9f360a26540357f629734c7d83a67c7ffd0df94b 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.363 2004-07-05 15:31:59 geuzaine Exp $ +# $Id: Makefile,v 1.364 2004-07-14 22:42:26 geuzaine Exp $ # # Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle # @@ -23,7 +23,7 @@ include variables GMSH_MAJOR_VERSION = 1 GMSH_MINOR_VERSION = 54 -GMSH_PATCH_VERSION = 1 +GMSH_PATCH_VERSION = 2 GMSH_EXTRA_VERSION = "-cvs" GMSH_VERSION = ${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}.${GMSH_PATCH_VERSION}${GMSH_EXTRA_VERSION} diff --git a/Mesh/2D_Cylindrical.cpp b/Mesh/2D_Cylindrical.cpp index a0e1684fe084664245e50f73ac2b27bfbaadfa6e..bdd3a94cdb9d11918fc00194e03d67380b14856e 100644 --- a/Mesh/2D_Cylindrical.cpp +++ b/Mesh/2D_Cylindrical.cpp @@ -1,4 +1,4 @@ -// $Id: 2D_Cylindrical.cpp,v 1.17 2004-06-20 23:25:32 geuzaine Exp $ +// $Id: 2D_Cylindrical.cpp,v 1.18 2004-07-14 22:42:26 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -295,7 +295,7 @@ int MeshCylindricalSurface(Surface * s) else if(CTX.mesh.algo2d == DELAUNAY_ANISO) AlgorithmeMaillage2DAnisotropeModeJF(s); else - Mesh_Shewchuk(s); + Mesh_Triangle(s); for(i = 0; i < CTX.mesh.nb_smoothing; i++) { tnxe = Tree_Create(sizeof(NXE), compareNXE); diff --git a/Mesh/2D_Mesh.cpp b/Mesh/2D_Mesh.cpp index 69862d28a4ae43ab786f6717fdb8727a6493dacd..fdb0b8d5f7f43674b83e1f476e65b0f688830ac8 100644 --- a/Mesh/2D_Mesh.cpp +++ b/Mesh/2D_Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: 2D_Mesh.cpp,v 1.67 2004-06-30 00:57:50 geuzaine Exp $ +// $Id: 2D_Mesh.cpp,v 1.68 2004-07-14 22:42:26 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -899,7 +899,7 @@ void Maillage_Surface(void *data, void *dum) else if(CTX.mesh.algo2d == DELAUNAY_ANISO) AlgorithmeMaillage2DAnisotropeModeJF(s); else - Mesh_Shewchuk(s); + Mesh_Triangle(s); if(CTX.mesh.nb_smoothing) { Msg(STATUS3, "Smoothing surface %d", s->Num); diff --git a/Mesh/2D_Mesh_Triangle.cpp b/Mesh/2D_Mesh_Triangle.cpp index 76616dd70a3b1bdae16fb8447b40d4ae7beac468..408cdbeb1db949f9614acf0c62146bb0a73a0734 100644 --- a/Mesh/2D_Mesh_Triangle.cpp +++ b/Mesh/2D_Mesh_Triangle.cpp @@ -1,4 +1,4 @@ -// $Id: 2D_Mesh_Triangle.cpp,v 1.9 2004-05-22 01:29:46 geuzaine Exp $ +// $Id: 2D_Mesh_Triangle.cpp,v 1.10 2004-07-14 22:42:26 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -26,7 +26,7 @@ #if !defined(HAVE_TRIANGLE) -int Mesh_Shewchuk(Surface * s) +int Mesh_Triangle(Surface * s) { Msg(GERROR, "Triangle is not compiled in this version of Gmsh"); return 1; @@ -72,11 +72,10 @@ void AddInMesh(Surface * sur, int nbbound, Vertex ** vertexbound, Free(out->pointattributelist); for(i = 0; i < out->numberoftriangles; i++) { - s = - Create_Simplex(vtable[out->trianglelist[i * out->numberofcorners + 0]], - vtable[out->trianglelist[i * out->numberofcorners + 1]], - vtable[out->trianglelist[i * out->numberofcorners + 2]], - NULL); + s = Create_Simplex(vtable[out->trianglelist[i * out->numberofcorners + 0]], + vtable[out->trianglelist[i * out->numberofcorners + 1]], + vtable[out->trianglelist[i * out->numberofcorners + 2]], + NULL); s->iEnt = sur->Num; Tree_Add(sur->Simplexes, &s); } @@ -108,7 +107,7 @@ void FindPointInHole(List_T * verts, REAL * x, REAL * y) *y = 0.5 * (v1->Pos.Y + v2->Pos.Y) + 1.e-12 * CTX.lc * c[1]; } -int Mesh_Shewchuk(Surface * s) +int Mesh_Triangle(Surface * s) { char opts[128]; int i, j, k, l, NbPts = 0, first; @@ -138,6 +137,7 @@ int Mesh_Shewchuk(Surface * s) k = 0; l = 0; + double lc_max = -1.0; for(i = 0; i < List_Nbr(s->Contours); i++) { List_Read(s->Contours, i, &list); first = l; @@ -146,6 +146,7 @@ int Mesh_Shewchuk(Surface * s) in.pointlist[k] = v->Pos.X; in.pointlist[k + 1] = v->Pos.Y; in.pointattributelist[l] = v->lc; + if(v->lc > lc_max) lc_max = v->lc; vtable[l] = v; in.segmentlist[k] = l; in.segmentlist[k + 1] = (j == List_Nbr(list) - 1) ? (first) : (l + 1); @@ -180,8 +181,16 @@ int Mesh_Shewchuk(Surface * s) mid.edgelist = NULL; mid.edgemarkerlist = NULL; - // triangulate the points with minimum angle > 20 deg, with no boundary breaking + // triangulate the points with minimum angle > 20 deg, with no + // boundary breaking, + // TODO: + // and with an area constraint related to the + // maximum char. length allowed (this last constraint is to avoid an + // extremely coarse initial grid, on which the interpolation of the + // final char. lengths would be awful). + + //sprintf(opts, "pqzYa%e", lc_max*lc_max/2.); strcpy(opts, "pqzY"); if(CTX.verbosity < 4) strcat(opts, "Q"); @@ -203,8 +212,7 @@ int Mesh_Shewchuk(Surface * s) mid.trianglearealist = (REAL *) Malloc(mid.numberoftriangles * sizeof(REAL)); for(i = 0; i < mid.numberoftriangles; i++) { - //if(THEM->BGM.Typ == ONFILE) { - if(0) { + if(THEM->BGM.Typ == ONFILE) { double xx = 0.0, yy = 0.0; for(j = 0; j < mid.numberofcorners; j++) { k = mid.trianglelist[i * mid.numberofcorners + j]; @@ -213,10 +221,13 @@ int Mesh_Shewchuk(Surface * s) } xx /= mid.numberofcorners; yy /= mid.numberofcorners; - // project the point in real space; this is a mess, since we - // actually change the parameters of the surface in 2d_Mesh.cpp - // x =, y = , z = ; - //val = Lc_XYZ(x, y, z, THEM); + Vertex *v, *dum; + v = Create_Vertex(-1, xx, yy, 0.0, 0.0, 0.0); + Calcule_Z_Plan(&v, &dum); + Projette_Inverse(&v, &dum); + val = Lc_XYZ(v->Pos.X, v->Pos.Y, v->Pos.Z, THEM); + val = val * val / 1.2; + Free_Vertex(&v, 0); } else { val = 0; @@ -225,7 +236,7 @@ int Mesh_Shewchuk(Surface * s) val += mid.pointattributelist[k]; } val /= mid.numberofcorners; - val = val * val / 1.5; // approx (we want isotropic meshes) + val = val * val / 1.5; } mid.trianglearealist[i] = val; } @@ -235,7 +246,8 @@ int Mesh_Shewchuk(Surface * s) out.trianglelist = NULL; out.triangleattributelist = NULL; - // refine the triangulation according to the triangle area constraints + // refine the triangulation according to the triangle area + // constraints //strcpy(opts, "praqzBPY"); strcpy(opts, CTX.mesh.triangle_options); diff --git a/Mesh/3D_Mesh_Netgen.cpp b/Mesh/3D_Mesh_Netgen.cpp index c97d1c932e3a3414011be0940a826ad790b3b56d..47e93fc3943af187026147a5e829f12b89911c0d 100644 --- a/Mesh/3D_Mesh_Netgen.cpp +++ b/Mesh/3D_Mesh_Netgen.cpp @@ -1,4 +1,4 @@ -// $Id: 3D_Mesh_Netgen.cpp,v 1.10 2004-06-30 19:51:44 geuzaine Exp $ +// $Id: 3D_Mesh_Netgen.cpp,v 1.11 2004-07-14 22:42:26 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -256,6 +256,7 @@ void Netgen::OptimizeVolume() List_Read(_volverts, i, &v); Tree_Suppress(_vol->Vertices, &v); Tree_Suppress(THEM->Vertices, &v); + Free_Vertex(&v, NULL); } // remove the tets Tree_Action(_vol->Simplexes, suppressSimplex); @@ -303,6 +304,8 @@ void Optimize_Netgen(Mesh *m) Msg(STATUS2, "Optimize volume mesh..."); double t1 = Cpu(); + Degre1(); // cleanup 2nd order vertices, if any + List_T *list = Tree2List(m->Volumes); for(int i = 0; i < List_Nbr(list); i++){ Volume *v; diff --git a/Mesh/Mesh.h b/Mesh/Mesh.h index 503126b30a172f033a55f846f651c9a1c94adcec..aeb301db909711e4bd3206c19789206e3cbafbf8 100644 --- a/Mesh/Mesh.h +++ b/Mesh/Mesh.h @@ -467,7 +467,7 @@ int MeshEllipticSurface(Surface * sur); int AlgorithmeMaillage2DAnisotropeModeJF(Surface * s); void Maillage_Automatique_VieuxCode(Surface * pS, Mesh * m, int ori); -int Mesh_Shewchuk(Surface *s); +int Mesh_Triangle(Surface *s); int Mesh_Netgen(Volume * v); void Optimize_Netgen(Volume * v); void Optimize_Netgen(Mesh * m); diff --git a/Netgen/nglib_addon.cpp b/Netgen/nglib_addon.cpp index fb42b7c511dad850235d8b444784801035c1d561..8416c0af5520fcb0cc2b9c399edb392195c565fb 100644 --- a/Netgen/nglib_addon.cpp +++ b/Netgen/nglib_addon.cpp @@ -1,4 +1,4 @@ -// small addition(s) to the netgen interface library for Gmsh +// small additions to the netgen interface library for Gmsh #include "meshing.hpp" #include "mystdlib.h" diff --git a/Plugin/DecomposeInSimplex.cpp b/Plugin/DecomposeInSimplex.cpp index 0b6620b23d842e4c996f4593be40bf2e3b6c8ce7..234856d8a3ea6d5f5b1da320e6d1d20960fa1a43 100644 --- a/Plugin/DecomposeInSimplex.cpp +++ b/Plugin/DecomposeInSimplex.cpp @@ -1,4 +1,4 @@ -// $Id: DecomposeInSimplex.cpp,v 1.12 2004-06-16 18:03:27 geuzaine Exp $ +// $Id: DecomposeInSimplex.cpp,v 1.13 2004-07-14 22:42:27 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -58,8 +58,8 @@ void GMSH_DecomposeInSimplexPlugin::getInfos(char *author, char *copyright, strcpy(copyright, "DGR (www.multiphysics.com)"); strcpy(help_text, "Plugin(DecomposeInSimplex) decomposes all\n" - "non-simplectic elements (quadrangles, prisms\n" - "pyramids, hexahedra) in the view `iView' into\n" + "non-simplectic elements (quadrangles, prisms,\n" + "hexahedra, pyramids) in the view `iView' into\n" "simplices (triangles, tetrahedra). If `iView' < 0,\n" "the plugin is run on the current view.\n" "\n" diff --git a/doc/VERSIONS b/doc/VERSIONS index 109a4eb6a254bfe40f8edc10aa54c4ca356c6feb..713fb8eed82a0863272b9b281905fb12723643b7 100644 --- a/doc/VERSIONS +++ b/doc/VERSIONS @@ -1,6 +1,7 @@ -$Id: VERSIONS,v 1.234 2004-07-05 15:31:59 geuzaine Exp $ +$Id: VERSIONS,v 1.235 2004-07-14 22:42:27 geuzaine Exp $ -New since 1.54: small bug fixes. +New since 1.54: added background mesh support for Triangle; small bug +fixes. New in 1.54: integrated Netgen (3D mesh quality optimization + alternative 3D algorithm); Extrude Surface now always automatically diff --git a/doc/texinfo/gmsh.texi b/doc/texinfo/gmsh.texi index 0f989aea9e8412c5d355dcf3524ebb8edebd7591..3d2a92e092ed704195308483212c5ba30b8e5f6b 100644 --- a/doc/texinfo/gmsh.texi +++ b/doc/texinfo/gmsh.texi @@ -1,5 +1,5 @@ \input texinfo.tex @c -*-texinfo-*- -@c $Id: gmsh.texi,v 1.126 2004-07-03 17:50:50 geuzaine Exp $ +@c $Id: gmsh.texi,v 1.127 2004-07-14 22:42:27 geuzaine Exp $ @c @c Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle @c @@ -1886,13 +1886,13 @@ way to compute the target sizes on this mesh (usually through an error estimation procedure, in an iterative process of mesh adaptation). Note that the target element sizes can be constrained by the characteristic lengths defined in the geometrical model if the -@code{Mesh.ConstrainedBackgroundMesh} option is set. - -This method only works with the isotropic 1D, 2D and 3D algorithm, and is -not currently available with the Triangle algorithm. To load a background +@code{Mesh.ConstrainedBackgroundMesh} option is set. To load a background mesh, use the @code{-bgm} command-line option (@pxref{Command-line options}) or select `Apply as background mesh' in the post-processing view option menu. + +Background meshes are not supported by the 2D anisotropic algorithm and the +3D Netgen algorithm. @end enumerate Here are the mesh commands that are related to the specification of @@ -2249,9 +2249,9 @@ Duplicates the @var{expression}-th post-processing view. Executes the plugin @var{string}. The list of default plugins is given in @ref{Post-processing plugins}. -@item Plugin (@var{string}) . @var{string} = @var{expression}; -Sets a floating point option for a given plugin. See @ref{t9.geo}, for some -examples. +@item Plugin (@var{string}) . @var{string} = @var{expression} | @var{char-expression}; +Sets an option for a given plugin. See @ref{Post-processing plugins}, for a +list of default plugins and @ref{t9.geo}, for some examples. @item Save View[@var{expression}] @var{char-expression}; Saves the the @var{expression}-th post-processing view in a file named diff --git a/doc/texinfo/opt_plugin.texi b/doc/texinfo/opt_plugin.texi index 896eb67a5bef1871ab3ac7f0c81a89f1e150c7b0..1e36dd642ec8b7cb571d4f8ca4c9b87af76d52e2 100644 --- a/doc/texinfo/opt_plugin.texi +++ b/doc/texinfo/opt_plugin.texi @@ -138,8 +138,8 @@ Default value: @code{-1} @item Plugin(DecomposeInSimplex) Plugin(DecomposeInSimplex) decomposes all -non-simplectic elements (quadrangles, prisms -pyramids, hexahedra) in the view `iView' into +non-simplectic elements (quadrangles, prisms, +hexahedra, pyramids) in the view `iView' into simplices (triangles, tetrahedra). If `iView' < 0, the plugin is run on the current view.