← Back to team overview

yade-users team mailing list archive

Re: [Question #655866]: Rel. to Uniaxial test

 

Question #655866 on Yade changed:
https://answers.launchpad.net/yade/+question/655866

Jan Stránský proposed the following answer:
Hello,

>
negIds,posIds,axis,crossSectionArea=bb['negIds'],bb['posIds'],bb['axis'],bb['area']
--> this time the command worked unlike the last time when I got an
error. Still no idea what the reason might have been

as I wrote and as the error said, the reason was invalid Python syntax,
i.e. `´ symbols. ' and " are used for strings, see Python docs for more
info

PyRunner [1] is used to run a Python code periodically, in your case executing function plotAddData. You can choose a period of executing the function, chose one:
iterPeriod ... runs the code every given time step
virtPeriod ... runs the code every given virtual time (e.g. every 1 ms)
realPeriod ... runs the code every real period, e.g. every 10 s

> When I execute the above, it shows "addPlotData" is not defined.

How do you run the code? using a script, or copying the code to yade terminal?
anyway, do not call O.step() inside a function you call by PyRunner.

cheers
Jan

[1] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.PyRunner

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.