Ticket #5759 - [FEM] mesh groups only work after calling gmsh again

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Ticket #5759 - [FEM] mesh groups only work after calling gmsh again

Post by Kunda1 »

issue #3315 discussion thread

Edit: Ticket migrated to issue #5759
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
joha2
Posts: 303
Joined: Tue Oct 11, 2016 9:48 pm

Re: Ticket #3315 - [FEM] mesh groups only work after calling gmsh again

Post by joha2 »

Kunda1 wrote: Tue Jul 23, 2019 11:42 pm issue #3315 discussion thread
I've submitted a PR https://github.com/berndhahnebach/FreeCAD_bhb/pull/57 where I started a first attempt to integrate groups without remeshing. Namely, I exposed some group functions like addGroup and addGroupElements from C++ to Python. The PR has to be approved and reviewed by an expert, and there is a GUI interface missing. Possibly this could fill in the missing feature.

On the other hand I think, it is no problem to remesh to define groups.

Best wishes
Johannes
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Ticket #3315 - [FEM] mesh groups only work after calling gmsh again

Post by Kunda1 »

bernd wrote:
bump
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Ticket #5759 - [FEM] mesh groups only work after calling gmsh again

Post by Kunda1 »

ticket migrated to GH issue #5759
joha2 wrote: Wed Jul 24, 2019 4:10 pm I've submitted a PR https://github.com/berndhahnebach/FreeCAD_bhb/pull/57 where I started a first attempt to integrate groups without remeshing. Namely, I exposed some group functions like addGroup and addGroupElements from C++ to Python. The PR has to be approved and reviewed by an expert, and there is a GUI interface missing. Possibly this could fill in the missing feature.
@joha2 looks like your PR was merged. Would you be so kind to follow-up regarding what the status of issue #5759 is? Thanks!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
joha2
Posts: 303
Joined: Tue Oct 11, 2016 9:48 pm

Re: Ticket #5759 - [FEM] mesh groups only work after calling gmsh again

Post by joha2 »

Kunda1 wrote: Wed Apr 13, 2022 11:48 am @joha2 looks like your PR was merged. Would you be so kind to follow-up regarding what the status of issue #5759 is? Thanks!
Hey Kunda1,

As far as I know, when you use mesh groups via the GUI interface you still have to regenerate the mesh to be able to use these groups.

My implementation just exposed the C++ functions to Python. This means, if you have a mesh which gmsh generated, then you may enter a command into the Python shell to add nodes or edges or elements to a new mesh group. But this is not reflected within the GUI. Insofar, the state of the GUI mesh is inconsistent in comparison with the internal representation, unfortunately. I'm not really sure how to fix this, since as far as I know, one cannot mixup GUI things with these low level functions. Maybe we need a Python function which encapsulates this call to addGroup and also updates the object tree in the GUI.

Unfortunately, I'm stuck at the moment, because I cannot install gmsh via my system repos because one of the dependency libraries is in conflict with the freecad-daily libraries. I didn't have the time yet, to compile it myself. :sad:

Edit: As far as I remember I tried to untangle the code which handles gmsh invokation (and updates the groups in the GUI) to avoid code doubling, but this was not possible without a deep interference with existing code and possible breakage. So, I let it be. :mrgreen:

Hope this helps.

Best wishes
Johannes
Post Reply