← Back to team overview

yade-users team mailing list archive

Re: [Question #599692]: How to plot the generated z direction force on facet

 

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

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hi Daniel,

beginning of YADE and Python I tough, I remember, byt do not give up :-)

ring is a list of ids,  probably a shorl list, something like [443,446,449]
you can try
print ring[0] # 443 in this example
print ring[1] # 446
print ring[2] # 449
print len(ring) # 3 in this example
print ring[449] # of course it is out of range, since the len is much shorter than 449

if you know ID is 449, you use it directly, no need to get back to ring again
fz = O.forces.f(449)[2]
fSumZ = sum(O.forces.f(id)[2] for id in (449,446,443))

cheers
Jan

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