Principal Stress Plots

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
HarryvL
Veteran
Posts: 1285
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: [fixed] Principal Stress Plots

Post by HarryvL »

HarryvL wrote: Mon Jun 13, 2022 6:56 pm I can't build - have an issue with shiboken2 library.

I think the error is easy to fix by renaming method "calculate_principal_stress" to "calculate_principal_stress_reinforced" everywhere (3 locations) in resulttools.py. That or change the test to call calculate_principal_stress instead. Not elegant, but it should work. See attached:

resulttools.py
I am still convinced that the issue is with the test and not the updated code. The test should call the "calculate_principal_stress" function and not the "calculate_principal_stress_reinforced" function, which is no longer used in the updated code.

Please note: the treatment of principal stress vectors should not depend on the material used. They are the same for all materials

@bernd can you please help out?
resulttools.py
(27.14 KiB) Downloaded 45 times
User avatar
HarryvL
Veteran
Posts: 1285
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: [fixed] Principal Stress Plots

Post by HarryvL »

HarryvL wrote: Thu Aug 25, 2022 11:28 am resulttools.py
OOPS wrong attachment. Here the correct one:
resulttools(3).py
(27.11 KiB) Downloaded 58 times
User avatar
HarryvL
Veteran
Posts: 1285
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Principal Stress Plots

Post by HarryvL »

... and the reason I care is because this regression is soon coming up to its 4th birthday. This
https://forum.freecadweb.org/viewtopic. ... 00#p276076 can now not be reproduced with FC/PV
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Principal Stress Plots

Post by Kunda1 »

Maybe @uwestoehr can address this when he's back from his hiatus
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Principal Stress Plots

Post by uwestoehr »

HarryvL wrote: Thu Aug 25, 2022 12:07 pm ... and the reason I care is because this regression is soon coming up to its 4th birthday. This
https://forum.freecadweb.org/viewtopic. ... 00#p276076 can now not be reproduced with FC/PV
I cannot follow you. You said my PR fixed the issue for you, therefore I merged it. With the next weekly build (on Sunday evening I guess) you should have it included.

Taking this, what is then still not working? I need a testcase and step by step instruction on how to reproduce the issue to be able to fix it. Because I must admit, that my PR was a shot in the dark as I could not yet reproduce the issue properly or did not understand it correctly.
User avatar
HarryvL
Veteran
Posts: 1285
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Principal Stress Plots

Post by HarryvL »

I pulled and built the latest version assuming it had your fix in there. If not, then I will need to try again.

I tested your fix earlier on concrete only, which worked, but not other materials. This because you had rolled back the fix I made for all other materials. This is what the above comments relate to.

To reproduce, simply analyse a little block with load on top using CCX and export VTK of the result object. The principal stress vectors should be there, irrespective of material.
User avatar
HarryvL
Veteran
Posts: 1285
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Principal Stress Plots

Post by HarryvL »

HarryvL wrote: Fri Aug 26, 2022 1:40 am I pulled and built the latest version assuming it had your fix in there. If not, then I will need to try again.
I did some comprehensive testing and can confirm that, as expected, the current master only exports principal stress vectors for concrete.

To fix this for all materials, resulttools.py needs to be updated as per my initial post, i.e.
resulttools.py
(27.11 KiB) Downloaded 48 times
If this leads to an issue with the unit tests, then I would like to understand what causes this problem and fix that, rather than live with the incorrect export.

Castellated Beam.png
Castellated Beam.png (204.29 KiB) Viewed 1188 times
User avatar
HarryvL
Veteran
Posts: 1285
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Principal Stress Plots

Post by HarryvL »

Castellated Beam (2).png
Castellated Beam (2).png (175.66 KiB) Viewed 1174 times
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Principal Stress Plots

Post by uwestoehr »

HarryvL wrote: Mon Aug 29, 2022 12:10 pm To fix this for all materials, resulttools.py needs to be updated as per my initial post, i.e.
...
If this leads to an issue with the unit tests, then I would like to understand what causes this problem and fix that, rather than live with the incorrect export.
Thanks. Can you please also post the .diff that I can see your changes (I am currently in vacation and have no access to a development PC).

Note that I had to revert you initial fix because with it the 3 principal stresses were no longer available for "normal" analysis, meaning CCX, see
https://github.com/FreeCAD/FreeCAD/issues/7242
Can you therefore please check if your new fix does not reintroduce this?
User avatar
HarryvL
Veteran
Posts: 1285
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Principal Stress Plots

Post by HarryvL »

uwestoehr wrote: Thu Sep 01, 2022 2:56 pm Note that I had to revert you initial fix because with it the 3 principal stresses were no longer available for "normal" analysis, meaning CCX, see
https://github.com/FreeCAD/FreeCAD/issues/7242
Can you therefore please check if your new fix does not reintroduce this?
The issue you mention came from the changes in FemVTKTools.cpp. Your current version is working well and I didn't touch it anymore.

The calculation of principal stress vectors happens in resulttools.py. I changed this file to make sure that principal stress vectors are calculated for all materials. See here for the diff file (to be opened with "cat resulttools_diff.txt" for colored changes):

resulttools_diff.txt
(3.3 KiB) Downloaded 43 times
Post Reply