Why does FEM meshing doesn't generate volume elements in some cases

About the development of the FEM module/workbench.

Moderator: bernd

vejmarie
Posts: 542
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Why does FEM meshing doesn't generate volume elements in some cases

Postby vejmarie » Sun May 08, 2016 2:35 pm

Hi Bernd,

Enjoy your week-end ;). Solofo is a friend, he is progressing on the build on linux. He has been able to launch FreeCAD and open the RuggedPOD model. Still face some linking issue on Fem and Mesh, but we might be able to fix all of that pretty soon. When you will restart compilation do not hesitate to pull the git repo (I have pushed 2 fix related to Solofo issues).

vejmarie
User avatar
bernd
Posts: 8244
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Why does FEM meshing doesn't generate volume elements in some cases

Postby bernd » Mon May 09, 2016 5:47 am

@solofo: great so see more people getting involved :)

udates on netgen5.3.1

I used:

Code: Select all

./configure  --with-tclconfig=/usr/lib/tcl8.5 --with-tkconfig=/usr/lib/tk8.5  --with-occ  --enable-shared  --enable-nglib  CXXFLAGS=-DNGLIB_EXPORTS  CXXFLAGS="-std=gnu++11"
I changed configurescript in the regard of occt directories and libsrc/include/incvis.hpp to get find header file glu.h:

Code: Select all

$ git diff master
diff --git a/netgen-5.3.1/configure b/netgen-5.3.1/configure
index fc3bd2c..40ae3f4 100755
--- a/netgen-5.3.1/configure
+++ b/netgen-5.3.1/configure
@@ -15352,9 +15352,9 @@ fi
 
 if test a$occon = atrue ; then
 
-       OCCFLAGS="-DOCCGEOMETRY -I$occdir/inc -I/usr/local/include/opencascade"
+       OCCFLAGS="-DOCCGEOMETRY -I/usr/local/include/opencascade"
 
-       OCCLIBS="-L$occdir/lib -lTKernel -lTKGeomBase -lTKMath -lTKG2d -lTKG3d -lTKXSBase -lTKOffset -lTKFillet -lTKShHealing -lTKMesh -lTKMeshVS -lTKTopAlgo -lTKGeomAlgo -lTKBool -lTKPrim -lTKBO -lTKIGES -lTKBRep -lTKSTEPBase -lTKSTEP -lTKSTL -lTKSTEPAttr -lTKSTEP209 -lTKXDESTEP -lTKXDEIGES -lTKXCAF -lTKLCAF -lFWOSPlugin"
+       OCCLIBS="-L/usr/local/lib -lTKernel -lTKGeomBase -lTKMath -lTKG2d -lTKG3d -lTKXSBase -lTKOffset -lTKFillet -lTKShHealing -lTKMesh -lTKMeshVS -lTKTopAlgo -lTKGeomAlgo -lTKBool -lTKPrim -lTKBO -lTKIGES -lTKBRep -lTKSTEPBase -lTKSTEP -lTKSTL -lTKSTEPAttr -lTKSTEP209 -lTKXDESTEP -lTKXDEIGES -lTKXCAF -lTKLCAF -lFWOSPlugin"
 
 
 #  -lTKDCAF
diff --git a/netgen-5.3.1/libsrc/include/incvis.hpp b/netgen-5.3.1/libsrc/include/incvis.hpp
index e705a30..b95005d 100644
--- a/netgen-5.3.1/libsrc/include/incvis.hpp
+++ b/netgen-5.3.1/libsrc/include/incvis.hpp
@@ -17,7 +17,7 @@
 #    include <OpenGL/glu.h>
 #  else
 #    include <GL/gl.h>
-#    include <glu.h>
+#    include <GL/glu.h>
 #  endif

Code: Select all

