PDFEngine

Asked by nobody on 2019-10-08

Hi All,

I want to use the PDFEngine in my simulation, and I found an answer, but it seems not to work.

here is my MWE:

from yade import pack, plot, export
import math
O.bodies.append(geom.facetBox((.5,.5,.5),(.5,.5,.5),wallMask=31))
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(1,1,1),rMean=.05,rRelFuzz=.5)
sp.toSimulation()
O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()]
 ),
 PyRunner(command='checkUnbalanced()',realPeriod=2),
 #PyRunner(command='addPlotData()',iterPeriod=100),
 #PyRunner(command='subbox()',iterPeriod=100),
 #PyRunner(command='stress_export()',iterPeriod=1000),
 #PyRunner(command='get_component()',iterPeriod=1000),
 NewtonIntegrator(gravity=(0,0,-9.81),damping=0.4),
 #PDFEngine(filename="PDF.txt",iterPeriod= 1000),
 PDFEngine(filename="PDF.txt", iterPeriod=1000, numDiscretizeAnglePhi=20,numDiscretizeAngleTheta=20)
]
O.dt=.5*PWaveTimeStep()
print(len(O.bodies))
def checkUnbalanced():
 if unbalancedForce()<.0001:
  O.pause()
  #plot.saveDataTxt('bbb.txt')
def addPlotData():
 plot.addData(i=O.iter,unbalanced=unbalancedForce())
#plot.plots={'i':('unbalanced')}
#plot.plot()

###################
when I run this, here is the error:

Welcome to Yade 2018.02b
TCP python prompt on localhost:9000, auth cookie `udeyas'
XMLRPC info provider on http://localhost:21000
Running script test.py
Traceback (most recent call last):
  File "/usr/bin/yade", line 182, in runScript
    execfile(script,globals())
  File "test.py", line 22, in <module>
    PDFEngine(filename="PDF.txt", iterPeriod=1000, numDiscretizeAnglePhi=20,numDiscretizeAngleTheta=20)
NameError: name 'PDFEngine' is not defined

https://answers.launchpad.net/yade/+question/682859 #3,

I did as they said, but the error said that I didn't define the name.

best,
yong

Question information

Language:
English Edit question
Status:
Open
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
2019-10-08
Last reply:

Can you help with this problem?

Provide an answer of your own, or ask nobody for more information if necessary.

To post a message you must log in.