netgen example

About the development of the FEM module/workbench.

Moderator: bernd

reox
Posts: 666
Joined: Sat Aug 13, 2016 10:06 am
Contact:

netgen example

Postby reox » Sun Mar 24, 2019 6:10 pm

I compiled a version of FC with netgen from debian sid. The compilation worked but I have no idea if netgen works...
If I create a mesh out of a cube, I get only one tetrahedron, which is a little bit too less I guess :mrgreen:
If I set the fineness to "very fine", it creates more tetrahedra but the mesh is not complete.
gmsh on the other hand produces a complete mesh.
2019-03-24-190324_663x343_scrot.png
2019-03-24-190324_663x343_scrot.png (19.99 KiB) Viewed 789 times
Sometimes the result looks broken too, so I guess the nodes are not connected correctly:
2019-03-24-190916_453x444_scrot.png
2019-03-24-190916_453x444_scrot.png (37.1 KiB) Viewed 789 times
So the question is, is there any netgen example which should work?

As I read here https://forum.freecadweb.org/viewtopic. ... en#p285927 netgen seems to be broken at the moment.

Code: Select all

OS: Debian GNU/Linux buster/sid
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16206 (Git)
Build type: Release
Branch: master
Hash: 763c2b22fed224eae1e767de1f7b8f2f703ba683
Python version: 3.7.3rc1
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Austria (de_AT)

Code: Select all

ii  libnglib-6.2.1804:amd64 6.2.1804+dfsg1-3 amd64        Automatic 3d tetrahedral mesh generator shared library
ii  libnglib-dev            6.2.1804+dfsg1-3 amd64        Automatic 3d tetrahedral mesh generator development files
ii  netgen                  6.2.1804+dfsg1-3 amd64        Automatic 3d tetrahedral mesh generator
ii  netgen-headers          6.2.1804+dfsg1-3 amd64        Automatic 3d tetrahedral mesh generator internal headers
ii  python3-netgen          6.2.1804+dfsg1-3 amd64        Automatic 3d tetrahedral mesh generator Python 3 bindings
Attachments
netgen_test.FCStd
(9.93 KiB) Downloaded 16 times
looo
Posts: 2951
Joined: Mon Nov 11, 2013 5:29 pm

Re: netgen example

Postby looo » Sun Mar 24, 2019 7:05 pm

I remembered such problems but in my eyes it should be solved in the internal and external smesh packages. Which smesh did you use?
please help with my conda-packaging efforts: https://liberapay.com/looooo/
User avatar
bernd
Posts: 8477
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: netgen example

Postby bernd » Sun Mar 24, 2019 7:39 pm

Which netgen did you use? From where did you download the source? Which cmake command did you use to compile netgen. Which cmake command did you use to compile FreeCAD with netgen. Some weeks ago I spent hours on compiling FreeCAD with netgen on Debian Buster, no success.

If I would have some commands I may try again too.
User avatar
kkremitzki
Posts: 1795
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: netgen example

Postby kkremitzki » Sun Mar 24, 2019 7:48 pm

bernd wrote:
Sun Mar 24, 2019 7:39 pm
Which netgen did you use? From where did you download the source? Which cmake command did you use to compile netgen. Which cmake command did you use to compile FreeCAD with netgen.
He stated it was with the Netgen package from Debian Unstable which is also currently the one in Buster, so only the last question should be needed.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
User avatar
bernd
Posts: 8477
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: netgen example

Postby bernd » Sun Mar 24, 2019 9:33 pm

kkremitzki wrote:
Sun Mar 24, 2019 7:48 pm
bernd wrote:
Sun Mar 24, 2019 7:39 pm
Which netgen did you use? ...
He stated it was with the Netgen package from Debian Unstable which is also currently the one in Buster, ...
:oops:
wmayer
Site Admin
Posts: 14992
Joined: Thu Feb 19, 2009 10:32 am

