[Gmsh] Problem with mesh over extruded surface where other surfaces are defined

Christophe Geuzaine cgeuzaine at uliege.be
Fri Feb 8 07:56:44 CET 2019



> On 7 Feb 2019, at 10:49, Isaac Haïk Dunn <anjeeisaac at gmail.com> wrote:
> 
> Thank you for your fast reply!
> 
> With respect to the bottom part, when I plot only the Physical Surfaces 98, 99 and 100 (they correspond to the Plane Surfaces 26, 46 and 47), I do not see any visible overlap. Plane 47 is indeed the one with holes, while Planes 26 and 46 are the surfaces of the holes. Those holes are where I will apply boundary conditions. Am I missing something?

That's correct. Bu you then extrude surface 6, which overlaps these three surfaces.

> 
> When I add BooleanFragments{ Surface{:}; Delete; }{ Volume{:}; Delete; } at the end of the file, I get a syntax errors, I suspect it's because I use an old gmsh version: 3.0.5. I'll retry on the latest version.
> 

Indeed: the {:} notation (to select all entities) was introduced later.

> With respect to 1), how would you do it? In other words, what did I do "wrong" or more complicated than it should be?
> 
> With respect to 2), when I remove Layers{15};, all the surfaces seem correctly meshed! But I am probably overlooking something... In any case, I wish to have a high mesh resolution along the z-axis direction, I thought that specifying Layers{}; was the simplest way to go for that. How could I do it if I remove the Layers{}; command?

If you want a structured mesh (regular elements along z), you will need the "holes" on the top and bottom to match ; of they don't you can still create a pattern that reproduces the intersection of both top and bottom features, and extrude that. You can then re-assemble the partial surfaces into meaningful ones using Physical groups.

Christophe

> 
> On Thu, Feb 7, 2019, 08:34 Christophe Geuzaine <cgeuzaine at uliege.be wrote:
> 
> 
> > On 6 Feb 2019, at 23:14, Isaac Haïk Dunn <anjeeisaac at gmail.com> wrote:
> > 
> > Hello,
> > My goal is to create a parallelepiped with two rectangles on each of the top and bottom surfaces. That way I could import the mesh and solve an equation on that volume and apply boundary conditions on each of the 4 rectangular regions over the solid.
> > 
> > I've almost completed the task by extruding a rectangular shape and by defining the rectangles over the top and bottom surfaces. However when I mesh 3D, the bottom surface and the volume are correctly meshed, but not the top surface. The mesh does not accommodate to the two rectangular shapes, hence my final mesh over that surface has two meshes overlapping on each rectangle, which is a problem.
> > I applied the exact same logic than for the bottom surface, so I do not really understand why the result differs, nor how I could fix it. I would greatly appreciate some guidance!
> > 
> 
> Even for the bottom part, you have defined overlapping surfaces. Only surface 47 is correctly defined with holes...
> 
> You can "fragment" everything, i.e. add
> 
>    BooleanFragments{ Surface{:}; Delete; }{ Volume{:}; Delete; }
> 
> add the end of your file to fix the mess, but 
> 
> 1) it would clearly be better to define everything correctly in the first place
> 2) you won't be able to use structured meshing commands in the extrusion (i.e. you have to remove "Layers ..." in Extrude)
> 
> Christophe
> 
> > Here's the code:
> > 
> > SetFactory("OpenCASCADE");
> > Mesh.RandomFactor=1.0e-6;
> > lc=0.35;
> > a = 2;
> > b = 1;
> > c = 0.06;
> > 
> > // bottom motif
> > Point(1) = {-a/2, -b/2, -c/2, lc};
> > Point(2) = {-a/2, b/2, -c/2, lc};
> > Point(3) = {a/2, b/2, -c/2, lc};
> > Point(4) = {a/2, -b/2, -c/2, lc};
> > Line(1) = {1,2};
> > Line(2) = {2,3};
> > Line(3) = {3,4};
> > Line(4) = {4,1};
> > Line Loop(5) = {1,2,3,4};
> > Plane Surface(6) = {5};
> > 
> > // auxiliary points over top and bottom surface
> > // rectangle 1
> > Point(7) = {-a/10 + a/4.4,-b/10, c/2};
> > Point(8) = {-a/10 + a/4.4,b/10,c/2};
> > Point(9) = {a/10 + a/4.4, b/10,c/2};
> > Point(10) = {a/10 + a/4.4,-b/10,c/2};
> > Line(11) = {7,8};
> > Line(12) = {8,9};
> > Line(13) = {9,10};
> > Line(14) = {10,7};
> > Line Loop(15) = {11,12,13,14};
> > Plane Surface(16) = {15};
> > 
> > // rectangle 2
> > Point(17) = {-a/16+a/4,-b/16, -c/2};
> > Point(18) = {-a/16+a/4,b/16,-c/2};
> > Point(19) = {a/16+a/4, b/16,-c/2};
> > Point(20) = {a/16+a/4,-b/16,-c/2};
> > Line(21) = {17,18};
> > Line(22) = {18,19};
> > Line(23) = {19,20};
> > Line(24) = {20,17};
> > Line Loop(25) = {21,22,23,24};
> > Plane Surface(26) = {25};
> >  
> > // rectangle 3
> > Point(27) = {-(-a/16+a/4),-b/16, c/2};
> > Point(28) = {-(-a/16+a/4),b/16,c/2};
> > Point(29) = {-(a/16+a/4), b/16,c/2};
> > Point(30) = {-(a/16+a/4),-b/16,c/2};
> > Line(31) = {27,28};
> > Line(32) = {28,29};
> > Line(33) = {29,30};
> > Line(34) = {30,27};
> > Line Loop(35) = {31,32,33,34};
> > Plane Surface(36) = {35};
> > 
> > // rectangle 4
> > Point(37) = {-a/22+a/14,-b/22, -c/2};
> > Point(38) = {-a/22+a/14,b/22,-c/2};
> > Point(39) = {a/22+a/14, b/22,-c/2};
> > Point(40) = {a/22+a/14,-b/22,-c/2};
> > Line(41) = {37,38};
> > Line(42) = {38,39};
> > Line(43) = {39,40};
> > Line(44) = {40,37};
> > Line Loop(45) = {41,42,43,44};
> > Plane Surface(46) = {45};
> > 
> > 
> > // bottom mesh
> > Line Loop(46) = {2, 3, 4, 1};
> > Line Loop(47) = {42, 43, 44, 41};
> > Line Loop(48) = {22, 23, 24, 21};
> > Plane Surface(47) = {46, 47, 48};
> > Physical Surface(98) = {26};
> > Physical Surface(99) = {46};
> > Physical Surface(100) = {47};
> > 
> > surfaceVector[] = Extrude {0, 0, c} {
> >      Surface{6};
> >     Layers{15};
> >      Recombine;
> >     };
> > 
> > // volume and top mesh
> > Physical Volume("internal") = surfaceVector[1];
> > Physical Surface(201) = {16};
> > Physical Surface(202) = {36};
> > Line Loop(54) = {49,51,52,47};
> > Plane Surface(203) ={54, 15, 35};
> > Physical Surface(203)={203};
> > 
> > 
> > In Gmsh, to see that the bottom surface mesh is correct, go to Visibility and select Surfaces 98, 99 and 100. To see that the top surface mesh is wrong, select the surfaces 201, 202 and 203.
> > 
> > Thanks!
> > _______________________________________________
> > 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
> 
> 
> 
> _______________________________________________
> 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






More information about the gmsh mailing list