randomDensePack

Asked by Arthur Mercier

Hi,

I don't understand everything about randomDensePack.

What does this code mean?
"spheres=pack.randomDensePack(pack.inAlignedBox((-.25,-.25,-.5),(.25,.25,.5)),spheresInCell=1000,radius=.01,memoizeDb='/tmp/triaxPackCache.sqlite')
O.bodies.append(spheres)"

I was thinking that meant: we specify the lowest corner and the highest corner of a box (which are here ((-.25,-.25,-.5),(.25,.25,.5))); then we specify that we just want 1000 spheres in that box with a radius of .01.

But I'm wrong. "spheresInCell – if given, the packing will be periodic, with given number of spheres in the periodic cell."
What does that mean ? I can change spheresinCell from 65 to 1000 for example and the number of spheres will be around 2000 anyway.

Thanks !

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

>But I'm wrong. "spheresInCell – if given, the packing will be periodic, with given number of spheres in the periodic cell."
>What does that mean ? I can change spheresinCell from 65 to 1000 for example and the number of spheres will be around 2000 anyway.

This means, that firstly a periodic cell is assembled with number of spheres = spheresInCell parameter and with particles of given radius. When this is finished, desired shape (a cube in given example) is "cut" from that periodic assamble. If the periodic cell is smaller than the desired shape, the assamble is simply copied to proper positions and the shape is cut from this extended assambly..

Jan

Revision history for this message
Arthur Mercier (mercier-arthur) said :
#2

Thanks, but now, how can I define the size of this periodic cell ? Do I need periodic boundary conditions ?

Do I need the finest periodic cell (I mean the smallest) to get a more realistic model ? 'Cause, when you wrote "If the periodic cell is smaller than the desired shape, the assamble is simply copied to proper positions and the shape is cut from this extended assambly..", I understand that "smaller is the periodic cell, more realistic I will be", am I right ?

Revision history for this message
Best Jan Stránský (honzik) said :
#3

>Arthur Mercier is still having a problem:
>Thanks, but now, how can I define the size of this periodic cell ? Do I
>need periodic boundary conditions ?
Periodic boundary conditions are used to create the initial assembly of particles by the function itself. Then only the assembly of particles is copied to your simulation, so you don't need periodic boundary conditions in your actual simulation, you just use the assembly.

>Do I need the finest periodic cell (I mean the smallest) to get a more
>realistic model ? 'Cause, when you wrote "If the periodic cell is
>smaller than the desired shape, the assamble is simply copied to proper
>positions and the shape is cut from this extended assambly..", I
>understand that "smaller is the periodic cell, more realistic I will
>be", am I right ?
You define particle size and the number of particles in the cell. With these parameters, the cell is defined, you have no way to change it. For example, you define 1000 particles in cell, so it will create something like 10x10x10 box (of course with random structure, but something like this). Now, if your simulation cube is of size 5x5x5 particles, it will cut such box form the cell. If your cube is 20x20x5, the periodic cell is copied twice in x and y direction and from this "extended cell" the 20x20x5 cube is cut.

If you have <5000 particles in your simulation, you can use randomDensePack without periodic conditions. But for example for simulation with 200k particles, assembling the initial configuration would take incredibly much time, so there is advantageous to use periodic cell with e.g. 3000 particles (which will be assembled almost imediatelly in comparison with 200k articles) and extend (copy) this 3000 cell to all space occupied by the 200k particles.

Conclusion: Using randomDensePack with spheresInCell=3000 should be good for every case :-) so if you just want to use random dense packing, take it as an axiom :-)

Jan

Revision history for this message
Arthur Mercier (mercier-arthur) said :
#4

Thanks honzik, that solved my question.