← Back to team overview

yade-users team mailing list archive

Re: [Question #695164]: Interparticle spacing

 

Question #695164 on Yade changed:
https://answers.launchpad.net/yade/+question/695164

    Status: Answered => Open

Othman Sh is still having a problem:
Thanks Robert. I did the code below but strangely I am not getting any
outcome. The separation array is still empty!.

I am copying what I get in the terminal


Welcome to Yade 20201215-4510~714a723~focal1 
Using python version: 3.8.5 (default, Jul 28 2020, 12:59:40) 
[GCC 9.3.0]
TCP python prompt on localhost:9000, auth cookie `sycsuk'
XMLRPC info provider on http://localhost:21000
Running script inter.py
porosity =  0.7337488803402193
number of interactions =  3776
[]
[[ ^L clears screen, ^U kills line. F12 controller, F11 3D view (press "h" in 3D view for help), F10 both, F9 generator, F8 plot. ]]

My code is below.

Thanks
Othman
--------------------------------

from yade import pack
import numpy as np

sp_radius=2.36/1000

mnx=0
mny=0
mnz=0
mxx=50.8/1000 
mxy=50.8/1000 
mxz=50.8/1000 

mn,mx=Vector3(mnx,mny,mnz),Vector3(mxx,mxy,mxz)

yade.qt.View()
########## spheres ##########
sp=pack.SpherePack()
sp.makeCloud(mn,mx,rMean=sp_radius)
sp.toSimulation()

print ('porosity = ', utils.porosity())

O.engines=[
 ForceResetter(),
 InsertionSortCollider([
  Bo1_Sphere_Aabb(),
  Bo1_Facet_Aabb()
 ]),
 InteractionLoop(
  [
   Ig2_Sphere_Sphere_ScGeom(),
   Ig2_Facet_Sphere_ScGeom(),
  ],
  [

   Ip2_FrictMat_FrictMat_FrictPhys(),
  ],
  [

   Law2_ScGeom_FrictPhys_CundallStrack(),
  ],
 ),

 NewtonIntegrator(gravity=(0,0,0),damping=.4),

]
O.step() #creating interactions
print('number of interactions = ',len(O.interactions))

separations =[]

for i in O.interactions:
  id1,id2 = i.id1,i.id2
  x = np.linalg.norm(O.bodies[id1].state.pos - O.bodies[id2].state.pos)
  separations.append(x)

print(separations)

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.