Re: netgen example

Postby wmayer » Mon Mar 25, 2019 12:03 am

For me it works with:
OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16206 (Git)
Build type: Release
Branch: master
Hash: 763c2b22fed224eae1e767de1f7b8f2f703ba683
Python version: 3.7.2
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
The netgen version is 6.2.

The output of the mesh in the Python console is:
========================== Dump contents of mesh ==========================

1) Total number of nodes: 26
2) Total number of edges: 12
3) Total number of faces: 12
4) Total number of polygons: 0
5) Total number of volumes: 5
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: 12
11) Total number of quadratic faces: 12
11.1) Number of quadratic triangles: 12
11.2) Number of quadratic quadrangles: 0
12) Total number of quadratic volumes: 5
12.1) Number of quadratic hexahedrons: 0
12.2) Number of quadratic tetrahedrons: 5
12.3) Number of quadratic prisms: 0
12.4) Number of quadratic pyramids: 0

===========================================================================
Btw, the two meshes inside your projects are empty. Only when creating a new mesh with default values I get the above mesh.
reox
Posts: 666
Joined: Sat Aug 13, 2016 10:06 am
Contact:

Re: netgen example

Postby reox » Mon Mar 25, 2019 6:41 am

wmayer wrote:
Mon Mar 25, 2019 12:03 am
Btw, the two meshes inside your projects are empty. Only when creating a new mesh with default values I get the above mesh.
Ah yes, I deleted them before uploading - the usual practice, which makes no sense in this situation :oops:
bernd wrote:
Sun Mar 24, 2019 7:39 pm
Which cmake command did you use to compile FreeCAD with netgen.
I used this debian package description: https://github.com/reox/FreeCAD_gitpack ... bian/rules
Here is a script to build a daily-build from scratch: https://gist.github.com/reox/522922a1a6 ... edd484f48f
Attachments
netgen_test.FCStd
(101.08 KiB) Downloaded 15 times
User avatar
PatTropos
Posts: 4
Joined: Tue Apr 30, 2019 1:20 pm

Re: netgen example

Postby PatTropos » Fri Jun 07, 2019 8:33 am

Hi , Im pretty new to the Forum and this will be my first Question anyways. The other Issues I could find and solve mostly on my own.
I'm using Linux Mint and installed Freecad Version 0.17 and 0.18 on my Linux. Both are without Netgen in the FEM Workbench.
I found by using the forum this theme seems to be the most recent one.
How far is the progress in making Netgen avaliable for Linux Distributions (Mint) for Freecad?
I m not a programmer, so I get lost in trying to implement such things by following forum-discussions :? . Sometimes i can but in this case not.

Thank for a Hint in a promissing direction or may already a solution.

OS: Linux Mint 19.1 Tessa
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13541 (Git) AppImage
Build type: None
Branch: releases/FreeCAD-0-17
Hash: 9948ee4f1570df9216862a79705afb367b2c6ffb
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)

OS: Linux 4.15.0-20-generic
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14555 (Git shallow)
Build type: Release
Branch: (HEAD detached at 0.18.2)
Hash: dbb4cc6415bac848a294f03b80f65e888d531742
Python version: 2.7.15
Qt version: 5.12.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
User avatar
bernd
Posts: 8477
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: netgen example

Postby bernd » Fri Jun 07, 2019 2:28 pm

Netgen mesher has been available for FEM and Mesh WB for years. It is not a matter of developing, since it is developed already. It is a matter of compiling Netgen and compiling FreeCAD with Netgen.

BTW: If you really would like to work with FreeCAD FEM you should consider to word with 0.19dev version of FreeCAD.
reox
Posts: 666
Joined: Sat Aug 13, 2016 10:06 am
Contact:

Re: netgen example

Postby reox » Fri Jun 21, 2019 1:58 pm

