<div dir="ltr"><div><div><div><div><div><div><div>Hello everyone,<br></div></div><div>I'm trying to use gmsh to define a simple 2D square. I want to create an "almost" structured mesh. The idea is that I want to use a progression value .ne. 1 such that I have one of the diagonals more refined.<br>
<br></div><div>So far I was able to produce the code bellow.<br></div><br></div>I'm having two issues:<br></div>1- Running the geo file bellow gives me a mesh that is not symmetric along the diagonal. What I intended was to create a simple linear variation from each node on one edge to its equivalent in the other edge. Using smoothing helps with the symmetry problem but does not solve the non-linear aspect. I need this geometry because it is what was used in a previous research and I want to do it in gmsh because I might need to integrate this piece into a more complex geometry.<br>
<br></div>2- I got the impression that the number after "Transfinite Line {...} =" would be the number of nodes inserted in that line. However, to get X segments in a line I had to set that number as X/2+1.<br><br>
</div>Thank you for your time,<br></div>Miguel Arriaga<br><div><div><br><br><div><div><div>// Gmsh<br><br>// Mesh Options<br>Mesh.RecombineAll=1; <br>Mesh.Algorithm=8; <br>Mesh.SubdivisionAlgorithm=1;<br>Mesh.ColorCarousel=0;<br>
Mesh.Smoothing = 0; // Elliptic smoother<br><br>// Parameters<br>pw = 1.0E-3; // Plate width<br>xx = 40;<br>nn = xx/2+1; // Number of nodes on each side of the square<br>pr = 1.10; // Progression of element sizes <br>
cl1 = pw/2; // Mesh size - Not used in structured<br><br>// Nodes<br>Point(1) = {0, 0, 0, cl1};<br>Point(2) = {pw, 0, 0, cl1};<br>Point(3) = {pw, pw, 0, cl1};<br>Point(4) = {0, pw, 0, cl1};<br><br>// Exterior sides of the Square<br>
Line(1) = {1, 2};<br>Line(2) = {2, 3};<br>Line(3) = {3, 4};<br>Line(4) = {4, 1};<br><br>// Surface<br>Line Loop(6) = { 1, 2, 3, 4};<br>Ruled Surface(7) = {6};<br><br>// Meshing<br>Transfinite Line {1, 3} = nn Using Progression pr;<br>
Transfinite Line {2, 4} = nn Using Progression 1/pr;<br>Transfinite Surface{7} = {1,2,3,4};<br><br>// Physical Surface<br>Physical Surface(1) = {6};<br><br><div><br></div></div></div></div></div></div></div>