Export Von Mises strees values result

About the development of the FEM module/workbench.

Moderator: bernd

JV_3D
Posts: 41
Joined: Fri Dec 23, 2016 4:45 am

Export Von Mises strees values result

Postby JV_3D » Sat Aug 19, 2017 7:47 am

Hello forum users

I am experimenting with FEM analysis and I see the when an analysis finished and before showing the result there is a property in the Property view that correspond to 'Stress values, but there is no way to open or export this values, I used ctrl+c but when pasting in notepad is only the first values.

Is there an export option to excel, notepad? I am guessing since the software is already showing the values they are somewhere already saved. I need the list of value since I got a model with a singularity so I need to analyze the rest of the stress values.

Thank you so much for the help
UR_
Posts: 1198
Joined: Tue Jan 03, 2017 8:42 pm

Re: Export Von Mises strees values result

Postby UR_ » Sun Aug 20, 2017 4:20 pm

JV_3D wrote:
Sat Aug 19, 2017 7:47 am
Is there an export option to excel
Hello JV_3D,
ccx writes some output, but there are only stress components like Sxx, Syy, Szz, Sxy, Sxz, and Syz available.
If you run 3D-example from FreeCAD's startpage, ccx will generate a .dat and a .frd result file.

The location of these files can be appointed here:
working folder.png
working folder.png (9.93 KiB) Viewed 1252 times

If you need derived stresses (e. g. vMises) you can translate the .frd file to .vtk using this tiny utility
https://forum.freecadweb.org/viewtopic. ... 10#p184850

Resulting .vtk-file is a human readable ascii file and therefore can be imported into excel or libreoffice by their standard text import filter.

Above mentioned example will then look like this:
Screenshot LibreOffice.png
Screenshot LibreOffice.png (18.08 KiB) Viewed 1252 times
I added a MIN/MAX filter so you see same values as in property window.
JV_3D
Posts: 41
Joined: Fri Dec 23, 2016 4:45 am

Re: Export Von Mises strees values result

Postby JV_3D » Wed Aug 23, 2017 1:38 am

UR_ wrote:
Sun Aug 20, 2017 4:20 pm
JV_3D wrote:
Sat Aug 19, 2017 7:47 am
Is there an export option to excel
Hello JV_3D,
ccx writes some output, but there are only stress components like Sxx, Syy, Szz, Sxy, Sxz, and Syz available.
If you run 3D-example from FreeCAD's startpage, ccx will generate a .dat and a .frd result file.

The location of these files can be appointed here:
working folder.png


If you need derived stresses (e. g. vMises) you can translate the .frd file to .vtk using this tiny utility
https://forum.freecadweb.org/viewtopic. ... 10#p184850

Resulting .vtk-file is a human readable ascii file and therefore can be imported into excel or libreoffice by their standard text import filter.

Above mentioned example will then look like this:
Screenshot LibreOffice.png

I added a MIN/MAX filter so you see same values as in property window.
Wow, great answer, this is what I need, but I do not if the app does not work, I opened it but it state only "press Enter" and nothing happend, the other links in the forum download zip file that contain .cs file, how one can use this type of files? What am I missing?
Thanks however for the answer I will check options/alternatives to convert .fdr files to .vtk (although first time I heard this type of files :oops: )

EDIT:

Ok, I figured out, now I can check the vtk output file and open it with Excel, however I do not find the VMises result as in the image you uploaded, I find Stress Sxx, Syy, Szz, Sxy, Syz, Szx all of them state 'double' but there is no output for VMises. Finding the maximum value is lower that the one FreeCAD shows

2nd EDIT:
Sorry for various edits, I already find the solution I was looking for. For every other newbie out there, this is the process:
1) Go to the thread UR_ posted, and download the file named 'ccxfrd2vtk' by the same user
2) Extract all the file
3) Run an analysis in FreeCAD and copy the .frd file from the Temp folder (default) or the folder you defined for the Calculix analysis
3) Paste the .frd file in to the 'ccxfrd2vtk\bin\Release' path folder
4) Drag and release the .frd to the 'mmh_ccx2vtk' file, wait to the end and close the command window
5) You will obtain the desired .vtk file
6) Use notepad to open it, Excel/LibreOffice/WPS could work too but I find faster importing with notepad
7) Ctrl+F and type 'vmises'; there you go. Now one can and use Ctrl+Shift+End to copy all the Von Mises stress results

Thank you so much community and UR_ for this utility, very helpful
User avatar
bernd
Posts: 10973
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Export Von Mises strees values result

Postby bernd » Wed Aug 23, 2017 5:04 am

in FreeCAD:

- open 3D example from StartWB
- copy code into python console (if you are on Windwos it's fine, if you are on unix you should change the out path)
- find the file on C:/vMises.csv on windwos

Code: Select all

vmises = App.ActiveDocument.CalculiX_static_results.StressValues
nodes = App.ActiveDocument.CalculiX_static_results.NodeNumbers

# out = "/tmp/vMises.csv"  # linux
out = "C:/vMises.csv"  # windows

f = open(out, "w")

for n, i in enumerate(nodes):
    res = (str(nodes[n]) + ", " + str(vmises[i-1]))
    print(res)
    f.write(res + "\n")

f.close()
@UR_ or other with Windows and German Komma locale. Would you test this?
UR_
Posts: 1198
Joined: Tue Jan 03, 2017 8:42 pm

Re: Export Von Mises strees values result

Postby UR_ » Wed Aug 23, 2017 2:24 pm

Windows version works! :)
(point for decimal delimiter is used, even in german locale)
User avatar
bernd
Posts: 10973
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Export Von Mises strees values result

Postby bernd » Wed Aug 23, 2017 6:03 pm

UR_ wrote:
Wed Aug 23, 2017 2:24 pm
Windows version works! :)
(point for decimal delimiter is used, even in german locale)
cool, thanks for testing. I did not expect it to work especially the comma decimal delimiter :D