← Back to team overview

yade-users team mailing list archive

Re: [Question #679638]: How to assign the values of kn ks of particles in Yade directly

 

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

Jan Stránský posted a new comment:
For future reference, a MWE how to achieve this without modification of
source code:

###
kn = 1e6
radii = [0.7, 0.8, 0.9, 1.0]
centers = [
   (0,0,0),
   (1,0,0),
   (0,1,0),
   (0,0,1),
]
youngs = [kn/r for r in radii]
materials = [FrictMat(young=young,poisson=0.3) for young in youngs]
O.bodies.append([sphere(c,r,material=mat,fixed=True) for c,r,mat in zip(centers,radii,materials)])
O.step()
for i in O.interactions:
   print i.phys.kn,i.phys.ks # prints "1000000.0 300000.0" for 6 interactions
###

cheers
Jan

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