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

孙灿 posted a new comment:
I know what you mean. But while I'm using this code, I don't know how to call 
the grain itself. The relevant code is as follows (not all of it):
shuzu=[]
circleRadius=2
circleCenter = Vector3(0.05,15,6)
for b in O.bodies:
        d = (b.state.pos - circleCenter).norm()
        if d < circleRadius:
                shuzu.append(?)

def printInfo():
    print("=============")
    print("step",O.iter)
    for i,body in enumerate(O.bodies):
        print("body",i,"young",body.mat.young)
    for i,intr in enumerate(O.interactions):
        print("interaction",intr.id1,intr.id2,"kn",intr.phys.kn)
O.step()
printInfo()
def li():
        for body in shuzu:
                body.mat = Mat2
                for intr in body.intrs():
                        O.interactions.erase(intr.id1,intr.id2)
        printInfo()
I want to add eligible particles in the list shuzu[] using a for loop, and will 
change their material later using li(), I don't know how to call the particles 
themselves directly (put in the list shuzu[]), as I wrote shuzu.append(?). 
Maybe it's a very simple problem, but I don't know how to fix it.

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

_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to