Elmergrid to gmsh?

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

Elmergrid to gmsh?

Post by mzenker » 21 Jun 2012, 15:41

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: 3447
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Elmergrid to gmsh?

Post by raback » 21 Jun 2012, 16:29

Sorry, no.

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

Re: Elmergrid to gmsh?

Post by mzenker » 21 Jun 2012, 16:35

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: 3447
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Elmergrid to gmsh?

Post by raback » 25 Jun 2012, 14:12

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: 1943
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Elmergrid to gmsh?

Post by mzenker » 19 Sep 2012, 12:00

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: 3447
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Elmergrid to gmsh?

Post by raback » 19 Sep 2012, 17:53

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: 1943
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Elmergrid to gmsh?

Post by mzenker » 19 Sep 2012, 18:32

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: 3447
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Elmergrid to gmsh?

Post by raback » 19 Sep 2012, 21:03

Hi Matthias

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

-Peter

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

Re: Elmergrid to gmsh?

Post by mzenker » 27 Sep 2012, 13:52

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 194 times
test_gmsh.msh
mesh file as generated by gmsh
(9.46 KiB) Downloaded 187 times

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

Re: Elmergrid to gmsh?

Post by raback » 27 Sep 2012, 22:26

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