FEM crash when trying to write calculix input file

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

FEM crash when trying to write calculix input file

Post by PrzemoF »

I guess after reading some posts that this crash is normal on linux, but just in case it's not and I'm just doing something wrong:

Code: Select all

(gdb) bt
#0  0x00007fff6ef8407a in SMDS_MeshElement::GetID() const () at /home/przemo/fedora/FreeCAD/build/lib/libSMDS.so
#1  0x00007fff741d902a in Fem::FemMesh::writeABAQUS(std::string const&) const () at /home/przemo/fedora/FreeCAD/build/Mod/Fem/Fem.so
#2  0x00007fff742038f1 in Fem::FemMeshPy::writeABAQUS(_object*) () at /home/przemo/fedora/FreeCAD/build/Mod/Fem/Fem.so
#3  0x00007fff741fcae1 in Fem::FemMeshPy::staticCallback_writeABAQUS(_object*, _object*) () at /home/przemo/fedora/FreeCAD/build/Mod/Fem/Fem.so
#4  0x00000035fc4e2a4e in PyEval_EvalFrameEx () at /lib64/libpython2.7.so.1.0
#5  0x00000035fc4e3400 in PyEval_EvalCodeEx () at /lib64/libpython2.7.so.1.0
#6  0x00000035fc46f5dc in function_call () at /lib64/libpython2.7.so.1.0
#7  0x00000035fc44a903 in PyObject_Call () at /lib64/libpython2.7.so.1.0
#8  0x00000035fc459815 in instancemethod_call () at /lib64/libpython2.7.so.1.0
#9  0x00000035fc44a903 in PyObject_Call () at /lib64/libpython2.7.so.1.0
#10 0x00000035fc4dc4c7 in PyEval_CallObjectWithKeywords () at /lib64/libpython2.7.so.1.0
#11 0x00000035f0a0e7f0 in PySide::SignalManager::callPythonMetaMethod(QMetaMethod const&, void**, _object*, bool) () at /lib64/libpyside-python2.7.so.1.2
#12 0x00000035f0a14010 in PySide::GlobalReceiverV2::qt_metacall(QMetaObject::Call, int, void**) () at /lib64/libpyside-python2.7.so.1.2
#13 0x00000035f2b9b07b in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () at /lib64/libQtCore.so.4
#14 0x00000035f4e571e2 in QAbstractButton::clicked(bool) () at /lib64/libQtGui.so.4
#15 0x00000035f4b974e3 in QAbstractButtonPrivate::emitClicked() () at /lib64/libQtGui.so.4
#16 0x00000035f4b98924 in QAbstractButtonPrivate::click() () at /lib64/libQtGui.so.4
#17 0x00000035f4b98a34 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () at /lib64/libQtGui.so.4
#18 0x00000035f481b118 in QWidget::event(QEvent*) () at /lib64/libQtGui.so.4
#19 0x00000035f47c7efc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib64/libQtGui.so.4
#20 0x00000035f47ceabf in QApplication::notify(QObject*, QEvent*) () at /lib64/libQtGui.so.4
#21 0x00007ffff75e7e47 in Gui::GUIApplication::notify(QObject*, QEvent*) () at /home/przemo/fedora/FreeCAD/build/lib/libFreeCADGui.so
#22 0x00000035f2b8616d in QCoreApplication::notifyInternal(QObject*, QEvent*) () at /lib64/libQtCore.so.4
#23 0x00000035f47ce11f in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () at /lib64/libQtGui.so.4
#24 0x00000035f4844562 in QETWidget::translateMouseEvent(_XEvent const*) () at /lib64/libQtGui.so.4
#25 0x00000035f4842f5c in QApplication::x11ProcessEvent(_XEvent*) () at /lib64/libQtGui.so.4
#26 0x00000035f486aff4 in x11EventSourceDispatch(_GSource*, int (*)(void*), void*) () at /lib64/libQtGui.so.4
#27 0x00000035e14497fb in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#28 0x00000035e1449b98 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
#29 0x00000035e1449c4c in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#30 0x00000035f2bb549e in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQtCore.so.4
#31 0x00000035f486b176 in QGuiEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQtGui.so.4
#32 0x00000035f2b84cc1 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQtCore.so.4
#33 0x00000035f2b85025 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQtCore.so.4
#34 0x00000035f2b8a709 in QCoreApplication::exec() () at /lib64/libQtCore.so.4
#35 0x00007ffff75e35cb in Gui::Application::runApplication() () at /home/przemo/fedora/FreeCAD/build/lib/libFreeCADGui.so
#36 0x0000000000408d31 in main ()
OS: Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4651 (Git)
Branch: master
Hash: 95ed26715000f90b18be5afe5db21e2e5baf925f
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 3.1.3
wmayer
Founder
Posts: 20298
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FEM crash when trying to write calculix input file

Post by wmayer »

