← Back to team overview

yade-users team mailing list archive

Re: [Question #163736]: Body' state change

 

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

    Status: Open => Answered

Chareyre proposed the following answer:

> 1.  I created a RotationEngine and a TranslationEngine, both with the
> same id, as want that a body (obtained from a mesh for example) has
> translational and rotational movement. But I see that just the one that
> is defined in the second place affects the body in the simulation. I saw
> that there is a CombinedKinematicEngine, but I am not sure if I should
> use it for this case. Anyway, how should I proceed in order to have the
> rotation and translation engines acting on the body?
Note that if your motion is not too complicated, e.g. constant velocity
or spin, you can do something like:

b=O.bodies[100]
b.state.blockedDOFs='xyz' #block translational DOFs
b.state.vel=(1,0,0) #impose a velocity

> 2. I want to change the position and orientation of the body at some iterations. Can I do it using some Engine? I cannot imagine that I can do this using the TranslationEngine, as with this Engine I can define just the velocity. 
> When I include the body with O.bodies.append(YMPORT.GMSH("file.mesh",shift=,orientation=), I can define the orientation using Quaternion and the position using shift. I though that I could may bechange these variables, but I am also not sure because then I would need to reload the mesh every time that I change their values.
>
Basically, the chance that you break something by imposing position
shifts is high, because many DEM algorithms are based on velocity
(updating bounds, contact kinematics, viscous and/or incremental contact
laws, post-processing,...). If you want to move b from p1 to p2,
consider this method:

b.state.blockedDOFs='xyz'
b.state.vel=(p2-p1)/O.dt
O.run(1)
Then maybe release the body:
b.state.blockedDOFs=''
b.state.vel=(0,0,0)

This is compatible with 100% of Yade algorithms.

Bruno

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.