problem of pyRunner()

Asked by lip on 2019-08-22

     i have defined a function named energysb() to culculate the linear kinetic energy of polyhedra and sphere seperately when the number of iterations is k*3000 , where k=1,2,3,..., but it turn out to be that the calculation occured when the iter number more than 10000,i do not know where is wrong, can you give me some advice?
below is part of my code:
   O.engines = [
    # GravityEngine(gravity=(0,0,-9.81)),
    NewtonIntegrator(damping=0.5, gravity=(0, 0, -9.81)),

    PyRunner(command='changecolor()', realPeriod=15),
    PyRunner(command='checkUnbalanced()', realPeriod=15),
    PyRunner(command='energysb()', realPeriod=3000),

def energysb():
    for b in O.bodies:
            if isinstance(b.shape,Polyhedra):
    with open('spEnergyChange.txt','a') as text:
by the way,there exist about 70000 sphere particles and 300 polyhedra particles in my simulation.

Question information

English Edit question
Yade Edit question
No assignee Edit question
Last query:
Last reply:
Jan Stránský (honzik) said : #1

> ... to culculate ... when the number of iterations is k*3000
> ... but ... occured when the iter number more than 10000
> PyRunner(command='energysb()', realPeriod=3000),

use iterPeriod instead of realPeriod


Can you help with this problem?

Provide an answer of your own, or ask lip for more information if necessary.

To post a message you must log in.