Reading gmsh mesh with elmer (ElmerGrid/Elmer GUI)

The graphical user interface of Elmer
Post Reply
samuel_user
Posts: 5
Joined: 28 Mar 2019, 12:56
Antispam: Yes

Reading gmsh mesh with elmer (ElmerGrid/Elmer GUI)

Post by samuel_user » 28 Mar 2019, 13:27

Hello,

I encounter some problem to read gmsh meshes with elmer. So I give below a simple example. Hope someone can help.

I used gmsh (version 4.2.1) to generate a mesh file (simply a cube)
$ gmsh cube.geo -3 -order 2

I used ElmerGrid (ElmerSoler Version: 8.4 (Rev: f598a6f7, Compiled: 2019-03-27)) to convert the mesh for Elmer
$ ElmerGrid 14 2 cube.msh -autoclean

I obtain a segmentation error (see ERRORS FROM ELMERGRID below and also the log_cube.txt file for details)

Using ElmerGUI to open cube.msh give also errors (see terminal output ERRORS FROM ELMERGUI below)

Is there some incompatibilities between version of gmsh and elmer?

Thanks for your help

Samuel

************ ERRORS FROM ELMERGRID ***********************************************
Starting program Elmergrid
Elmergrid reading in-line arguments
Lower dimensional boundaries will be removed
Materials and boundaries will be renumbered
Nodes that do not appear in any element will be removed
Output will be saved to file cube.

Elmergrid loading data:
-----------------------
Format chosen using the first line: $MeshFormat
Loading mesh in Gmsh format 4.0 from file cube.msh
Reading 8 entities in 0D
Reading 12 entities in 1D
Reading 6 entities in 2D
Reading 1 entities in 3D
$Nodes section should end to string $EndNodes:
-5e-05 -3.500000000000002e-05 5e-05

Allocating for 7888 knots and 5260 elements.
Boundary name for physical group 1 is: Anode
Boundary name for physical group 2 is: Cathode
Body name for physical group 3 is: Gas
Maximum original tag for 12 1DIM entities is 12
Maximum original tag for 6 2DIM entities is 6
Maximum original tag for 1 3DIM entities is 1
Reading 7888 nodes in 27 blocks.
$Nodes section should end to string $EndNodes:
-5e-05 -3.500000000000002e-05 5e-05

Untreated command: -5e-05 -2.500000000000003e-05 5e-05
Untreated command: -5e-05 -1.500000000000004e-05 5e-05
Untreated command: -5e-05 -5.000000000000033e-06 5e-05

...

Reading 5260 elements in 3 blocks.
Reading 258 elements with tag 2 of type 306
Mapping mesh tag 2 to physical tag 3 in 1DIM
Reading 258 elements with tag 2 of type 306
Erreur de segmentation (core dumped)
***************************************************

**************** ERRORS FROM ELMERGUI ***********************************
...
Untreated command: 5258 3321 1760 2159 3464 7826 7816 7767 7574 7721 7817
Untreated command: 5259 3234 306 241 269 7263 506 7499 7291 502 507
Untreated command: 5260 3234 241 306 3346 7499 506 7263 7262 7261 7772
Making elements to boundary conditions
Leading bulk elementtype is 306
Trailing bulk elementtype is 0
GetElementDimension: unknown elementtype 0
There are 0 (out of 5260) lower dimensional elements.
Successfully read the mesh from the Gmsh input file.

ElmerGrid manipulating and importing data
Input method: 14
Manipulate mesh definition: 14 0 1.000e+00
Converting ElmerGrid data to ElmerGUI data
Setting elements of 2dim
Setting number of nodes 7888
Setting number of 2d elements 5260
Done converting
Done converting mesh
Found 407 edges on boundary
Creating edge indexes
40 boundary edges were numbered up to index 1
findBoundaryElementNormals: error: unknown code
****************************************************
Attachments
log_cube.txt
terminal errors
(840 KiB) Downloaded 43 times
cube.geo
geometry used in gmsh
(1.26 KiB) Downloaded 45 times
cube.msh
mesh from gmsh
(819.61 KiB) Downloaded 42 times

kevinarden
Posts: 246
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Reading gmsh mesh with elmer (ElmerGrid/Elmer GUI)

Post by kevinarden » 28 Mar 2019, 16:06

Elmer is not reading the new version of gmesh, gmesh changed file formats.

Go to GMSH help. current options and workspace, search for mesh.format, change it to a value of 2, goto file save mesh, GMSH will then save it as a *.unv file that ElmerGUI ro ElmerGrid can read.

samuel_user
Posts: 5
Joined: 28 Mar 2019, 12:56
Antispam: Yes

Re: Reading gmsh mesh with elmer (ElmerGrid/Elmer GUI)

Post by samuel_user » 28 Mar 2019, 19:32

Thanks "kevinarden" it worked.

For how would be interested here is the command line for extracting unv mesh format with gmsh

GMSH : gmsh <geometry_file>.geo -3 -order 2 -format unv

the same with ElmerGrid : 8 is for unv format

ELMER : ElmerGrid 8 2 <mesh_file>.unv -autoclean

mzenker
Posts: 1954
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Reading gmsh mesh with elmer (ElmerGrid/Elmer GUI)

Post by mzenker » 29 Mar 2019, 12:41

kevinarden wrote:
28 Mar 2019, 16:06
Go to GMSH help. current options and workspace, search for mesh.format, change it to a value of 2, goto file save mesh, GMSH will then save it as a *.unv file that ElmerGUI ro ElmerGrid can read.
A value of 1 makes gmsh save the mesh in the old format which Elmer can also read.

HTH,
Matthias

Adev
Posts: 1
Joined: 02 Oct 2019, 22:18
Antispam: Yes
Location: Florida, USA

Re: Reading gmsh mesh with elmer (ElmerGrid/Elmer GUI)

Post by Adev » 02 Oct 2019, 22:38

kevinarden wrote:
28 Mar 2019, 16:06
Elmer is not reading the new version of gmesh, gmesh changed file formats.

Go to GMSH help. current options and workspace, search for mesh.format, change it to a value of 2, goto file save mesh, GMSH will then save it as a *.unv file that ElmerGUI ro ElmerGrid can read.
Awesome, thank you! I'm a beginner with ELMER and Gmsh, and I struggled for more than a day trying to figure this out, not finding any solution in any of the manuals.
Perhaps someone can incorporate this into future updates of the manuals?
:)

Post Reply