# Coordination Number

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(

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:
- 2020-03-06

- Last reply:
- 2020-03-06

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 isInsideRelevan

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:/

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

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**

- avgNumInteracti

the other difference is domain considered:

- b.intrs() deals with one body

- avgNumInteracti

cheers

Jan

[1] https:/

[2] https:/

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(

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

sphs = [b for b in O.bodies if isInsideRelevan

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.

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:/

>

> 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(

>

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

> the facetbox

>

> sphs = [b for b in O.bodies if isInsideRelevan

>

> 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.

> -h/2<b.

>

> --

> You received this question notification because your team yade-users is

> an answer contact for Yade.

>

> _______

> Mailing list: https:/

> Post to : <email address hidden>

> Unsubscribe : https:/

> More help : https:/

>

>

>

## Can you help with this problem?

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