random algorithm of makecloud

Asked by GUANGYAO LI on 2020-08-11

Hi everyone,

I have tried many methods to find out the random algorithm used in MakeCloud , but I could not find the answer. Could anyone help me with that? Are there any papers or reference books that give a detailed introduction to the random algorithm?
Thanks in advance!

Guangyao

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
GUANGYAO LI
Solved:
2020-08-13
Last query:
2020-08-13
Last reply:
2020-08-11
Jan Stránský (honzik) said : #1

Hello,

what is "the random algorithm"?

1) the internal random number generator?
It is std::mt19937 [1]

2) the general method of makeCloud?
have a look at the source code [2].
The algorithm is straightforward, it places randomly spheres and checks overlap with already placed spheres.
In the case of no overlap, it continues with other particles until the finish condition.
If there is an overlap, it retries to place the particle. If the amount of retries is too high, exit.

Roughly:
1. reset try counter
2. increment try counter, take random radius from given distribution, take random center from the makeCloud cube
3. test if there is an overlap with already existing spheres
4. there is NO overlap: go to 8
5. there IS some overlap: go to TODO
6. if try counter is too high: exit with some warning
7. go to 2
8. check terminal condition (number of particles, porosity, ...) according to input parameters
9. terminal condition fulfilled? then exit
10. terminal condition not fulfilled? go to 1

cheers
Jan

[1] https://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine
[2] https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/SpherePack.cpp#L111

GUANGYAO LI (yaogezuiniu131) said : #2

Hi Jan,

Many thanks for your prompt reply! That helps me a lot!

Best regards,
Guangyao