[Gmsh] Having trouble to mesh muilti-domain geometries

Wesley Ranger metorm at outlook.com
Fri Nov 3 14:36:36 CET 2017

Prof. Geuzaine:

You are right, my *.stp file is exported by PTC Creo from a 3D assembly. It does contain several parts which are not topologically connected.

I first tried adding "Coherence" statement but it didn't work. Moreover, the "loading script" operation was as fast as before, I think this indicates that "Coherence" operation wasn't actually performed.

Fortunately, the "BooleanFragments" operation perfectly worked as intended. The resulting mesh is just what I want.

Thank you very much for your advice.

Best regards


> On 3 Nov 2017, at 13:23, Wesley Ranger <metorm at outlook.com> wrote:
> Hi guys
> I am having trouble meshing a geometry composed of 3 kinds of materials. Let's call them material A, B and C.
> The 3 material in the geometry has 2 interfaces. I defined several physical surfaces and 3 physical domains.
> Weird things happened then. In the resulting mesh, the vertices on A/B interface are well aligned, i.e. each vertex on A/B interface and belongs to A mesh has an identical copy in B mesh. They have the same coordinates, so I can connect them in solving stage.
> However, the vertices on B/C are not well aligned. A vertex belongs to C mesh may be located in the middle of a facet which belongs to B mesh.
> It is hard to describe using words, so I posted a question here:
> https://stackoverflow.com/questions/47095493/any-way-to-make-gmsh-to-use-the-same-vertex-set-on-both-sides-of-a-material-boun
> Any way to make gmsh to use the same vertex set on both sides of a material boundary?

Your step file probably contains volumes that are topologically not connected, i.e. there are 2 surfaces (at the same location) for each internal boundary. Gmsh then creates 2 independent surface meshes, one for each surface. If you remove the duplicates, Gmsh will generate a single surface mesh for each interface, and your volume mesh will be conformal.

You can use the new CAD features in Gmsh to remove these duplicate internal surfaces. With the stable release, you can do

v() = ShapeFromFile("file.step");
BooleanFragments{ Volume{v()}; Delete; }{}

With the latest development snapshots, you can use the "Coherence" shortcut (which does exactly the same thing):

Merge "file.step";


PS : Physical definitions have no influence on mesh generation - they are just a way to group/name entities for exporting.

> I am trying to mesh a complex geometry composed of 3 kinds of materials, like below: The geometry is imported from a *.stp file. I defined several physical surfaces and 3 physical domains in the ...
> stackoverflow.com
> Anyone, please give me some suggestions to handle this. Thank you!
> _______________________________________________
> gmsh mailing list
> gmsh at onelab.info
> http://onelab.info/mailman/listinfo/gmsh

Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science

Free software: http://gmsh.info | http://getdp.info | http://onelab.info

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20171103/e9ca1923/attachment-0001.html>

More information about the gmsh mailing list