Making all in nglib
make[2]: Entering directory '/home/hugo/Documents/dev/netgen/netgen-vejmarie/netgen-5.3.1/nglib'
/bin/bash ../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..  -I../libsrc/include   -DOCCGEOMETRY -I/usr/local/include/opencascade -D_OCC64 -DHAVE_IOSTREAM -DHAVE_LIMITS -DHAVE_LIMITS_H -DHAVE_IOMANIP   -std=gnu++11 -fopenmp -MT nglib.lo -MD -MP -MF .deps/nglib.Tpo -c -o nglib.lo nglib.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I../libsrc/include -DOCCGEOMETRY -I/usr/local/include/opencascade -D_OCC64 -DHAVE_IOSTREAM -DHAVE_LIMITS -DHAVE_LIMITS_H -DHAVE_IOMANIP -std=gnu++11 -fopenmp -MT nglib.lo -MD -MP -MF .deps/nglib.Tpo -c nglib.cpp  -fPIC -DPIC -o .libs/nglib.o
mv -f .deps/nglib.Tpo .deps/nglib.Plo
/bin/bash ../libtool --tag=CXX   --mode=link g++  -std=gnu++11 -fopenmp -avoid-version  -o libnglib.la -rpath /opt/netgen/lib nglib.lo ../libsrc/interface/libinterface.la ../libsrc/geom2d/libgeom2d.la ../libsrc/csg/libcsg.la ../libsrc/stlgeom/libstl.la ../libsrc/occ/libocc.la ../libsrc/meshing/libmesh.la -L/usr/local/lib -lTKernel -lTKGeomBase -lTKMath -lTKG2d -lTKG3d -lTKXSBase -lTKOffset -lTKFillet -lTKShHealing -lTKMesh -lTKMeshVS -lTKTopAlgo -lTKGeomAlgo -lTKBool -lTKPrim -lTKBO -lTKIGES -lTKBRep -lTKSTEPBase -lTKSTEP -lTKSTL -lTKSTEPAttr -lTKSTEP209 -lTKXDESTEP -lTKXDEIGES -lTKXCAF -lTKLCAF -lFWOSPlugin  
libtool: link: g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.9/crtbeginS.o  .libs/nglib.o   -Wl,-rpath -Wl,/home/hugo/Documents/dev/netgen/netgen-vejmarie/netgen-5.3.1/libsrc/interface/.libs -Wl,-rpath -Wl,/home/hugo/Documents/dev/netgen/netgen-vejmarie/netgen-5.3.1/libsrc/geom2d/.libs -Wl,-rpath -Wl,/home/hugo/Documents/dev/netgen/netgen-vejmarie/netgen-5.3.1/libsrc/csg/.libs -Wl,-rpath -Wl,/home/hugo/Documents/dev/netgen/netgen-vejmarie/netgen-5.3.1/libsrc/stlgeom/.libs -Wl,-rpath -Wl,/home/hugo/Documents/dev/netgen/netgen-vejmarie/netgen-5.3.1/libsrc/occ/.libs -Wl,-rpath -Wl,/home/hugo/Documents/dev/netgen/netgen-vejmarie/netgen-5.3.1/libsrc/meshing/.libs -Wl,-rpath -Wl,/opt/netgen/lib ../libsrc/interface/.libs/libinterface.so ../libsrc/geom2d/.libs/libgeom2d.so ../libsrc/csg/.libs/libcsg.so ../libsrc/stlgeom/.libs/libstl.so ../libsrc/occ/.libs/libocc.so ../libsrc/meshing/.libs/libmesh.so -L/usr/local/lib -lTKernel -lTKGeomBase -lTKMath -lTKG2d -lTKG3d -lTKXSBase -lTKOffset -lTKFillet -lTKShHealing -lTKMesh -lTKMeshVS -lTKTopAlgo -lTKGeomAlgo -lTKBool -lTKPrim -lTKBO -lTKIGES -lTKBRep -lTKSTEPBase -lTKSTEP -lTKSTL -lTKSTEPAttr -lTKSTEP209 -lTKXDESTEP -lTKXDEIGES -lTKXCAF -lTKLCAF -lFWOSPlugin -L/usr/lib/gcc/x86_64-linux-gnu/4.9 -L/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.9/../../.. -lstdc++ -lm -lgomp -lpthread -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/4.9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crtn.o  -fopenmp   -fopenmp -Wl,-soname -Wl,libnglib.so -o .libs/libnglib.so
libtool: link: ( cd ".libs" && rm -f "libnglib.la" && ln -s "../libnglib.la" "libnglib.la" )
g++ -DHAVE_CONFIG_H -I. -I..  -I../libsrc/include   -DOCCGEOMETRY -I/usr/local/include/opencascade -D_OCC64 -DHAVE_IOSTREAM -DHAVE_LIMITS -DHAVE_LIMITS_H -DHAVE_IOMANIP   -std=gnu++11 -fopenmp -MT ng_vol.o -MD -MP -MF .deps/ng_vol.Tpo -c -o ng_vol.o ng_vol.cpp
mv -f .deps/ng_vol.Tpo .deps/ng_vol.Po
/bin/bash ../libtool --tag=CXX   --mode=link g++  -std=gnu++11 -fopenmp   -o ng_vol ng_vol.o libnglib.la ../libsrc/interface/libinterface.la ../libsrc/geom2d/libgeom2d.la ../libsrc/csg/libcsg.la ../libsrc/stlgeom/libstl.la ../libsrc/occ/libocc.la ../libsrc/meshing/libmesh.la -L/usr/local/lib -lTKernel -lTKGeomBase -lTKMath -lTKG2d -lTKG3d -lTKXSBase -lTKOffset -lTKFillet -lTKShHealing -lTKMesh -lTKMeshVS -lTKTopAlgo -lTKGeomAlgo -lTKBool -lTKPrim -lTKBO -lTKIGES -lTKBRep -lTKSTEPBase -lTKSTEP -lTKSTL -lTKSTEPAttr -lTKSTEP209 -lTKXDESTEP -lTKXDEIGES -lTKXCAF -lTKLCAF -lFWOSPlugin  
libtool: link: g++ -std=gnu++11 -fopenmp -o .libs/ng_vol ng_vol.o  ./.libs/libnglib.so ../libsrc/interface/.libs/libinterface.so ../libsrc/geom2d/.libs/libgeom2d.so ../libsrc/csg/.libs/libcsg.so ../libsrc/stlgeom/.libs/libstl.so ../libsrc/occ/.libs/libocc.so ../libsrc/meshing/.libs/libmesh.so -L/usr/local/lib -lTKernel -lTKGeomBase -lTKMath -lTKG2d -lTKG3d -lTKXSBase -lTKOffset -lTKFillet -lTKShHealing -lTKMesh -lTKMeshVS -lTKTopAlgo -lTKGeomAlgo -lTKBool -lTKPrim -lTKBO -lTKIGES -lTKBRep -lTKSTEPBase -lTKSTEP -lTKSTL -lTKSTEPAttr -lTKSTEP209 -lTKXDESTEP -lTKXDEIGES -lTKXCAF -lTKLCAF -lFWOSPlugin -fopenmp -Wl,-rpath -Wl,/opt/netgen/lib
../libsrc/occ/.libs/libocc.so: undefined reference to `IGESCAFControl_Reader::IGESCAFControl_Reader()'
../libsrc/occ/.libs/libocc.so: undefined reference to `IGESCAFControl_Reader::SetColorMode(unsigned int)'
collect2: error: ld returned 1 exit status
Makefile:460: recipe for target 'ng_vol' failed
make[2]: *** [ng_vol] Error 1
make[2]: Leaving directory '/home/hugo/Documents/dev/netgen/netgen-vejmarie/netgen-5.3.1/nglib'
Makefile:354: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/hugo/Documents/dev/netgen/netgen-vejmarie/netgen-5.3.1'
Makefile:285: recipe for target 'all' failed
make: *** [all] Error 2
User avatar
bernd
Posts: 8244
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Why does FEM meshing doesn't generate volume elements in some cases

