← Back to team overview

yade-users team mailing list archive

Re: [Question #680577]: how to move a wall by applying a specific force?

 

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

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hello,

thanks for the info. But next time please also try provide a MWE [1], it is then much more clear what you have done and what not
Like how you created the wall, what values you have assigned it etc. It might happen that your wall is parallel to x axis and applying force also parallel to x axis has no effect..

Using yade.utils.wall function (**gussing/assuming** you use this one), walls are made fixed (with blocked all degrees of freedom) and with zero mass.
To make applying force work, you have to un-fix the DOF perpendicular to the wall and assign non-zero mass.

To change the force during simulation, there are several options depending on your use case:
- use setPermF, then O.run(...,True), then setPermF, then O.run(...,True), then ......
- use addF or setPermF inside a PyRunner
- use ForceEngine
- ...

### MWE
wall = utils.wall((0,0,0),axis=0)
wall_id = O.bodies.append(wall)
# wall default values
print wall.state.blockedDOFs # walls are fixed by default
print wall.state.mass # walls has zero mass by default
# modify necessary attributes
wall.state.blockedDOFs = 'yzXYZ'
wall.state.mass = 1 # assign your own value
# set force (for example this way)
O.forces.setPermF(wall_id,(10,0,0)) # or O.forces.addF(wall_id,(10,0,0),permanent=True) for older versions
O.step()
print wall.state.vel
print wall.state.pos
O.step()
print wall.state.vel
print wall.state.pos
###

cheers
Jan

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