yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #22917
Re: [Question #690160]: i.geom.incidentVel is not a vector
Question #690160 on Yade changed:
https://answers.launchpad.net/yade/+question/690160
Jérôme Duriez posted a new comment:
Because I previously overlooked that necessary Interaction attribute
(thanks Jan), let me try to add more explanations:
Your initial output message (more than an "error" message, indeed) was some "..method..". In the framework of object-oriented programming (like Python, C++, and YADE, where everything is an instance (= an item, one may say) of some given Class), method means function, and parentheses are then mandatory.
At least, as soon as you're interested more in the return value than in the function itself.. That was your case: you wanted to have the Vector3 returned by that method incidentVel, and not the method itself.
Then the question is, what do you have to put inside those parentheses ?
Most often, nothing. You can call directly eg i.geom.dict() even though
the doc would mention one attribute "arg1" [*]. This arg1 attribute
actually refers to the object whose method you're calling, so it's not
necessary to pass it as an attribute.
On the other hand, incidentVel doc here mentions other attributes than
arg1: an Interaction instance in particular => this one is necessary,
see Jan's syntax.
There also is a bracket-delimited attribute, here
avoidGranularRatcheting, with an equal sign. This one is an optional
attribute, it has some default value = the right hand side of the
equality. You do not need to pass this attribute as long as you're happy
with that default value.
Further reading could be found in Python documentation about Python
functions and their docstrings.
[*] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.ScGeom.dict
--
You received this question notification because your team yade-users is
an answer contact for Yade.