← Back to team overview

yade-dev team mailing list archive

Re: [Branch ~yade-dev/yade/trunk] Rev 2318: - Add stress getter and python wrapper (replacing reverted r2314).

 

Václav Šmilauer a écrit :
Bruno, I think the interface is quite horrible (c-style), sorry.

I suggest that "stress" is not a function, but a property (TT.stress,
rather than TT.stress(..)) which internally calls a function and those 6
values are returned as a tuple. Is that OK for you? I think it is much
more friendly. Then you call TT.stress[3] instead of TT.stress(3).
I'll have to update all my scripts... but its ok if somebody wants to make this change (with index in 1,...,6 please).
For sigma1, sigma2, sigma3, I suggest just "sigma" which just returns a
Vector3r... Or call it avgStress if you want.

1/ Many users around are using sigma1,2,3 at the moment. More accessors can be added but not sigma's removed.
2/ sigma1,2,3 are not averaged stresses but _prescribed_ stresses
3/ For actual stresses (the tuple above), average them in python if you need, I see no reason to give access to 3 values only when there are 6.

Bruno




What do you think?

I can do those changes if you don't feel like it.

V.


_______________________________________________
Mailing list: https://launchpad.net/~yade-dev
Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp



--
_______________
Bruno Chareyre
Associate Professor
ENSE3 - Grenoble INP
Lab. 3SR
BP 53 - 38041, Grenoble cedex 9 - France
Tél : 33 4 56 52 86 21
Fax : 33 4 76 82 70 43
________________




Follow ups

References