yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #14534
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,
> I'm new to Yade
welcome :-)
> Because facets don't have ids. :(
all bodies in Yade have ids. When you O.bodies.append multiple bodies at once, a list of their IDs is returnd, so 'ring' in your script is a list of IDs.
O.bodies append with one body returns its ID, so ring.id would not work anyway..
The solution is to use
bottomID = ring[something] # 'something' depends on what is returned geom.facetCylinder, I don't know the function myself..
...
Fz = O.forces.f(bottomID)[2] # 2 is z-component
if you want to sum forces from entire facetCylinder, you can use
fSumZ = sum(O.forces.f(id)[2] for id in ring)
cheers
Jan
--
You received this question notification because your team yade-users is
an answer contact for Yade.