← 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

Jan Stránský proposed the following answer:
>
>
>
> I forgot to add script in my last comment, so the script am using is
> below:
>

I will have a look later, sorry..


>
> So this program generates three files, for the periodic spheres in three
> directions. Is there anything wrong with script am using?
>

Initially I showed you only x direction as an example, I think you can then
merge all directions into one single file. It is also possible, that you
would have to specially treat corners :-)

I know that the beginning of working with periodic yade is not easy and
needs some time, so do not feel upset not understanding everything
imediatelly :-)

cheers
Jan


PS: a mind training: generate your periodic packing, and than run:

import random
ri = random.randint

calm() # sets zero velocity to all particles
for b in O.bodies:
   x,y,z = ri(-5,5), ri(-5,5), ri(-5,5) # some random integers
   shift = Vector3(O.cell.size[0]*x, O.cell.size[1]*y, O.cell.size[2]*z) #
shift of particles to be applied, as a random multiplication of cell size
   vel = shift/O.dt # transfer shift to velocity as Yade don't like direct
position assignment
   b.state.vel = vel
O.step() # apply new positions
calm() # sets zero velocities

now your packing should look almost the same as before these steps, but the
actual positions of particles are complete mess for the first sight (if you
print or export it)

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