##### Personal tools
You are here: Home Use Quadrangural 2D mesh for face with hole

# Quadrangural 2D mesh for face with hole

Up to Use

### Quadrangural 2D mesh for face with hole

Posted by T Hilden at August 22. 2012

hello eveybody,

I am desperatly trying to create a quadrangular(mapping) 2D mesh on a face. The face is a square with a hole in the middle.Therefore the face is defined by two wires, one for the rectangle and one for the hole. When I try to use the quadrangle(mapping) algorithm I get a "wrong number of wires:2" message. I understand, that this algorithm per se is not able to mesh my face as a whole.

I then tried to divide the face in half with an auxiliary line used as the "tool" in a partition operation. This way I get two faces, each of them having 3 straight sides and one with a semicircle "dent" in it. I then tried to mesh the half-faces but I get another error: I'm only allowed 4 edges per face, but I have 6.

I then tried to create a unified edge from the "dented" side of the face, but fails with an error, that there are "sharp bends".

So how do I get a quadrangular mesh for my face with a hole in it?

Thank you

p.s.: 100kb is hardly enough to get anyhting into a file

Attachments

### Re: Quadrangural 2D mesh for face with hole

Posted by Saint Michael at August 22. 2012
p, li { white-space: pre-wrap;

Hello
Type "import ex05_hole1build" in the Python console of SALOME . This sample script does what you need.

100kb is enough only to attach a Python dump of one's Study

St.Michael

### Re: Quadrangural 2D mesh for face with hole

Posted by T Hilden at August 22. 2012

my first reaction was "aehmm, what?" I'm new to Salome and I never used python scripts or the console so I was pretty irritated.

I read the ex05 example. What I get out of it is that they create four faces , each of them having four edges, one of them being a quarter arc, two diagonal lines and one straight edge. These four segments are them compunded to make up the entire face which can then be meshed.

Is this really the easiest way to do this? It seems really complicated for a simple example like this and will be even more so for more complex geometries.

### Re: Quadrangural 2D mesh for face with hole

Posted by Saint Michael at August 22. 2012

In the directory where that script is located there are several scripts with "hole" in their names, they demonstrate different ways to get same results. Using Partition seems to me to be the most simple one.

St.Michael

### Re: Quadrangural 2D mesh for face with hole

Posted by T Hilden at August 22. 2012

good advice. I don't do this CAD stuff too often, so I'm not familiar with the tricks'n'tweaks one can use to facilitate the matter. Using partition I can draw my regular geometry and then go gung ho in creating 4-edged faces.

Thx, will try tonight

### Re: Quadrangural 2D mesh for face with hole

Posted by T Hilden at August 27. 2012

Well, I hada a go at this over the weekend, and I must say I'm frusttrated. What I want this to look like in the end isn't too complex at all, but I don't feel comfortable with Salome. When I see my co-workers do this in a day with their commercial software after only a day of training I get frustrated.

The problem I have now when partitioning is that I get a circle cut into 4 slices and for more face segments which seem to have 4 edges for quadrangular meshing. So far so good. But one of the circular edges actually is made up of two instead of one edge. In meshing the algorithem then obviously complains about the excess edge and won't work.

Attachments

### Re: Quadrangural 2D mesh for face with hole

Posted by Saint Michael at August 27. 2012

Hi

St.Michael

Attachments

### Re: Quadrangural 2D mesh for face with hole

Posted by T Hilden at August 27. 2012

aehm, i'm a bit confused right now. I tried so many different ways over the weekend i kind of lose track what way I followed in what file.

So what I make out of your changes is:

1. you use composite side discretion, which should allow the split arc to be treated as if it is one arc. I'm not sure how this helps, as it is a 1D algorithm, but it's the 2D alorithm that wa failing. So should we tell the 2D algorithm to treat the two split edges as one.

2. You apply the quadrangle algorith to both, the circface and the surrounding face, I used the Radial Quadrangle 1D2D for the circface. I should have been more precise with what I intend this to use for. Eventually I want to FEA a water cooled heat sink. In this test case I set up the rectangular block as the heat sink and the tube in it is supposed to be the water filled cooling tube. As this is going to be a CFD-thermo coupled simulation I would like the Mesh for the water tube to have a certain appearance. The Radial Quadrangular 1D2D algorithm lets me make a mesh that is well suited for my purposes, as I can make it a very dense mesh at the outer region where I will have my boundary layer. So I would really like to use Radial Quadrangle because of it's cylindric symmetry, as my waterflow will also be symmetric.

But when I use this algorithm with the composite side discretion I still have the same problem with the split edges.

### Re: Quadrangural 2D mesh for face with hole

Posted by SMESH expert at August 27. 2012

Hello

Unfortunately it's a limitation of "Radial Quadrangular 1D2D" that it can't work with divided circles, though it's not so difficult to implement.

1) split the circle into quarters as well
2) apply Repair / Remove Extra Edges to you geometry.

