← Back to team overview

yade-users team mailing list archive

Re: [Question #239835]: two harmonicRotationEngine on one Object

 

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

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hi Oguz,
you can use CombinedKinematicEngine [1] for this purpose. See an example
[2]. In your case, you will use two HarmonicRotationEngines:

O.engines = [
  ...
  CombinedKinematicEngine(ids=fctIds,label='comb')
+ HarmonicRotationEngine(rotationAxis=[1,0,0],...)
+ HarmonicRotationEngine(rotationAxis=[0,1,0],...),
  ...
]

cheers
Jan

[1]
https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.CombinedKinematicEngine
[2]
http://bazaar.launchpad.net/~yade-pkg/yade/git-trunk/view/head:/examples/test/combined-kinematic-engine.py



2013/11/26 Oguz Cebeci <question239835@xxxxxxxxxxxxxxxxxxxxx>

> New question #239835 on Yade:
> https://answers.launchpad.net/yade/+question/239835
>
> Hi,
> I tried to apply some simulation. I am in need of a cauldron which is
> "tumbling". My approach was to add the HarmonicRotationEngine. I tried to
> apply this engine two times on one object. One rotation in (1,0,0) and the
> other one in (0,1,0) direction. But yade only uses the last engine I
> declared, such that the harmonic rotation in this case is only in (0,1,0)
> direction. Is there any solution?
>
> Here is my Code:
>
>
> from yade import ymport
>
> fctIds=O.bodies.append(ymport.stl('cauldron.stl',color=(0,1,0),wire=False,fixed=True))
>
>
> sp=pack.SpherePack()
> # generate randomly spheres with uniform radius distribution
> sp.makeCloud((-.2,-.2,.2),(.2,.2,.1),rMean=.020,seed=1)
> sp.toSimulation()
> amplitude=((2*pi)/360)*.75
>
> O.engines=[
>    ForceResetter(),
>    InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
>    InteractionLoop(
>       # handle sphere+sphere and facet+sphere collisions
>       [Ig2_Sphere_Sphere_L3Geom(),Ig2_Facet_Sphere_L3Geom()],
>       [Ip2_FrictMat_FrictMat_FrictPhys()],
>       [Law2_L3Geom_FrictPhys_ElPerfPl()]
>    ),
>    GravityEngine(gravity=(0,0,-9.81)),
>    NewtonIntegrator(damping=0.5),
>
>  HarmonicRotationEngine(ids=fctIds,rotationAxis=[1,0,0],zeroPoint=(0,0,0),rotateAroundZero=True,A=amplitude,f=30,dead=False,label='xRot'),
>
>  HarmonicRotationEngine(ids=fctIds,rotationAxis=[0,1,0],zeroPoint=(0,0,0),rotateAroundZero=True,A=amplitude,f=30,dead=False,label='yRot')
>
>
>
>
> ]
> O.dt=.00005*utils.PWaveTimeStep()
>
>
> Best regards!
> Thanks!
>
>
> --
> You received this question notification because you are a member of
> yade-users, which 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 you are a member of
yade-users, which is an answer contact for Yade.