yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #19941
[Question #681474]: force chain in paraview
New question #681474 on Yade:
https://answers.launchpad.net/yade/+question/681474
Hello All,
I want to model force chain in the paraview, but I have problem to do it. I have the error that "NameError: name 'VTKExporter' is not defined". I was wondering if you could give me an example to solve my problem. Thank you very much.
Best Regards
Alireza
P.S. my code is :
from yade import utils, plot
from yade import pack, qt
from datetime import datetime
qtr=qt.Renderer()
qtr.bgColor=(1,1,1)
#===========================================================
#==================set a periodic boundary==================
#===========================================================
O.periodic=True
O.cell.refSize=(2e-1,2e-1,2e-1)
#==============================================================
#================= define the materials =======================
#==============================================================
O.materials.append(CohFrictMat(normalCohesion= 1e20, shearCohesion= 1e20, isCohesive= True, young=6.81e8, density=1377.5, poisson=0.3, frictionAngle= 0.31, fragile=False, label='Coke'))
#===============================================================
#=================== define packing ============================
#===============================================================
nums=['t']
mats=['Coke']
coke=(5e-3,150)
nums=pack.SpherePack()
nums.makeCloud((0,0,0),(2e-1,2e-1,2e-1),rMean=coke[0],rRelFuzz=0,num=coke[1])
O.bodies.append([utils.sphere(c,r,material=mats[0],color=(0,0,1)) for c,r in nums])
sigmaIso=-1e5
#===============================================================
#=============================VTK===============================
#===============================================================
vtkExporter = VTKExporter('VTK_simulatione')
#===============================================================
#=================== define Engine =============================
#===============================================================
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]
),
PeriTriaxController(label='triax',
goal=(sigmaIso,sigmaIso,sigmaIso),stressMask=7,
dynCell=True,maxStrainRate=(1,1,1),
maxUnbalanced=.01,relStressTol=1e-3,
doneHook='compactionFinished()'
),
NewtonIntegrator(damping=0.4),
PyRunner(iterPeriod=50, command="vtkExporter.exportInteractions(ids='all',what=[('forceN','i.phys.normalForce().norm()')])")
]
O.dt=1e-6
O.saveTmp()
O.run(200000,True)
def compactionFinished():
print 'Finished'
O.pause()
--
You received this question notification because your team yade-users is
an answer contact for Yade.