Coordination Number

Asked by Paolo

Hi everybody.

I'm trying to evaluate the mean coordination number (mean number of contact of a bunch of particle) of a packing. I have not written down the code yet, but the idea is that, during the simulation, there will be several generations of spheres with the make cloud option. These spheres, after some steps and thanks to gravity (similarly to a pinball), will finally end in one of two different top-opened boxes. I'd like to know the coordination number of the spheres that will end in the first of the two boxes which is, i.e.:

geom.facetBox((0,0,0),(d,l,s),wallMask=31)

Basically, can you suggest me how to evaluate the mean number of concact of a group of spheres contained in a specific volume?

Thank you

Question information

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

Hello,

roughly:

1) select the relevant spheres, whose center is inside a box
sphs = [b for b in O.bodies if isInsideRelevantBox(b)]

2) compute number of interactions of each sphere using b.intrs() [1]
you can also use information about shape to exclude sphere-nonsphere contact if it is not desirable

3) averaging is trivial

cheers
Jan

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

Revision history for this message
Paolo (p4olo) said :
#2

Thanks Jan for answering.
By the way, I can't understand how I could define the condition of being in the box I want. Moreover, which is the difference between intrs() and avgNumInteractions?
Thanks

Revision history for this message
Jan Stránský (honzik) said :
#3

> I can't understand how I could define the condition of being in the box I want.

please be more specific what you can't understand (principles, how to code it, how to use values from yade, ...).
It also pretty much depends on what "box" actually is.

> which is the difference between intrs() and avgNumInteractions?

documentation [2,3] is clear IMO. The main difference is returned type:
- b.intrs() returns a **list of interactions**
- avgNumInteractions() returns average **number** of interactions per particle

the other difference is domain considered:
- b.intrs() deals with one body
- avgNumInteractions() deals with all bodies (hence not suitable for your task)

cheers
Jan

[1] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Body.intrs
[2] https://yade-dem.org/doc/yade.utils.html#yade.utils.avgNumInteractions

Revision history for this message
Paolo (p4olo) said :
#4

My box is a facetbox with its top open. Let's suppose that I'd like to determine the averege coordination number of the spheres which are inside:

geom.facetBox((0,0,0),(d,l,s),wallMask=31)

You suggested me to detect the relevant spheres whose center is inside the facetbox

sphs = [b for b in O.bodies if isInsideRelevantBox(b)]

I can't understande how to code the isInsideRelevantBox condition.

I think it could be something related to the x,y,z relative position between a center and the box. Basically a sphere is inside it

if -d/2<b.state.pos[0]<d/2 and -l/2<b.state.pos[1]<l/2 and -h/2<b.state.pos[2]<h/2

Revision history for this message
Chareyre (bruno-chareyre-9) said :
#5

Hi, I confirm your self answer.
You could put this in a function to be used in the condition.
Bruno

Le ven. 6 mars. 2020 14:17, Paolo <email address hidden> a
écrit :

> Question #689086 on Yade changed:
> https://answers.launchpad.net/yade/+question/689086
>
> Status: Answered => Open
>
> Paolo is still having a problem:
> My box is a facetbox with its top open. Let's suppose that I'd like to
> determine the averege coordination number of the spheres which are
> inside:
>
> geom.facetBox((0,0,0),(d,l,s),wallMask=31)
>
> You suggested me to detect the relevant spheres whose center is inside
> the facetbox
>
> sphs = [b for b in O.bodies if isInsideRelevantBox(b)]
>
> I can't understande how to code the isInsideRelevantBox condition.
>
> I think it could be something related to the x,y,z relative position
> between a center and the box. Basically a sphere is inside it
>
> if -d/2<b.state.pos[0]<d/2 and -l/2<b.state.pos[1]<l/2 and
> -h/2<b.state.pos[2]<h/2
>
> --
> You received this question notification because your team yade-users 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
>
>
>

Can you help with this problem?

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

To post a message you must log in.