← Back to team overview

yade-users team mailing list archive

Re: [Question #270991]: Packing in a predicate excluding the volume already occupied by spheres

 

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

behzad posted a new comment:
check this out:



from yade import utils, plot
from yade import pack, qt


#==========================================
## define the materials

O.materials.append(CohFrictMat(normalCohesion= 1e8, shearCohesion= 1e8, isCohesive= False, young=1.0e4,
density=1530, poisson=0.3, frictionAngle= 0.5,fragile=False,label='coke'))


#========= creating walls ======================

walls=aabbWalls([(-0.006,-0.006,-0.00005),(0.006,0.006,0.002)],thickness=0.0001,oversizeFactor=1.0,material='coke')
wallIds=O.bodies.append(walls)


#================================================================
#===================== Inserting aggregates =====================
#================================================================


radz12= [0.447918e-3,0.631558e-3,0.432997e-3,0.354383e-3,0.644684e-3,0.501349e-3,0.419795e-3,0.305748e-3,0.401928e-3,0.301956e-3]
poz12= [[-0.327852e-3,0.13963e-3,0.0854213e-3],[-0.00642485e-3,0.0540226e-3,0.130283e-3],[-0.0784524e-3,0.131143e-3,0.507045e-3],[0.266248e-3,-0.210016e-3,-0.630071e-3],[-0.0142571e-3,-0.106791e-3,-0.16405e-3],[0.221276e-3,0.213503e-3,0.309049e-3],[0.2366e-3,-0.0271234e-3,-0.29612e-3],[-0.55599e-3,-0.0426141e-3,-0.214846e-3],[0.214827e-3,0.265521e-3,0.442681e-3],[0.376437e-3,0.0275707e-3,0.181478e-3]]	
template12= []
template12.append(clumpTemplate(relRadii=radz12,relPositions=poz12))	


coke3050=(0.129903989e-03,5)


temps3050=['t']

temps_3050=[template12]


for i in range(len(temps3050)):
    tp=pack.SpherePack()
    tp.makeCloud((-0.0004,-0.0004,0.0002),(0.0004,0.0004,0.0019),rMean=coke3050[0],rRelFuzz=0.0,num=coke3050[1])
    O.bodies.append([utils.sphere(c,r, material='coke') for c,r in tp])
    O.bodies.replaceByClumps(temps_3050[i],[1.0])


############################
###   DEFINING ENGINES   ###
############################

O.engines=[
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb(),Bo1_Facet_Aabb()]),
	InteractionLoop([Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Box_Sphere_ScGeom6D()],
	[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True, setCohesionOnNewContacts=True)],
	[Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
	),
	NewtonIntegrator(damping=0.4,gravity=[0,0,-9.81])
]

O.dt=1e-7


#======= creating the sphere packing ============


sp=pack.SpherePack()
sp.fromSimulation()

sp.makeCloud((-0.001,-0.001,0.0),(0.001,0.001,0.002),num=500,
rMean=5e-5,rRelFuzz=0.0)

O.bodies.append([utils.sphere(c,r,material='coke') for c,r in sp])


for x in range(len(O.bodies)):
	if (O.bodies[x]):
                if isinstance(O.bodies[x].shape,Sphere):
			if O.bodies[x].isClumpMember:
				O.bodies[x].shape.color=(0.8,0.8,0.0)
			else:
				O.bodies[x].shape.color=(0.1,0.3,0.1)



The clumps become NaN:


O.run(100,True)
O.bodies[21].state.pos

gives: Vector3(nan,nan,nan)

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