Principal Stress Plots

About the development of the FEM module/workbench.

Moderator: bernd

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

Principal Stress Plots

Post by HarryvL »

I saw a few posts (can't locate them anymore) where people struggled to plot principal stress directions and magnitude (i.e. line vectors) in ParaView. This is a regression, because it worked back in 2019.

I managed to fix the problem (irrespective of material), as shown below:

Beam.png
Beam.png (99.45 KiB) Viewed 2316 times
Block.png
Block.png (78.6 KiB) Viewed 2316 times
Plate.png
Plate.png (269.87 KiB) Viewed 2316 times

My biggest challenge is how to generate a pull request to get this into FC0.20
User avatar
NewJoker
Veteran
Posts: 3014
Joined: Sun Oct 11, 2020 7:49 pm

Re: Principal Stress Plots

Post by NewJoker »

HarryvL wrote: Mon Jun 13, 2022 8:08 am My biggest challenge is how to generate a pull request to get this into FC0.20
Do you have a GitHub account ? If not, I will try to create a PR if you can send me the code.

@uwestoehr Would it be possible to merge this today before the release ?
User avatar
HarryvL
Veteran
Posts: 1283
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Principal Stress Plots

Post by HarryvL »

I do have an account, but merging etc. before the pull request would cost me all day, so herewith the two affected files:
FemVTKTools.cpp
(41.48 KiB) Downloaded 49 times
resulttools.py
(27.11 KiB) Downloaded 44 times
User avatar
NewJoker
Veteran
Posts: 3014
Joined: Sun Oct 11, 2020 7:49 pm

Re: Principal Stress Plots

Post by NewJoker »

HarryvL wrote: Mon Jun 13, 2022 9:29 am I do have an account, but merging etc. before the pull request would cost me all day, so herewith the two affected files:
Some time ago I made a small PR by editing the file directly on GitHub. It saved me a lot of time. I will try to do it here as well.
User avatar
HarryvL
Veteran
Posts: 1283
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Principal Stress Plots

Post by HarryvL »

NewJoker wrote: Mon Jun 13, 2022 9:36 am
HarryvL wrote: Mon Jun 13, 2022 9:29 am I do have an account, but merging etc. before the pull request would cost me all day, so herewith the two affected files:
Some time ago I made a small PR by editing the file directly on GitHub. It saved me a lot of time. I will try to do it here as well.
Do you know what parts to change in both files?
User avatar
NewJoker
Veteran
Posts: 3014
Joined: Sun Oct 11, 2020 7:49 pm

Re: Principal Stress Plots

Post by NewJoker »

HarryvL wrote: Mon Jun 13, 2022 9:42 am Do you know what parts to change in both files?
Yes, I compared your files with original ones using Compare plug-in in Notepad++. I made the changes and sent two PRs. Hopefully, they will be accepted.
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 Jun 13, 2022 9:29 am I do have an account, but merging etc. before the pull request would cost me all day, so herewith the two affected files:

FemVTKTools.cpp

resulttools.py
thanks!

before I can merge, I need more info:

- why did you delete 3 stresses in FemVTKTools.cpp: https://github.com/FreeCAD/FreeCAD/pull ... 128f50d576
(Why do they harm and are not necessary?)

- in resulttools.py you changed
calculate_principal_stress_reinforced
to
calculate_principal_stress
(https://github.com/FreeCAD/FreeCAD/pull ... s/935b0c1a)
Are you sure this has no negative side effect on simulations for reinforced concrete etc?
User avatar
HarryvL
Veteran
Posts: 1283
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Principal Stress Plots

Post by HarryvL »

1) I moved the three stresses up to the vector section, because that’s what they are and that’s what you need to display them in ParaView.
2) I wrote the concrete routines and am convinced that this works. Actually, the old concrete routine is now used for all materials and I just renamed it by dropping “concrete” in the name.

Thanks. Harry
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 Jun 13, 2022 2:26 pm 1) I moved the three stresses up to the vector section, because that’s what they are and that’s what you need to display them in ParaView.
Thanks. However, I don't see a movement, only 3 lines were deleted. Therefore I am asking.
User avatar
HarryvL
Veteran
Posts: 1283
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Principal Stress Plots

Post by HarryvL »

That's not right then. See my above file and below:

Code: Select all

 std::map<std::string, std::string> _getFreeCADMechResultVectorProperties() {
    // see src/Mod/Fem/femobjects/_FemResultMechanical
    // App::PropertyVectorList will be a list of vectors in vtk
    std::map<std::string, std::string> resFCVecProp;
    resFCVecProp["DisplacementVectors"] = "Displacement";
    // the following three are filled only if there is a reinforced mat object
    // https://forum.freecadweb.org/viewtopic.php?f=18&t=33106&start=70#p296317
    // https://forum.freecadweb.org/viewtopic.php?f=18&t=33106&p=416006#p412800
    resFCVecProp["PS1Vector"] = "Major Principal Stress";
    resFCVecProp["PS2Vector"] = "Intermediate Principal Stress";
    resFCVecProp["PS3Vector"] = "Minor Principal Stress";
Post Reply