# Spheres with no physical contact but have interactions

Hi,

I'm trying to generate a set of spheres which are arranged along a spherical surface based on Fibonacci algorithm (see MWE), these spheres generally have no physical contact with each other. However, after run one step (or more), some of them have interactions but there is no physical overlap for these balls. Here is the MWE, the problematic balls are shown in red color.

##################

from yade import pack, plot

import math

import numpy as np

import random

from random import gauss

numBalls=500

Gl1_Sphere.

O.engines=[

ForceResett

InsertionSo

Interaction

),

NewtonInteg

]

rnd = random.random() * numBalls

offset = 2. / numBalls

increment = math.pi * (3. - math.sqrt(5.))

ballsList=[]

for i in range(numBalls):

y = ((i * offset) - 1) + (offset / 2);

r = math.sqrt(1 - pow(y, 2))

phi = ((i + rnd) % numBalls) * increment

x = math.cos(phi) * r

z = math.sin(phi) * r

Center =1.05 * np.array([x, y, z])

ballsList.

O.step()

OverlapBalls=set()

def findOverlapBalls():

for i in ballsList:

for j in ballsList:

if i>=j:

else:

if O.interactions.

findOverlapBalls()

print 'There are',len(

def changeColor():

for i in OverlapBalls:

changeColor()

###############

My Yade version is 2018.02b on Ubuntu 18.04.

So, why these balls with no contact but have interactions?

Thanks

Leonard

## Question information

- Language:
- English Edit question

- Status:
- Solved

- For:
- Yade Edit question

- Assignee:
- No assignee Edit question

- Solved by:
- Jan Stránský

- Solved:
- 2019-10-14

- Last query:
- 2019-10-14

- Last reply:
- 2019-10-12

Jan Stránský (honzik) said : | #1 |

Hi Leonard,

see [1] (parts about collision detection) and change

###

if O.interactions.

###

to

###

if O.interactions.

###

In Yade, interactions are created by a collider, which creates interactions wherever there is a "potential of physical interactions", i.e. when bounding boxes overlap (the approximate collision detection phase).

It is then a work of Ig2/Law2 to do exact contact detection, "marking" the interaction as real if there is a "physical overlap" or not.

cheers

Jan

Leonard (z2521899293) said : | #2 |

Thanks Jan Stránský, that solved my question.