What is the best way to create a cuboidal box of particles?

Asked by Hashir Ahmad

I am having a problem as to how this box can be created. I have come across the following predicates:

1. pack.inAlignedBox(...)
2. pack.inParallelepiped(...)

But the problem is when I use any of these along with randomDensePack, I get the following error:

No suitable packing in database found, running periodic compression.

Please help!

Question information

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

Hi Hashir,
please provide a complete MWE [1]

> No suitable packing in database found, running periodic compression.

it is no error, just info message

cheers
Jan

[1] https://yade-dem.org/wiki/Howtoask

Revision history for this message
Hashir Ahmad (hash.ir) said :
#2

Here's what I am trying:

pred = pack.inParallelepiped((0,0,0),(4,0,0),(0,2,0),(0,0,2))
sp = pack.randomDensePack(pred,spheresInCell=2000,radius=3.5e-3)
O.bodies.append(sp)

The same code is working for the hyperboloid example given in the documentation. But not for the parallelepiped. It never goes past the "No suitable packing in....." message.

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

Thanks, the complete code made it clear :-) the problem here is number of particles. assuming diameter=7e-3, i.e. in line it would be approx. 150 particles per unit. In your box of size 4x2x2 there would be (4*150)*(2*150)*(2*150)=54e6 particles.
On my 4GB RAM computer, already 1e6 particles occupies significant amount of memory, your example made my computer freeze completely :-)

radius=3.5e-2 works perfectly in my case

back to your original question, pack.inAlignedBox is a special case of pack.inParallelepiped, so the approaches are pretty equivalent. For a box, I would prefer pack.inAlignedBox as the meaning is clearer and the parameters are more readable in case of box

cheers
Jan

Revision history for this message
Hashir Ahmad (hash.ir) said :
#4

Hey Jan

You're right. pack.inAlignedBox did work like a charm. And the code works efficiently taking radius around that value.
Thank You!

Regards
Hashir