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

Christophe Geuzaine cgeuzaine at ulg.ac.be
Tue Jul 16 08:36:24 CEST 2013


On 15 Jul 2013, at 23:36, Miguel Arriaga <mta2122 at columbia.edu> wrote:

> 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.
> 

We use transfinite interpolation: see the "TRAN_QUA" formula in Mesh/meshGFaceTransfinite.cpp.

It could indeed be interesting to add other simple interpolation formulas -- if you do send us a patch we'll integrate it.



> 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.

No, the number is the number of vertices on the line; beware that this includes the 2 boundary vertices.


> 
> 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};
> 
> 
> _______________________________________________
> gmsh mailing list
> gmsh at geuz.org
> http://www.geuz.org/mailman/listinfo/gmsh

-- 
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science 
http://www.montefiore.ulg.ac.be/~geuzaine