Re: [Yade-users] [Question #233241]: how to get the body numbers who is contact with a sphere
Question #233241 on Yade changed: https://answers.launchpad.net/yade/+question/233241 liucheng83 posted a new comment: Thank you all, Christian and Jan. that solved my question. -- 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@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #233241]: how to get the body numbers who is contact with a sphere
Question #233241 on Yade changed: https://answers.launchpad.net/yade/+question/233241 Status: Answered = Solved liucheng83 confirmed that the question is solved: Thanks Christian Jakob, that solved my question. -- 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@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #233241]: how to get the body numbers who is contact with a sphere
Question #233241 on Yade changed: https://answers.launchpad.net/yade/+question/233241 Christian Jakob posted a new comment: did you try this? count = 0 for i in O.interactions.withBody(i): if i.isReal: count += 1 print count -- 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@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #233241]: how to get the body numbers who is contact with a sphere
Question #233241 on Yade changed: https://answers.launchpad.net/yade/+question/233241 Status: Open = Answered Jan Stránský proposed the following answer: Hello, @Christian, withBody Return list of real interactions of given body [1] @Liucheng, maybe the same reason, try to use also withBodyAll function Return list of all (real as well as non-real) interactions of given body [2]. Is now this number and the number from inspector same, or not? cheers Jan [1] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.InteractionContainer.withBody [2] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.InteractionContainer.withBodyAll 2013/7/30 Christian Jakob question233...@answers.launchpad.net Question #233241 on Yade changed: https://answers.launchpad.net/yade/+question/233241 Christian Jakob posted a new comment: did you try this? count = 0 for i in O.interactions.withBody(i): if i.isReal: count += 1 print count -- 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@lists.launchpad.net 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. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #233241]: how to get the body numbers who is contact with a sphere
Question #233241 on Yade changed: https://answers.launchpad.net/yade/+question/233241 Status: Answered = Open liucheng83 is still having a problem: Hello, I try this srcipts: --- k=200 count = 0 for i in O.interactions.withBody(k): if i.isReal: count += 1 print count len(O.interactions.withBody(k)) len(O.interactions.withBodyAll(k)) -- The result is the same as the inspector. Thank you all, Christian and Jan. But how to caculate the coordination number wihin a box range, I just want to caculate the particle who is not moving. Is the following is true? -- for i in range(103,len(O.bodies)): if O.bodies[i].state.vel.norm()0.1 : if len(O.interactions.withBody(i))=3: num_in_contact[0]=num_in_contact[0]+1 num_contact[0]=num_contact[0]+len(O.interactions.withBody(i)) num_coordination[0]=1.0*num_contact[0]/num_in_contact[0] -- -- 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@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #233241]: how to get the body numbers who is contact with a sphere
Question #233241 on Yade changed: https://answers.launchpad.net/yade/+question/233241 liucheng83 gave more information on the question: -- for i in range(103,len(O.bodies)): if O.bodies[i].state.vel.norm()0.1 : if len(O.interactions.withBody(i))=3: num_in_contact[0]=num_in_contact[0]+1 num_contact[0]=num_contact[0]+len(O.interactions.withBody(i)) num_coordination[0]=1.0*num_contact[0]/num_in_contact[0] -- -- 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@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #233241]: how to get the body numbers who is contact with a sphere
Question #233241 on Yade changed: https://answers.launchpad.net/yade/+question/233241 Status: Open = Answered Christian Jakob proposed the following answer: hm, personally I prefer using proofed and implemented methods: #if you have clumps in the model: coord_num = avgNumInteractions(considerClumps=True) #else: coord_num = avgNumInteractions(considerClumps=False) -- 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@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #233241]: how to get the body numbers who is contact with a sphere
Question #233241 on Yade changed: https://answers.launchpad.net/yade/+question/233241 liucheng83 posted a new comment: Yes, a simple way to get the coordination numbers in whole, but is there something wrong with my script to get coordination numbers in a small regin. Does avgNumInteractions(considerClumps=True) consider the contacts from the wall? -- 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@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #233241]: how to get the body numbers who is contact with a sphere
Question #233241 on Yade changed: https://answers.launchpad.net/yade/+question/233241 Christian Jakob proposed the following answer: Yes, a simple way to get the coordination numbers in whole, but is there something wrong with my script to get coordination numbers in a small regin. So write your tool, and check out if it gives same result as avgNumInteractions(). If yes, it works fine ;) Does avgNumInteractions(considerClumps=True) consider the contacts from the wall? Yes, once for sphere-wall contact, twice for sphere-sphere contacts. There was a similar discussion about coordination number, see here: https://answers.launchpad.net/yade/+question/207350 cheers, christian -- 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@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp