← Back to team overview

yade-users team mailing list archive

Re: [Question #694628]: How do I change the Oedometric compression test to tract particle orientation?

 

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

    Status: Open => Needs information

Jan Stránský requested more information:
Hello,

there is "orientation" in the title, but "Cartesian coordinates" in the
question. Please be consistent and explain what actually you want.

> I have already been using a .py program

please provide the code

> I have not been successful using the following lines

please be more specific. Do you get error? do you get unexpected output?
... ?

The code seems OK.
please provide a MWE [1], without it we can just guess..

> x,y,z=b.state.pos[0],b.state.pos[1],b.state.pos[2]

x,y,z=b.state.pos
does the same job in more readable way

> def myaddData(): ...

have a look at export.textExt [2], with it you can save the spheres with much less code, something like:
###
def myaddData():
   if (O.iter%8==0):
      fn = "timeStep."+str(O.iter)
      comment = "id vz force_x force_y force_z"
      export.textExt(fn,"x_y_z_r_attrs",comment=comment,attrs=["b.id","b.state.vel[2]","O.forces.f(b.id)"])
###

cheers
Jan

[1] https://www.yade-dem.org/wiki/Howtoask
[2] https://yade-dem.org/doc/yade.export.html#yade.export.textExt

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