[Gmsh] Visualization of high order FE

Gonçalo Pena gpena at mat.uc.pt
Mon Jul 26 16:17:56 CEST 2010


Dear all,
first of all, let me congratulate the developers for this piece of 
software. I started using it in the beginning of my PhD and nowadays, 
I'm trying to use it to visualize high order FE, and this is the reason 
behind this email.

Some colleagues of mine and myself have been working recently on 
exporting high order finite elements from the code Life 
(https://life.prudhomm.org/) to visualize them in Gmsh. So far, with the 
help of the documentation, we managed to export (and visualize) 
successfully, polynomials defined in 2D geometries as long as the order 
of the geometrical element is the same as the degree of the polynomial 
to visualize. We're now working on different orders, for mesh and 
polynomials, say, visualizing P2 polynomials defined in a first order mesh.

In the documentation, the answer seems to be in INTERPOLATION_SCHEME. 
However, it isn't very clear to me how to use this. Or, is it the case, 
that we need to have a PN mesh to visualize a PN polynomial, because we 
need the same number of nodes in $Nodes as in $ElementNodeData?

I send also a test file that I produce with Life that has a scalar field 
to visualize. As you can notice, the fields are described in terms of 
second order polynomials, while the mesh is only first order.


I appreciate any help regarding this.
Best regards,
Gonçalo Pena







$MeshFormat
2.1 0 8
$EndMeshFormat
$PhysicalNames
0
$EndPhysicalNames
$Nodes
12
0  -0.7071067811860418   0.7071067811870533 0
1  -0.1897439228705794   0.2667201536224437 0
2                    0                    1 0
3                    0                   -1 0
4   0.7071067811860418  -0.7071067811870533 0
5  -0.1408946105016504    -0.37413167509243 0
6                   -1                    0 0
7  -0.7071067811870533  -0.7071067811860418 0
8   0.3482429378986684 -0.09008816204044831 0
9   0.3724286026917267   0.3759818061590915 0
10                    1                    0 0
11   0.7071067811870533   0.7071067811860418 0
$EndNodes
$Elements
14
1 2 3 30 2 0 0 1 2
2 2 3 30 2 0 3 4 5
3 2 3 30 2 0 6 7 5
4 2 3 30 2 0 6 5 1
5 2 3 30 2 0 4 8 5
6 2 3 30 2 0 2 1 9
7 2 3 30 2 0 0 6 1
8 2 3 30 2 0 10 11 9
9 2 3 30 2 0 10 9 8
10 2 3 30 2 0 10 8 4
11 2 3 30 2 0 2 9 11
12 2 3 30 2 0 3 5 7
13 2 3 30 2 0 1 8 9
14 2 3 30 2 0 1 5 8
$EndElements

$ElementNodeData
1
"u"
1
0
3
0
1
14
1 6 0.3544306459215495 0.5664082761327489 -0.9589242746631385 
-0.4040540091617816 -0.02242205229588271 0.1766722257951939
2 6 0.9589242746631385 -0.3544306459215492 -0.7279524889380636 
-0.1766722257951936 -0.06565804187548438 0.2717545476036742
3 6 -3.143789905713103e-18 -0.3544306459164914 -0.7279524889380636 
0.4217999183067372 0.2216348132523938 0.7713374287536935
4 6 -3.143789905713103e-18 -0.7279524889380636 0.5664082761327489 
0.7713374287536935 -0.1797188243388555 -0.6098466318160971
5 6 -0.3544306459215492 0.07383514395404676 -0.7279524889380636 
0.7991133394270261 -0.7965509459645959 -0.06565804187548438
6 6 -0.9589242746631385 0.5664082761327489 -0.2736282412554601 
-0.02242205229588271 0.8969273006136105 -0.1754836004650726
7 6 0.3544306459215495 -3.143789905713103e-18 0.5664082761327489 
-0.421799918308763 -0.6098466318160971 -0.4040540091617816
8 6 -3.147825104174809e-17 0.3544306459164914 -0.2736282412554601 
-0.4217999183067372 -0.3798507294866314 -0.7739321326512995
9 6 -3.147825104174809e-17 -0.2736282412554601 0.07383514395404676 
-0.7739321326512995 -0.1499833895338262 0.2174904125698404
10 6 -3.147825104174809e-17 0.07383514395404676 -0.3544306459215492 
0.2174904125698404 0.7991133394270261 0.4217999183087631
11 6 -0.9589242746631385 -0.2736282412554601 0.3544306459164914 
-0.1754836004650726 -0.3798507294866314 0.1766722257972194
12 6 0.9589242746631385 -0.7279524889380636 -0.3544306459164914 
0.2717545476036742 0.2216348132523938 -0.1766722257972193
13 6 0.5664082761327489 0.07383514395404676 -0.2736282412554601 
0.3942541141515671 -0.1499833895338262 0.8969273006136105
14 6 0.5664082761327489 -0.7279524889380636 0.07383514395404676 
-0.1797188243388555 -0.7965509459645959 0.3942541141515671
$EndElementNodeData