← Back to team overview

yade-users team mailing list archive

Re: [Question #678987]: error in applying constant displacement using state.vel.

 

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

    Status: Open => Answered

Jérôme Duriez proposed the following answer:
Hi,

The error says it all: the you're asking in "disk*.state.vel=something"
to access (and modify) the state.vel of list objects, and not Body
objects. Yade Body objects do have a state.vel, (Python) lists do not.

Your disk1, disk2 indeed are lists of bodies ids, because your top and
bottom disks are composed of many facet bodies.

You need to touch (for state.vel modifications) the bodies themselves, not their (list of) ids. 
General method is:

body = O.bodies[id] # this is a body when id is an integer
body.state.vel = (0,0,1) # this will then be possible


Not that I do not think you really need top and bottom *disks*. You could use as well a single Box/Wall/... body, even though it will match less nicely the cylinder shape of your sample.


Jérôme

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