How to accesss the saved data in tutorials?

Asked by Yaswanth Kalepu on 2020-04-14

I am running Oedometric test and gravity deposition examples of tutorial.

I want the location and radius information of the spheres after gravity deposition and Oedometric test.
How to access this information from the O.saveTmp()?

I actually want to generate random spheres with gaussian distribution of radius, which have to be used in the gravity deposition.

Application: I want to generate the metallic powder bed for additive manufacturing.

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Yaswanth Kalepu
Solved:
2020-04-14
Last query:
2020-04-14
Last reply:
2020-04-14
Jan Stránský (honzik) said : #1

Hello,

> I want the location and radius information of the spheres after gravity deposition and Oedometric test.
> How to access this information ...

How to access:
###
for b in O.bodies:
   location = b.state.pos
   radius = b.shape.radius
# or
# b = O.bodies[someID]
###

How to save:
e.g. using export module [2]:
export.text("particle_data.dat")

> How to access this information from the O.saveTmp()?

1) O.loadTmp() # [3,4]
2) see above

> I actually want to generate random spheres with gaussian distribution of radius,

if this is a question and you want an answer (not clear), please open a new question as it is unrelated to saving/accessing data [1]

cheers
Jan

[1] https://www.yade-dem.org/wiki/Howtoask
[2] https://yade-dem.org/doc/yade.export.html
[3] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Omega.saveTmp
[4] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Omega.loadTmp

I added the following line at the end to the gravity deposition example >>> export.text("particle_data.dat")

I get the foloowing error:
Traceback (most recent call last):
  File "/usr/bin/yade", line 182, in runScript
    execfile(script,globals())
  File "02-gravity-deposition.py", line 66, in <module>
    export.text("particle_data.dat")
NameError: name 'export' is not defined
[[ ^L clears screen, ^U kills line. F8 plot. ]]

From the link you shared I added the following lines to gravity example but again error>>>
exportSpheres(ids='all', what={}, comment='comment', numLabel=None, useRef=False)[source]
export.text("particle_data.dat")

I get the following error:
exportSpheres(ids='all', what={}, comment='comment', numLabel=None, useRef=False)[source]
export.text("particle_data.dat")

Jan Stránský (honzik) said : #3

from yade import export
export.text(...)

or

yade.export.text(...)

Jan

Jan Stránský (honzik) said : #4

yade.export.text does not work, so use the first option
Jan

Thank You Very Much :)