Do you know the specification of the abaqus format? In the code when writing an abaqus file for a volume element it is expected to have 10 elements. However, there are cases where a volume only has four elements (I guess this is a tetrahedron?) but the code doesn't handle this and thus it crashes. So, my question: if a volume has less than 10 elements is it expected to be exported or skipped?
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: FEM crash when trying to write calculix input file

Post by bernd »

Netgen generates 10-node Tetrahedron.

It seams gmsh gnerates 4 node tetrahedron (http://freecadweb.org/wiki/index.php?ti ... on_element). CalculiX supports 4-node tetrahedron as well (http://www.dhondt.de/ov_calcu.htm). CalculiX uses Abaqus file format languarge.

I'm on the way over the weekend so I can not give more input on this just now.
wmayer
Founder
Posts: 20298
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FEM crash when trying to write calculix input file

Post by wmayer »

Netgen generates 10-node Tetrahedron.
This contradicts to itself. A tetrahedron has only four nodes. :ugeek:
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: FEM crash when trying to write calculix input file

Post by shoogen »

wmayer wrote:A tetrahedron has only four nodes. :ugeek:
They have more if you use higher order elements.
A Fem node is not the same as a mesh vertex (or in this subject "corner node").
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: FEM crash when trying to write calculix input file

Post by bernd »

@werner
see provided link to freecadweb
wmayer
Founder
Posts: 20298
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FEM crash when trying to write calculix input file

Post by wmayer »

On the Salome forum I have found an implementation of writing an abaqus file: http://www.salome-platform.org/forum/fo ... hread_1562

The abaqus files created by FreeCAD are these valid? Have somebody ever tried it?
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: FEM crash when trying to write calculix input file

Post by bernd »

Just checked:
netgen generates 10-node-tetrahedron
gmsh generates 4-node-tetrahedron

nodes can be highlited:

Code: Select all

Gui.ActiveDocument.Box_Mesh.HighlightedNodes = range(App.ActiveDocument.Box_Mesh.FemMesh.NodeCount)
information of the mesh

Code: Select all

App.ActiveDocument.Box_Mesh.FemMesh
see number of nodes an number of tetrahedrons

I'm gone provide abaqus format for 4-node-tetrahedron in the next post
Attachments
netgen-cube.FCStd
(4.27 KiB) Downloaded 91 times
gmsh-cube.fcstd
(37.5 KiB) Downloaded 85 times
Last edited by bernd on Sun Mar 15, 2015 9:42 am, edited 2 times in total.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: FEM crash when trying to write calculix input file

Post by bernd »

freecad code for the meshes

10-node tetrahedron:

Code: Select all

import FreeCAD, Fem
m = Fem.FemMesh()
m.addNode(0,10,0)
m.addNode(0,0,10)
m.addNode(10,0,0)
m.addNode(0,0,0)
m.addNode(0,5,5)
m.addNode(5,0,5)
m.addNode(5,5,0)
m.addNode(0,5,0)
m.addNode(0,0,5)
m.addNode(0,0,0)
m.addVolume([1,2,3,4,5,6,7,8,9,10])
Fem.show(m)
and

4-node-tetrahedron

Code: Select all

import FreeCAD, Fem
m = Fem.FemMesh()
m.addNode(0,10,0)
m.addNode(0,0,10)
m.addNode(10,0,0)
m.addNode(0,0,0)
m.addVolume([1,2,3,4])
Fem.show(m)
attached the FreeCAD files which includes mesh and analysis

The abaqus format which is written by writeAbaqus() should be for:
10-node tetrahedron (current implementation of writeAbaqus):

Code: Select all

*Node , NSET=Nall
1,0,10,0
2,0,0,10
3,10,0,0
4,0,0,0
5,0,5,5
6,5,0,5
7,5,5,0
8,0,5,0
9,0,0,5
10,0,0,0
*Element, TYPE=C3D10, ELSET=Eall
1,2,1,3,4,5,7,6,9,8,10,
4-node-tetrahedron
http://web.mit.edu/calculix_v2.7/Calcul ... ode32.html

Code: Select all

*Node , NSET=Nall
1,0,10,0
2,0,0,10
3,10,0,0
4,0,0,0
*Element, TYPE=C3D4, ELSET=Eall
1,2,1,3,4,
attached both input files from freecad and the CalculiX abaqusfiles the 10 is generated by current freecad master, the 4-node was edited by myself

may be writeAbaqus() is not the best name, because writeAbaqus() writes a 10-node-tetrahedron in Abaqus-Format, but there will be lots of different elementtypes which will be written from FreeCAD in Abaqus-Format in the future (hopefully ;) ).

zip has to be deleted in file name
Attachments
10-node-tetrahedron-netgen.inp.zip
(1.63 KiB) Downloaded 111 times
10-node-tetrahedron-netgen.fcstd
(4.72 KiB) Downloaded 82 times
4-node-tetrahedron-netgen.inp.zip
(1.55 KiB) Downloaded 118 times
4-node-tetrahedron-gmsh.fcstd
(4.65 KiB) Downloaded 86 times
Post Reply