When trying to create a stress linearization plot
https://wiki.freecadweb.org/FEM_PostFil ... edStresses
I get a division by zero error.
Here is an example file: https://github.com/FreeCAD/FreeCAD/file ... y-zero.zip
- select the line filter object and create a linearization plot to get the error
The error occurs here: https://github.com/FreeCAD/FreeCAD/blob ... .cpp#L1225
So the last coordinate that is read here: https://github.com/FreeCAD/FreeCAD/blob ... .cpp#L1218
has the value zero.
The strange thing is that one can change the line filter points and one like but the bug does not go away. So the bug is somewhat deeper that the coordinate is not updated on updating the line filter.
And indeed, when you delete the line filter and recreate it using exactly the same point settings, the issue does no longer occur.
[fixed] [bug 6972] division by zero when creating stress linearization plot
Moderator: bernd
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
Re: [bug 6972] division by zero when creating stress linearization plot
This is the first time, i use filters, so please be patient if i writ something wrong.
First of all, i do not really understand, for what this all is or how to use it correctly, especially some of the filters like the line clip filter (which points,, are they x, y, z and mm? which select points?, what is resolution in that case?, .....)
I used it an an bar, similar to yours but with an straight tensions, no bending, then the there is no dived to zero error (van Mises). But other errors. For example the plot is in MPa, which does not match with the new SI units now (1e7 vs. 10MPa). Also some things are not readable on the plot. If the mm is OK, i can not say, since i do not know, if i set the points correctly (that the max. the tensions is 10MPa, even the position is not clear is, because the tensions is very homogeneous).
Greetings
user1234
First of all, i do not really understand, for what this all is or how to use it correctly, especially some of the filters like the line clip filter (which points,, are they x, y, z and mm? which select points?, what is resolution in that case?, .....)
I used it an an bar, similar to yours but with an straight tensions, no bending, then the there is no dived to zero error (van Mises). But other errors. For example the plot is in MPa, which does not match with the new SI units now (1e7 vs. 10MPa). Also some things are not readable on the plot. If the mm is OK, i can not say, since i do not know, if i set the points correctly (that the max. the tensions is 10MPa, even the position is not clear is, because the tensions is very homogeneous).
Greetings
user1234
Re: [bug 6972] division by zero when creating stress linearization plot
Me neither I just filled the last empty FEM Wiki pages and this way found the issues.
MPa is hereby correct since the CCX panel uses the set unit system. However, I don't understand what is plot is about so cannot tell.
Re: [bug 6972] division by zero when creating stress linearization plot
I am pretty sure, that is a only method to plot a stair curve without stairs. wrong
A divide to zero can then happen when the array is (half) shifted (must be, when this plotting method is the case, fell in that trap myself once a time). in that case also wrong
Greetings
user1234
edit: strokes
Re: [bug 6972] division by zero when creating stress linearization plot
That is stress linearization: https://www.graspengineering.com/what-i ... arization/.
Since i never have something to do with ASME and not that often with piping systems (and when is calculated in an other way), i never head about that.
Greetings
user1234
Since i never have something to do with ASME and not that often with piping systems (and when is calculated in an other way), i never head about that.
Greetings
user1234
Re: [bug 6972] division by zero when creating stress linearization plot
Thanks! Great site. I linked it now in the Wiki: https://wiki.freecadweb.org/FEM_PostFil ... edStressesuser1234 wrote: ↑Tue Jun 07, 2022 2:04 pm That is stress linearization: https://www.graspengineering.com/what-i ... arization/.
Re: [bug 6972] division by zero when creating stress linearization plot
With your attached example there was an error that an object DataAlongLine doesn't exist. And there is indeed no object of this name but DataAlongLine001. It's only the label that has set this value.
With git commit 7400b118700 I can run the function now but I don't get a division-by-zero error.
With git commit 7400b118700 I can run the function now but I don't get a division-by-zero error.
Re: [bug 6972] division by zero when creating stress linearization plot
Thanks for this commit!wmayer wrote: ↑Mon Jun 13, 2022 3:12 pm With git commit 7400b118700 I can run the function now but I don't get a division-by-zero error.
I could reproduce this issue here on another PC. Strange what happened to the file.
Concerning the division by zero I will retest with current master later on the machine where i encountered the bug.
Re: [bug 6972] division by zero when creating stress linearization plot
I had a look. The bug occurred because the axis data were completely zero. This happened because in some cases the axis data was never filled. I fixed this last weekend perhaps with https://github.com/FreeCAD/FreeCAD/comm ... e3070336e5
However now the axis data won't be zero.