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

VG posted a new comment:
Thanks Jan!

So after using TriaxialStressController in compress.py, I get the position of 
the walls by using O.bodies[].state.pos.
This gives me the dimension and location of the granular sample. 
For example, starting from an initial dimension of (15,15,15), I get to the 
following locations for the walls:
0 -> Vector3(1.9603017656924078,7.5,7.5)
1 -> Vector3(13.213873202175382,7.5,7.5)
2 -> Vector3(7.5,1.0408600478483976,7.5)
3 -> Vector3(7.5,12.620020625453774,7.5)
4 -> Vector3(7.5,7.5,2.0193261962347355)
5 -> Vector3(7.5,7.5,13.575093096100462)

Now, I am trying to use this information in simulation.py to define the
size of the periodic cell and also to translate the granular sample so
that it lies perfectly within the periodic cell.

For translation, I was trying to use

for s in sp:
  s.state.pos[0] = s.state.pos[0] - 1.9603017657
  s.state.pos[1] = s.state.pos[1] - 1.04086
  s.state.pos[2] = s.state.pos[2] - 2.01932

which doesn't work.

Then, I noticed from the Yade user manual that there is a function 
translate((Vector3)arg2) which translate all spheres by given vector. I tried 
using it as:
sp.translate(-1.96030,-1.04086,-2.01932)

but this gives me the error: AttributeError: 'list' object has no
attribute 'translate'. Mostly, I am using it wrong. Could you please
point me to the correct usage ?

Thanks
Varun

-- 
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