Gmsh import doesn't show geometry

Mesh generators, CAD programs, and other tools
Post Reply
emells99
Posts: 5
Joined: 13 Jul 2021, 23:51
Antispam: Yes

Gmsh import doesn't show geometry

Post by emells99 »

Hey all,

I've been trying to import my mesh into elmer and I'm nearly there, but something is going screwy in the last step.

What I did:
1) built the geometry in solidworks and exported as a .step file
2) meshed in gmsh (and made some physical groups for boundaries/solid bodies); exported as .unv
3) opened the .unv file in Elmer

The mesh displays just fine, but the CAD model is empty, and when I click on the different body properties nothing highlights, so I can't tell which is which. I've attached the .step and .geo files for reference (the .unv file is too large to upload, so I made a very coarse version of the mesh to upload--it works the same when I import it to Elmer).

What step have I missed in here, or how do I need to modify the geometry/mesh to make it work?

Thanks!
Attachments
coil and substrate.STEP
(105.03 KiB) Downloaded 32 times
coil and substrate.geo
(949 Bytes) Downloaded 35 times
coil and substrate coarse.unv
(303.96 KiB) Downloaded 29 times
Rich_B
Posts: 68
Joined: 24 Aug 2009, 20:18

Re: Gmsh import doesn't show geometry

Post by Rich_B »

Hello,

I opened the .step and .geo files using gmsh.

Then, without changing anything in gmsh, Export, and select gmsh version 2, checked save all elements, then save as 'coil_substrate.msh' using the .msh extension.

Next, run 'elmergrid 14 2 coil_substrate -autoclean', which creates the elmer mesh files. Note that elmergrid can't tolerate any spaces in file names or directory names.

Load in ElmerGUI, and the picture looks nice and there are selectable entries under bodies and boundaries.
coil_substrate.png
(229.15 KiB) Not downloaded yet
Basically, use gmsh to export the mesh in gmsh2 format, then use elmergrid to convert the mesh to elmer format.

Hope this works for you.

Rich.
emells99
Posts: 5
Joined: 13 Jul 2021, 23:51
Antispam: Yes

Re: Gmsh import doesn't show geometry

Post by emells99 »

Thank you so much! This worked perfectly.

Cheers,
E
Rich_B
Posts: 68
Joined: 24 Aug 2009, 20:18

Re: Gmsh import doesn't show geometry

Post by Rich_B »

Glad to hear it worked for you.

Would you mind exporting and posting the Solidworks file again, this time in addition to STEP, also in BREP, STL, and IGES?

Just curious to see how all four Solidworks export formats work with both gmsh and ElmerGUI.

Thanks, Rich.
emells99
Posts: 5
Joined: 13 Jul 2021, 23:51
Antispam: Yes

Re: Gmsh import doesn't show geometry

Post by emells99 »

Here is the STL and IGES files. The version of solidworks I'm using doesn't seem to have an export to BREP option, but hopefully these are still useful to you.
Cheers,
E
Attachments
coil and substrate.IGES
(236.39 KiB) Downloaded 27 times
coil and substrate.STL
(33.87 KiB) Downloaded 28 times
Post Reply