position of spheres in periodic cell

Asked by feda

Hello,
how can i get the position of spheres after an isotropic compression in periodic cell ?
what is the difference between:
1) for i in rage(len(O.bodies)):
         position=O.bodies[i].state.pos
and 2)for i in rage(len(O.bodies)):
                 position=O.cell.wrapPt(O.bodies[i].state.pos)
Thank you!
feda

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#1

Hi,
1) gives the absolute position as it is memory, it can be anywhere in unbounded infinite 3D space
2) gives for each particle its image particle in the reference period, so that all the wraped positions are close to each other (merely what you see in the 3D view)

Note that your loops are odd, they result in
position=O.bodies[-1].state.pos #without loop

Bruno

Revision history for this message
feda (feda.s) said :
#2

Hi,
Thank you for your response, but I didn't fully understand what you mentioned in 2)
if you could explain that to me it would be appreciated. I want to obtain the positions of the spheres at the final state (after the isotropic compression, and with the obtained porosity), so what is the best method to do that?

Also, I can't tell where the problem in my loop is, knowing that the id's of the bodies in Yade start from 0 which means that my loop covers all the spheres.

Thank you.
Feda

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#3

PBC are a bit complicated to explain. Please make sure to read the documentation on PBC and if something is still not clear be specific on what it is.

The problem in you loop is the same as in
for k in [1,2,3]:
    x=k

the above loop is useless since it is equivalent to
x=3

Bruno

Can you help with this problem?

Provide an answer of your own, or ask feda for more information if necessary.

To post a message you must log in.