Page 1 of 4
Principal Stress Plots
Posted: Mon Jun 13, 2022 8:08 am
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 (99.45 KiB) Viewed 2319 times
- Block.png (78.6 KiB) Viewed 2319 times
- Plate.png (269.87 KiB) Viewed 2319 times
My biggest challenge is how to generate a pull request to get this into FC0.20
Re: Principal Stress Plots
Posted: Mon Jun 13, 2022 8:23 am
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 ?
Re: Principal Stress Plots
Posted: Mon Jun 13, 2022 9:29 am
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:
Re: Principal Stress Plots
Posted: Mon Jun 13, 2022 9:36 am
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.
Re: Principal Stress Plots
Posted: Mon Jun 13, 2022 9:42 am
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?
Re: Principal Stress Plots
Posted: Mon Jun 13, 2022 9:54 am
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.
Re: Principal Stress Plots
Posted: Mon Jun 13, 2022 12:31 pm
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?
Re: Principal Stress Plots
Posted: Mon Jun 13, 2022 2:26 pm
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
Re: Principal Stress Plots
Posted: Mon Jun 13, 2022 3:07 pm
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.
Re: Principal Stress Plots
Posted: Mon Jun 13, 2022 3:18 pm
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";