[Gmsh] Curved/second order element?

Christophe Geuzaine cgeuzaine at ulg.ac.be
Wed Jul 2 01:24:02 CEST 2008


Shi Jin wrote:
> Hi,
> 
> I read from the FAQ about the curved/2nd-order element:
> " 5.8 Does Gmsh support curved elements?
> 
> Yes, Gmsh can generate both 1st order and 2nd order elements. To
> generate second order elements, click on 'Second order' in the mesh
> menu after the mesh is completed. To always generate 2nd order
> elements, select 'Generate second order elements' in the mesh option
> panel. From the command line, you can also use '-order 2'. "
> 
>  
> However, as I tested, the generated 2nd order elements are actually the same straight-edged elements with the middle points added. What I have in mind is the curved element where the edge points are placed on the exact curved edge which is  different from the straight line connecting the two end points.
> 
> To make it clear, I am posting my geo and msh file.
> In the geo file, I am testing a simple 2D circular arc:
> element_dim = 1; 
> Point(1) = {radius, 0, 0, element_dim} ;
> Point(2) = {0, radius, 0, element_dim} ;
> Point(3) = {0, 0, 0, element_dim};
> Circle(1) = {1,3,2};
> Line(2)={2,3};
> Line(3)={3,1};
> Line Loop(1) = {1,2,3};
> Plane Surface(1) = {1};
> Transfinite Line {1} = 2 Using Progression 1;
> 
> In the resulting msh file ( I chose the 'Second order' in the mesh
> menu as suggested in the FAQ) is
> $MeshFormat
> 2 0 8
> $EndMeshFormat
> $Nodes
> 6
> 1 1 0 0
> 2 0 1 0
> 3 0 0 0
> 4 0.5 0.5 0  !Note here: what I would like is 4 0.70711 0.70711 0
> 5 0 0.5 0
> 6 0.5 0 0
> $EndNodes
> $Elements
> 7
> 1 15 2 0 1 1
> 2 15 2 0 2 2
> 3 15 2 0 3 3
> 4 8 3 0 1 0 1 2 4
> 5 8 3 0 2 0 2 3 5
> 6 8 3 0 3 0 3 1 6
> 7 9 3 0 1 0 1 2 3 4 5 6
> $EndElements
> 
> So I am wondering what is wrong with my procedure in order to get the curved element. Thank you very much.


Hi Shi - Maybe you have the option "Mesh.SecondOrderLinear" set to 1? 
(It's 0 by default, which is what it should be to put high order nodes 
on the geometry).

Try:

Mesh.ElementOrder = 2;
Mesh.SecondOrderLinear = 0;
radius = 1;
element_dim = 1;
Point(1) = {radius, 0, 0, element_dim} ;
Point(2) = {0, radius, 0, element_dim} ;
Point(3) = {0, 0, 0, element_dim};
Circle(1) = {1,3,2};
Line(2)={2,3};
Line(3)={3,1};
Line Loop(1) = {1,2,3};
Plane Surface(1) = {1};
Transfinite Line {1} = 2 Using Progression 1;

This should give:

$MeshFormat
2 0 8
$EndMeshFormat
$Nodes
6
1 1 0 0
2 0 1 0
3 0 0 0
4 0.707106781187899 0.7071067811851959 0
5 0 0.5000000000013305 0
6 0.4999999999986718 0 0
$EndNodes
$Elements
7
1 15 2 0 1 1
2 15 2 0 2 2
3 15 2 0 3 3
4 8 3 0 1 0 1 2 4
5 8 3 0 2 0 2 3 5
6 8 3 0 3 0 3 1 6
7 9 3 0 1 0 1 2 3 4 5 6
$EndElements




> 
> Shi
> --
> Shi Jin, PhD
> 
> 
> 
>       
> 
> _______________________________________________
> 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