yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #18325
Re: [Question #675256]: running .so file wrapped by cython parallellized by mpi in yade
Question #675256 on Yade changed:
https://answers.launchpad.net/yade/+question/675256
Status: Solved => Open
Ataollah Nateghi is still having a problem:
Dear Bruno
Can you please show me some example for the second case( importing yade instead of running it)? I am trying to import yade modules and run my code with python but I have some difficulties. What I am doing is (using a simple example from tutorial)
from yade import pack,geom#,plot # or any module that I need
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()]
),
NewtonIntegrator(gravity=(0,0,-9.81),damping=0.4),
PyRunner(command='checkUnbalanced()',realPeriod=2),
PyRunner(command='addPlotData()',iterPeriod=100)
]
O.dt=.5*PWaveTimeStep()
O.trackEnergy=True
def checkUnbalanced():
if unbalancedForce()<.05:
O.pause()
# plot.saveDataTxt('bbb.txt.bz2')
#def addPlotData():
# plot.addData(i=O.iter,unbalanced=unbalancedForce(),**O.energy)
#plot.plots={'i':('unbalanced',None,O.energy.keys)}
#plot.plot()
O.saveTmp()
##################
but I get errors like
NameError: name 'ForceRessetter' is not defined
or
NameError: name 'sphere' is not defined
or in plot case
from yade import plot
ImportError: No module named mtTkinter
I am wondering, what is a good source that I can read for solving these problems.
Thank you so much in advance.
Ataollah
--
You received this question notification because your team yade-users is
an answer contact for Yade.