Stress Result in Shells

About the development of the FEM module/workbench.

Moderator: bernd

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

Re: Stress Result in Shells

Postby bernd » Sun Mar 25, 2018 9:25 pm

related issue #2873 in case of the reason of the renumbering.
UR_
Posts: 734
Joined: Tue Jan 03, 2017 8:42 pm

Re: Stress Result in Shells

Postby UR_ » Sun Mar 25, 2018 9:32 pm

I think, vtk isn't the problem at 1st place.
Please run ccx and generate a new Calculix_static_results object.
Have a look at plot of max principal stresses. They are looking good.
But after saving and reloading, same plot looks weird. :shock:

EDIT: exporting "weird" looking result object to vtk, looks good in paraview ;)


Maybe heap corruption is done while producing result object.
With saving and reloading bad allocs are cleaned out.
Unfortunately vtk runs into this mess if done otherwise.
User avatar
HarryvL
Posts: 783
Joined: Sat Jan 06, 2018 7:38 pm

Re: Stress Result in Shells

Postby HarryvL » Mon Mar 26, 2018 12:58 am

bernd wrote:
Sun Mar 25, 2018 8:28 pm
it chrashes here too.

BUT there is a workaround. Export the result to vtk file and import the vtk file as vtk pipline (or use the exported vtk file in paraview) will work :D

Neverless I will have a look at the crash.

bernd
If I re-run my original file (posted earlier) and try to export the Result as VTK then FC crashes. No different from trying to create a VTK Pipeline
User avatar
HarryvL
Posts: 783
Joined: Sat Jan 06, 2018 7:38 pm

Re: Stress Result in Shells

Postby HarryvL » Mon Mar 26, 2018 1:27 am

bernd wrote:
Sun Mar 25, 2018 8:37 pm
would you guys do my a favor an try this ...

- load file https://forum.freecadweb.org/download/file.php?id=55290
- recalculate the analysis
- save the file
- close the file
- reopen the file
- create a vtk pipeline from the result object
- it works :o :shock: at least it does for me :mrgreen:
This indeed doesn't crash, but the results are wrong:

Test56_Bernd_PS_Max.png
Test56_Bernd_PS_Max.png (439.59 KiB) Viewed 333 times

Then closing and opening the CalculiX_static_results object again, FreeCAD started to misbehave. :twisted: Part of the model was gone and zooming out to fit on screen did not work (froze for a while and came back with an empty screen). Could there be something wrong with an array index - trying to access beyond array bounds?
User avatar
HarryvL
Posts: 783
Joined: Sat Jan 06, 2018 7:38 pm

Re: Stress Result in Shells

Postby HarryvL » Mon Mar 26, 2018 1:38 am

Here an example of mis-behaviour:

Test56_Bernd_Misbehaving.png
Test56_Bernd_Misbehaving.png (208.8 KiB) Viewed 330 times
User avatar
bernd
Posts: 6892
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Stress Result in Shells

Postby bernd » Mon Mar 26, 2018 7:43 am

the resultmesh is renumbered at save and reload, but the node numbers attribute in result object has still the old not renumbered numbers ...
User avatar
bernd
Posts: 6892
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Stress Result in Shells

Postby bernd » Wed Mar 28, 2018 5:36 pm

Poisson ratio fix is in master. git commit 8717edb98
User avatar
bernd
Posts: 6892
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Stress Result in Shells

Postby bernd » Wed Mar 28, 2018 5:37 pm

To export to vtk or to create a vtk pipeline the mesh nodes should not have gaps. Attached simple mesh will crash freecad:

Code: Select all

import Fem
path = '/home/hugo/Desktop/'

nodes = Fem.FemMesh()
nodes.addNode( 0,  0, 0, 1)
nodes.addNode( 6, 12, 0, 3)
nodes.write(path + 'nodes.vtk')


https://github.com/FreeCAD/FreeCAD/blob ... #L446-L455



OS: Debian GNU/Linux 9.4 (stretch)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13470 (Git)
Build type: Debug
Branch: master
Hash: 656a669cb0dc3d2d3becf20a5330531233b56834
Python version: 2.7.13
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0
Locale: German/Switzerland (de_CH)
wmayer
Site Admin
Posts: 13608
Joined: Thu Feb 19, 2009 10:32 am

Re: Stress Result in Shells

Postby wmayer » Sun Apr 01, 2018 4:03 pm

I can confirm the crash but I have no idea why. It happens inside exportFemMeshFaces where it tries to destroy the grid. However, the ref counter is set to three at this point and it shouldn't try to delete it.
User avatar
bernd
Posts: 6892
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Stress Result in Shells

Postby bernd » Tue Apr 03, 2018 3:55 pm

wmayer wrote:
Sun Apr 01, 2018 4:03 pm
I can confirm the crash but I have no idea why. It happens inside exportFemMeshFaces where it tries to destroy the grid. However, the ref counter is set to three at this point and it shouldn't try to delete it.
It somehow seams to crash here: https://github.com/FreeCAD/FreeCAD/blob ... s.cpp#L453 If all other following code in exportVTKMesh() is commented ( this one: https://github.com/FreeCAD/FreeCAD/blob ... #L455-L461 ) FreeCAD still crashes ...

https://github.com/berndhahnebach/FreeC ... fb6934c967