VTK does not work in my code
Hi all,
Can anyone tell me why VTK and Snapshot don’t work in below script?
# encoding: utf-8
# 2012 ©Bruno Chareyre <email address hidden>
# This variant of triax-basic.py shows the usage of cohesive contact laws and moments at contacts
from yade import pack, qt
sp=pack.
## corners of the initial packing
mn,mx=Vector3(
## box between mn and mx, avg radius ± ½(20%), 2k spheres
sp.makeCloud(
## create material #0, which will be used as default
O.materials.
O.materials.
## copy spheres from the packing into the scene
O.bodies.
## create walls around the packing
walls=aabbWalls
wallIds=
triax=TriaxialC
wall_bottom_
wall_top_
wall_left_
wall_right_
wall_back_
wall_front_
internalCompac
sigmaIsoCompac
sigmaLateralCo
max_vel=10,
strainRate=0.03,
label="triax"
)
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
#box-sphere interactions will be the simple normal-shear law, we use ScGeom for them
[Ig2_
#Boxes will be frictional (FrictMat), so the sphere-box physics is FrictMat vs. CohFrictMat, the Ip type will be found via the inheritance tree (CohFrictMat is a FrictMat) and will result in FrictPhys interaction physics
#and will result in a FrictPhys
[Ip2_
#Finally, two different contact laws for sphere-box and sphere-sphere
[Law2_
useIncrement
always_
label=
),
#VTKRecorder(
GlobalStiffnes
triax,
TriaxialStateR
NewtonIntegrat
VTKRecorder(
qt.SnapshotEng
]
O.dt=.5*
# we must open the view explicitly (limitation of the qt.SnapshotEngine)
qt.View()
from yade import plot
O.engines=
def history():
plot.
s11=
s22=
s33=
i=O.iter)
print 'Number of elements: ', len(O.bodies)
print 'Box Volume: ', triax.boxVolume
#plot.plots=
plot.plots=
plot.plot()
print "computing, be patient..."
#First run without moment and without cohesion
O.run(120000,True)
#This will reload the autosaved compacted sample
O.reload()
#second run with rolling friction
O.engines[
O.run(120000,True)
O.reload()
#third run with rolling friction + cohesion
O.engines[
#We assign cohesion to all contacts at the next iteration
O.engines[
O.run(120000,True)
#plot.saveDataT
##or even generate a script for gnuplot. Open another terminal and type "gnuplot plotScriptKEY.
#plot.saveGnupl
## display on the screen (doesn't work on VMware image it seems)
plot.plot()
##### PLAY THE SIMULATION HERE WITH "PLAY" BUTTON OR WITH THE COMMAND O.run(N) #####
rr=yade.
rr.shape=True
rr.intrPhys=True
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jan Stránský
- Solved:
- Last query:
- Last reply: