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

liucheng83 posted a new comment:
Really, I want to build an array like this
tt=[]
tt=[ForceEngine(ids=[i],force=(0,0,i),label="ttForce") for i in ids_sp]
and  tt[0],tt[i] are the ForceEngine,
but I donnot know how to add it to the O.engine if ids_sp is a big number. 
a loop method like "for i in ids_sp " cannot be insert to O.engine like this:

O.engines=[
        ForceResetter(),
        
InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=interactionRadius,label='aabb'),Bo1_Facet_Aabb()]),
        InteractionLoop(
                
[Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=interactionRadius,label='Ig2ssGeom'),
                Ig2_Facet_Sphere_ScGeom(),],
                [Ip2_FrictMat_FrictMat_FrictPhys()],
                [Law2_ScGeom_FrictPhys_CundallStrack()]
        ),
        ## Apply tt Force to some particles
        ForceEngine(ids=[i],force=(0,0,i),label="dragForce"+str(i)) for i in 
ids_spSlurry   # a message SyntaxError: invalid syntax is given
        NewtonIntegrator(damping=0.1,gravity=(0,0,-9.81)),
        
PyRunner(command='checkInteraction()',iterPeriod=iterPeriod_checkInteraction,label='checker')
]

# a message SyntaxError: invalid syntax is given because of using for
loop

PyRunner, which executes O.forces.addF for each particle in each
iteration may be a method, but it is not  the most efficient one, maybe
the force keep as a constant for a time, and then anoter constant for a
next time.

How to solve it, please give some advice, somebody, thank you!

-- 
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@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to