diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp index 125b2c0fb134d34f71b37e5271d4e619f3a80ae0..cf916fe593df80c5e3408979576b93f1a4766c1e 100644 --- a/Geo/GModel.cpp +++ b/Geo/GModel.cpp @@ -1,4 +1,4 @@ -// $Id: GModel.cpp,v 1.32 2007-02-02 23:50:33 geuzaine Exp $ +// $Id: GModel.cpp,v 1.33 2007-02-04 15:59:18 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -300,7 +300,21 @@ int GModel::getMeshStatus() return -1; } -int GModel::numElement() +int GModel::numVertices() +{ + int n = 0; + for(viter it = firstVertex(); it != lastVertex(); ++it) + n += (*it)->mesh_vertices.size(); + for(eiter it = firstEdge(); it != lastEdge(); ++it) + n += (*it)->mesh_vertices.size(); + for(fiter it = firstFace(); it != lastFace(); ++it) + n += (*it)->mesh_vertices.size(); + for(riter it = firstRegion(); it != lastRegion(); ++it) + n += (*it)->mesh_vertices.size(); + return n; +} + +int GModel::numElements() { int n = 0; for(eiter it = firstEdge(); it != lastEdge(); ++it) @@ -381,7 +395,7 @@ static int checkElements(std::vector<T*> &elements, void GModel::checkMeshCoherence() { - int numEle = numElement(); + int numEle = numElements(); if(!numEle) return; Msg(INFO, "Checking mesh coherence (%d elements)", numEle); diff --git a/Geo/GModel.h b/Geo/GModel.h index c9af9f91ac68019125f5c32b97d6449351285b7d..ac632e83ddfd672ed7b021a86fd6d93e2abb06bc 100644 --- a/Geo/GModel.h +++ b/Geo/GModel.h @@ -136,8 +136,11 @@ class GModel // Returns the mesh status for the entire model. virtual int getMeshStatus(); + // Returns the total number of vertices in the mesh + virtual int numVertices(); + // Returns the total number of elements in the mesh - virtual int numElement(); + virtual int numElements(); // The list of partitions virtual std::set<int> &getMeshPartitions() { return meshPartitions; } diff --git a/Graphics/SelectBuffer.cpp b/Graphics/SelectBuffer.cpp index 95d6d89bea85fccd7f6078ddbc7f0a12dd67d64a..a7b0a816c04030f614ff0a2daa97dbd8187f611c 100644 --- a/Graphics/SelectBuffer.cpp +++ b/Graphics/SelectBuffer.cpp @@ -1,4 +1,4 @@ -// $Id: SelectBuffer.cpp,v 1.11 2006-12-16 20:52:37 geuzaine Exp $ +// $Id: SelectBuffer.cpp,v 1.12 2007-02-04 15:59:18 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -63,7 +63,7 @@ bool ProcessSelectionBuffer(int entityType, // In our case the selection buffer size is equal to between 5 and 7 // times the maximum number of possible hits - int eles = (meshSelection && CTX.pick_elements) ? 4 * GMODEL->numElement() : 0; + int eles = (meshSelection && CTX.pick_elements) ? 4 * GMODEL->numElements() : 0; int size = 7 * (GMODEL->numVertex() + GMODEL->numEdge() + GMODEL->numFace() + GMODEL->numRegion() + eles) + 1000 ; diff --git a/Mesh/Generator.cpp b/Mesh/Generator.cpp index 2a024578fc6f5140bd00bc2ad950838d4b182e04..bab07cc3d1cae83f6e084886861c60f208867f19 100644 --- a/Mesh/Generator.cpp +++ b/Mesh/Generator.cpp @@ -1,4 +1,4 @@ -// $Id: Generator.cpp,v 1.113 2007-01-18 10:18:30 geuzaine Exp $ +// $Id: Generator.cpp,v 1.114 2007-02-04 15:59:18 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -303,6 +303,8 @@ void GenerateMesh(int ask) if(GMODEL->getMeshStatus() && CTX.mesh.order == 2) Degre2(CTX.mesh.second_order_linear, CTX.mesh.second_order_incomplete); + Msg(INFO, "%d vertices %d elements", GMODEL->numVertices(), GMODEL->numElements()); + CTX.threads_lock = 0; CTX.mesh.changed = ENT_ALL; } diff --git a/benchmarks/extrude/onde-rec.geo b/benchmarks/extrude/onde-rec.geo index ccc468c5ea2db9f3141ab5ad6aa57203054d4fca..ceed032ce0f67e7061b8baab024188a23b2da287 100644 --- a/benchmarks/extrude/onde-rec.geo +++ b/benchmarks/extrude/onde-rec.geo @@ -16,7 +16,6 @@ Line(2) = {7,1}; Line(3) = {1,2}; Line Loop(4) = {3,1,2}; Plane Surface(5) = {4}; -Extrude Surface {5, {0,1,0}, {0,0,0}, Pi/2} -{Layers{10,100,1}; Recombine;}; +Extrude Surface {5, {0,1,0}, {0,0,0}, Pi/2} {Layers{10}; Recombine;}; diff --git a/doc/gmsh.html b/doc/gmsh.html index 76ab7e4754a493526674af399f7067f16ddf5c9b..87d870d75399bf4b0e2ab5fa166eeb4399839d2f 100644 --- a/doc/gmsh.html +++ b/doc/gmsh.html @@ -25,7 +25,7 @@ generator with built-in pre- and post-processing facilities</h1> <p> <h3 align="center">Christophe Geuzaine and Jean-Fran�ois Remacle</h3> <p> -<h3 align=center>Version 2.0, February 5 2006</h3> +<h3 align=center>Version 2.0.0, February 5 2006</h3> <p> <center> <a href="#Description">Description</a> | @@ -250,13 +250,8 @@ thumbnail"></a> <a href="/gmsh/gallery/cmap.png">pict3</a>. <li>Structured and unstructured grids of an extruded geometry: <a href="/gmsh/gallery/spirale.gif">pict1</a>. -<!-- -<li>Didactic animations about computational electromagnetism at - <a href="http://elap.montefiore.ulg.ac.be/services/elm/demos/demos_en.html">ELAP</a>. ---> </ul> - <h2><a name="Links"></a>Links</h2> Gmsh can be linked with diff --git a/tutorial/t1.geo b/tutorial/t1.geo index 55f2bb27722db4cceb47edfa0ee8edb4bb8f30eb..83a941e046dedbf328213a58b11845fc331067b1 100644 --- a/tutorial/t1.geo +++ b/tutorial/t1.geo @@ -7,29 +7,22 @@ * *********************************************************************/ -// The simplest construction of Gmsh's scripting language is the +// The simplest construction in Gmsh's scripting language is the // `affectation'. The following command defines a new variable `lc': lc = 0.009; -// This variable can then for example be used in the definition of -// Gmsh's simplest `elementary entity', a `Point'. A Point is defined -// by a list of four numbers: its three coordinates (X, Y and Z), and -// a characteristic length which sets the target element size at the -// point: +// This variable can then be used in the definition of Gmsh's simplest +// `elementary entity', a `Point'. A Point is defined by a list of +// four numbers: three coordinates (X, Y and Z), and a characteristic +// length (lc) that sets the target element size at the point: -Point(1) = {0, 0, 0, 9.e-1 * lc}; +Point(1) = {0, 0, 0, lc}; -// The actual distribution of the mesh element sizes is then obtained -// by interpolation of these characteristic lengths throughout the -// geometry. Another method to specify characteristic lengths is to use -// a background mesh (see `t7.geo' and `bgmesh.pos'). - -// As can be seen in the previous definition, more complex expressions -// can be constructed from variables and floating point -// constants. Here, the product of the variable `lc' by the constant -// 9.e-1 is given as the fourth argument of the list defining the -// point. +// The distribution of the mesh element sizes is then obtained by +// interpolation of these characteristic lengths throughout the +// geometry. Another method to specify characteristic lengths is to +// use a background mesh (see `t7.geo' and `bgmesh.pos'). // We can then define some additional points as well as our first // curve. Curves are Gmsh's second type of elementery entities, and, @@ -74,8 +67,8 @@ Plane Surface(6) = {5} ; Physical Point(1) = {1,2} ; // Consequently, two punctual elements will be saved in the output -// files, both with the region number 1. The mechanism is identical -// for line or surface elements: +// mesh file, both with the region number 1. The mechanism is +// identical for line or surface elements: MyLine = 99; Physical Line(MyLine) = {1,2,4} ; @@ -83,11 +76,11 @@ Physical Line(MyLine) = {1,2,4} ; Physical Surface("My fancy surface label") = {6} ; // All the line elements created during the meshing of lines 1, 2 and -// 4 will be saved in the output file with the region number 99; and -// all the triangular elements resulting from the discretization of -// surface 6 will be given an automatic region number (100). - -// Note that, if no physical entities are defined, all the elements in -// the mesh will be directly saved with their default orientation and -// with a region number equal to the number of the elementary entity -// they discretize. +// 4 will be saved in the output mesh file with the region number 99; +// and all the triangular elements resulting from the discretization +// of surface 6 will be given an automatic region number (100, +// associated with the label "My fancy surface label"). + +// Note that if no physical entities are defined, then all the +// elements in the mesh will be saved "as is", with their default +// orientation. diff --git a/tutorial/t2.geo b/tutorial/t2.geo index 7fb50cd18bce6b817f35686d6ed5a76a9e29879f..7c88451bcefeefb2214d2b7c3e19af384ec56085 100644 --- a/tutorial/t2.geo +++ b/tutorial/t2.geo @@ -73,7 +73,7 @@ Extrude {0, 0, h} { Surface{11}; } // All these geometrical transformations automatically generate new // elementary entities. The following command permits to manually -// specify a characteristic length for some of the new points: +// assign a characteristic length to some of the new points: Characteristic Length {tmp[0], 2, 12, 3, 16, 6, 22} = lc * 4; diff --git a/tutorial/t3.geo b/tutorial/t3.geo index d196009746412dffa5c994eba5a1cff805007260..f8ddc7f6161e3bf8d3ff171a10db6532db3b44e2 100644 --- a/tutorial/t3.geo +++ b/tutorial/t3.geo @@ -40,14 +40,13 @@ out[] = Extrude { {-2*h,0,0}, {1,0,0} , {0,0.15,0.25} , Pi/2 } { Surface{news-1}; Layers{10}; Recombine; }; -// In this last extrusion command we retrieved the volume -// number programatically by saving the output of the command -// into an array. This array will contain the "top" of the extruded -// surface (in out[0]) as well as the newly created volume (in -// out[1]). +// In this last extrusion command we retrieved the volume number +// programatically by saving the output of the command into a +// list. This list will contain the "top" of the extruded surface (in +// out[0]) as well as the newly created volume (in out[1]). -// We can then define a new physical volume to save all -// the tetrahedra with a common region number (101): +// We can then define a new physical volume to save all the tetrahedra +// with a common region number (101): Physical Volume(101) = {1, 2, out[1]}; @@ -74,5 +73,5 @@ Geometry.Color.Surfaces = Geometry.Color.Points; // window to see the current values of all options. To save all the // options in a file, you can use the `File->Save as->Gmsh options' // menu. To save the current options as the default options for all -// future Gmsh sessions, you should use the `Tools->Options->Save' -// button. +// future Gmsh sessions, you should use the `Tools->Options->Save as +// defaults' button. diff --git a/tutorial/t4.geo b/tutorial/t4.geo index c5d2b9c7e1de698123a7c15141cac7bb1dfc3c0c..7a1e1c3c73dbda46f276fd1b72398ad87f82c20c 100644 --- a/tutorial/t4.geo +++ b/tutorial/t4.geo @@ -55,28 +55,28 @@ Point(25)= { 0 , h1+h3-R2, 0.0 , Lc2}; Line(1) = {1 ,17}; Line(2) = {17,16}; -// Since not all curves are straight lines, Gmsh provides many other -// curve primitives: splines, B-splines, circle arcs, ellipse arcs, -// etc. Here we define a new circle arc, starting at point 14 and -// ending at point 16, with the circle's center being the point 15: +// Gmsh provides other curve primitives than stright lines: splines, +// B-splines, circle arcs, ellipse arcs, etc. Here we define a new +// circle arc, starting at point 14 and ending at point 16, with the +// circle's center being the point 15: Circle(3) = {14,15,16}; -// Note that, in Gmsh, circle arcs should always be stricly smaller -// than Pi. We can then define additional lines and circles, as well -// as a new surface: +// Note that, in Gmsh, circle arcs should always be smaller than +// Pi. We can then define additional lines and circles, as well as a +// new surface: Line(4) = {14,13}; Line(5) = {13,12}; Line(6) = {12,11}; Line(7) = {11,10}; -Circle(8) = { 8, 9,10}; -Line(9) = { 8, 7}; -Line(10) = { 7, 6}; -Line(11) = { 6, 5}; -Circle(12) = { 3, 4, 5}; -Line(13) = { 3, 2}; -Line(14) = { 2, 1}; +Circle(8) = {8,9,10}; +Line(9) = {8,7}; +Line(10) = {7,6}; +Line(11) = {6,5}; +Circle(12) = {3,4,5}; +Line(13) = {3,2}; +Line(14) = {2,1}; Line(15) = {18,19}; Circle(16) = {21,20,24}; Circle(17) = {24,20,19}; @@ -87,8 +87,8 @@ Line(20) = {21,22}; Line Loop(21) = {17,-15,18,19,-20,16}; Plane Surface(22) = {21}; -// But we still need to define the exterior surface. Since it has a -// hole, its definition now requires two lines loops: +// But we still need to define the exterior surface. Since this +// surface has a hole, its definition now requires two lines loops: Line Loop(23) = {11,-12,13,14,1,2,-3,4,5,6,7,-8,9,10}; Plane Surface(24) = {23,21}; diff --git a/tutorial/t5.geo b/tutorial/t5.geo index 28e4c5111c10a9eed005d67ce1ae00012e4a9abd..cea94ad40ea2b2f6489a8326227d7f9bd87a0a8b 100644 --- a/tutorial/t5.geo +++ b/tutorial/t5.geo @@ -18,18 +18,17 @@ lcar3 = .055; // option (or with `Mesh.CharacteristicLengthFactor' in an option // file). For example, with: // -// > gmsh t5 -clscale 1 +// > gmsh t5.geo -clscale 1 // -// this input file produces a mesh of approximately 2,500 nodes and -// 13,000 tetrahedra (in 4 seconds on a 1.2GHz PC). With +// this input file produces a mesh of approximately 3,000 nodes and +// 15,000 tetrahedra. With // -// > gmsh t5 -clscale 0.2 +// > gmsh t5.geo -clscale 0.2 // -// (i.e. with all characteristic lengths divided by 5), the mesh -// counts approximately 260,000 nodes and 1.6 million tetrahedra (and -// the computation takes 16 minutes on the same machine). +// the mesh counts approximately 600,000 nodes and 3.6 million +// tetrahedra. -// Let us proceed by defining some elementary entities describing a +// We proceed by defining some elementary entities describing a // truncated cube: Point(1) = {0.5,0.5,0.5,lcar2}; Point(2) = {0.5,0.5,0,lcar1}; @@ -58,8 +57,8 @@ Line Loop(34) = {7,3,8,9}; Plane Surface(35) = {34}; Line Loop(36) = {-10,18,-16,-20,4,-8}; Plane Surface(37) = {36}; Line Loop(38) = {-14,-13,-12,19}; Plane Surface(39) = {38}; -// Instead of using included files, let us now use a user-defined -// function in order to carve some holes in the cube: +// Instead of using included files, we now use a user-defined function +// in order to carve some holes in the cube: Function CheeseHole @@ -92,9 +91,8 @@ Function CheeseHole c11 = newreg; Circle(c11) = {p4,p1,p6}; c12 = newreg; Circle(c12) = {p6,p1,p7}; - // We need non-plane surfaces to define the spherical cheese - // holes. Here we use ruled surfaces, which can have 3 or 4 - // sides: + // We need non-plane surfaces to define the spherical holes. Here we + // use ruled surfaces, which can have 3 or 4 sides: l1 = newreg; Line Loop(l1) = {c5,c10,c4}; Ruled Surface(newreg) = {l1}; l2 = newreg; Line Loop(l2) = {c9,-c5,c1}; Ruled Surface(newreg) = {l2}; @@ -105,14 +103,9 @@ Function CheeseHole l7 = newreg; Line Loop(l7) = {-c2,-c7,-c12};Ruled Surface(newreg) = {l7}; l8 = newreg; Line Loop(l8) = {-c6,-c9,c2}; Ruled Surface(newreg) = {l8}; - // Please note that all surface meshes are generated by projecting a - // 2D planar mesh onto the surface, and that this method gives nice - // results only if the surface's curvature is small enough. If not, - // you will have to cut the surface in pieces. - - // We then use an array of variables to store the surface loops - // identification numbers for later reference (we will need these to - // define the final volume): + // We then store the surface loops identification numbers in list + // for later reference (we will need these to define the final + // volume): theloops[t] = newreg ; @@ -155,10 +148,10 @@ theloops[0] = newreg ; Surface Loop(theloops[0]) = {35,31,29,37,33,23,39,25,27} ; -// The volume of the cube, without the 5 cheese holes, is now defined -// by 6 surface loops (the exterior surface and the five interior -// loops). To reference an array of variables, its identifier is -// followed by '[]': +// The volume of the cube, without the 5 holes, is now defined by 6 +// surface loops (the exterior surface and the five interior loops). +// To reference an array of variables, its identifier is followed by +// '[]': Volume(186) = {theloops[]} ;