3D '827' elements Gmsh -> ElmerGrid

Mesh generators, CAD programs, and other tools
YannGuevel
Posts: 30
Joined: 26 May 2014, 12:37
Antispam: Yes

3D '827' elements Gmsh -> ElmerGrid

Post by YannGuevel »

Hello,

i'm trying to mesh simple geometries in 3D using hexaedral element. I'd like to use complete quadratic 27 nodes elements: code 827 in elmer.
I start with Gmsh mesh with H27 element (3D hexahedral second order complete) , but ElmerGrid does not find all the boundary element (409), and the produced mesh generated is unusable.

I tried something else using the increase option, but it only gives incomplete 820 element.
I create a H8 linear element un Gmsh in order to increase to a quadratic element in Elmer. But it only gives 820 quadratic incomplete elements.
ElmerGrid 14 2 test.msh -autoclean -increase
How to get a 827 hexahedral quadratic complete element with ElmerGrid using Gmsh files?
Is this a gmsh issue?
is this an option missing in ElmerGrid?
Is this even possible to get 827 from gmsh files?

Thanks for any suggestions.
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: 3D '827' elements Gmsh -> ElmerGrid

Post by raback »

Hi

It is probably some permutation issue. I don't think we have had any Gmsh file with 827 elements to test. Perhaps you could give a pointer to the ordering of nodes in Gmsh then it would be an rather easy fix.

-Peter
YannGuevel
Posts: 30
Joined: 26 May 2014, 12:37
Antispam: Yes

Re: 3D '827' elements Gmsh -> ElmerGrid

Post by YannGuevel »

It look like this:
GMSH TYPE 12 : 27-node second order hexahedron (8 nodes associated with the vertices, 12 with the edges, 6 with the faces and 1 with the volume).

Code: Select all

Hexahedron:             Hexahedron20:          Hexahedron27:
       v
3----------2            3----13----2           3----13----2     
|\     ^   |\           |\         |\          |\         |\    
| \    |   | \          | 15       | 14        |15    24  | 14  
|  \   |   |  \         9  \       11 \        9  \ 20    11 \  
|   7------+---6        |   7----19+---6       |   7----19+---6 
|   |  +-- |-- | -> u   |   |      |   |       |22 |  26  | 23| 
0---+---\--1   |        0---+-8----1   |       0---+-8----1   | 
 \  |    \  \  |         \  17      \  18       \ 17    25 \  18
  \ |     \  \ |         10 |        12|        10 |  21    12| 
   \|      w  \|           \|         \|          \|         \| 
    4----------5            4----16----5           4----16----5
I will generate a smal example and put it here if it may help.

Using 820, I aslo noticed a paraview visual problem , maybe and ordering too?

Thanks for your help.
Attachments
GMSH_3D_CUBE_Hexa_test.tgz
GMSH : geo and msh
ElmerGrid command and log
Elmer Mesh files generated with boundary problems
(4.67 KiB) Downloaded 437 times
Last edited by YannGuevel on 06 Mar 2015, 02:00, edited 1 time in total.
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: 3D '827' elements Gmsh -> ElmerGrid

Post by raback »

Hi

In elmerfem/elmergrid/src/femfilein.c there is something like:

Code: Select all

