← Back to team overview

yade-users team mailing list archive

Re: [Question #478785]: Export VTK files to txt files

 

Question #478785 on Yade changed:
https://answers.launchpad.net/yade/+question/478785

Yor1 posted a new comment:
Hello Jan and Bruno,

Finally i use these lines in the recorder to obtain the text files
peridically :

if (O.iter%1000==302):
      f = open(str(O.iter)+'_data_spheres', 'w')
      for b in O.bodies:
	if (type(b.shape)==Sphere):
	  f.write('{} {} {} {} {} {} {} {} {} {} {} {}\n'.format(b.state.pos[0],b.state.pos[1],b.state.pos[2],b.state.vel[0]*0.1*utils.PWaveTimeStep(),b.state.vel[1]*0.1*utils.PWaveTimeStep(),b.state.vel[2]*0.1*utils.PWaveTimeStep(),b.state.vel[0],b.state.vel[1],b.state.vel[2],s[b.id][0,0],s[b.id][1,1],s[b.id][2,2]))
      print f  

I use this condition "if (O.iter%1000==302)" because my vtk files are
enumerated like this : 40302, 41302, 42302 etc ...

Best regards.
Jabrane

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.