Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any way to make gmsh to use the same vertex set on both sides of a material boundary?

I am trying to mesh a complex geometry composed of 3 kinds of materials, like below:

enter image description here

The geometry is imported from a *.stp file.

I defined several physical surfaces and 3 physical domains in the geo file:

Physical Surface("air-case", 1) = {50, 42, 41, 40, 48};
Physical Surface("case-thermal", 2) = {32, 15, 22, 21, 25};
Physical Surface("thermal-grain", 3) = {2, 7, 6};
Physical Surface("thermal-fluid", 4) = {30, 27};
Physical Surface("burning", 5) = {3, 4, 5, 10, 13, 9, 11, 12};

Physical Surface("case-sym", 11) = {49, 51, 34, 43, 44, 47};
Physical Surface("thermal-sym", 12) = {24, 28, 14, 23, 29, 33};
Physical Surface("grain-sym", 13) = {8, 1};

Physical Volume("case", 1) = {6, 5, 7};
Physical Volume("thermal", 2) = {2, 3, 4};
Physical Volume("grain",3)={1};

The picture looks ok at first glance. The vertices near material boundaries are well aligned, see enlarged views below:

enter image description here

However, inside the geometry (actually, near the middle of the cylinder part), you can find the vertice are not aligned

enter image description here

It is wired because, on the boundary of the green and yellow material, all the vertice are aligned. Even though the output mesh contains duplicated points, I can easily remove duplicated ones according to the coordinate. I think this means gmsh does have the ability to ensure this.

However, near the yellow/blue interface, vertice just randomly distributes on two sides, it is then impossible to connect the vertices without modifying the coordinates.

I think there must be some way to ensure gmsh to use the same vertex on both sides of the interface, but I didn't find relevant information in the document. Any suggestions?

like image 329
Wesley Ranger Avatar asked Oct 17 '25 17:10

Wesley Ranger


1 Answers

OK, I've got the solution somewhere else. I am posting it here to help others who encountered the same issue.

The problem is resulted by my modelling procedure. I modelled the geometry using Creo in separated parts and then exported the assembly. As a result, the *.stp file contains several geometries which are not topologically connected.

To solve this, we need to merge the duplicated surfaces. There are two options:

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

SetFactory("OpenCASCADE");
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):

SetFactory("OpenCASCADE");
Merge "file.step";
Coherence;

The Coherence didn't work for my model, but BooleanFragments worked perfectly.

Thank professor Geuzaine for offering help.

like image 136
Wesley Ranger Avatar answered Oct 21 '25 03:10

Wesley Ranger