I had a few minutes today. Just updated the defs to your up to date algorithm and tested with tet10. I did neither look into the integration to the whole class nor into the get_volumes for replacing the get_femelements_by_femnodes().
I need to test with other element types.
cheers bernd
https://github.com/berndhahnebach/FreeC ... mgmshgroup
Better mesh last instead of mesh first?
Moderator: bernd
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
Re: Better mesh last instead of mesh first?
I tried to include the volume search to replace the method get_femelements_by_femnodes() with the binary search. Some problem arised. Your binary search only works on volume elements, but the get_femelements_by_femnodes() works on all element from http://www.freecadweb.org/wiki/index.ph ... ment_Types without checking the element type. Would it be possibel to extend the search to all element types or should I check the element type befor the binary search is called?
commit:
https://github.com/berndhahnebach/FreeC ... 31eb8921d4
Branch https://github.com/berndhahnebach/FreeC ... mgmshgroup only has the changes in the regard of your MeshInfoClass. All other changes in the regard of FEM especially GMSH and group meshing are on top in branch https://github.com/berndhahnebach/FreeC ... emgmshtool which implements a GMSH meshing tool inside FreeCAD. Would be cool if you could give it a try.
cheers bernd
commit:
https://github.com/berndhahnebach/FreeC ... 31eb8921d4
Branch https://github.com/berndhahnebach/FreeC ... mgmshgroup only has the changes in the regard of your MeshInfoClass. All other changes in the regard of FEM especially GMSH and group meshing are on top in branch https://github.com/berndhahnebach/FreeC ... emgmshtool which implements a GMSH meshing tool inside FreeCAD. Would be cool if you could give it a try.
cheers bernd
Re: Better mesh last instead of mesh first?
It would be possible to extent the method to other elements as well.bernd wrote:Would it be possibel to extend the search to all element types or should I check the element type befor the binary search is called?
There are a few things to be considered. Currently the now by me called pattern_dict is only build from the volumes. Searching shell elements would require to build a separate dictionary from the shell elements.
I do distinguish the different type of elements just by the number of nodes per element. There is a coincidence with 4 nodes for a tet and 4 nodes for rectangular shell element. Therefore the search has to need to know, if a search is needed for volumes or for shells or for both.
The Gmsh-approach does also supply shell elements for the physical entities. Searching for elements in both volumes and shells may result in unwanted shell-elements. In the long term, there would be a requirement to filter the supplied mesh from Gmsh, so we can have both volume-elements from solids and shell-elements from shells, but not the shell-elements from the needed physical surfaces of the solids.
Ulrich
Re: Better mesh last instead of mesh first?
I had similar problem with recognising element type in FemMeshtToMesh macro. Now it uses mesh.faces dict to search for face elements, but this makes whole macro slow.It would be possible to extent the method to other elements as well.
There are a few things to be considered. Currently the now by me called pattern_dict is only build from the volumes. Searching shell elements would require to build a separate dictionary from the shell elements.
I do distinguish the different type of elements just by the number of nodes per element. There is a coincidence with 4 nodes for a tet and 4 nodes for rectangular shell element. Therefore the search has to need to know, if a search is needed for volumes or for shells or for both.
https://github.com/fandaL/FreeCAD_macro ... esh.py#L35
viewtopic.php?f=22&t=17724
Re: Better mesh last instead of mesh first?
Mesh with 7315 volumes:
old volume search:
9.6 sekunden
new volume search:
4.6 sekunden
It works for sure on volume meshes without face data. Shell and Edge meshes use the old search. I need to exclude or trigger the volume mesh with face and or edge data. I may find a solution for the problem. May be for your mesh converter too fandaL.
see last commit in branch, development still in progress:
https://github.com/berndhahnebach/FreeC ... mgmshgroup
old volume search:
9.6 sekunden
new volume search:
4.6 sekunden
It works for sure on volume meshes without face data. Shell and Edge meshes use the old search. I need to exclude or trigger the volume mesh with face and or edge data. I may find a solution for the problem. May be for your mesh converter too fandaL.
see last commit in branch, development still in progress:
https://github.com/berndhahnebach/FreeC ... mgmshgroup
Re: Better mesh last instead of mesh first?
50199 volumes
binary search: Writing time input file: 43.623497
standard search: Writing time input file: 262.482714
binary search: Writing time input file: 43.623497
standard search: Writing time input file: 262.482714
Re: Better mesh last instead of mesh first?
As more elements as more speed up. Means on 1000000 we may have factor 100.PrzemoF wrote:x5 speed up? Great!!!
BTW: made some tests and it worked out well. It works for volume element. Since FreeCAD FEM does not support mixed meshes (It can save mixed meshes, but not make a proper CalculiX inputfile from it.) we can distinguish easily what kind of mesh we have.
see https://github.com/berndhahnebach/FreeC ... mgmshgroup
I activated the binary search for all volume meshes in my up to date development branch for gmsh tool too https://github.com/berndhahnebach/FreeC ... emgmshtool
BTW:
As more changes I make on FemMeshTools as more the swithch to a MeshInfoClass goes up in my ToDoList