← Back to team overview

yade-users team mailing list archive

Re: [Question #235259]: How to count number of interactions

 

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

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hi Reza,

the ball is hopping (regardless harmonic motion of facets), as you wrote
:-) so at the end of simulation, I would expect the sphere to be somewhere
"hopped" from the floor (the situation that you stop the simulation just at
the moment of interaction is very unlikely in my opinion). Can you check
the position of the floor and of the sphere at the moment you are
investigating number of interactions?

You can also use PyRunner to do something periodically in the simulation
(like checking number of interactions), so you can for example add one to
O.engines:

O.engines = [
  ...
  PyRunner(iterPeriod=1,command="getMaxNumIntrs()"),
]

maxNumIntrs=0
def getMaxNumIntrs():
  global maxNumIntrs
  maxNumIntrs = max(len(O.interactions),maxNumIntrs)

to get maximum number of interactions during the whole simulation time
(should be 1 or more if there is at least one sphere repulse from floor).

cheers
Jan



2013/9/9 Reza Housseini <question235259@xxxxxxxxxxxxxxxxxxxxx>

> Question #235259 on Yade changed:
> https://answers.launchpad.net/yade/+question/235259
>
>     Status: Answered => Open
>
> Reza Housseini is still having a problem:
> > How many interactions would you expect from a simple model with one
> sphere and facets?
>
> The facet is driven by a HarmonicMotionEngine and the ball is therefore
> hopping.
>
> > how do you (what command do you use) to get the number of
> interactions?
>
> I just let the simulation run and then use len(O.interactions) to count
> the number of interactions. I also found out about
> utils.avgNumInteractions() but this too does not count any interactions.
>
> Aren't all interactions loggend in the InteractionContainer?
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to     : yade-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp
>

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.