← Back to team overview

yade-users team mailing list archive

[Question #252203]: is it possible to manually modify interaction forces using PyRunner?

 

New question #252203 on Yade:
https://answers.launchpad.net/yade/+question/252203

Hi, all

I modeled  a spring-mass system in yade, using the remote interaction function of JCFpmMat. But i want to change the value of the interaction forces during the simulation. So I put PyRunner before NewtonIntegrator in O.engines, in order to change the interaction forces before it was used for calculation. But it seems it doesn't work out as I expected. parts of my script are as follows.

##################################################
def changeForce():
    for i in O.interactions:
        i.phys.normalForce=someValue   # for example, someValue=(0,0,0)

O.engines=[
    ...
    PyRunner(command='changeForce()',iterPeriod=1),
    NewtonIntegrator(gravity=[0,0,0],damping=0.2)
]
##################################################

Thanks,

Zixuan Xu

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.