FEM Workbench - No mesh generated even though there are no errors

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
andrigtmiller
Posts: 84
Joined: Wed Jan 27, 2016 5:14 pm

FEM Workbench - No mesh generated even though there are no errors

Post by andrigtmiller »

Here is my FreeCAD version information:

OS: Fedora 33 (Workstation Edition) (GNOME/gnome)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23578 (Git) AppImage
Build type: Release
Branch: master
Hash: 50c3cbf00579dc4941ca743c25720d016b0453ce
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)

I have Gmsh installed separately, and it launches cleanly on it's own.

I have been trying to learn to use the FEM workbench to do analysis on some models I have, and I cannot get a mesh to generate, even though I get no errors.

I created an Analysis
I created the material solid (I left the list at the bottom empty, but have tried adding a solid to it, neither changes the results)
I created a fixed constraint on one surface
I created a force constraint on another surface (opposite end of the model)
I generated a gmesh, and it shows the following:

0.0: We are going to start ...
0.0: Start Gmsh ...
0.1: Clean run of Gmsh
0.1: Gmsh done!

Then when I try to make the mesh visible, there is nothing. The property tab for the Mesh shows Nodes 0, Edges 0, Faces 0, Polygons 0, Volumes 0, Polyhedrons 0, Groups 0

It shows my Body as the part the mesh was generated from.

So, obviously with the time it took to generate it didn't do anything, and the property values clearly showed it didn't do anything, but why would there be no errors or warnings or anything?

If you need the model, I have attached it. Seems very strange to me.
Attachments
DualTaperedPushrod.FCStd
My model that I am trying to use FEM on
(39.21 KiB) Downloaded 49 times
chrisb
Veteran
Posts: 54213
Joined: Tue Mar 17, 2015 9:14 am

Re: FEM Workbench - No mesh generated even though there are no errors

Post by chrisb »

Moved to FEM forum.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
heda
Veteran
Posts: 1348
Joined: Sat Dec 12, 2015 5:49 pm

Re: FEM Workbench - No mesh generated even though there are no errors

Post by heda »

just checked out of curiosity and opened in fc v0.18 (which is the one I have installed)
and then some sketches are empty, which I guess they are not in v0.19.

however doing the meshing I get same as you, and it complains like below

Code: Select all

Original exception was:
TypeError: Can't call meta function because I have no idea how to handle Base::Quantity
which once again can very well be a version thing.

exported a stp-file and imported to gmsh (4.4.1 on mint) - crashes on 3d mesh, was ok on 1d, but crashed already on 2d.
it crashed in such way that gui died

same stp in netgen - works (but got a feeling that it struggled a bit to make the mesh).

you can do the mesh outside of fc and import it back - not an ideal workflow - but can be good to know as workaround if subjected to barriers like this.

not clear from op if it meshes cleanly when running gmsh on its own.
andrigtmiller
Posts: 84
Joined: Wed Jan 27, 2016 5:14 pm

Re: FEM Workbench - No mesh generated even though there are no errors

Post by andrigtmiller »

Interesting. I just thought to look at the report view, and it shows this:

13:24:04 Unexpected error when creating mesh: <class 'RuntimeError'>

Here is the entire list of messages:

3:24:04
Gmsh FEM mesh run is being started.
13:24:04 Part to mesh: Name --> Body, Label --> Body, ShapeType --> Solid
13:24:04 CharacteristicLengthMax: 1e+22
13:24:04 CharacteristicLengthMin: 0.0
13:24:04 ElementOrder: 2
13:24:04 ElementDimension: 3
13:24:04 Group meshing for analysis is set to true in FEM General Preferences. Are you really sure about this? You could run into trouble!
13:24:04
13:24:04
13:24:04
13:24:04 {'MaterialSolid': ['Solid1'], 'ConstraintFixed': ['Face1'], 'ConstraintForce': ['Face5']}
13:24:04 /tmp/fcfem_dyzycwuo/Body_Geometry.brep
13:24:04 /tmp/fcfem_dyzycwuo/Body_Mesh.unv
13:24:04 /tmp/fcfem_dyzycwuo/shape2mesh.geo
13:24:04 /usr/bin/gmsh
13:24:04 Unexpected error when creating mesh: <class 'RuntimeError'>
13:24:04 Clean run of Gmsh

Not very helpful, but this group meshing for analysis set to true may be something to look at.

I tried to generate a mesh with gmesh outside of it, using a STEP file export, and received this:

