Hi All,
I'm having trouble generating FEM meshes in FreeCAD.
Steps to reproduce:
Create a cube from the Design workspace.
Select the cube and create a mesh from the "FEM Mesh from shape by GMSH" button in the FEM workspace.
An empty mesh is created.
There's another variation:
Create a cube
Change the height to 1mm.
Select the Cube and create a mesh with GMSH.
Save the file.
Close the file.
Open the file.
The mesh is empty. (The file size also decreases from 38.3kiB to 6.2kiB, so I think the mesh gets deleted because FreeCAD realizes it's invalid)
I'm pretty sure that GMSH works, because I can create meshes without issue and import them into ElmerGUI.
Here's my system info:
OS: Arch Linux (Budgie:GNOME/Budgie Desktop)
Word size of FreeCAD: 64-bit
Version: 0.20.31245 (Git)
Build type: Release
Branch: makepkg
Hash: 096210d21183e9dfdc3b25777760bfb6c00a210b
Python version: 3.10.5
Qt version: 5.15.5
Coin version: 4.0.1
OCC version: 7.5.3
Locale: English/United States (en_US)
GMSH plugin doesn't generate mesh [SOLVED]
Moderator: bernd
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
GMSH plugin doesn't generate mesh [SOLVED]
- Attachments
-
- bad mesh.FCStd
- (38.29 KiB) Downloaded 24 times
Last edited by kamocat on Tue Jul 12, 2022 2:37 pm, edited 1 time in total.
Re: GMSH plugin doesn't generate mesh
This is wrong because FreeCAD is at
Code: Select all
Version: 0.21.29487
Therefore please install a valid FreeCAD, if possible the plain FreeCAD 0.20 release, no development build.
You need at least Gmsh 4.8. For VTK if possible avoid VTK 9.x, if this is no option, use the latest VTK 9.x version you can get.
Re: GMSH plugin doesn't generate mesh
Have you seen and read the "small" red box above the forum?
Re: GMSH plugin doesn't generate mesh
Thanks. I didn't realize that the nightly builds were incomplete.
I'm on the regular appimage and gmsh works fine now.
I'm on the regular appimage and gmsh works fine now.
Code: Select all
OS: Arch Linux (Budgie:GNOME/Budgie Desktop)
Word size of FreeCAD: 64-bit
Version: 0.20.29177 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.20)
Hash: 68e337670e227889217652ddac593c93b5e8dc94
Python 3.9.13, Qt 5.12.9, Coin 4.0.0, Vtk 9.1.0, OCC 7.5.3
Locale: English/United States (en_US)
Re: GMSH plugin doesn't generate mesh [SOLVED]
I experienced this same issue when compiling on Linux (and Windows) with:
* FreeCAD 0.20
* VTK 9
* Internal SMESH
The issue is with the now old (~version 7) internal SMESH module. It is not compatible with VTK 9. If you compile with external SMESH enabled (and build and install the SMESH project on github) in the CMake settings, it fixes the issue. However, the default CMake scripts for the external SMESH setting do not work. They are not fully implemented.
This PR I made (at least for the realthunder fork, but it should work the same on the main fork) fixes the external SMESH mode, and this issue goes away on my machine when compiling against VTK 9.
https://github.com/realthunder/FreeCAD/pull/522
* FreeCAD 0.20
* VTK 9
* Internal SMESH
The issue is with the now old (~version 7) internal SMESH module. It is not compatible with VTK 9. If you compile with external SMESH enabled (and build and install the SMESH project on github) in the CMake settings, it fixes the issue. However, the default CMake scripts for the external SMESH setting do not work. They are not fully implemented.
This PR I made (at least for the realthunder fork, but it should work the same on the main fork) fixes the external SMESH mode, and this issue goes away on my machine when compiling against VTK 9.
https://github.com/realthunder/FreeCAD/pull/522
Re: GMSH plugin doesn't generate mesh [SOLVED]
BTW: In FEM gmsh only uses unv importer of internal smesh. I would assume the problem ist on unv import ...
But what has VTK9 to do with meshing? IMHO VTK is used for postprocessing only.
strange ...
Which version of gmsh was used?
But what has VTK9 to do with meshing? IMHO VTK is used for postprocessing only.
strange ...
Which version of gmsh was used?
Re: GMSH plugin doesn't generate mesh [SOLVED]
Some time ago we already had a problem with broken meshes when using VTK9 and the internal SMESH. The problem has been reported here: issue #6553 (forum thread: https://forum.freecadweb.org/viewtopic.php?f=18&t=66948) and its confirmed fix git commit d60dd085b
Could it be that your FreeCAD build is by far too old? If you have a fairly recent build but it still fails then double check that VTK_CELL_ARRAY_V2 is defined in SMDS_UnstructuredGrid.cpp. What's also possible is that you have encountered a different problem. In this case it would be good if you could upload your original mesh file (.unv format or similar) as the FCStd file of the OP is of no help here.
The problem with unstructured grid is the internal representation of the IDs in the old and new VTK version.The issue is with the now old (~version 7) internal SMESH module. It is not compatible with VTK 9.
Inside FreeCAD VTK is only used for post-processing but SMESH makes heavy use of it, too.