yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #23050
[Question #690741]: Error in saveDataTxt
New question #690741 on Yade:
https://answers.launchpad.net/yade/+question/690741
Hi everyone,
I hope you all are safe and healthy.
I run a triaxial code for the following input data:
print ('============ DEFINING VARIABLES ============')
nRead=readParamsFromTable(
num_spheres=20000,
compFricDegree = 10,
key='_triax_',
unknownOk=True
)
from yade.params import table
num_spheres=table.num_spheres
key=table.key
targetPorosity = 0.4
compFricDegree = table.compFricDegree
finalFricDegree = 29
damp=0.2
thick=0.01
stabilityThreshold=0.01
r_min=0.1*1e-3 # m
d_min=2*r_min # m
r_max=0.3*1e-3 # m
d_max=2*r_max # m
r_avr=(r_min+r_max)/2 # m
d_avr=2*r_avr # m
r_fuz=(r_max/r_avr)-1 # m
young=10e8 # Kn = 2 (E r1 E r2 / E r1 + E r2) >>> E = Kn/r_avr
Kn=young*(d_avr)
Kt=Kn
poisson=Kt/Kn # Kt/Kn
Ls=0.02 # m
mn,mx=Vector3(0,0,0),Vector3(Ls,Ls,Ls)
volume = (mx[0]-mn[0])*(mx[1]-mn[1])*(mx[2]-mn[2])
strainRate=-0.5 # %/sec
target_strain=0.25
sigmaIso=-5e5 # Pa
particleDensity=2000 #kg/m3
at the end of the computation, I want to save data on a text file with the following command:
plot.saveDataTxt('Macro_results')
knowing that I have defined the history function as follows:
from yade import plot
def history():
plot.addData(
e11 = -triax.strain[0],
e22 = -triax.strain[1],
e33 = -triax.strain[2],
ev = -triax.strain[0]-triax.strain[1]-triax.strain[2],
s11 = -triax.stress(triax.wall_right_id)[0],
s22 = -triax.stress(triax.wall_top_id)[1],
s33 = -triax.stress(triax.wall_front_id)[2],
i = O.iter,
t = O.time, # virtual (yade) time --- time of simulation
fab = utils.fabricTensor()[0])
The code runs with no problem until the end of the code, for line:
plot.saveDataTxt('Macro_results')
And I get this error:
============ RECORD AND PLOT DATA ============
Traceback (most recent call last):
File "/home/ehsan/yade/install/bin/yade-2019-08-08.git-775ae74", line 336, in runScript
execfile(script,globals())
File "/usr/lib/python3/dist-packages/past/builtins/misc.py", line 82, in execfile
exec_(code, myglobals, mylocals)
File "Final.py", line 437, in <module>
File "/home/ehsan/yade/install/lib/x86_64-linux-gnu/yade-2019-08-08.git-775ae74/py/yade/plot.py", line 660, in saveDataTxt
for i in range(len(data[vars[0]])):
IndexError: list index out of range
[[ ^L clears screen, ^U kills line. F12 controller, F11 3D view (press "h" in 3D view for help), F10 both, F9 generator, F8 plot. ]]
I want to know if should I use hd5 format file instead of txt file?
Thank you all.
--
You received this question notification because your team yade-users is
an answer contact for Yade.