static void GmshToElmerIndx(int elemtype,int *topology)
{
  int i=0,nodes=0,oldtopology[MAXNODESD2];
  int reorder, *porder;

  int order510[]={0,1,2,3,4,5,6,7,9,8};
  int order614[]={0,1,2,3,4,5,8,10,6,7,9,11,12,13};
  int order718[]={0,1,2,3,4,5,6,9,7,8,10,11,12,14,13,15,17,16};
  int order820[]={0,1,2,3,4,5,6,7,8,11,13,9,10,12,14,15,16,18,19,17};
...
Now on quick inspection it seems that one could add

Code: Select all

  int order827[]={0,1,2,3,4,5,6,7,8,11,13,9,10,12,14,15,16,18,19,17, 20,21,23,24,22,25,26};
and

Code: Select all

case 827:        
    reorder = TRUE;
    porder = &order827[0];
    break;
Perhaps you could give it a go... The ordering of Elmer nodes should be in some Appendix of Solver manual. This was just out of my memory.

-Peter
YannGuevel
Posts: 30
Joined: 26 May 2014, 12:37
Antispam: Yes

Re: 3D '827' elements Gmsh -> ElmerGrid

Post by YannGuevel »

I didn't checked this code, and i understand better why it wasn't working.
Thanks a lot for the hint, i'm trying to do that i'll let you know if this is working.
YannGuevel
Posts: 30
Joined: 26 May 2014, 12:37
Antispam: Yes

Re: 3D '827' elements Gmsh -> ElmerGrid

Post by YannGuevel »

Code: Select all

       v
       ^
       |
       |    
       +----> u   
        \
         \
           w
  GMSH Hexahedron27:
    3----13----2     
    |\         |\    
    |15    24  | 14  
    9  \ 20    11 \  
    |   7----19+---6 
    |22 |  26  | 23| 
    0---+-8----1   | 
     \ 17    25 \  18
     10 |  21    12| 
       \|         \| 
        4----16----5 
# ----------- ELMER : fem/src/elements.def

Code: Select all

ELEMENT 27 Node Octahedron
!
Dimension 3
Topology  Brick
!
Code 827
!
Nodes 27
!          1    2    3    4    5    6    7    8    9    10   11   12   13   14   15   16   17   18   19   20   21   22   23   24   25   26   27
Node U   -1.0  1.0  1.0 -1.0 -1.0  1.0  1.0 -1.0  0.0  1.0  0.0 -1.0 -1.0  1.0  1.0 -1.0  0.0  1.0  0.0 -1.0  0.0  1.0  0.0 -1.0  0.0  0.0  0.0        
Node V   -1.0 -1.0  1.0  1.0 -1.0 -1.0  1.0  1.0 -1.0  0.0  1.0  0.0 -1.0 -1.0  1.0  1.0 -1.0  0.0  1.0  0.0 -1.0  0.0  1.0  0.0  0.0  0.0  0.0
Node W   -1.0 -1.0 -1.0 -1.0  1.0  1.0  1.0  1.0 -1.0 -1.0 -1.0 -1.0  0.0  0.0  0.0  0.0  1.0  1.0  1.0  1.0  0.0  0.0  0.0  0.0 -1.0  1.0  0.0
!
!GMSH      0    1    2    3    4    5    6    7    8    11   13    9   10   12   14    15   16  18   19  17   21    23  24   22   20   25    26
Proposed code in fem/src/elements.def : GmshToElmerIndx

Code: Select all

  int order827[]={0,1,2,3,4,5,6,7,8,11,13,9,10,12,14,15,16,18,19,17,21,23,24,22,20,25,26};
and

Code: Select all

case 827:       
    reorder = TRUE;
    porder = &order827[0];
    break;
It finds correctly the boundary element, i'll try to launch a solver test.

ElmerGui still have a problem loading the 827 mesh.
Loading elmer mesh files
Summary:
Nodes: 125
Point elements: 0
Edge elements: 0
Surface elements: 24
Volume elements: 8
Found 48 edges on boundary
findSurfaceElementNormals: error: unable to change element orientation
Last edited by YannGuevel on 06 Mar 2015, 13:21, edited 1 time in total.
YannGuevel
Posts: 30
Joined: 26 May 2014, 12:37
Antispam: Yes

Re: 3D '827' elements Gmsh -> ElmerGrid

Post by YannGuevel »

ElmerGui loading he new mesh with 827 body element and 409 boundary surface element.
findSurfaceElementNormals: error: unable to change element orientation
elmerfem/ElmerGUI/Application/src/meshutils.cpp

Code: Select all

void Meshutils::findSurfaceElementNormals(mesh_t *mesh)
..
	} else if(surface->getCode() == 408) {
It looks like 409 boundary surface element are not in ElmeGUI. Should i send a wish or report at someone?

Thanks a lot for your help.
Attachments
GMSH_3D_CUBE_Hexa_827_ElmerGrid_recompile.tgz
Elmer Mesh files obtained with a modified version of ElmerGrid using 827 element type coming from gmsh.
(1.65 KiB) Downloaded 528 times
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: 3D '827' elements Gmsh -> ElmerGrid

Post by mzenker »

Hi,

do you load the gmsh .msh file in ElmerGUI? If so, then the problem lies there - ElmerGUI does not use Elmergrid, it has some functionality of Elmergrid compiled in.
So either you fix the Elmergrid contained in ElmerGUI and recompile ElmerGUI, or, if Elmergrid (standalone, launched from the command line) is able to process the mesh, then you can load its output with ElmerGUI using file->load mesh instead of file->open.

HTH,

Matthias
YannGuevel
Posts: 30
Joined: 26 May 2014, 12:37
Antispam: Yes

Re: 3D '827' elements Gmsh -> ElmerGrid

Post by YannGuevel »

I did load the mesh generated via ElmerGrid modified in order to produce 827 elements and 409 boundary elements.
.msh to (14 2 -autoclean) mesh.nodes, mesh.elements mesh.boundary mesh.header .

It seems that ElmerGUI is not able to load 827 elments and 409 boudary elements.

I don't know how to modify the 408 case in order to get 409 elements working, and maybe other errors will come.

It's not a big problem because i don't use much the ElmerGUI. But it might be better to make it work.
Thanks again for the support.
YannGuevel
Posts: 30
Joined: 26 May 2014, 12:37
Antispam: Yes

Re: 3D '827' elements Gmsh -> ElmerGrid

Post by YannGuevel »

Of course VTU is not working directly.

One should modify fem/src/modules/ResultOutputSolve.F90

Code: Select all

  FUNCTION Elmer2VtkElement( ElmerCode ) RESULT ( VTKCode )
    
    SELECT CASE (ElmerCode)

    CASE( 827 )
      VTKCode = 29  !    VTK_TRIQUADRATIC_HEXAHEDRON           29
That's it, then from Gmsh to Paraview 827 looks like working, still trying to understand why 820 and 827 lloks weird in paraview.... like with a bad order....

Correction GMSH type 12 Elmer type 827 is a VTK TriQuad : code 29
cell represents a parabolic, 27-node isoparametric hexahedron
vtkTriQuadraticHexahedron is a concrete implementation of vtkNonLinearCell to represent a three-dimensional, 27-node isoparametric triquadratic hexahedron. The interpolation is the standard finite element, triquadratic isoparametric shape function. The cell includes 8 edge nodes, 12 mid-edge nodes, 6 mid-face nodes and one mid-volume node. The ordering of the 27 points defining the cell is point ids (0-7,8-19, 20-25, 26) where point ids 0-7 are the eight corner vertices of the cube; followed by twelve midedge nodes (8-19); followed by 6 mid-face nodes (20-25) and the last node (26) is the mid-volume node. Note that these midedge nodes correspond lie on the edges defined by (0,1), (1,2), (2,3), (3,0), (4,5), (5,6), (6,7), (7,4), (0,4), (1,5), (2,6), (3,7). The mid-surface nodes lies on the faces defined by (first edge nodes id's, than mid-edge nodes id's): (0,1,5,4;8,17,12,16), (1,2,6,5;9,18,13,17), (2,3,7,6,10,19,14,18), (3,0,4,7;11,16,15,19), (0,1,2,3;8,9,10,11), (4,5,6,7;12,13,14,15). The last point lies in the center of the cell (0,1,2,3,4,5,6,7).

Code: Select all

top
 7--14--6
 |      |
15  25  13
 |      |
 4--12--5

 middle
19--23--18
 |      |
20  26  21
 |      |
16--22--17

bottom
 3--10--2
 |      |
11  24  9
 |      |
 0-- 8--1
I do like finite elements!!
Thanks a lot for your advices, i'll try to make it work. When it's done i'll produce a report in order to help other people who would love to work with Full quadratic hexahedron :)
Last edited by YannGuevel on 08 Mar 2015, 00:32, edited 1 time in total.
Post Reply