Thanks for the code examples! In particular we should have a look at the copy code for groups, maybe this provides some hints on how to proceed.bernd wrote: ↑Mon Apr 22, 2019 7:41 pmthe commits which added some group reading methods ...
git commit 084e163
git commit efb87dc1
some group code ...
https://github.com/FreeCAD/FreeCAD/blob ... #L211-L249 and https://github.com/FreeCAD/FreeCAD/blob ... L960-L1032
Do you refer to the function names which should be exposed to Python? If so, I would suggest something like addGroup('name') [the group number is simply incremented) and addGroupElements(group_number, element_list) [a counterpart to getGroupElements] where the element_list may only consist of elements which already exist in the mesh structure (they were created by addNode, addEdge, ... and so on.)
Any news here? If we have implemented addGroup and the former mentioned functions, maybe we can think of to define boundary conditions also based on groups and not only on geometry. From this the flexibility of FEM is increased and also compliance calculations (these simulations shown in another thread removing elements to maintain a mechanism or functionality) could be done, couldn't they?
Hehe I knew that this would make you happy
- Would it make sense to also add deleting functionality? Like a delGroup function?
I have never needed sucht method, thus I do not know
- Would it make sense to add also the whole bunch of manipulating group functions? I.e. intersect etc?
do you meand these ones: https://github.com/FreeCAD/FreeCAD/blob ... 1649-L1658 for sure this would be better from code point of view. Why not in the file FemMesh.cpp? It belongs to the mesh.
- I realized that at several places in the code a conversion from/to elementtype into string takes place. Where would a general function doing this belong to? This is obviously nothing which should only appear in the Python implementation of FemMesh, neither in the C++ interface of FemMesh? Is there a more general file where such service functions belong to?
- Correct me if I am wrong: The implementation of the groups at the moment works via: define them in the mesh GUI, mesh via GMSH (use PhysicalGroups), reimport the GMSH-created UNV-file and add the groups in the UNV-import from Salome. I did not really understood it from inspecting the code. Can you explain that further?