diff --git a/Mesh/meshGRegion.cpp b/Mesh/meshGRegion.cpp index b8ac10d815c0a1ca0cc33a857a48e079a06ebfb7..8a0ee3d091244ed8b50308e0ee098f431c19c685 100644 --- a/Mesh/meshGRegion.cpp +++ b/Mesh/meshGRegion.cpp @@ -1,4 +1,4 @@ -// $Id: meshGRegion.cpp,v 1.25 2007-01-18 10:18:30 geuzaine Exp $ +// $Id: meshGRegion.cpp,v 1.26 2007-01-25 20:41:40 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -422,7 +422,7 @@ void meshNormalsPointOutOfTheRegion(GRegion *gr) while(it != faces.end()){ GFace *gf = (*it); int nb_intersect = 0; - for(unsigned int i = 0; i< gf->triangles.size(); i++){ + for(unsigned int i = 0; i < gf->triangles.size(); i++){ MTriangle *t = gf->triangles[i]; double X[3] = {t->getVertex(0)->x(), t->getVertex(1)->x(), t->getVertex(2)->x()}; double Y[3] = {t->getVertex(0)->y(), t->getVertex(1)->y(), t->getVertex(2)->y()}; @@ -451,30 +451,37 @@ void meshNormalsPointOutOfTheRegion(GRegion *gr) t_b->getVertex(2)->y()}; double Z_b[3] = {t_b->getVertex(0)->z(), t_b->getVertex(1)->z(), t_b->getVertex(2)->z()}; - int inters = intersect_line_triangle( X_b, Y_b, Z_b, P, N); + int inters = intersect_line_triangle(X_b, Y_b, Z_b, P, N); nb_intersect += inters; } } ++it_b; } - Msg (INFO,"Region %d Face %d, %d intersect", - gr->tag(), gf->tag(), nb_intersect); - if (nb_intersect >= 0) break; // negative value means intersection is not "robust" + Msg(INFO,"Region %d Face %d, %d intersect", gr->tag(), gf->tag(), nb_intersect); + if(nb_intersect >= 0) break; // negative value means intersection is not "robust" } - if (nb_intersect < 0){ + if(nb_intersect < 0){ setRand(rrr); } else{ if(nb_intersect % 2 == 1){ // odd nb of intersections: the normal points inside the region - for (unsigned int i = 0; i< gf->triangles.size(); i++){ + for (unsigned int i = 0; i < gf->triangles.size(); i++){ gf->triangles[i]->revert(); } } ++it; } } + + // FILE *fp = fopen("debug.pos", "w"); + // fprintf(fp, "View \"debug\" {\n"); + // for(std::list<GFace*>::iterator it = faces.begin(); it != faces.end(); it++) + // for(unsigned int i = 0; i < (*it)->triangles.size(); i++) + // (*it)->triangles[i]->writePOS(fp, 1., (*it)->tag()); + // fprintf(fp, "};\n"); + // fclose(fp); } void meshGRegion::operator() (GRegion *gr) diff --git a/doc/FAQ b/doc/FAQ index db5650db1d636347d916b54518cdbdb36473e45f..402512d1ed1bd86a53db2d7e78f830b5e728e1ad 100644 --- a/doc/FAQ +++ b/doc/FAQ @@ -1,4 +1,4 @@ -$Id: FAQ,v 1.79 2007-01-25 15:51:04 geuzaine Exp $ +$Id: FAQ,v 1.80 2007-01-25 20:41:40 geuzaine Exp $ This is the Gmsh FAQ @@ -164,42 +164,40 @@ Section 5: Mesh module * 5.1 What should I do when the 2D unstructured algorithm fails? -Send us a bug report (including your geometry). +Verify that the 1D mesh does not self-intersect. If it does, use a +smaller characteristic length. If it doesn't, send us a bug report +(including your geometry). * 5.2 What should I do when the 3D unstructured algorithm fails? -Try to change some characteristic lengths in your input file to -generate meshes that better suit the geometrical details of your -structure. +Try the other 3D algorithms (Tool->Options->Mesh->General->3D +algorithm). If none works, try to adapt the characteristic lengths in +your input file so that the surface mesh better matches the +geometrical details of the model. If nothing works, send us a bug +report (including your geometry). -* 5.3 I changed the characteristic lengths, but the 3D algorithm still -does not work. What should I do? - -Try one of the other algorithms (Tool->Options->Mesh->General->3D -algorithm). If everything fails, buy a professional mesh generator ;-) - -* 5.4 The quality of the elements generated by the 3D algorithm is +* 5.3 The quality of the elements generated by the 3D algorithm is very bad. Use 'Optimize quality' in the mesh menu. -* 5.5 Non-recombined 3D extruded meshes sometimes fail. +* 5.4 Non-recombined 3D extruded meshes sometimes fail. The swapping algorithm is not very clever at the moment. Try to change the surface mesh a bit, or recombine your mesh to generate prisms or hexahedra instead of tetrahedra. -* 5.6 Can I explicitly assign region numbers to extruded layers? +* 5.5 Can I explicitly assign region numbers to extruded layers? No, this feature has been removed in Gmsh 2.0. You must use the standard entity number instead. -* 5.7 Did you remove the elliptic mesh generator in Gmsh 2.0? +* 5.6 Did you remove the elliptic mesh generator in Gmsh 2.0? Yes. You can achieve the same result by using the transfinite algorithm with smoothing (e.g., with "Mesh.Smoothing = 10"). -* 5.8 Does Gmsh support curved elements? +* 5.7 Does Gmsh support curved elements? Yes, Gmsh can generate both 1st order and 2nd order elements. To generate second order elements, click on 'Second order' in the mesh @@ -207,14 +205,14 @@ menu after the mesh is completed. To always generate 2nd order elements, select 'Generate second order elements' in the mesh option panel. From the command line, you can also use '-order 2'. -* 5.9 Can I import an existing surface mesh in Gmsh and use it to +* 5.8 Can I import an existing surface mesh in Gmsh and use it to build a 3D mesh? Yes, you can import a surface mesh in any one of the supported mesh file formats, define a volume, and mesh it. For an example see 'demos/sphere-discrete.geo'. -* 5.10 How do I define boundary conditions or material properties in +* 5.9 How do I define boundary conditions or material properties in Gmsh? By design, Gmsh does not try to incorporate every possible definition @@ -227,12 +225,12 @@ Lines, Physical Surfaces and Physical Volumes). See the reference manual as well as the tutorials (in particular 'tutorial/t1.geo') for a detailed description and some examples. -* 5.11 How can I display only the mesh associated with selected +* 5.10 How can I display only the mesh associated with selected geometrical entities? See question 4.3. -* 5.12 How can I "explore" a mesh (for example, to see inside a +* 5.11 How can I "explore" a mesh (for example, to see inside a complex structure)? You can use 'Tools->Clipping Planes' to clip the region of @@ -246,7 +244,7 @@ fields. There is also one additional clipping plane available for "cutting" only the mesh (by keeping entire elements), in 'Tools->Options->Mesh->Cut Plane'. -* 5.13 What is the signification of Rho, Eta and Gamma in +* 5.12 What is the signification of Rho, Eta and Gamma in Tools->Statistics? They measure the quality of the tetrahedra in a mesh: @@ -436,7 +434,7 @@ line option. * 7.14 How can I see "inside" a complicated post-processing view? -See question 5.12. +See question 5.11. When viewing 3D scalar fields, you can also modify the colormap ('Tools->Options->View->Map') to make the iso-surfaces "transparent":