← Back to team overview

yade-users team mailing list archive

Re: [Question #255437]: Periodic random packing of spheres in a cube

 

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

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hi Shailesh,


>
> I tried to run the script, but it generated empty output file with just
> the first line as " x y z "
> I have attached the script that i ran, is there something wrong in that?
>

the indentation is wrong. The indents are extremely important in Python :-)
please try to use the indents I did in my previous email. If you have still
problems, I can send you the script directly (outside this forum, as
attaching files is not possible).


>
> So, " for b in O.bodies" does this also consider the bodies on the edges
> and their periodic images too? Because before intializing the box, it had
> say 72 bodies and after initialising )O.step) there should be more bodies
> including those on the edges. So i tried len(O.bodies), which came out as
> 72. I was thinking, may be in the for loop it does not consider any bodies
> on the edges, so there is no output. Let me kno what you think of my
> understanding.
>
>
O.bodies has always the same length. Let me remind you once more that there
are *no* "bodies on the edges" and every particle is present only once in
the simulation. It might not be easy to understand at first, especially if
you have some background in FEM-like periodic simulations (I remember my
problems). The periodicity is stored "merely" in the interactions,
remembering that the second particle of the interaction is xyz periods form
the first one. Nothing else. So, O.bodies does not contain periodic images.

You can see some "ghost" particles in 3D window, but it is only a
postprocessing and visualization. The program determines which particles
are sufficiently close to the boundary and draw also their periodic images.
But from simulation point of view, number of particles is always the same.

HTH
Jan

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