Choose a more precise object name: vonMises instead of StressValues

About the development of the FEM module/workbench.

Moderator: bernd

UR_
Veteran
Posts: 1354
Joined: Tue Jan 03, 2017 8:42 pm

Choose a more precise object name: vonMises instead of StressValues

Post by UR_ »

Disturbed for a long time by diffuse object naming, like

Screenshot 002.png
Screenshot 002.png (8.09 KiB) Viewed 1618 times

instead of "von Mises equivalent stress".

There are many stress definitions out there, e.g. von Mises, Tresca, Coulomb, Saint-Venant, Guest, Rankine, Burzyński-Yagn, Huber, Mao-Hong Yu, Altenbach-Bolchoun-Kolupaev

(some of them from wikipedia, and unkown for myself :roll: )

But we should try (at least) to be more precise in naming.

Branch can be found here: https://github.com/UR-0/FreeCAD/commit/ ... 66b165d015

But there is of a drawback. Oldstyle result objects have to be reloaded or recalculated.

What to you think about this?
User avatar
HarryvL
Veteran
Posts: 1284
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Choose a more precise object name: vonMises instead of StressValues

Post by HarryvL »

+1
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Choose a more precise object name: vonMises instead of StressValues

Post by bernd »

git commit 8b68ab7 hopefully no regression somewhere. I had not have the time to test befor merge ... Nevermind we will fix any regression.

The result objects of the start wb examples needs to be updated ... !
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Choose a more precise object name: vonMises instead of StressValues

Post by bernd »

Ahh forgot to say it's a valuable change !
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Choose a more precise object name: vonMises instead of StressValues

Post by vocx »

bernd wrote: Fri Feb 14, 2020 3:58 pm git commit 8b68ab7 hopefully no regression somewhere...
I'm not opposed to the change, but doesn't this break the Results object? You cannot just rename a property like that because you won't be able to load the "StressValues" property from older files. Is that not a problem?

To avoid breaking older files, I think we should migrate the property through some code inside onDocumentRestored. This is mentioned in this thread, Migrating and upgrading old scripted objects.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
UR_
Veteran
Posts: 1354
Joined: Tue Jan 03, 2017 8:42 pm

Re: Choose a more precise object name: vonMises instead of StressValues

Post by UR_ »

vocx wrote: Fri Feb 14, 2020 4:10 pm but doesn't this break the Results object?
Yes, old result objects get broken.

bernd wrote: :bell:

To patch old result object we need to add to femobjects\_FemResultMechanical.py line 304:

Code: Select all

    def onDocumentRestored(self, obj):
        if hasattr(obj, "StressValues") == True:
            obj.addProperty(
                "App::PropertyFloatList",
                "vonMises",
                "NodeData",
                "",
                True
            )
            obj.vonMises = obj.StressValues
            obj.removeProperty("StressValues")

Should this really be done, or is this to much effort.

IIRC, result and other objects gets broken on regular bases in past ;)
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Choose a more precise object name: vonMises instead of StressValues

Post by vocx »

UR_ wrote: Fri Feb 14, 2020 8:07 pm IIRC, result and other objects gets broken on regular bases in past ;)
I think in FEM it's not very critical to break the result object because if the problem is well defined, the user can just re-run the solver to obtain the results again. Still, it's just a small thing to consider.

In other workbenches it's possibly more important to maintain compatibility and be able to access and re-edit the older objects.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
UR_
Veteran
Posts: 1354
Joined: Tue Jan 03, 2017 8:42 pm

Re: Choose a more precise object name: vonMises instead of StressValues

Post by UR_ »

vocx wrote: Sat Feb 15, 2020 7:03 am I think in FEM it's not very critical to break ...
:)

Nevertheless, PR: https://github.com/FreeCAD/FreeCAD/pull/3052
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Choose a more precise object name: vonMises instead of StressValues

Post by bernd »

UR_ wrote: Sat Feb 15, 2020 9:15 am
vocx wrote: Sat Feb 15, 2020 7:03 am I think in FEM it's not very critical to break ...
:)

Nevertheless, PR: https://github.com/FreeCAD/FreeCAD/pull/3052
git commit f192ac8 great. We should have started whith such migrate code much earlier.
Post Reply