← Back to team overview

yade-users team mailing list archive

Re: [Question #678308]: save spheres coordinates to a file

 

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

    Status: Open => Answered

Robert Caulk proposed the following answer:
O.bodies contains all bodies, including any walls (Facet) you might have
appended. I guess walls don't have radii :-)

You can use a check like this:

def myaddData():
   for b in O.bodies:
      if not isinstance(b.shape,sphere): continue
      idt,rad=b.id,b.shape.radius
      x,y,z=b.state.pos[0],b.state.pos[1],b.state.pos[2]
      veloc,force=b.vel[2],O.forces.f(b.id)
      fil.write("{:e} {:e} {:e} {:e} {:e} {:e} {:e}\n".format(idt,x,y,z,veloc,rad,force)) # ( .format = % )

>> yade.wrapper.Recorder(addIternNum=True,file=fil)

Recorder is a separate engine in Yade [1], one that appears to have very
little documentation associated with it. I've never used it, I use
VTKRecorder for this type of data collection [2].

[1]https://yade-dev.gitlab.io/trunk/yade.wrapper.html#yade.wrapper.Recorder
[2]https://yade-dev.gitlab.io/trunk/user.html#saving-data-during-the-simulation

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