FEM: Status of old GMSH interface PR and discussion of STL meshing through GMSH
Moderator: bernd
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
FEM: Status of old GMSH interface PR and discussion of STL meshing through GMSH
Hey bernd,
I had submitted a PR https://github.com/berndhahnebach/FreeCAD_bhb/pull/54 where I implemented multi threading in the GMSH call and did some small changes to the GMSH interface. Is there any update on this? The github history does not reveal much.
In connection with this, some months ago I posted whether someone is interested in code for STL meshing by GMSH. I thought I lost the code (therefore no update on this) and today realized that I only played around with the 'shape2mesh.geo' file where I substitued the '.brep' path with an '.stl' file and GMSH was able to output an FEM mesh (.unv).
So my questions are these:
a) Does it make sense to let the meshing icon also be applied for an STL mesh (i.e. from the meshing workbench), too? This may be of interest for topology optimizing projects, since they usually get an STL from a marching cubes algorithm.
b) Should we revive the old PR above and implement this feature there? (I don't want code doubling for a feature which just needs another file name.)
EDIT: I saw an update on the https://github.com/berndhahnebach/FreeC ... emgmshpref from just a few days ago, incorporating my commits. So, maybe it does not make sense to revive the old PR, does it?
Thanks for your help and best wishes
Johannes
I had submitted a PR https://github.com/berndhahnebach/FreeCAD_bhb/pull/54 where I implemented multi threading in the GMSH call and did some small changes to the GMSH interface. Is there any update on this? The github history does not reveal much.
In connection with this, some months ago I posted whether someone is interested in code for STL meshing by GMSH. I thought I lost the code (therefore no update on this) and today realized that I only played around with the 'shape2mesh.geo' file where I substitued the '.brep' path with an '.stl' file and GMSH was able to output an FEM mesh (.unv).
So my questions are these:
a) Does it make sense to let the meshing icon also be applied for an STL mesh (i.e. from the meshing workbench), too? This may be of interest for topology optimizing projects, since they usually get an STL from a marching cubes algorithm.
b) Should we revive the old PR above and implement this feature there? (I don't want code doubling for a feature which just needs another file name.)
EDIT: I saw an update on the https://github.com/berndhahnebach/FreeC ... emgmshpref from just a few days ago, incorporating my commits. So, maybe it does not make sense to revive the old PR, does it?
Thanks for your help and best wishes
Johannes
Re: FEM: Status of old GMSH interface PR and discussion of STL meshing through GMSH
I am on the way. Just FYI ... the changes in my branch from your PR are just because I keep the branch rebased on master regularly by a script.
Use my rebased branch or your old and do the rebase yourslf. What ever fits best for you ...
I will answer all the others later on.
Use my rebased branch or your old and do the rebase yourslf. What ever fits best for you ...
I will answer all the others later on.
Re: FEM: Status of old GMSH interface PR and discussion of STL meshing through GMSH
Hey bernd,
Thanks for your fast response! Of course, I will use your rebased branch, since I have still no idea how to rebase without messing all up
Stay safe
Johannes
Re: FEM: Status of old GMSH interface PR and discussion of STL meshing through GMSH
Hey HoWil! Nice to hear from you! As I far as I understood, bernd rebased my old branch onto the actual FreeCAD master and put all together into the branch I mentioned in my edit. So it is on its way, but has to be approved and merged by him. (You may check out the branch from bernd and you will get an impression, but notice that gmsh needs to be compiled with multi threading support.)
Best wishes
Johannes
Re: FEM: Status of old GMSH interface PR and discussion of STL meshing through GMSH
Hello Johannes,
Do you have any documentation on how to compile gmsh for multi threading?
I only found http://gmsh.info/doc/texinfo/gmsh.html# ... ource-code but this is not really satisfying.
BR,
HoWil
Do you have any documentation on how to compile gmsh for multi threading?
I only found http://gmsh.info/doc/texinfo/gmsh.html# ... ource-code but this is not really satisfying.
BR,
HoWil
Re: FEM: Status of old GMSH interface PR and discussion of STL meshing through GMSH
ENABLE_OPENMP should include multithreading. See here:HoWil wrote: ↑Thu Jul 30, 2020 8:01 pm I only found http://gmsh.info/doc/texinfo/gmsh.html# ... ource-code but this is not really satisfying.
https://de.wikipedia.org/wiki/OpenMP
There is also ENABLE_MPI, but it is not used for meshing, according to the above cited Gmsh documentation.
Ulrich
Re: FEM: Status of old GMSH interface PR and discussion of STL meshing through GMSH
Hi HoWil and Ulrich,ulrich1a wrote: There is also ENABLE_MPI, but it is not used for meshing, according to the above cited Gmsh documentation.
For me for compiling gmsh
Code: Select all
cmake -DENABLE_OPENMP=1 -DENABLE_MPI=1
https://github.com/berndhahnebach/FreeC ... 664f11cad1
At the end of the day gmsh meshed a cube with 1 million elements quite fast, but the main bottleneck is the transfer back to FreeCAD (output as text file UNV and read back into FreeCAD, display perhaps). A suggestion on the gitlab repo of gmsh was to use a library gmsh file together with its Python API into FreeCAD and access the mesh structure directly. See
https://gitlab.onelab.info/gmsh/gmsh/issues/552
where I discussed these issues with the creators and maintainers of gmsh.
Best wishes
Johannes
Re: FEM: Status of old GMSH interface PR and discussion of STL meshing through GMSH
Even when FC prescribes loads, BCs and material on geometry, for me it makes sense to mesh STL, becase after topology optimization original geometry (before removing material) can be used to define analysis together with FEM mesh which is not associated to the geometry.
Otherwise I would need to mesh STL externally or transform STL mesh to the geometry in FreeCAD which (after some waiting) results in geometry with many faces.
Re: FEM: Status of old GMSH interface PR and discussion of STL meshing through GMSH
have not had the time to do anything in this regard ...
stl meshing with gmsh would be good, but since this would be a FreeCAD Mesh object and not a FreeCAD FemMesh object we shoould use a separate icon for this even is we use the same code base and even uf we put the tool inside Fem.
Or is the aim to really produce a stl file?
stl meshing with gmsh would be good, but since this would be a FreeCAD Mesh object and not a FreeCAD FemMesh object we shoould use a separate icon for this even is we use the same code base and even uf we put the tool inside Fem.
Or is the aim to really produce a stl file?