Postby bernd » Mon May 09, 2016 6:21 am

Code: Select all

libtool: link: g++ -std=gnu++11 -fopenmp -o .libs/ng_vol ng_vol.o  ./.libs/libnglib.so ../libsrc/interface/.libs/libinterface.so ../libsrc/geom2d/.libs/libgeom2d.so ../libsrc/csg/.libs/libcsg.so ../libsrc/stlgeom/.libs/libstl.so ../libsrc/occ/.libs/libocc.so ../libsrc/meshing/.libs/libmesh.so -L/usr/local/lib -lTKernel -lTKGeomBase -lTKMath -lTKG2d -lTKG3d -lTKXSBase -lTKOffset -lTKFillet -lTKShHealing -lTKMesh -lTKMeshVS -lTKTopAlgo -lTKGeomAlgo -lTKBool -lTKPrim -lTKBO -lTKIGES -lTKBRep -lTKSTEPBase -lTKSTEP -lTKSTL -lTKSTEPAttr -lTKSTEP209 -lTKXDESTEP -lTKXDEIGES -lTKXCAF -lTKLCAF -lFWOSPlugin -fopenmp -Wl,-rpath -Wl,/opt/netgen/lib
I'm just trying to find where the /opt/netgen/ comes from. I've never ever used the /opt on my machine :) . I may should but I have not :shock:

