← 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

honzik proposed the following answer:

I think that you can use labels:

O.engines = [
...
SomeEngine(...,label='sEngine')
...
]

sEngine.someParameter = value

good luck
Jan

______________________________________________________________
> Od: "Daniela" <question163736@xxxxxxxxxxxxxxxxxxxxx>
> Komu: yade-users@xxxxxxxxxxxxxxxxxxx
> Datum: 06.07.2011 15:11
> Předmět: Re: [Yade-users] [Question #163736]: Body' state change
>
>Question #163736 on Yade changed:
>https://answers.launchpad.net/yade/+question/163736
>
>    Status: Solved => Open
>
>Daniela is still having a problem:
>Hi Anton,
>I took a look in the example that you sent me and tried to change it. My goal is that I can change for example the angular velocity of the RotationEngine at each iterPeriod. I tried it:
>
>rotvel=0
>O.engines=[
>	#SubdomainBalancer(colorize=True,initRun=True,iterPeriod=100),
>	ForceResetter(),
>	InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Wall_Aabb()],label='collider'),
>	InteractionLoop(
>		[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()],
>		[Ip2_FrictMat_FrictMat_FrictPhys()],
>		[Law2_ScGeom_FrictPhys_CundallStrack()],
>	),
>	GravityEngine(gravity=(1e-2,1e-2,-1000)),
>	NewtonIntegrator(damping=.1,exactAsphericalRot=True),
>	RotationEngine(
>		ids=rotateIDs,
>		angularVelocity=rotvel,
>		rotationAxis=[0,-1,0],
>		rotateAroundZero=1,
>		zeroPoint=[-7.0,-6.0,-5.0]),
>	HarmonicMotionEngine(A=[0,0,0.5], f=[0,0,20.0], fi = [0.0,0.0,pi], ids = vibrationPlate),
>	HarmonicRotationEngine(A=0.2, f=100.0, fi = pi, rotationAxis=[1.0,0.0,0.0], rotateAroundZero = True, zeroPoint = [-15.0,3.0,-7.0], ids = vibrationRotationPlate), 
>     PyRunner(command='rotation()',iterPeriod=100) 
>]
>def rotation():
>    global rotvel 
>    rotvel = 100
>
>but the value of rotvel seems to be always 0. How can I change then a variable located inside of the Engine?
>Thanks, Daniela
>
>-- 
>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.