Ferrite-FEM / FerriteGmsh.jl

MIT License
14 stars 7 forks source link

All entities in Physical Group not added to cellset (?) #10

Closed fredrikekre closed 2 years ago

fredrikekre commented 2 years ago

I played around a bit with this package, mainly just for reading .geo and .msh files. It is very nice compared to my own little mesh reader I used in the past!

Anyway, I was thinking I could use "Physical Groups" to mark regions in the mesh and have that translate to cellsets in Ferrite. That seems to work if there is just one surface in the group, the remaining ones seems to be forgotten. I attach the .msh file here: test.log (I had to change .msh extension .log for GitHub to accept it). Checking e.g.

julia> using Ferrite, FerriteGmsh

julia> g = saved_file_to_grid("test.msh");

julia> vtk_grid("test", g) do vtk
           vtk_cellset(vtk, g)
       end

only one of the circles are included in the "inclusions" cellset.

koehlerson commented 2 years ago

Thanks for reporting the bug! It was a small logical error inside the cellset creation (https://github.com/Ferrite-FEM/FerriteGmsh.jl/commit/f5c234f5fc660b41d5d1e2eb4b8f0e901948649b). I never tested PhysicalGroups where multiple entities belong to one group, but I'll add it now to the tests!

I think it should look like that right: grafik grafik

fredrikekre commented 2 years ago

Great, thanks!

fredrikekre commented 2 years ago

Looks like the same bug happens for facesets:

ERROR: LoadError: ArgumentError: there already exists a set with the name: left

Edit: Nevermind, I did something stupid.

koehlerson commented 2 years ago

works? If so, I'll add the facesets test in the evening to https://github.com/Ferrite-FEM/FerriteGmsh.jl/pull/11

fredrikekre commented 2 years ago

Yea it works (I will still trying to add the facesets in my own code even though I had moved them to the mesh file). Here is an updated mesh with facesets:

periodic.log