Best regards

Edward

### Re: Quadrangural 2D mesh for face with hole

Posted by T Hilden at August 27. 2012

Hello Edward,

what I did was creating arcs which works alright, it's just work. I am a step further now. Unfortunatly I, OF COURSE, have a new problem. My circle is now split into several segments. I created a group with all the segment faces and apply the radial quadrangle algo on it, using composite side discretion, because I want to have similarly spaced segments. I then want to use this segment group as a source face and project it to the end of my tube. This is when it fails. Eveything is fine except one segment which Salome does not want to project.

Unfortunatly, Salome is so buggy, that I cannot make a python dump of my study and the hdf is too big for this forum. I'll try to create one from my Linux PC at home.

### Re: Quadrangural 2D mesh for face with hole

Posted by SMESH expert at August 27. 2012

If you apply Repair / Remove Extra Edges to you geometry, you won't need composite side discretion and you won't have problem with projection, I hope.

Regards

Edward

### Re: Quadrangural 2D mesh for face with hole

Posted by T Hilden at August 28. 2012

I'm not quite sure I iumplemented your suggestion correctly. See the attached file.

I start with a square face and partition it with two diagonal lines. I then cut a hole in it via a circular face. Although at this point four arc segments should be enough to describe the geometry I have 5. I then run the Remove Extra Edges command on the entire cut. After that I still have 5 segments in my circle.

Attachments

### Re: Quadrangural 2D mesh for face with hole

Posted by SMESH expert at August 28. 2012

Sorry, I was wrong about "Remove Extra edges", it removes seam edges from periodic surfaces but don't unite edges.

As a workaround I propose to rotate the disk to avoid presence of that excess vertex. See a modified script which also creates a mesh you wish.

Best regards

Edward

### Re: Quadrangural 2D mesh for face with hole

Posted by SMESH expert at August 28. 2012

Oops, forgot the script.

Attachments

### Re: Quadrangural 2D mesh for face with hole

Posted by T Hilden at August 28. 2012

well yes, I got this far with my method of creating individual arcs. But as I said earlier I then have a problem with the projection. Unfortunately I still cannot post a python dump of the study, as it constantly crashes under Windows and the one I made under Linux 1) creates differnt results that I had under Win, 2) cannot be imported because of an error.

So I'll describe what I was doing:

1) extruded Partition_1

2)made 4 face groups, 1 with the four segments of the inner circle on the front side, 1 with the  4 outer segments of the front face, 1 with the four segments in the inner circle on the back side, and 1 with the four outer faces on the back side.

3) in Mesh module I created a MainMesh for the entire Extrusion with 1d: max length, 2d: quadrangle, 3d: 3d extrusion

4) added a submesh for the circle group with the 4 segments of the inner frontside circle face, 1d: wire discretion, maxlength, 2d: radial quadrangle, these front side circle faces get meshed as expected

5) trying to project the ftront side circle face group to the back: creating a submesh for the back side inner circle face group, using front side inner cricle face group as source and my mesh of the entire extrusion geometry as the main mesh. I use the projection 2d-1d algorithm.

when I launch that it only projects one of the four circle faces onto the back, the others fail with

"Projection_1D2D Sub shape #123, #133, #113, Can't apply source mesh pattern to the face"

Is it in general possible to use the projection algorithm on groups? Does it know, that the source faces have to be matched to certain target faces? Obviously say the bottom left front face must be used for the bottom left back face and not for the top right back face.  I tried to investigate in this direction, and it seemed that the algorithm by itself takes care of that.

### Re: Quadrangural 2D mesh for face with hole

Posted by SMESH expert at August 28. 2012

I try your scenario and see it's a bug of Projection algorithm.

As a workaround, instead of Projection algo, you can simply assign same algo and hyps to groups of circle faces as I do in the attached script.

Best regards

Edward

Attachments

### Re: Quadrangural 2D mesh for face with hole

Posted by T Hilden at August 28. 2012

Hi Edward and St Michael,

thank  you two for your help. I ended up using the same algorithm on front and back side of my geometry and it works. Although the quadrangel mesh is not as I would wish it was. It uses very large area segments, I wish it had a max area constraint as the Mephisto does. So I ended up using Mephisto on the front an back side and quad on the sides, which means there is no need for splitting all my front and back faces into 4-edged segments. But I don't have cubic 3d elements anymore but extruded triangles. Not what I initially wanted, but I think I can live with it. Doing it like that makes life a lot easier.

I must say that this was quite an unsatisfying experience using Salome. Some algorithms are buggy (projection), some are clunky (quadrangle), some features only work occasionally (python exports) and some just kill the program altogether (trying Netgens of any sort). But it's free software and for that it's pretty powerful and elaborate and if you know how to use it and get accustomed to its concepts it is suited for probably most CAD jobs.