I compiled a new version including flatmesh from the meshdesign wb. There you also have the option to create meshes with netgen.
I saw that there the mesh looks good, while in FEM, the Mesh is broken.
Which brings me back to the question: does netgen currently work in FEM?
Is this just a wrong representation of the mesh?

As wmayer said, it should work - so what is wrong with my version?

Code: Select all

OS: Debian GNU/Linux 10 (buster) (i3/i3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17089 (Git)
Build type: Release
Branch: master
Hash: d7b6d4dba9d8467886b79927ad8addb7d2fed1fa
Python version: 3.7.3
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Austria (de_AT)
netgen 6.2.1804+dfsg1-3

And I used these compiler flags: https://github.com/reox/FreeCAD_gitpack ... /rules#L11

getting this summary:

Code: Select all

==============
Summary report
==============

-- Python:              [/usr/bin/python3] [.cpython-37m-x86_64-linux-gnu]
-- PCL:                 1.9.1       
-- pybind11:            2.2.4       
-- Boost:               106700      
-- XercesC:             [/usr/lib/x86_64-linux-gnu/libxerces-c.so] [/usr/include]
-- ZLIB:                1.2.11      
-- PyCXX:               [/build/freecad-daily-0.19+git201906210013~daily/src]
-- OCC:                 7.3.0 [TKFillet;TKMesh;TKernel;TKG2d;TKG3d;TKMath;TKIGES;TKSTL;TKShHealing;TKXSBase;TKBin;TKBool;TKBO;TKCDF;TKBRep;TKTopAlgo;TKGeomAlgo;TKGeomBase;TKOffset;TKPrim;TKSTEP;TKSTEPBase;TKSTEPAttr;TKHLR;TKFeat]
-- SMESH:               build internal
--  MEDFile:            [/usr/lib/x86_64-linux-gnu/libmedC.so] [/usr/include]
--  HDF5:               1.10.4      
--  VTK:                7.1.1       
-- NETGEN:              6.2-dev [-DNO_PARALLEL_THREADS;-DOCCGEOMETRY;-DNETGEN_VERSION=393728] [] [/usr/include/netgen/include;/usr/include/netgen] [nglib] [/usr/include/netgen/include;/usr/include/netgen]
-- SWIG:                3.0.12      
-- Eigen3               3.3.7       
-- Qt5Core:             5.11.3      
-- Qt5Network:          5.11.3      
-- Qt5Xml:              5.11.3      
-- Qt5XmlPatterns:      5.11.3      
-- Qt5Widgets:          5.11.3      
-- Qt5PrintSupport:     5.11.3
-- Qt5OpenGL:           5.11.3      
-- Qt5Svg:              5.11.3      
-- Qt5UiTools:          5.11.3      
-- Qt5Concurrent:       5.11.3      
-- Qt5WebKitWidgets:    5.212.0
-- Shiboken2:           5.11.2 [/usr/lib/x86_64-linux-gnu/cmake/Shiboken2-5.11.2] [/usr/include/shiboken2]
-- PySide2:             5.11.2 [/usr/include/PySide2]
-- PySide2Tools:        [/usr/bin/pyside2-uic] [/usr/bin/pyside2-rcc]
-- Freetype:            2.9.1       
-- OpenGLU:             /usr/lib/x86_64-linux-gnu/libGLU.so [/usr/lib/x86_64-linux-gnu/libGLU.so][/usr/include]
-- Coin3D:              [/usr/lib/x86_64-linux-gnu/libCoin.so] [/usr/include]
-- SPNAV:               [/usr/lib/libspnav.so] [/usr/include]
-- Matplotlib:          3.0.2       
-- Rift:                not enabled (BUILD_VR)
-- Doxygen:             not found   
2019-06-21-155732_1181x510_scrot.png
2019-06-21-155732_1181x510_scrot.png (55.13 KiB) Viewed 457 times
Attachments
netgen_mesh.FCStd
(275.77 KiB) Downloaded 10 times