[Gmsh] Error generating simple mesh

Christophe Geuzaine cgeuzaine at uliege.be
Mon Sep 23 17:02:58 CEST 2019



> On 23 Sep 2019, at 15:23, Elisa Schenone <elisa.schenone at moxoff.com> wrote:
> 
> You were indeed correct. The 1D meshes should be fixed now.
> 
> I send you the correct geo file which is a bit closer to the real application (instead of the ring described in object.stl I will have a more complicated geometry).
> The three mesh files have been tested with the -check gmsh command and seem to be correct.
> 
> During the 3D mesh generation I still get the error:
> Error   : Invalid boundary mesh (segment-facet intersection) on surface 1, intersection (0.327411,-5.98225,4.06924e-11)
> 

The STL mesh in object.stl is defined by coordinates: there is no topological link between the triangulation and the discrete curve meshes that you provide in the circleLine{1,2}.mesh files. You should either provide the mesh with the full topology; or force Gmsh to merge all geometrically identical nodes by adding

Coherence Mesh;

after you merge object.stl. It's slower (it involves geometrical lookups) but it works well on your test case :



-------------- next part --------------
A non-text attachment was scrubbed...
Name: testGmsh.png
Type: image/png
Size: 149482 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20190923/bdba016a/attachment-0001.png>
-------------- next part --------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: testGmsh.geo
Type: application/octet-stream
Size: 2963 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20190923/bdba016a/attachment-0001.geo>
-------------- next part --------------


Christophe


> Thanks again for your help,
> Elisa
> 
> 
> Il giorno ven 20 set 2019 alle ore 17:50 Christophe Geuzaine <cgeuzaine at uliege.be> ha scritto:
> 
> 
> > On 20 Sep 2019, at 09:20, Elisa Schenone <elisa.schenone at moxoff.com> wrote:
> > 
> > Thank you for your quick answer.
> > 
> > I'm sorry I missed "BottomBox" surface in the surface loop. Adding it does not fix the problem.
> > I cannot see why the volume should not be correctly defined since I use the same 1D entities to define adjacent surfaces.
> > 
> 
> The 1D mesh in circleLine2.mesh does not seem to be correct: 
> 
> Info    : Running 'gmsh circleLine2.mesh -check' [Gmsh 4.5.0-git-52cd4c1bd, 1 node, max. 1 thread]
> Info    : Started on Fri Sep 20 17:47:42 2019
> Info    : Reading 'circleLine2.mesh'...
> Info    : 240 nodes
> Info    : 240 edges
> Info    : Done reading 'circleLine2.mesh'
> Info    : Checking mesh coherence (240 elements)...
> Info    : Checking for duplicate nodes...
> Warning : Vertex 22 (-5, -2.09068991909e-14, 0) already exists in the mesh with tolerance 1.41421e-07: Vertex 21 (-5, -1.98869004218e-14, 0)
> Warning : Vertex 82 (-6.12322976306e-16, -5, 0) already exists in the mesh with tolerance 1.41421e-07: Vertex 81 (-1.72085002921e-15, -5, 0)
> Warning : Vertex 83 (4.99599990504e-16, -5, 0) already exists in the mesh with tolerance 1.41421e-07: Vertex 81 (-1.72085002921e-15, -5, 0)
> Warning : Vertex 143 (5, 2.39252994044e-14, 0) already exists in the mesh with tolerance 1.41421e-07: Vertex 142 (5, 2.29676998584e-14, 0)
> Error   : 4 duplicate nodes: see `duplicate_node.pos'
> 
> Let's fix that first and see how to proceed from there?
> 
> Christophe
> 
> 
> 
> 
> 
> > Actually, the real application is more complicated than the simplified example I sent you. Instead of the circle surface I have a quite complicated geometry coming from a stp from which I extracted the boundary (the 1D mesh I merge in my geo file). Also, I cannot use OpenCascade since I need some attractor fields and a boundary layer in my real application.
> > 
> > Maybe there is a better way to treat stp file? I need to extract "manually" its boundary because I'd like to write in my geo something like:
> > bnd[] = Boundary{Surface{14};};
> > but I don't know a priori the label of the surface I want to extract the boundary of.
> > 
> > Even assuming I know the label from which to extract the 1D boundary, I still have this kind of error:
> > Error   : Invalid boundary mesh (segment-facet intersection) on surface 121, intersection (50,15,5.57227e-11)
> > I attach a screenshot too.
> > I tried to change the sign of surface 93 (which is innermost circle), the intersection error moves few elements on the right but is the same.
> > 
> > Could it be because of normals?
> > 
> > Thank you,
> > Elisa
> > 
> > Il giorno gio 19 set 2019 alle ore 19:59 Christophe Geuzaine <cgeuzaine at uliege.be> ha scritto:
> > 
> > 
> > > On 19 Sep 2019, at 11:28, Elisa Schenone <elisa.schenone at moxoff.com> wrote:
> > > 
> > > Dear gmsh developers,
> > > 
> > > I'm trying to use gmsh to create a cube mesh with a surface separated in multiple entities: two concentric circles are inscribed into the top surface (square).
> > > The external circle comes from a 1D mesh that I merge to my geo script.
> > > The internal circle has been created only as a workaround since gmsh could not create the 2D mesh inside the 1D line (file circleLine1.mesh or circleLine2.mesh).
> > > 
> > > Small changes in the script, i.e. characteristic length, line1 or line2, small circle dimensions, etc., give different errors but none of these combinations seems to work.
> > > 
> > > Also, in case the 2D mesh is correctly generated, the surface mesh quality is very bad in some points and the 3D mesh cannot be generated. I tried various options for the 2D and 3D mesh algorithms but none of them gives good results.
> > > 
> > > What am I doing wrong?
> > > 
> > 
> > The volume does not seem to be defined correctly. In all cases the surface mesh looks fine to me...
> > 
> > Why don't you define all the curves as CAD entities?
> > 
> > Christophe
> > 
> > > I send you a minimal example of my geo script and the 1D mesh I use to define the inscribed circle.
> > > 
> > > Thank you in advance,
> > > bests,
> > > Elisa
> > > 
> > > 
> > > <circleLine2.mesh><testGmsh.geo><circleLine1.mesh>_______________________________________________
> > > gmsh mailing list
> > > gmsh at onelab.info
> > > http://onelab.info/mailman/listinfo/gmsh
> > 
> > ? 
> > Prof. Christophe Geuzaine
> > University of Liege, Electrical Engineering and Computer Science 
> > http://www.montefiore.ulg.ac.be/~geuzaine
> > 
> > 
> > 
> > 
> > 
> > 
> >      
> > <ScreenshotGmsh.png><ScreenshotGmsh2.png>_______________________________________________
> > gmsh mailing list
> > gmsh at onelab.info
> > http://onelab.info/mailman/listinfo/gmsh
> 
> ? 
> Prof. Christophe Geuzaine
> University of Liege, Electrical Engineering and Computer Science 
> http://www.montefiore.ulg.ac.be/~geuzaine
> 
> 
> 
> 
> 
> 
> <ScreenshotGmsh3.png><testGmsh.geo><circleLine2.mesh><object.stl><circleLine1.mesh>

? 
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science 
http://www.montefiore.ulg.ac.be/~geuzaine





More information about the gmsh mailing list