← Back to team overview

yade-users team mailing list archive

Re: [Question #403695]: RotationEngine can't work

 

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

    Status: Open => Answered

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

RotationEngine.ids has to be a sequence. Try

RotationEngine(ids=[q.id],...)

and let us know
cheers
Jan

Dne 1. 11. 2016 7:44 napsal uživatel "xjin" <
question403695@xxxxxxxxxxxxxxxxxxxxx>:

> New question #403695 on Yade:
> https://answers.launchpad.net/yade/+question/403695
>
> I am trying to model a rigid body consisted by particles which are
> clumped. And when I try to use RotationEngine to make it rotate, I get a
> problem.
> The script is like this:
>
> bodylist=[]
> bodylist.append(O.bodies.append(sphere([0,0,0],1)))
> for ix in range(0,10):
> bodylist.append(O.bodies.append(sphere([0.5+ix,0,0],0.5)))
> bodylist.append(O.bodies.append(sphere([-0.5-ix,0,0],0.5)))
>
> for iy in range(0,10):
> bodylist.append(O.bodies.append(sphere([0,0.5+iy,0],0.5)))
> bodylist.append(O.bodies.append(sphere([0,-0.5-iy,0],0.5)))
>
> idclump=O.bodies.clump(bodylist)
> q=O.bodies[len(O.bodies)-1]
>
> globals()['q']=locals()['q']
> O.engines=[
> ForceResetter(),
> InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
> InteractionLoop(
> [Ig2_Sphere_Sphere_L3Geom(),Ig2_Facet_Sphere_L3Geom()],
> [Ip2_FrictMat_FrictMat_FrictPhys()],
> [Law2_L3Geom_FrictPhys_ElPerfPl()]
> ),
> NewtonIntegrator(gravity=(0,0,-9.8),damping=0.4),
> RotationEngine(ids=q.id,
> angularVelocity=1,
> rotationAxis=(1,1,0),
> rotateAroundZero=1,
> zeroPoint=(1,1,1))
> ]
> O.dt=0.05*PWaveTimeStep()
>
>
>
> When I type the script, the termination notice me a problem before the
> O.dt.
>  It tells me that :
>
> ------------------------------------------------------------
> ---------------
> TypeError                                 Traceback (most recent call last)
> /home/dj/yade/install/bin/yade in <module>()
>      12 rotationAxis=(1,1,0),
>      13 rotateAroundZero=1,
> ---> 14 zeroPoint=(1,1,1))
>      15 ]
>
> TypeError: No registered converter was able to produce a C++ rvalue of
> type std::vector<int, std::allocator<int> > from this Python object of type
> int
>
>
> I type it following the information in your website, and I try some ways
> but all failed.Can you tell me how to use RotationEngine correctly?
> Thanks for any suggestions
> xjin
>
> --
> You received this question notification because your team yade-users is
> an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to     : yade-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp
>

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