New question #685054 on Yade:
https://answers.launchpad.net/yade/+question/685054

Hi,
I'm trying to generate a set of spheres which are arranged along a spherical 
surface (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.quality=3
O.engines=[
    ForceResetter(),
    InsertionSortCollider([Bo1_Sphere_Aabb()]),
    InteractionLoop(
        [Ig2_Sphere_Sphere_ScGeom()],
        [Ip2_FrictMat_FrictMat_FrictPhys()],
        [Law2_ScGeom_FrictPhys_CundallStrack()]
    ),
    NewtonIntegrator(damping=0.4),
]

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.append(
        O.bodies.append(sphere((Center[0], Center[1], Center[2]), radius=0.05, 
color=[1, 1, 1])))

O.step()
OverlapBalls=set()
def findOverlapBalls():
    for i in ballsList:
        for j in ballsList:
            if i>=j:
                continue
            else:
                if O.interactions.has(i,j):
                    OverlapBalls.add(i)
findOverlapBalls()
print 'There are',len(OverlapBalls),'balls which have interactions'

def changeColor():
    for i in OverlapBalls:
        O.bodies[i].shape.color=[1,0,0]

changeColor()
###############
My Yade version is 2018.02b on Ubuntu 18.04.
Why these balls with no contact but have interactions?

Thanks
Leonard

-- 
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 protected]
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to