How you move a wall or facet?

Asked by liucheng83

Hi, everyone

I want to move the top wall created with
---
mn,mx=Vector3(0,0,0),Vector3(1,1,1) # corners of the initial packing
walls=aabbWalls([mn,mx],thickness=0,material='walls')
wallIds=O.bodies.append(walls)
---
The initial y position of the top wall is y=0, I want to move it to y=1.5. But it seems change the position does not work.
---------
O.bodies[3].state.pos[1]=1.5
print O.bodies[3].state.pos[1]
----
The print information is O.bodies[3].state.pos[1] =1.0

Anyone knows how to move a facet?
Thank you!

Cheng

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
Last query:
Last reply:
Revision history for this message
Best Jan Stránský (honzik) said :
#1

Hello,

you need to assign pos as full Vector3 at once:

O.bodies[3].state.pos[1]=1.5 # does not work
pos = O.bodies[3].state.pos # copy of state.pos
pos = 1.5 # set values as needed
O.bodies[3].state.pos = pos # new pos as complete Vector3 at once

Just a note, assigning position directly is not recommended in Yade, so you should know what and why you do. E.g. if the position change is before the first O.step, there should be no problem.

cheers
Jan

Revision history for this message
liucheng83 (lcheng83) said :
#2

Hi, Jan

Thank you for your help. It works now. I think "pos = 1.5 # set values as needed" may be wrong. The following is true.

---
pos[1] = 1.5 # set values as needed
---

Thank you!

Cheng

Revision history for this message
liucheng83 (lcheng83) said :
#3

Thanks Jan Stránský, that solved my question.