EDIT:
commented in configure script:
#ac_default_prefix="/opt/netgen"

it's compiling ...
User avatar
bernd
Posts: 8244
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Why does FEM meshing doesn't generate volume elements in some cases

Postby bernd » Mon May 09, 2016 6:29 am

no still an undefined reference on netgen 5.3.1 ...

Code: Select all

libtool: link: ( cd ".libs" && rm -f "libnglib.la" && ln -s "../libnglib.la" "libnglib.la" )
g++ -DHAVE_CONFIG_H -I. -I..  -I../libsrc/include   -DOCCGEOMETRY -I/usr/local/include/opencascade -D_OCC64 -DHAVE_IOSTREAM -DHAVE_LIMITS -DHAVE_LIMITS_H -DHAVE_IOMANIP   -std=gnu++11 -fopenmp -MT ng_vol.o -MD -MP -MF .deps/ng_vol.Tpo -c -o ng_vol.o ng_vol.cpp
mv -f .deps/ng_vol.Tpo .deps/ng_vol.Po
/bin/bash ../libtool --tag=CXX   --mode=link g++  -std=gnu++11 -fopenmp   -o ng_vol ng_vol.o libnglib.la ../libsrc/interface/libinterface.la ../libsrc/geom2d/libgeom2d.la ../libsrc/csg/libcsg.la ../libsrc/stlgeom/libstl.la ../libsrc/occ/libocc.la ../libsrc/meshing/libmesh.la -L/usr/local/lib -lTKernel -lTKGeomBase -lTKMath -lTKG2d -lTKG3d -lTKXSBase -lTKOffset -lTKFillet -lTKShHealing -lTKMesh -lTKMeshVS -lTKTopAlgo -lTKGeomAlgo -lTKBool -lTKPrim -lTKBO -lTKIGES -lTKBRep -lTKSTEPBase -lTKSTEP -lTKSTL -lTKSTEPAttr -lTKSTEP209 -lTKXDESTEP -lTKXDEIGES -lTKXCAF -lTKLCAF -lFWOSPlugin  
libtool: link: g++ -std=gnu++11 -fopenmp -o .libs/ng_vol ng_vol.o  ./.libs/libnglib.so ../libsrc/interface/.libs/libinterface.so ../libsrc/geom2d/.libs/libgeom2d.so ../libsrc/csg/.libs/libcsg.so ../libsrc/stlgeom/.libs/libstl.so ../libsrc/occ/.libs/libocc.so ../libsrc/meshing/.libs/libmesh.so -L/usr/local/lib -lTKernel -lTKGeomBase -lTKMath -lTKG2d -lTKG3d -lTKXSBase -lTKOffset -lTKFillet -lTKShHealing -lTKMesh -lTKMeshVS -lTKTopAlgo -lTKGeomAlgo -lTKBool -lTKPrim -lTKBO -lTKIGES -lTKBRep -lTKSTEPBase -lTKSTEP -lTKSTL -lTKSTEPAttr -lTKSTEP209 -lTKXDESTEP -lTKXDEIGES -lTKXCAF -lTKLCAF -lFWOSPlugin -fopenmp
../libsrc/occ/.libs/libocc.so: undefined reference to `IGESCAFControl_Reader::IGESCAFControl_Reader()'
../libsrc/occ/.libs/libocc.so: undefined reference to `IGESCAFControl_Reader::SetColorMode(unsigned int)'
collect2: error: ld returned 1 exit status
Makefile:460: recipe for target 'ng_vol' failed
make[2]: *** [ng_vol] Error 1
make[2]: Leaving directory '/home/hugo/Documents/dev/netgen/netgen-vejmarie/netgen-5.3.1/nglib'
Makefile:354: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/hugo/Documents/dev/netgen/netgen-vejmarie/netgen-5.3.1'
Makefile:285: recipe for target 'all' failed
make: *** [all] Error 2
hugo@weide:~/Documents/dev/netgen/netgen-vejmarie/netgen-5.3.1$
Last edited by bernd on Mon May 09, 2016 6:33 am, edited 1 time in total.
User avatar
bernd
Posts: 8244
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Why does FEM meshing doesn't generate volume elements in some cases

