[Gmsh] Linear interpolation on structured mesh and strange "Transfinite Line" behaviour

Miguel Arriaga mta2122 at columbia.edu
Mon Jul 15 23:36:50 CEST 2013


Hello everyone,
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.

So far I was able to produce the code bellow.

I'm having two issues:
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.

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.

Thank you for your time,
Miguel Arriaga


// Gmsh

// Mesh Options
Mesh.RecombineAll=1;
Mesh.Algorithm=8;
Mesh.SubdivisionAlgorithm=1;
Mesh.ColorCarousel=0;
Mesh.Smoothing = 0; // Elliptic smoother

// Parameters
pw  = 1.0E-3; // Plate width
xx  = 40;
nn  = xx/2+1; // Number of nodes on each side of the square
pr  = 1.10;    // Progression of element sizes
cl1 = pw/2;   // Mesh size - Not used in structured

// Nodes
Point(1) = {0, 0, 0, cl1};
Point(2) = {pw, 0, 0, cl1};
Point(3) = {pw, pw, 0, cl1};
Point(4) = {0, pw, 0, cl1};

// Exterior sides of the Square
Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 1};

// Surface
Line Loop(6) = { 1, 2, 3, 4};
Ruled Surface(7) = {6};

// Meshing
Transfinite Line {1, 3} = nn Using Progression pr;
Transfinite Line {2, 4} = nn Using Progression 1/pr;
Transfinite Surface{7} = {1,2,3,4};

// Physical Surface
Physical Surface(1) = {6};
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20130715/af6f16bf/attachment.html>