← Back to team overview

yade-users team mailing list archive

Re: [Question #230139]: clumps generating randomly in 2D simulation

 

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

Christian Jakob posted a new comment:
hmm, i think your script is not working, as you would expect it. some
small modifications may help:

#...

def Unitcells(): # define unitcell for clumps

    global sphereList

    for b in coordes:
    	sphereList = []
        coors1 = [ b[0] - radius , b[1] - radius , 0 ]
        coors2 = [ b[0] + radius , b[1] - radius , 0 ]
        coors3 = [ b[0] + radius , b[1] + radius , 0 ]
        coors4 = [ b[0] - radius , b[1] + radius , 0 ]       
        spherepara1 = sphere ( coors1 , radius  )
        spherepara2 = sphere ( coors2 , radius  )
        spherepara3 = sphere ( coors3 , radius  )
        spherepara4 = sphere ( coors4 , radius  )   
        sphere1 = O.bodies.append ( spherepara1 )
        sphere2 = O.bodies.append ( spherepara2 )
        sphere3 = O.bodies.append ( spherepara3 )
        sphere4 = O.bodies.append ( spherepara4 )
        sphereList.append ([sphere1 , sphere2 , sphere3 , sphere4])
        Clumps()

def Clumps(): # generate the clumps desired

    for b in sphereList:   
        clump_ids = O.bodies.clump (b)

def DOF(): # of course, DOF condition only for 2D simulation

    for b in O.bodies:
        if b.isClump:
           b.state.blockedDOFs = 'zXY'
           
# control flows
Parameters()
Radius()
Coor()
Unitcells()
#Clumps()
DOF() 

# ...

for your problem with biaxial compression:

clump_ids = O.bodies.clump (b)

will not work since b is a body pointer, try b.id

if it is still not working, please append "new-test.py"

christian

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.