← Back to team overview

yade-users team mailing list archive

Re: [Question #698647]: Specify makeClumpCloud composition

 

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

    Status: Open => Answered

Karol Brzezinski proposed the following answer:
Hi Bence,

the simplest way to do this is to repeat c1 three times and c2 seven
times in the list passed to makeClumpCloud(). However, you won't get
exactly 30%, rather approximately 30%.

Cheers,
Karol

##################
from yade import pack

O.bodies.append(geom.facetBox((0,0,0),(0.6,1,0.8),wallMask=55,fixed=True))

sp=pack.SpherePack()
c1=pack.SpherePack([((0,0,0),.05),((0.1,0,0),0.05),((0.2,0,0),.05)])
sp=pack.SpherePack()
c2=pack.SpherePack([((0,0,0),.05),((0.1,0,0),0.05)])
sp.makeClumpCloud((-0.5,-1,-0.8),(0.5,1,0.8),[c1,c1,c1,c2,c2,c2,c2,c2,c2,c2],num=-1)
sp.toSimulation()

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,-9.81,0),damping=0.2),
]

O.dt=.5*PWaveTimeStep()
O.saveTmp()

c1_count = 0 
c2_count = 0  
 
for b in O.bodies: 
	if isinstance(b.shape,Clump):
		if b.state.mass >1.5:
			c1_count += 1
		else:
			c2_count += 1
			
print("C1/(C1+C2) = {:.2f}".format(c1_count/(c1_count+c2_count)))

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