← Back to team overview

yade-users team mailing list archive

[Question #275973]: Mannually Update Location of Components of Clumps

 

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

I did a test about mannually updating location of one clump's components:

## here is the example:
a = utils.sphere([0,0,0],1)
b = utils.sphere([0,0,1],1)
c = utils.sphere([0,0,2],1)
O.bodies.appendClumped([a,b,c]);

##Now, I want to mannually change the position of 'a':
a.state.pos = Vector3(0,0,100)

##However I don't know what information of the clump that contains 'a' should be changed.
##If I use O.step(), then the clump will set the location of 'a' back.

O.step()
a.state.pos
##Output:Vector3(-8.529034726309396e-18,4.7316020007752715e-17,-1.1102230246251565e-16)
##According to those examples about Clump, I figured out one solution: That is to remove a from the clump and then add it back:

O.bodies.releaseFromClump(0,3)
O.bodies.addToClump([0],3)
O.step()
a.state.pos
##Output:Vector3(9.525366606588648e-15,1.6515434853037192e-14,100)
##This is doable, but it will make the calculation really slow when there are many components. So I want to know if you can figure out some better solution?

Thanks for your precious time, and I'm looking forward to hearing from you!





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