Elmergrid to gmsh?

Mesh generators, CAD programs, and other tools
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Elmergrid to gmsh?

Post by mzenker »

Hi,

since the mesh inspection capabilities of Elmer are, well, somewhat limited, I thought it could be practical to be able to view the mesh generated by Elmergrid with gmsh, e.g. to find out how bodies and boundaries (and nodes) have been renumbered.

In the Elmergrid manual it says that there are some undocumented export formats.
Question: Is gmsh .msh (or a format that gmsh understands) among those?

Thank you,

Matthias
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Elmergrid to gmsh?

Post by raback »

Sorry, no.
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Elmergrid to gmsh?

Post by mzenker »

OK.
I have seen that the commandline-ElmerGrid produces some output where the renumbered bodies and boundaries are listed. Better than nothing... ;)

Matthias
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Elmergrid to gmsh?

Post by raback »

Hi
mzenker wrote:Question: Is gmsh .msh (or a format that gmsh understands) among those?
There is now a preliminary version of Gmsh output format (with magic number 4). It only handles the $Nodes and $Elements fields. Comments are welcome.

-Peter
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Elmergrid to gmsh?

Post by mzenker »

Hi,

I have just tested the gmsh export from ElmerGrid for the first time with a 3D mesh. It is a very practical way to find out which body/boundary has which number (using Tools->Visibility in gmsh for selective display), while waiting for a similar feature in ElmerGUI. ;)
There is a small quirk, however: The numbering of the bodies I see in gmsh corresponds to what I see in Elmer, but the numbering of the surfaces (boundaries) doesn't. Would it be possible to change that?

Thanks,

Matthias
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Elmergrid to gmsh?

Post by raback »

Hi Matthias

Ok, I altered the numbering because I thought that gmsh does not like different entities having the same number. But perhaps this is just a convention of the geometric entities therein - not a limitation. Can you confirm that a body and a boundary could have the same index number.

-Peter
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Elmergrid to gmsh?

Post by mzenker »

Hi Peter,

yes, gmsh tolerates the same number for surfaces and volumes. I just checked that by modifying the msh file exported by ElmerGrid so that there was a Volume 1 and a Surface 1. It loaded in gmsh without problem.

Matthias
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Elmergrid to gmsh?

Post by raback »

Hi Matthias

I removed the offset for the BC in svn version 5834.

-Peter
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Elmergrid to gmsh?

Post by mzenker »

Hi Peter,

the removed offset works fine, thank you - now body and boundary numbers correspond to what is seen in Elmer. That is almost perfect!
However, the exported mesh has holes which are not there in the Elmer mesh files. I attach a small mesh file as test case so that you can have a look.

Matthias

P.S.: The test file has been generated with the current binary (Rev. 5817) to make sure that it's not a problem of my self-compiled binary.
Attachments
test_elmer.msh
the result of elmergrid 14 2 and elmergrid 2 4
(8.93 KiB) Downloaded 392 times
test_gmsh.msh
mesh file as generated by gmsh
(9.46 KiB) Downloaded 403 times
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Elmergrid to gmsh?

Post by raback »

Hi Matthias

Ok, didn't find it visually but looking directly at the output there was a stupid problem. It is now fixed in svn version 5843.

Just go to directory $ELMERSRC/elmergrid

and say 'make' and 'make install'.

-Peter
Post Reply