Postby bernd » Mon May 09, 2016 6:32 am

vejmarie wrote:I have pushed 2 fix related to Solofo issues
recompiled your updated FreeCAD occt7.0.0 without netgen. See the really small changes I had to make on cmakes
https://github.com/berndhahnebach/FreeC ... 700569149e

But still on changing to Part or Fem ...
first time:

Code: Select all

/home/hugo/Documents/dev/freecad/freecadbhb_vejmarie/build/Mod/Part/Part.so: undefined symbol: _ZNK18IGESControl_Writer5ModelEv
second time:

Code: Select all

segmentation fault
bernd
vejmarie
Posts: 542
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Why does FEM meshing doesn't generate volume elements in some cases

Postby vejmarie » Mon May 09, 2016 11:24 am

I am building a vagrant provisioning script out of debian/jessie64, so it might be helpfull to you guys ;) Stay tune it shall be available during the night
vejmarie
Posts: 542
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Why does FEM meshing doesn't generate volume elements in some cases

Postby vejmarie » Mon May 09, 2016 12:30 pm

Good news guys, I have been able to recompile the stuff under linux with everything which works. I will publish a vagrant file tonight as to help you, but the run has been made on a fresh Debian/Jessie64 running under VirtualBox ...

So you shall be able to make it work. I have published a few fix on my git, just re-pull it. Other things, I have installed all the libraries within there STANDARD destination directory (like /usr/local), and copied netgen source tree into /usr/share/netgen as the FindNETGEN.cmake is looking for that directory even if it is strange ;)

Here a quick screenshot !
FreeCADLinux.png
FreeCADLinux.png (514.31 KiB) Viewed 961 times
User avatar
bernd
Posts: 8244
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Why does FEM meshing doesn't generate volume elements in some cases

Postby bernd » Mon May 09, 2016 1:48 pm

vejmarie wrote:Good news guys, I have been able to recompile the stuff under linux with everything which works. I will publish a vagrant file tonight as to help you, but the run has been made on a fresh Debian/Jessie64 running under VirtualBox ...
Wow cool ! I'm really curious! I have spent quite some time on this now ...
vejmarie
Posts: 542
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Why does FEM meshing doesn't generate volume elements in some cases

Postby vejmarie » Mon May 09, 2016 5:28 pm

@bernd, @solofo, here is the vagrant file which works

https://gist.github.com/vejmarie

You need to download the Vagrantfile and FreeCAD.sh which is the provisioning script. It does generate a working FreeCAD with OCCT 7 and new Salome version on Debian/Jessie64 vagrant box.

Enjoy, just let me know if you have any issues !

vejmarie
solofo
Posts: 5
Joined: Sat May 07, 2016 7:01 pm

Re: Why does FEM meshing doesn't generate volume elements in some cases

Postby solofo » Sat May 14, 2016 12:14 pm

@vejmarie

It seems compilation with FreeCAD.sh worked :-) thanks!
Used schroot/debootstrap instead of vagrant because the build machine is already a debian (stretch/sid), so this is more lightweight than vagrant/virtualbox, and probably easier for display export.