number of interactions is not correct!

Asked by behzad

Hi,

I'm running a simulations in which when I ask for number of interactions, I get 25612! But, I cannot find any of them and actually the geometry is not showing any interactions.

Yade [31]: len(O.interactions)
 -> [31]: 25612

list=[]

Yade [28]: for x in range(len(O.bodies)):
     ....: if (O.bodies[x]):
     ....: if len(O.bodies[x].intrs())>0:
     ....: list.append(x)
     ....:
Yade [30]: print(len(list))
0

How this is possible?

Thanks,
Behzad

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
behzad
Solved:
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

Hi Behzad,

len(O.interactions) also consideres potential interactions (when bounding
boxes collides)

if you use "for i in O.interactions:", the iteration is done over only real
interactions.

so try "print len([i for i in O.interaction])" and it should give you
correct results

cheers
Jan

2015-02-10 20:46 GMT+01:00 behzad <email address hidden>:

> New question #261928 on Yade:
> https://answers.launchpad.net/yade/+question/261928
>
> Hi,
>
> I'm running a simulations in which when I ask for number of interactions,
> I get 25612! But, I cannot find any of them and actually the geometry is
> not showing any interactions.
>
> Yade [31]: len(O.interactions)
> -> [31]: 25612
>
>
> list=[]
>
> Yade [28]: for x in range(len(O.bodies)):
> ....: if (O.bodies[x]):
> ....: if len(O.bodies[x].intrs())>0:
> ....: list.append(x)
> ....:
> Yade [30]: print(len(list))
> 0
>
>
>
> How this is possible?
>
> Thanks,
> Behzad
>
>
>
> --
> 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 : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
behzad (behzad-majidi) said :
#2

Thanks Jan,

Alright, yeah I tried it and it gives 0 (as it's supposed to). Thus, the reason for (Yade [31]: len(O.interactions)
 -> [31]: 25612) might be the fact that I've imported gts files as facets. They're making cylindrical shapes and I define them as clumps.
But, actually, there's not interactions. Good!

Thanks!
Cheers,
Behzad