← Back to team overview

yade-users team mailing list archive

Re: [Question #670358]: about growParticle()

 

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

Description changed to:
I try to change the particle's radius in simulation.and I write code like this:
-----------------------------------------------------------------------------------------------------------------------------
O.bodies.append(geom.facetBox((.5,.5,.5),(.5,.5,.5),wallMask=15))
O.bodies.append(facet([(0,0,0),(1,1,0),(1,0,0)]))
O.bodies.append(facet([(0,0,0),(1,1,0),(0,1,0)]))
O.bodies.append(sphere([0.5,0.5,0.5],0.08))

O.bodies[8].state.vel=(0,0,0.01)
O.bodies[9].state.vel=(0,0,0.01)

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.81),damping=0.4),
PyRunner(iterPeriod=100,command='pengzhang()'),

]
O.dt=0.0005*PWaveTimeStep()

Ql=[]
globals()['Ql']=locals()['Ql']
Ql=Ql+[O.bodies[-1]]
def pengzhang(): 
    for i in Ql:
           growParticle(i.id,1.5,updateMass=True)

globals()['pengzhang']=locals()['pengzhang']

O.run(202)
--------------------------------------------------------------------------------------------
When simulation is completed, the particle's radius does not change.

but if I change pengzhang() like this:
------------------------------------------------------------------------------------------------
def pengzhang(): 
      growParticle(O.bodies[-1].id,1.5,updateMass=True)
-----------------------------------------------------------------------------------------------
the particle's radius changes.
Can you give me suggestion?
I need to use--- 
  for i in Ql:
           growParticle(i.id,1.5,updateMass=True) 
---------------------------to do future work.
Thanks very much!

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