I did more investigation and learned a few things:
1) Edit->Preferences->FEM-> gmsh binary path - does not want the path to the binary. It wants the binary itself with the path.
Thus /home/me/Downloads/gmsh-4.8.4-Linux64/bin will not work.
It wants /home/me/Downloads/gmsh-4.8.4-Linux64/bin/gmsh.
The term "binary path" is a bit misleading. When I read path, I think of the output of pwd. I think the label should be changed to "gmsh executable" and leave out the word path.
Developers could add a Test button in which gmsh --version will be run and the output displayed.
2) If you set the path to the gmsh executable incorrectly and run Gmesh-> Tasks -> Apply and you get the following message:
Code: Select all
0.0: We are going to start ...
0.0: Start Gmsh ...
0.0: Gmsh had warnings ...
0.0: Error executing: /home/me/Downloads/gmsh-4.8.4-Linux64/bin/ - /tmp/fcfem_8czy44x8/shape2mesh.geo
0.0: Gmsh done!
Or the following message in Report View:
Code: Select all
14:56:52 ElementDimension: 3
14:56:52 No Group meshing for analysis.
14:56:52 /tmp/fcfem_8czy44x8/Box_Geometry.brep
14:56:52 /tmp/fcfem_8czy44x8/Box_Mesh.unv
14:56:52 /tmp/fcfem_8czy44x8/shape2mesh.geo
14:56:52 /home/me/Downloads/gmsh-4.8.4-Linux64/bin/
14:56:52 Error executing: /home/me/Downloads/gmsh-4.8.4-Linux64/bin/ - /tmp/fcfem_8czy44x8/shape2mesh.geo
14:56:52 No mesh was created.
14:56:52 Gmsh had warnings ...
14:56:52 Error executing: /home/me/Downloads/gmsh-4.8.4-Linux64/bin/ - /tmp/fcfem_8czy44x8/shape2mesh.geo
it means that the gmsh isn't running at all. Maybe the path is wrong or you don't have gmsh installed on the computer.
The generated error message doesn't imply that gmsh isn't installed or couldn't be found. In fact, the "Gmsh had warnings" leads the user to believe that gmsh did in fact, run. This message should probably be changed so that the user has a better understanding of what is going on. I suggest that "gmsh executable not found" should be added somewhere in the output.
3) When I have a gmsh installed (4.7.1 or 4.8.4) and the path in FreeCAD is correct, FreeCAD crashes when I execute "Gmesh-> Tasks -> Apply".
I am getting the following error message on the command line when I run FreeCAD from the command line when this happens:
Code: Select all
...
2021-09-29 14:54:28.464 ( 30.247s) [ 75C629C0] vtkCellArray.cxx:551 ERR| vtkCellArray (0x55c77da48100): Invalid location.
2021-09-29 14:54:28.464 ( 30.247s) [ 75C629C0] vtkCellArray.cxx:551 ERR| vtkCellArray (0x55c77da48100): Invalid location.
2021-09-29 14:54:28.464 ( 30.247s) [ 75C629C0] vtkCellArray.cxx:551 ERR| vtkCellArray (0x55c77da48100): Invalid location.
2021-09-29 14:54:28.464 ( 30.247s) [ 75C629C0] vtkCellArray.cxx:551 ERR| vtkCellArray (0x55c77da48100): Invalid location.
2021-09-29 14:54:28.464 ( 30.247s) [ 75C629C0] vtkCellArray.cxx:551 ERR| vtkCellArray (0x55c77da48100): Invalid location.
FreeCAD: /builddir/build/BUILD/FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkEdge.cpp:119: virtual int SMDS_VtkEdge::NbNodes() const: Assertion `nbPoints >= 2' failed.
Aborted (core dumped)
The FEMMesh.unv file produced by this is:
Code: Select all
-1
164
1 SI: Meter (newton) 2
1.0000000000000000E+0 1.0000000000000000E+0 1.0000000000000000E+0
2.7314999999999998E+2
-1
-1
2420
1
SMESH_Mesh
1 0 0
Global Cartesian Coordinate System
1.0000000000000000E+0 0.0000000000000000E+0 0.0000000000000000E+0
0.0000000000000000E+0 1.0000000000000000E+0 0.0000000000000000E+0
0.0000000000000000E+0 0.0000000000000000E+0 1.0000000000000000E+0
0.0000000000000000E+0 0.0000000000000000E+0 0.0000000000000000E+0
-1
-1
2411
-1
-1
2412
-1
If I extract PartShape.brp from my FreeCAD file and then start gmsh 4.7.1 manually and then open PartShape.brp, gmsh will mesh it in both 2D and 3D. The gmsh console output file shows several 3D meshes because I pressed 3D several times to try to get it to crash. It didn't. Furthermore, gmsh displays what looks like cube with a 3D mesh on it.
Code: Select all
-------------------------------------------------------
Version : 4.7.1
License : GNU General Public License
Build OS : Linux64-sdk
Build date : 20210126
Build host : unknown
Build options : 64Bit ANN[system] Bamg Cgns DIntegration Dlopen Eigen[system] Fltk GMP Gmm[system] Hxt Jpeg Kbipack LinuxJoystick MathEx[system] Med Mesh Metis[system] ONELAB ONELABMetamodel OpenCASCADE OpenCASCADE-CAF OpenGL OpenMP Parser Plugins Png Post QuadTri Solver TetGen/BR Voro++[system] Zlib
FLTK version : 1.3.5
OCC version : 7.5.0
MED version : 4.1.0
Packaged by : mockbuild
Web site : https://gmsh.info
Issue tracker : https://gitlab.onelab.info/gmsh/gmsh/issues
-------------------------------------------------------
Info : Running 'gmsh' [Gmsh 4.7.1, 1 node, max. 1 thread]
Info : Started on Wed Sep 29 15:14:33 2021
Info : Reading '/home/me/PartShape.brp'...
Info : Done reading '/home/me/PartShape.brp'
Info : Meshing 1D...
Info : Meshing curve 1 (Line)
Info : Meshing curve 2 (Line)
Info : Meshing curve 3 (Line)
Info : Meshing curve 4 (Line)
Info : Meshing curve 5 (Line)
Info : Meshing curve 6 (Line)
Info : Meshing curve 7 (Line)
Info : Meshing curve 8 (Line)
Info : Meshing curve 9 (Line)
Info : Meshing curve 10 (Line)
Info : Meshing curve 11 (Line)
Info : Meshing curve 12 (Line)
Info : Done meshing 1D (Wall 0.00333891s, CPU 0.003125s)
Info : Meshing 2D...
Info : Meshing surface 1 (Plane, Frontal-Delaunay)
Info : Meshing surface 2 (Plane, Frontal-Delaunay)
Info : Meshing surface 3 (Plane, Frontal-Delaunay)
Info : Meshing surface 4 (Plane, Frontal-Delaunay)
Info : Meshing surface 5 (Plane, Frontal-Delaunay)
Info : Meshing surface 6 (Plane, Frontal-Delaunay)
Info : Done meshing 2D (Wall 0.0341637s, CPU 0.032565s)
Info : Meshing 3D...
Info : 3D Meshing 1 volume with 1 connected component
Info : Tetrahedrizing 272 nodes...
Info : Done tetrahedrizing 280 nodes (Wall 0.00656789s, CPU 0.006505s)
Info : Reconstructing mesh...
Info : - Creating surface mesh
Info : - Identifying boundary edges
Info : - Recovering boundary
Info : Done reconstructing mesh (Wall 0.0133022s, CPU 0.012884s)
Info : Found volume 1
Info : It. 0 - 0 nodes created - worst tet radius 3.01722 (nodes removed 0 0)
Info : 3D refinement terminated (339 nodes total):
Info : - 0 Delaunay cavities modified for star shapeness
Info : - 0 nodes could not be inserted
Info : - 1150 tetrahedra created in 0.0060005 sec. (191650 tets/s)
Info : Done meshing 3D (Wall 0.0441378s, CPU 0.03294s)
Info : Optimizing mesh...
Info : Optimizing volume 1
Info : Optimization starts (volume = 1000) with worst = 0.0354623 / average = 0.753685:
Info : 0.00 < quality < 0.10 : 2 elements
Info : 0.10 < quality < 0.20 : 6 elements
Info : 0.20 < quality < 0.30 : 13 elements
Info : 0.30 < quality < 0.40 : 21 elements
Info : 0.40 < quality < 0.50 : 24 elements
Info : 0.50 < quality < 0.60 : 50 elements
Info : 0.60 < quality < 0.70 : 243 elements
Info : 0.70 < quality < 0.80 : 312 elements
Info : 0.80 < quality < 0.90 : 324 elements
Info : 0.90 < quality < 1.00 : 153 elements
Info : 21 edge swaps, 0 node relocations (volume = 1000): worst = 0.309838 / average = 0.763895 (Wall 0.000351582s, CPU 0.000352s)
Info : No ill-shaped tets in the mesh :-)
Info : 0.00 < quality < 0.10 : 0 elements
Info : 0.10 < quality < 0.20 : 0 elements
Info : 0.20 < quality < 0.30 : 0 elements
Info : 0.30 < quality < 0.40 : 22 elements
Info : 0.40 < quality < 0.50 : 24 elements
Info : 0.50 < quality < 0.60 : 55 elements
Info : 0.60 < quality < 0.70 : 235 elements
Info : 0.70 < quality < 0.80 : 314 elements
Info : 0.80 < quality < 0.90 : 328 elements
Info : 0.90 < quality < 1.00 : 152 elements
Info : Done optimizing mesh (Wall 0.000961858s, CPU 0.000819s)
Info : 339 nodes 1752 elements
Info : Meshing 3D...
Info : 3D Meshing 1 volume with 1 connected component
Info : Tetrahedrizing 272 nodes...
Info : Done tetrahedrizing 280 nodes (Wall 0.00298244s, CPU 0.002914s)
Info : Reconstructing mesh...
Info : - Creating surface mesh
Info : - Identifying boundary edges
Info : - Recovering boundary
Info : Done reconstructing mesh (Wall 0.00556239s, CPU 0.005398s)
Info : Found volume 1
Info : It. 0 - 0 nodes created - worst tet radius 2.98501 (nodes removed 0 0)
Info : 3D refinement terminated (334 nodes total):
Info : - 0 Delaunay cavities modified for star shapeness
Info : - 0 nodes could not be inserted
Info : - 1111 tetrahedra created in 0.00220888 sec. (502970 tets/s)
Info : Done meshing 3D (Wall 0.0180624s, CPU 0.013965s)
Info : Optimizing mesh...
Info : Optimizing volume 1
Info : Optimization starts (volume = 1000) with worst = 0.0354623 / average = 0.754414:
Info : 0.00 < quality < 0.10 : 3 elements
Info : 0.10 < quality < 0.20 : 4 elements
Info : 0.20 < quality < 0.30 : 11 elements
Info : 0.30 < quality < 0.40 : 22 elements
Info : 0.40 < quality < 0.50 : 23 elements
Info : 0.50 < quality < 0.60 : 46 elements
Info : 0.60 < quality < 0.70 : 228 elements
Info : 0.70 < quality < 0.80 : 305 elements
Info : 0.80 < quality < 0.90 : 317 elements
Info : 0.90 < quality < 1.00 : 150 elements
Info : 18 edge swaps, 0 node relocations (volume = 1000): worst = 0.306328 / average = 0.764701 (Wall 0.000350884s, CPU 0.000351s)
Info : No ill-shaped tets in the mesh :-)
Info : 0.00 < quality < 0.10 : 0 elements
Info : 0.10 < quality < 0.20 : 0 elements
Info : 0.20 < quality < 0.30 : 0 elements
Info : 0.30 < quality < 0.40 : 22 elements
Info : 0.40 < quality < 0.50 : 23 elements
Info : 0.50 < quality < 0.60 : 47 elements
Info : 0.60 < quality < 0.70 : 222 elements
Info : 0.70 < quality < 0.80 : 309 elements
Info : 0.80 < quality < 0.90 : 319 elements
Info : 0.90 < quality < 1.00 : 150 elements
Info : Done optimizing mesh (Wall 0.000963534s, CPU 0.000822s)
Info : 334 nodes 1714 elements
Info : Writing '/home/me/PartShape.msh'...
Info : Done writing '/home/me/PartShape.msh'
Info : Meshing 3D...
Info : 3D Meshing 1 volume with 1 connected component
Info : Tetrahedrizing 272 nodes...
Info : Done tetrahedrizing 280 nodes (Wall 0.00558089s, CPU 0.005581s)
Info : Reconstructing mesh...
Info : - Creating surface mesh
Info : - Identifying boundary edges
Info : - Recovering boundary
Info : Done reconstructing mesh (Wall 0.0119513s, CPU 0.011857s)
Info : Found volume 1
Info : It. 0 - 0 nodes created - worst tet radius 2.98501 (nodes removed 0 0)
Info : 3D refinement terminated (334 nodes total):
Info : - 0 Delaunay cavities modified for star shapeness
Info : - 0 nodes could not be inserted
Info : - 1111 tetrahedra created in 0.00707634 sec. (157002 tets/s)
Info : Done meshing 3D (Wall 0.0325942s, CPU 0.032433s)
Info : Optimizing mesh...
Info : Optimizing volume 1
Info : Optimization starts (volume = 1000) with worst = 0.0354623 / average = 0.754414:
Info : 0.00 < quality < 0.10 : 3 elements
Info : 0.10 < quality < 0.20 : 4 elements
Info : 0.20 < quality < 0.30 : 11 elements
Info : 0.30 < quality < 0.40 : 22 elements
Info : 0.40 < quality < 0.50 : 23 elements
Info : 0.50 < quality < 0.60 : 46 elements
Info : 0.60 < quality < 0.70 : 228 elements
Info : 0.70 < quality < 0.80 : 305 elements
Info : 0.80 < quality < 0.90 : 317 elements
Info : 0.90 < quality < 1.00 : 150 elements
Info : 18 edge swaps, 0 node relocations (volume = 1000): worst = 0.306328 / average = 0.764701 (Wall 0.000620122s, CPU 0.00059s)
Info : No ill-shaped tets in the mesh :-)
Info : 0.00 < quality < 0.10 : 0 elements
Info : 0.10 < quality < 0.20 : 0 elements
Info : 0.20 < quality < 0.30 : 0 elements
Info : 0.30 < quality < 0.40 : 22 elements
Info : 0.40 < quality < 0.50 : 23 elements
Info : 0.50 < quality < 0.60 : 47 elements
Info : 0.60 < quality < 0.70 : 222 elements
Info : 0.70 < quality < 0.80 : 309 elements
Info : 0.80 < quality < 0.90 : 319 elements
Info : 0.90 < quality < 1.00 : 150 elements
Info : Done optimizing mesh (Wall 0.00235931s, CPU 0.00233s)
Info : 334 nodes 1714 elements
Info : Meshing 3D...
Info : 3D Meshing 1 volume with 1 connected component
Info : Tetrahedrizing 272 nodes...
Info : Done tetrahedrizing 280 nodes (Wall 0.00418302s, CPU 0.004138s)
Info : Reconstructing mesh...
Info : - Creating surface mesh
Info : - Identifying boundary edges
Info : - Recovering boundary
Info : Done reconstructing mesh (Wall 0.00668621s, CPU 0.006579s)
Info : Found volume 1
Info : It. 0 - 0 nodes created - worst tet radius 2.98501 (nodes removed 0 0)
Info : 3D refinement terminated (334 nodes total):
Info : - 0 Delaunay cavities modified for star shapeness
Info : - 0 nodes could not be inserted
Info : - 1111 tetrahedra created in 0.00246338 sec. (451006 tets/s)
Info : Done meshing 3D (Wall 0.0161731s, CPU 0.016065s)
Info : Optimizing mesh...
Info : Optimizing volume 1
Info : Optimization starts (volume = 1000) with worst = 0.0354623 / average = 0.754414:
Info : 0.00 < quality < 0.10 : 3 elements
Info : 0.10 < quality < 0.20 : 4 elements
Info : 0.20 < quality < 0.30 : 11 elements
Info : 0.30 < quality < 0.40 : 22 elements
Info : 0.40 < quality < 0.50 : 23 elements
Info : 0.50 < quality < 0.60 : 46 elements
Info : 0.60 < quality < 0.70 : 228 elements
Info : 0.70 < quality < 0.80 : 305 elements
Info : 0.80 < quality < 0.90 : 317 elements
Info : 0.90 < quality < 1.00 : 150 elements
Info : 18 edge swaps, 0 node relocations (volume = 1000): worst = 0.306328 / average = 0.764701 (Wall 0.000351023s, CPU 0.00035s)
Info : No ill-shaped tets in the mesh :-)
Info : 0.00 < quality < 0.10 : 0 elements
Info : 0.10 < quality < 0.20 : 0 elements
Info : 0.20 < quality < 0.30 : 0 elements
Info : 0.30 < quality < 0.40 : 22 elements
Info : 0.40 < quality < 0.50 : 23 elements
Info : 0.50 < quality < 0.60 : 47 elements
Info : 0.60 < quality < 0.70 : 222 elements
Info : 0.70 < quality < 0.80 : 309 elements
Info : 0.80 < quality < 0.90 : 319 elements
Info : 0.90 < quality < 1.00 : 150 elements
Info : Done optimizing mesh (Wall 0.000974498s, CPU 0.000974s)
Info : 334 nodes 1714 elements
Info : Meshing 3D...
Info : 3D Meshing 1 volume with 1 connected component
Info : Tetrahedrizing 272 nodes...
Info : Done tetrahedrizing 280 nodes (Wall 0.0058053s, CPU 0.005784s)
Info : Reconstructing mesh...
Info : - Creating surface mesh
Info : - Identifying boundary edges
Info : - Recovering boundary
Info : Done reconstructing mesh (Wall 0.0118948s, CPU 0.011874s)
Info : Found volume 1
Info : It. 0 - 0 nodes created - worst tet radius 2.98501 (nodes removed 0 0)
Info : 3D refinement terminated (334 nodes total):
Info : - 0 Delaunay cavities modified for star shapeness
Info : - 0 nodes could not be inserted
Info : - 1111 tetrahedra created in 0.00694329 sec. (160010 tets/s)
Info : Done meshing 3D (Wall 0.0312243s, CPU 0.031171s)
Info : Optimizing mesh...
Info : Optimizing volume 1
Info : Optimization starts (volume = 1000) with worst = 0.0354623 / average = 0.754414:
Info : 0.00 < quality < 0.10 : 3 elements
Info : 0.10 < quality < 0.20 : 4 elements
Info : 0.20 < quality < 0.30 : 11 elements
Info : 0.30 < quality < 0.40 : 22 elements
Info : 0.40 < quality < 0.50 : 23 elements
Info : 0.50 < quality < 0.60 : 46 elements
Info : 0.60 < quality < 0.70 : 228 elements
Info : 0.70 < quality < 0.80 : 305 elements
Info : 0.80 < quality < 0.90 : 317 elements
Info : 0.90 < quality < 1.00 : 150 elements
Info : 18 edge swaps, 0 node relocations (volume = 1000): worst = 0.306328 / average = 0.764701 (Wall 0.000667336s, CPU 0.000669s)
Info : No ill-shaped tets in the mesh :-)
Info : 0.00 < quality < 0.10 : 0 elements
Info : 0.10 < quality < 0.20 : 0 elements
Info : 0.20 < quality < 0.30 : 0 elements
Info : 0.30 < quality < 0.40 : 22 elements
Info : 0.40 < quality < 0.50 : 23 elements
Info : 0.50 < quality < 0.60 : 47 elements
Info : 0.60 < quality < 0.70 : 222 elements
Info : 0.70 < quality < 0.80 : 309 elements
Info : 0.80 < quality < 0.90 : 319 elements
Info : 0.90 < quality < 1.00 : 150 elements
Info : Done optimizing mesh (Wall 0.00246415s, CPU 0.002466s)
Info : 334 nodes 1714 elements
If I try to export the mesh as a .unv file, I get the following
Code: Select all
Info : Writing '/home/me/PartShape.msh'...
Info : Done writing '/home/me/PartShape.msh'
Info : Writing '/home/me/TestFEM'...
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Info : Done writing '/home/me/TestFEM'
The .unv file gmsh produces is attached below as TestFEMunv.txt. This is a very different .unv file from what is produced from within FreeCAD. From this I conclude that the brp file produced by FreeCAD is correct and that gmsh on its own works correctly.