← Back to team overview

yade-users team mailing list archive

Re: [Question #678682]: export final position of spheres from 'Bounching sphere'

 

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

    Status: Open => Answered

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

> I am very new to yade.

welcome :-)

> After exporting, i see always the initial positions of spheres are
exported.

Please, provide a working code. I have tried your and got SyntaxError at
textExt. If I correct it by adding comma after NewtonIntegrator, I get
"NameError: name 'textExt' is not defined".

> I want to extract the final positions of the sphere after they come in rest.
> Is there any way it is possible to export the final positions of sphere as text file?

of course it is possible :-) see below. Personally I see a bigger
problem in the definition of "the rest".

> I have tried other options in export module but was not successful.

please always try to be specific enough, i.e.:
- what other options have you tried (other than what? see my first comment)
- what "was not successful" mean? Some error? Again initial position saved? ...?

You can try e.g. (your code without comments and the problematic part in O.engines):
###
from yade import export, plot

O.bodies.append([
 sphere(center=(0,0,0),radius=.5,fixed=True),
 sphere((0,0,2),.5)
])

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb()]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()]
 ),
 NewtonIntegrator(gravity=(0,0,-9.81),damping=0.1),
]

O.dt=.5*PWaveTimeStep()

# this is new, running and exporting part
O.run(5000,True) # instead of 5000 you can put different value
export.textExt('lets_see.txt',format='x_y_z_r',comment='Final state of the spheres')
###

cheers
Jan

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