netgen (6.2)

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

netgen (6.2)

Post by looo »

Just had a look at the netgen commits [1], and saw the fixes from @vejmarie [2] and @wmayer are in the master branch. There are also many other changes so building with the latest netgen-master will be quite challenging, and maybe we have to send them some patches again :D

Anyway, good to know there is some kind of interaction between these projects.

reference:
[1] https://sourceforge.net/p/netgen-mesher ... it_browser
[2] https://github.com/vejmarie/netgen_5.3. ... dab525327a

can't find the forum-topics regarding this fixes.
Last edited by looo on Thu Feb 23, 2017 2:56 pm, edited 1 time in total.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: netgen (6.2)

Post by looo »

nearly worked out of the box. https://github.com/looooo/netgen/commit ... ec0c7e7520
I used this script to build netgen: https://github.com/looooo/FreeCAD_Conda ... n/build.sh

FindNetgen from FreeCAD needs the mydefs.hpp file. But in netgen this is called config.h. So some renaming has to be done after building. This is done at the end of the script. Also the headers were not properly copied with cmake, so I did this manually.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: netgen (6.2)

Post by looo »

the pybind11 bindings are working, and it's possible to interact with netgen via python. But I have only tested with python3.
netgen.png
netgen.png (54.16 KiB) Viewed 1916 times
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: netgen (6.2)

Post by looo »

with newer builds I now get a crash on creating a fem-mesh. I don't know what the source of the error is.

Code: Select all

#0  0x00007fff5fa443bf in netgen::Delaunay1(netgen::Mesh&, netgen::MeshingParameters const&, netgen::AdFront3*, netgen::Array<netgen::DelaunayTet, 0, int>&, int, netgen::DelaunayTet&, netgen::Point3d&, netgen::Point3d&) ()
   from ~/miniconda3/envs/freecad/lib/././libmesh.so
#1  0x00007fff5fa453a0 in netgen::Meshing3::Delaunay(netgen::Mesh&, int, netgen::MeshingParameters const&) ()
   from ~/miniconda3/envs/freecad/lib/././libmesh.so
#2  0x00007fff5fa9fa49 in netgen::MeshVolume(netgen::MeshingParameters&, netgen::Mesh&) ()
   from ~/miniconda3/envs/freecad/lib/././libmesh.so
#3  0x00007fff5f711377 in netgen::OCCGenerateMesh(netgen::OCCGeometry&, std::shared_ptr<netgen::Mesh>&, netgen::MeshingParameters&) ()
   from ~/miniconda3/envs/freecad/lib/././libocc.so
#4  0x00007fff675b06e9 in NETGENPlugin_Mesher::Compute() () from ~/miniconda3/envs/freecad/lib/./libNETGENPlugin.so
#5  0x00007fff67886a14 in Fem::FemMeshShapeNetgenObject::execute() () from ~/miniconda3/envs/freecad/lib/Fem.so
ian.rees
Posts: 696
Joined: Sun Jun 15, 2014 3:28 am
Contact:

Re: netgen (6.2)

Post by ian.rees »

Interesting, how much work do you think it would be switch FreeCAD's use of nglib 5.x to netgen 6? nglib is a pain to maintain. -Ian-
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: netgen (6.2)

Post by looo »

ian.res wrote:Interesting, how much work do you think it would be switch FreeCAD's use of nglib 5.x to netgen 6? nglib is a pain to maintain. -Ian-
As far as I know freecad uses netgen only to create shell meshes (mesh-wb) and volume-meshes (fem-wb). These two functions are working for me with conda, python3, netgen6.2, occt7.1. (The problem I have posted above wasn't related to freecad. I think it was related to some processor-optimization-differences and avx.)

FreeCAD should definitely work with the latest netgen. But as there isn't any official release of 6.2, it's maybe better to wait...

There were also some messages about updating pythonocc-smesh to netgen6.2:
https://github.com/tpaviot/pythonocc-core/issues/403
ian.rees
Posts: 696
Joined: Sun Jun 15, 2014 3:28 am
Contact:

Re: netgen (6.2)

Post by ian.rees »

Ahh, good to know. I suppose we should add netgen 6 support+upgrade to our MacOS TODO list then :). Thanks! -Ian-
Post Reply