← Back to team overview

yade-users team mailing list archive

[Question #705707]: find id clump in list

 

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

hello, every one 
I'm beginner in Yade .I want to have a list of clumps id, in the code below, and know what is there any connection between the clumps?
thank you
from yade import pack
 ############################################
###   DEFINING VARIABLES AND MATERIALS   ###
############################################
# The following 5 lines will be used later for batch execution
nRead=readParamsFromTable(
	num_spheres=1000,# number of spheres
	compFricDegree = 30,# contact friction during the confining phase
	ConPre=-30000,
	key='_triax_base_', # put you simulation's name here
	unknownOk=True
)
from yade.params import table

num_spheres=table.num_spheres# number of spheres
key=table.key
targetPorosity = 0.41#the porosity we want for the packing
compFricDegree = table.compFricDegree # initial contact friction during the confining phase (will be decreased during the REFD compaction process)
finalFricDegree = 30 # contact friction during the deviatoric loading
rate=-0.02 # loading rate (strain rate)
damp=0.2 # damping coefficient
stabilityThreshold=0.01 # we test unbalancedForce against this value in different loops (see below)
young=5e6 # contact stiffness
mn,mx=Vector3(-0.1,-0.1,-0.1),Vector3(.9,.9,.9) # corners of the initial packing
ConPre=-100000
O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(compFricDegree),density=2600,label='spheres'))
## create walls around the packing
walls=aabbWalls([mn,mx],thickness=0,material='spheres')
wallIds=O.bodies.append(walls)

## use a SpherePack object to generate a random loose particles packing
from yade import pack
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(.8,.8,.8),psdSizes=[.008,.012,.078,.08,.081],psdCumm=[0,.995,.995,.999,1],distributeMass=False,seed=1)
#for ss in sp: #split SpherePack into two other packs based on the particle size
  #r = ss[1]
  #if r > .05/2:# please note that you feed diameters nor radii in psdSizes, that is why I divide it by 2
    #spBig.add(ss[0],ss[1])

  #else:
    #spSmall.add(ss[0],ss[1])
print('bbb')

sp.toSimulation(material='spheres')
relRadList1 = [0.2882557656,0.406619778,0.3688555312,0.26]
relPosList1 = [[0,-0.187117,-0.09206748],[0,0.00806748,-0.0344172],[0,0.190184,0],[0.12,0,-0.18]]


relRadList2 = [0.29,0.27,0.3,0.28]
relPosList2 = [[0,-0.14,0.08],[0,-0.12,-0.2],[0,0.06,0.18],[0,0.07,-0.15]]


relRadList3 = [0.21,0.23,0.23,0.31,0.23,0.29,0.22]
relPosList3 = [[0,-0.26,0.07],[0,-0.09,-0.12],[0,-0.08,0.16],[0,0.02,0],[0,0.1,-0.27],[0,0.16,0.15],[0,0.22,-0.11]]


templates= []
templates.append(clumpTemplate(relRadii=relRadList1,relPositions=relPosList1))
templates.append(clumpTemplate(relRadii=relRadList2,relPositions=relPosList2))
templates.append(clumpTemplate(relRadii=relRadList3,relPositions=relPosList3))


#### show how to use replaceByClumps():



O.bodies.replaceByClumps(templates,[0.2,0.3,0.5],discretization = 20)

for b in O.bodies:
        if b.isClumpMember: b.shape.color=(1,1,1)

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