IndexError
Hi teachers
I run uniax-post.py , but there is a error. I do not know how to modify .
Running script /home/py/
Traceback (most recent call last):
File "bins/yade-
execfile(
File "/home/
pylab.figure(); ax,map=
File "/home/
ct=
File "/usr/lib/
return mcontour.
File "/usr/lib/
ContourSet.
File "/usr/lib/
self.
File "/usr/lib/
self.
IndexError: index out of bounds
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Revision history for this message
|
#1 |
Hello,
I have just found, that the script examples/
working. Is this also your case?
cheers
Jan
2013/11/13 pingyang.
> New question #239133 on Yade:
> https:/
>
> Hi teachers
> I run uniax-post.py , but there is a error. I do not know how to
> modify .
>
> Running script /home/py/
> Traceback (most recent call last):
> File "bins/yade-
> execfile(
> File "/home/
> pylab.figure();
> ax,map=
> File "/home/
> plot
>
> ct=axes.
> File "/usr/lib/
> contour
> return mcontour.
> File "/usr/lib/
> __init__
> ContourSet.
> File "/usr/lib/
> __init__
> self._process_
> File "/usr/lib/
> _process_levels
> self._levels.
> IndexError: index out of bounds
>
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______
> Mailing list: https:/
> Post to : <email address hidden>
> Unsubscribe : https:/
> More help : https:/
>
Revision history for this message
|
#2 |
Hi
I first run the script examples/
At 2013-11-13 15:26:20,"Jan Stránský" <email address hidden> wrote:
>Your question #239133 on Yade changed:
>https:/
>
> Status: Open => Answered
>
>Jan Stránský proposed the following answer:
>Hello,
>I have just found, that the script examples/
>working. Is this also your case?
>cheers
>Jan
>
>
>2013/11/13 pingyang.
>
>> New question #239133 on Yade:
>> https:/
>>
>> Hi teachers
>> I run uniax-post.py , but there is a error. I do not know how to
>> modify .
>>
>> Running script /home/py/
>> Traceback (most recent call last):
>> File "bins/yade-
>> execfile(
>> File "/home/
>> pylab.figure();
>> ax,map=
>> File "/home/
>> plot
>>
>> ct=axes.
>> File "/usr/lib/
>> contour
>> return mcontour.
>> File "/usr/lib/
>> __init__
>> ContourSet.
>> File "/usr/lib/
>> __init__
>> self._process_
>> File "/usr/lib/
>> _process_levels
>> self._levels.
>> IndexError: index out of bounds
>>
>>
>> --
>> You received this question notification because you are a member of
>> yade-users, which is an answer contact for Yade.
>>
>> _______
>> Mailing list: https:/
>> Post to : <email address hidden>
>> Unsubscribe : https:/
>> More help : https:/
>>
>
>--
>If this answers your question, please go to the following page to let us
>know that it is solved:
>https:/
>
>If you still need help, you can reply to this email or go to the
>following page to enter your feedback:
>https:/
>
>You received this question notification because you asked the question.
Revision history for this message
|
#3 |
Hi
this is the modified script, can you help me find where the error has? I want to run only "uniax-compression" and save '/tmp/uniax-
from __future__ import division
from yade import utils,plot,
import time, sys, os, copy
#import matplotlib
#matplotlib.
#matplotlib.
# default parameters or from table
utils.readParam
young=24e9,
poisson=.2,
sigmaT=3.5e6,
frictionAngle=
epsCrackOnset=
crackOpening=1e-6,
intRadius=1.5,
dtSafety=.8,
damping=0.4,
strainRateTens
strainRateComp
setSpeeds=True,
# 1=tension, 2=compression (ANDed; 3=both)
doModes=2,
specimenLength=.1,
sphereRadius=2e-3,
# isotropic confinement (should be negative)
isoPrestress=0,
# use the ScGeom variant
scGeom=False
)
from yade.params.table import *
if 'description' in O.tags.keys(): O.tags[
# make geom; the dimensions are hard-coded here; could be in param table if desired
# z-oriented hyperboloid, length 20cm, diameter 10cm, skirt 8cm
# using spheres 7mm of diameter
concreteId=
spheres=
#spheres=
O.bodies.
bb=utils.
negIds,
O.dt=dtSafety*
print 'Timestep',O.dt
mm,mx=[pt[axis] for pt in utils.aabbExtre
coord_25,
area_25,
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
NewtonIntegrat
CpmStateUpdate
UniaxialStrain
PyRunner(
PyRunner(
]
#O.miscParams=
# plot stresses in ¼, ½ and ¾ if desired as well; too crowded in the graph that includes confinement, though
plot.plots=
O.saveTmp(
xmin=-0.025
xmax=0.025
ymin=-0.0015
ymax=0.0015
zmin=-0.025
zmax=0.03
for b in O.bodies:
if ((xmin&
print 'Inside sphere ID:', b.id, b.state.pos, '\n'
O.bodies.
O.timingEnabled
global mode
mode='tension' if doModes & 1 else 'compression'
def initTest():
global mode
print "init"
if O.iter>0:
O.wait();
O.loadTmp(
print "Reversing plot data"; plot.reverseData()
else: plot.plot(
strainer.
try:
from yade import qt
renderer=
renderer.
except ImportError: pass
print "init done, will now run."
O.step(); # to create initial contacts
# now reset the interaction radius and go ahead
if not scGeom: ss2d3dg.
else: ss2sc.interacti
is2aabb.
O.run()
def stopIfDamaged():
global mode
if O.iter<2 or not plot.data.
sigma,
extremum=
minMaxRatio=0.5 if mode=='tension' else 0.5
if extremum==0: return
# uncomment to get graph for the very first time stopIfDamaged() is called
#eudoxos.
print O.tags[
import sys; sys.stdout.flush()
if abs(sigma[
if mode=='compression' and doModes & 2: # only if compression is enabled
mode='tension'
O.save(
print "Saved /tmp/uniax-
print "Damaged, switching to compression... "; O.pause()
# important! initTest must be launched in a separate thread;
# otherwise O.load would wait for the iteration to finish,
# but it would wait for initTest to return and deadlock would result
import thread; thread.
return
else:
print "Damaged, stopping."
ft,fc=
print 'Strengths fc=%g, ft=%g, |fc/ft|
title=
print 'gnuplot'
print 'Bye.'
#O.pause()
sys.exit(0)
def addPlotData():
yade.plot.
'sigma.
'sigma.
'sigma.
})
plot.plot(
#O.run()
initTest()
utils.waitIfBatch()
At 2013-11-13 15:26:20,"Jan Stránský" <email address hidden> wrote:
>Your question #239133 on Yade changed:
>https:/
>
> Status: Open => Answered
>
>Jan Stránský proposed the following answer:
>Hello,
>I have just found, that the script examples/
>working. Is this also your case?
>cheers
>Jan
>
>
>2013/11/13 pingyang.
>
>> New question #239133 on Yade:
>> https:/
>>
>> Hi teachers
>> I run uniax-post.py , but there is a error. I do not know how to
>> modify .
>>
>> Running script /home/py/
>> Traceback (most recent call last):
>> File "bins/yade-
>> execfile(
>> File "/home/
>> pylab.figure();
>> ax,map=
>> File "/home/
>> plot
>>
>> ct=axes.
>> File "/usr/lib/
>> contour
>> return mcontour.
>> File "/usr/lib/
>> __init__
>> ContourSet.
>> File "/usr/lib/
>> __init__
>> self._process_
>> File "/usr/lib/
>> _process_levels
>> self._levels.
>> IndexError: index out of bounds
>>
>>
>> --
>> You received this question notification because you are a member of
>> yade-users, which is an answer contact for Yade.
>>
>> _______
>> Mailing list: https:/
>> Post to : <email address hidden>
>> Unsubscribe : https:/
>> More help : https:/
>>
>
>--
>If this answers your question, please go to the following page to let us
>know that it is solved:
>https:/
>
>If you still need help, you can reply to this email or go to the
>following page to enter your feedback:
>https:/
>
>You received this question notification because you asked the question.
Revision history for this message
|
#4 |
This question was expired because it remained in the 'Open' state without activity for the last 15 days.
Revision history for this message
|
#5 |
Hello,
try to run it also with the tensile part, the IndexError might deend on
this (e.g. the uniax-post.py tried to plot both tension and compression,
saved under 0 and 1 index, but there is only one index present).
cheers
Jan
2013/11/13 pingyang.
> Question #239133 on Yade changed:
> https:/
>
> pingyang.
> Hi
> this is the modified script, can you help me find where the error
> has? I want to run only "uniax-compression" and save
> '/tmp/uniax-
>
>
> from __future__ import division
>
> from yade import utils,plot,
> import time, sys, os, copy
>
> #import matplotlib
> #matplotlib.
>
> #matplotlib.
>
>
> # default parameters or from table
> utils.readParam
> young=24e9,
> poisson=.2,
>
> sigmaT=3.5e6,
> frictionAngle=
> epsCrackOnset=1e-4,
> crackOpening=1e-6,
>
> intRadius=1.5,
> dtSafety=.8,
> damping=0.4,
> strainRateTensi
> strainRateCompr
> setSpeeds=True,
> # 1=tension, 2=compression (ANDed; 3=both)
> doModes=2,
>
> specimenLength=.1,
> sphereRadius=2e-3,
>
> # isotropic confinement (should be negative)
> isoPrestress=0,
>
> # use the ScGeom variant
> scGeom=False
> )
>
> from yade.params.table import *
>
> if 'description' in O.tags.keys():
> O.tags[
>
>
> # make geom; the dimensions are hard-coded here; could be in param table
> if desired
> # z-oriented hyperboloid, length 20cm, diameter 10cm, skirt 8cm
> # using spheres 7mm of diameter
>
> concreteId=
>
>
> spheres=
>
> #spheres=
> O.bodies.
> bb=utils.
>
> negIds,
> O.dt=dtSafety*
> print 'Timestep',O.dt
>
> mm,mx=[pt[axis] for pt in utils.aabbExtre
> coord_25,
>
> area_25,
>
> O.engines=[
> ForceResetter(),
>
> InsertionSortCo
> InteractionLoop(
>
> [Ig2_Sphere_
> scGeom else
> Ig2_Sphere_
> [Ip2_CpmMat_
> [Law2_Dem3DofGe
> else Law2_ScGeom_
> ),
> NewtonIntegrato
> CpmStateUpdater
>
> UniaxialStraine
>
> PyRunner(
>
> PyRunner(
> ]
>
> #O.miscParams=
>
> # plot stresses in ¼, ½ and ¾ if desired as well; too crowded in the graph
> that includes confinement, though
> plot.plots=
> #'sigma.
>
> O.saveTmp(
>
>
> xmin=-0.025
> xmax=0.025
> ymin=-0.0015
> ymax=0.0015
> zmin=-0.025
> zmax=0.03
> for b in O.bodies:
> if
> ((xmin&
> print 'Inside sphere ID:', b.id, b.state.pos, '\n'
> O.bodies.
>
>
> O.timingEnabled
>
> global mode
> mode='tension' if doModes & 1 else 'compression'
>
> def initTest():
> global mode
> print "init"
> if O.iter>0:
> O.wait();
> O.loadTmp(
> print "Reversing plot data"; plot.reverseData()
> else: plot.plot(
> strainer.
> -abs(strainRate
> try:
> from yade import qt
> renderer=
> renderer.
> else (100,100,100)
> except ImportError: pass
> print "init done, will now run."
> O.step(); # to create initial contacts
> # now reset the interaction radius and go ahead
> if not scGeom: ss2d3dg.
> else: ss2sc.interacti
> is2aabb.
>
> O.run()
>
> def stopIfDamaged():
> global mode
> if O.iter<2 or not plot.data.
> nothing at the very beginning
> sigma,eps=
> extremum=max(sigma) if (strainer.
> minMaxRatio=0.5 if mode=='tension' else 0.5
> if extremum==0: return
> # uncomment to get graph for the very first time stopIfDamaged()
> is called
>
> #eudoxos.
> print O.tags[
> import sys; sys.stdout.flush()
> if abs(sigma[
> abs(strainer.
> if mode=='compression' and doModes & 2: # only if
> compression is enabled
> mode='tension'
> O.save(
> print "Saved /tmp/uniax-
> use with interaction-
> print "Damaged, switching to compression... ";
> O.pause()
> # important! initTest must be launched in a
> separate thread;
> # otherwise O.load would wait for the iteration to
> finish,
> # but it would wait for initTest to return and
> deadlock would result
> import thread; thread.
> return
> else:
> print "Damaged, stopping."
> ft,fc=max(
> print 'Strengths fc=%g, ft=%g,
> |fc/ft|
> title=O.
> O.tags.keys() else O.tags['params']
> print
> 'gnuplot'
> print 'Bye.'
> #O.pause()
> sys.exit(0)
>
> def addPlotData():
>
> yade.plot.
>
> 'sigma.
>
> 'sigma.
>
> 'sigma.
> })
> plot.plot(
> #O.run()
> initTest()
>
> utils.waitIfBatch()
> At 2013-11-13 15:26:20,"Jan Stránský" <
> <email address hidden>> wrote:
> >Your question #239133 on Yade changed:
> >https:/
> >
> > Status: Open => Answered
> >
> >Jan Stránský proposed the following answer:
> >Hello,
> >I have just found, that the script examples/
> not
> >working. Is this also your case?
> >cheers
> >Jan
> >
> >
> >2013/11/13 pingyang.
> >
> >> New question #239133 on Yade:
> >> https:/
> >>
> >> Hi teachers
> >> I run uniax-post.py , but there is a error. I do not know how to
> >> modify .
> >>
> >> Running script /home/py/
> >> Traceback (most recent call last):
> >> File "bins/yade-
> >> execfile(
> >> File "/home/
> >> pylab.figure();
> >> ax,map=
> >> File "/home/
> >> plot
> >>
> >>
> ct=axes.
> >> File "/usr/lib/
> >> contour
> >> return mcontour.
> >> File "/usr/lib/
> in
> >> __init__
> >> ContourSet.
> >> File "/usr/lib/
> in
> >> __init__
> >> self._process_
> >> File "/usr/lib/
> in
> >> _process_levels
> >> self._levels.
> >> IndexError: index out of bounds
> >>
> >>
> >> --
> >> You received this question notification because you are a member of
> >> yade-users, which is an answer contact for Yade.
> >>
> >> _______
> >> Mailing list: https:/
> >> Post to : <email address hidden>
> >> Unsubscribe : https:/
> >> More help : https:/
> >>
> >
> >--
> >If this answers your question, please go to the following page to let us
> >know that it is solved:
> >https:/
> >
> >If you still need help, you can reply to this email or go to the
> >following page to enter your feedback:
> >https:/
> >
> >You received this question notification because you asked the question.
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______
> Mailing list: https:/
> Post to : <email address hidden>
> Unsubscribe : https:/
> More help : https:/
>