## missing stress values Sxy, Syz, Szy

About the development of the FEM module/workbench.

Moderator: bernd

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

### missing stress values Sxy, Syz, Szy

according issue #2918 3 stress values are missing. But we gone read them, we just do not expose them to the result obj. https://github.com/FreeCAD/FreeCAD/blob ... em.py#L260 and https://github.com/FreeCAD/FreeCAD/blob ... #L436-L437

The question is what is best used to save them in the FreeCAD result object. Here are all available properties https://www.freecadweb.org/wiki/index.p ... properties

How about the stress vectors (Sxx, Syy, Szz). It does not make sense to save them twice.

bernd
HarryvL
Posts: 1071
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

### Re: missing stress values Sxy, Syz, Szy

Bernd, storing/displaying sxx, syy, szz without sxy, szx, szy makes little sense. I would say it is either none or all.
EkaitzEsteban
Posts: 101
Joined: Wed Sep 12, 2018 1:31 pm

### Re: missing stress values Sxy, Syz, Szy

Hello!

Be careful with the shear stresses. Sxy, Syz, Szy...

Calculix .frd file contains stress components per node.
Calculix .dat file contains stress components per element.

But the order of them is different (different indexes...) !

This is discussed here...

Just as Harry says, Store all of them or none of them...
bernd
Posts: 9035
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

### Re: missing stress values Sxy, Syz, Szy

HarryvL wrote:
Mon Jan 28, 2019 5:32 pm
Bernd, storing/displaying sxx, syy, szz without sxy, szx, szy makes little sense. I would say it is either none or all.
this seams not easy there is not real aray or matrix property in FreeCAD ATM. See https://forum.freecadweb.org/viewtopic.php?f=10&t=33806
HarryvL
Posts: 1071
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

### Re: missing stress values Sxy, Syz, Szy

Bernd, I see sxx, syy and szz are stored in a FreeCAD.Vecor:

but I see no engineering-physical or code reason to do so. What use is the vecor (sxx, syy, szz)? I would therefore say that we simply store sxx, syy, szz as a list and append sxy, sxz and syz? In fact this list already exists as mode_stress[elem] in importCcxFrdResults.py (see above). What benefit would we get from storing the full stress tensor as a matrix?

Anyway, if the result object cannot handle a list of lists, then you can always store the 6 lists separately.
bernd
Posts: 9035
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

### Re: missing stress values Sxy, Syz, Szy

HarryvL wrote:
Wed Jan 30, 2019 4:38 am
but I see no engineering-physical or code reason to do so. What use is the vecor (sxx, syy, szz)?
+1 here except the vector is used at lots of other parts in FreeCAD code. All these needs to be changed.

HarryvL wrote:
Wed Jan 30, 2019 4:38 am
In fact this list already exists as mode_stress[elem] in importCcxFrdResults.py (see above).
I know, it is what is used to calculate von Mises and principal stress etc. I have some code where I store Sxy, Syz, Szy in a second FreeCAD.Vector, but I am not happy with this at all.

HarryvL wrote:
Wed Jan 30, 2019 4:38 am
What benefit would we get from storing the full stress tensor as a matrix?
good question ... One would be a small tree view for each stress in the property editor like.

HarryvL wrote:
Wed Jan 30, 2019 4:38 am
Anyway, if the result object cannot handle a list of lists, then you can always store the 6 lists separately.
might be the best to go for this, because it is easy to code. More than ever if we have in mind to extend the vkt result object and more and more use this on. There we do not have this problem. The vtk result supports scalar lists and list of lists.

How about EXY, EYZ and EZX ? We should save them too ?!?

In frd file there is furthermore some error. Does someone know what this is?

Code: Select all

``````    1PSTEP                         4           1           1
100CL  101 1.000000000         228                     0    1           1
-4  ERROR       1    1
-5  STR(%)      1    1    0    0
-1         1 1.62174E+01
``````
HarryvL
Posts: 1071
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

### Re: missing stress values Sxy, Syz, Szy

Exact same story for strains. But even less application for this.
bernd
Posts: 9035
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

### Re: missing stress values Sxy, Syz, Szy

OK ...

BTW: a App::PropertyMap does not work either because it only supports stings as keys and values.
HarryvL
Posts: 1071
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

### Re: missing stress values Sxy, Syz, Szy

As discussed here: https://forum.freecadweb.org/viewtopic. ... 20#p282583 and here: https://forum.freecadweb.org/viewtopic. ... 14#p283044, the freeCAD data structure is not ideal (and perhaps/because not intended) for handling FEM information. Rather than force-fitting and ending up with work-arounds of the type:

Code: Select all

``````E = float(App.Units.Quantity(object['Object'].Material['YoungsModulus']).getValueAs('MPa'))
``````
to extract a simple float for use in a calculation, I would say it might be worth setting up some parallel, traditional data structures (as discussed in the first link). It may consume some storage space and upset OOP purists, but would make coding for FEM workbench a lot more intuitive, efficient and enjoyable.
Jee-Bee
Posts: 1987
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

### Re: missing stress values Sxy, Syz, Szy

would numpy help?