← Back to team overview

yade-users team mailing list archive

Re: [Question #681115]: How to plot vector plot in Paraview for particle displacement of simulation run in Yade?

 

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

Jan Stránský proposed the following answer:
Hi Nicholas,

you can use export.VTKExporter [1], created exactly for this purposes:

###
# something simple to save
from yade import export
s1,s2 = sphs = (
   sphere((1,2,3),4),
   sphere((5,6,7),8),
)
s1.state.vel = (2,3,4)
s2.state.vel = (5,6,7)
O.bodies.append(sphs)
O.step()
# actual save
vtk = export.VTKExporter("dspl-export")
vtk.exportSpheres(
   useRef=True, # saves original position of particles, use it or not according to your needs
   what=[("dspl","b.state.displ()")] # saves displacement vector, labeled 'dspl' in Paraview
)
###

you can also use the last command in PyRunner

cheers
Jan

[1] https://yade-
dem.org/doc/yade.export.html#yade.export.VTKExporter.exportSpheres

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