← Back to team overview

yade-users team mailing list archive

Re: [Question #223165]: How to save data into a file?

 

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

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hello Aalam,

personally I don't know how you can save from inspector, but you can save
the data directly from your python script:

f = open("somFileName","w")
b = O.bodies[70]
pos = b.state.pos
intrs = b.intrs()
f.write("%s \n"%str(pos))
for i in intrs:
  f.write("%s \n"%i.phys.normalForce) # depends on what you mean by "save
the data of interactions"
f.close()

HTH at least a bit
Jan


2013/3/1 Aalam Singh Cheema <question223165@xxxxxxxxxxxxxxxxxxxxx>

> New question #223165 on Yade:
> https://answers.launchpad.net/yade/+question/223165
>
> Hi I was running my script on a cylinder with rotating base and some
> spheres falling into it. I had a shpere of id=70 and went to the inspector
> to look at position of body no 70 and interactions. I have some questions :-
>
> 1. Can I save the data of positions into a file directly from Inspector?
> 2. Can I fix body number 70 in interactions, to see only its interactions
> with other bodies? If so how can I save the data of interactions in the
> file.
>
> Many Thanks
> Aalam S Cheema
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to     : yade-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp
>

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.