← Back to team overview

yade-users team mailing list archive

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

 

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

Hi!

First of all I'm new to Yade and sorry if my problem is very simple, but i have no idea how to do it.
I'm making a gravity deposition and I want to plot the z direction force that generates on the ground facet.
How should I do it? Because facets don't have ids. :(
Thanks!

My code:

from yade import pack, plot, qt

sp=pack.SpherePack()
sp.makeCloud((-.7,-.7,6),(.7,.7,10),rMean=.1,rRelFuzz=.2)
sp.toSimulation()

ring=O.bodies.append(geom.facetCylinder((0,0,0),radius=3,height=3,wallMask=6))

O.engines=[
   ForceResetter(),
   # sphere, facet
   InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
   InteractionLoop(
      [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
      [Ip2_FrictMat_FrictMat_FrictPhys()],
      [Law2_ScGeom_FrictPhys_CundallStrack()]
   ),
   NewtonIntegrator(gravity=(0,0,-9.81),damping=0.5),
   PyRunner(command='addPlotData()',iterPeriod=200),
]
O.dt=.5*PWaveTimeStep()
O.step()

def addPlotData():
   Fz=O.forces.f(ring.id)[1]      #the problem is somewhere here
   plot.addData(Fz=Fz,t=O.time,unbalanced=unbalancedForce(),i=O.iter)

plot.plots={'i':('unbalanced'),'t':('Fz',)}
plot.plot()

O.saveTmp()
v=qt.View()
v.eyePosition=(10,0,-1);v.upVector=(0,0,1);v.viewDir=(-9.5,0,0)

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