KeyError while accessing data from a script
Hi all,
I run peri3dControlle
stressXX = plot.data['sx'] as given in the scrip (this is just to check whether it works though I need all the data) but when I run this, it gives KeyError. Any helps to overcome this is appreciated.
Also, I am wondering what is /tmp/packDb.sqlite and how to access that.
kumara@
Welcome to Yade 0.60
TCP python prompt on localhost:9000, auth cookie `dsausy'
XMLRPC info provider on http://
Running script peri3dControlle
Considering packing (radius=
ACCEPTED
Found suitable packing in /tmp/packDb.sqlite (radius=
Traceback (most recent call last):
File "/usr/bin/yade", line 152, in runScript
execfile(
File "peri3dControll
iters = plot.data['iter']
KeyError: 'iter'
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view, F10 both, F9 generator, F8 plot. ]]
Regards,
Janaka
.......
# peri3dControlle
# script, that explains funcionality and input parameters of Peri3dController on the example of
# triaxial compression.
# Firstly, a hydrostatic preassure is applied, then a strain along z axis is increasing
# while x- and y- stress is constant
# The simulation is run on rotated cell to enable localization and strain softening
# (you can also try simulation with command sp.toSimulation() with no rotation,
# in this case there is almost no difference, but in script peri3dControlle
# the cell rotation has significant effect)
from yade import pack,plot,qt
# define material
O.materials.
# create periodic assembly of particles
initSize=1.2
sp=pack.
angle=0
rot=Matrix3(
sp.toSimulation
# plotting
plot.live=False
plot.plots=
def plotAddData():
plot.addData(
iter=
sx=p3d.
syz=p3d.
ex=p3d.
eyz=p3d.
)
iters = plot.data['iter']
stressXX = plot.data['sx']
O.dt=utils.
# define the first part of simulation, hydrostatic compression
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
NewtonIntegrat
Peri3dController( goal=(-
nSteps=500,
label='p3d'
),
PyRunner(
]
O.run(); O.wait()
# second part, z-axis straining and constant transversal stress
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
NewtonIntegrat
Peri3dController( goal=(-
nSteps=1000,
label='p3d',
),
PyRunner(
]
O.run();O.wait()
plot.plot()
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask janaka kumara for more information if necessary.