Mesh refinement and boundary tags

Mesh generators, CAD programs, and other tools
Post Reply
chenry
Posts: 10
Joined: 11 Nov 2020, 19:05
Antispam: Yes

Mesh refinement and boundary tags

Post by chenry »

Hi all,

I’ve been using the MMG2DSolver to refine a mesh in a given area and this has worked perfectly. I’m now comparing my Elmer/Ice simulations with another model (icepack) and would like to use the same refined mesh which should be in an .msh format with boundary tags. After using the MMG2DSolver, I saved the vtu file and converted it to an .msh file using meshio, which works fine except that I lose information about the boundary tags (directly saving as an .msh file from Elmer gives me more trouble).

Do any of you know how I can retain the boundary tags after using the MMG2DSolver? Is there a way to add a line to the .msh file to redefine the boundaries? Or is specifying the mesh refinement in the original .geo file the only way to solve this?

Many thanks for any help!

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

Re: Mesh refinement and boundary tags

Post by kevinarden »

I convert elmer mesh to msh file using ElmerGrid and the boundary elements remain in the msh file

ElmerGrid 2 4 mesh
chenry
Posts: 10
Joined: 11 Nov 2020, 19:05
Antispam: Yes

Re: Mesh refinement and boundary tags

Post by chenry »

Many thanks for your reply — that is indeed a much cleaner way to convert to an msh file.

Unfortunately, I am still having issues with the boundary tags, however. It seems that they are dropped during mesh refinement at some point which can be seen in the fourth column under $Elements in the msh file, where the boundary tags appear as zeros in the refined mesh (MeshNew.msh) and values 1-5 in the previous mesh (MeshOriginal.msh). Is there some way to retain these boundary tags after refinement?

Thanks!
Attachments
MeshOriginal.msh
(249.79 KiB) Downloaded 32 times
MeshOriginal.geo
(837 Bytes) Downloaded 33 times
MeshNew.msh
(675.64 KiB) Downloaded 35 times
kevinarden
Posts: 2313
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Mesh refinement and boundary tags

Post by kevinarden »

When I open your two mesh files in Elmer the boundaries are there numbered 1 - 5, so I am not sure what you mean by boundary tags
Post Reply