Info : Reconstructing mesh...
Info : - Creating surface mesh
Info : - Identifying boundary edges
Info : - Recovering boundary
Error : PLC Error: A segment and a facet intersect at point
Info : (0.0923147,-2.2175,148.762).
Info : Segment: [41,46] #-1 (0)
Info : Facet: [30,31,32] #3
Error : Invalid boundary mesh (segment-facet intersection) on surface 3, intersection (0.0923147,-2.2175,148.762)
Error : No elements in volume 1
Info : Done meshing 3D (Wall 0.00386286s, CPU 0.003825s)
Info : 60 nodes 146 elements
Error : ------------------------------
Error : Mesh generation error summary
Error : 0 warnings
Error : 3 errors
Error : Check the full log for details
Error : ------------------------------

The UI looked terrible, in terms of the visual representation of the mesh. I can't tell what these segments and facets are, so this doesn't help, but there certainly is an issue with something. Just can't tell what yet.
UR_
Veteran
Posts: 1355
Joined: Tue Jan 03, 2017 8:42 pm

Re: FEM Workbench - No mesh generated even though there are no errors

Post by UR_ »

Just no problems running Gmsh.
Screenshot 002.png
Screenshot 002.png (67.89 KiB) Viewed 1205 times
========================== Dump contents of mesh ==========================

1) Total number of nodes: 184290
2) Total number of edges: 728
3) Total number of faces: 39680
4) Total number of polygons: 0
5) Total number of volumes: 109366
6) Total number of polyhedrons: 0

7) Total number of linear edges: 0
8) Total number of linear faces: 0
9) Total number of linear volumes: 0

10) Total number of quadratic edges: 728
11) Total number of quadratic faces: 39680
11.1) Number of quadratic triangles: 39680
11.2) Number of quadratic quadrangles: 0
12) Total number of quadratic volumes: 109366
12.1) Number of quadratic hexahedrons: 0
12.2) Number of quadratic tetrahedrons: 109366
12.3) Number of quadratic prisms: 0
12.4) Number of quadratic pyramids: 0

===========================================================================

Please set this property to avoid neg. jacobians
Screenshot 003.png
Screenshot 003.png (2.88 KiB) Viewed 1205 times

mesh size:
Screenshot 004.png
Screenshot 004.png (10.29 KiB) Viewed 1205 times

file (cleared mesh):
DualTaperedPushrod.ur_.FCStd
(41.24 KiB) Downloaded 39 times

used version:
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23679 (Git)
Build type: Release
Branch: master
Hash: 6b3936c8b8859f8d45a1f3e9859ef7e7bde5b271
Python version: 3.8.6
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.4.0
Locale: German/Germany (de_DE)

Gmsh 4.7.1
heda
Veteran
Posts: 1348
Joined: Sat Dec 12, 2015 5:49 pm

Re: FEM Workbench - No mesh generated even though there are no errors

Post by heda »

was going to say that it does not seem to be anything particularly wrong with the geometry itself.
gmsh can mesh the geometry - but one has to tweak the settings to get it done.

the default settings in native gmsh, on my box at least, simply is not able to handle the long inner edge of the hole in combination with the thin cross section (well it does the 1d/2d but the result is utterly useless, and it then crashes on the 3d).

when limiting element size this is circumvented (there are other ways possible as well in native gmsh).

netgen seems to do it out of the box with default settings.
andrigtmiller
Posts: 84
Joined: Wed Jan 27, 2016 5:14 pm

Re: FEM Workbench - No mesh generated even though there are no errors

Post by andrigtmiller »

I tried the setting for Second Order Linear being true, but nothing changed. I also did as you did with using 3D instead of From Shape, with the same min and max mm settings.

Still didn't work.

The only thing I see different between our two installations is you seem to have Gmsh 4.7.1, and I have 4.6.0, and of course, I'm running on Linux, and your in Windows. I wonder if the version of Gmsh is my issue?
heda
Veteran
Posts: 1348
Joined: Sat Dec 12, 2015 5:49 pm

Re: FEM Workbench - No mesh generated even though there are no errors

Post by heda »

given that gmsh seems troublesome in this case, why not try netgen, should be installable for you, at least for me it did it with one button press in native netgen (I have trouble running netgen from within fc - so I have to revert to running it native and import the meshes).
andrigtmiller
Posts: 84
Joined: Wed Jan 27, 2016 5:14 pm

Re: FEM Workbench - No mesh generated even though there are no errors

Post by andrigtmiller »

Yeah, I may try that.

Thanks for the help everyone. At least I know it's not the geometry of the part.
Post Reply