yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #22890
Re: [Question #690127]: Missing particles in VTK
Question #690127 on Yade changed:
https://answers.launchpad.net/yade/+question/690127
Przemek posted a new comment:
I just tried to use this:
vtkExporter = export.VTKExporter('/tmp/vtkExporterTesting')
vtkExporter.exportSpheres(what=dict(dist='b.state.pos.norm()'))
But I had an error:
ValueError Traceback (most recent call last)
/usr/bin/yade in <module>()
/usr/bin/yade in tempCalc()
202
203 vtkExporter = export.VTKExporter('vtkExporterTesting')
--> 204 vtkExporter.exportSpheres(what=dict(dist='b.state.pos.norm()'))
205
206 #export.textExt('test.txt', format='x_y_z_r_attrs', attrs=['b.getTemp()'], comment='temp')
/usr/lib/x86_64-linux-gnu/yade/py/yade/export.py in exportSpheres(self, ids, what, comment, numLabel, useRef)
428 outFile.write("%g\n"%(b.shape.radius))
429 # write additional data from 'what' param
--> 430 for name,command in what: # for each name...
431 test = eval(command) # ... eval one example to see what type (float, Vector3, Matrix3) the result is ...
432 # ... and write appropriate header line and loop over all bodies and write appropriate vtk line(s)
ValueError: too many values to unpack
Yade [2]: ---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
/usr/lib/x86_64-linux-gnu/yade/py/yade/__init__.py in refreshEvent(self)
198 def yzxSlot(self): self.setViewAxes((-1,0,0),(0,0,1))
199 def zxySlot(self): self.setViewAxes((0,-1,0),(1,0,0))
--> 200 def refreshEvent(self):
201 self.refreshValues()
202 self.activateControls()
KeyboardInterrupt:
In case when I used export to txt file, I get:
#format x_y_z_r_attrs
# x y z r temp
0 0 0 0.55 40
1 0 0 0.55 42.3553
2 0 0 0.55 44.7105
3 0 0 0.55 47.0658
4 0 0 0.55 49.421
And after text2vtk:
# vtk DataFile Version 3.0.
comment
ASCII
DATASET POLYDATA
POINTS 4 double
1 0 0
2 0 0
3 0 0
4 0 0
POINT_DATA 4
SCALARS radius double 1
LOOKUP_TABLE default
0.55
0.55
0.55
0.55
SCALARS temp double 1
LOOKUP_TABLE default
42.3553
44.7105
47.0658
49.421
So, in txt I have 5 particles and in vtk file 4... wierd...
--
You received this question notification because your team yade-users is
an answer contact for Yade.