Page 117 - The Combined Finite-Discrete Element Method
P. 117
100 CONTACT DETECTION
3167112145 9 4 812613 15110
3 < 8, 10 > 8,
so it so it
stays stays
Figure 3.30 Sorting concept.
3167112145 9 4 812613 15110
16 > 8, 1 < 8,
so it so it
moves moves
Figure 3.31 Number 16 and 1 need to swap places.
3 1 7112145 9 4 812613 15 16 10
7 < 8, 15 > 8,
so it so it
stays stays
Figure 3.32 No swapping needed.
3 1 7112145 9 4 812613 15 16 10
11 > 8, 13 > 8,
so it so it
moves stays
Figure 3.33 No pair to swap exists yet.
The first number is supposed to be smaller than 8, while the second is supposed to be
greater than 8, as shown in Figure 3.30.
If this is not the case, as shown in Figure 3.31, the two numbers are swapped.
The process is repeated until a new pair of numbers that require swapping is found
(Figures 3.32, 3.33).
The swapping sequence is continued as shown in Figures 3.35–3.37, finally resulting
in the original array being split into two sub-arrays, as shown in Figure 3.38. The first
array has all numbers smaller than the medium number (i.e. smaller than 8), and the
second array contains all numbers grater than 8.
The total number of operations performed so far is proportional to the size of the array,
i.e. to the total number of discrete elements N. Now the array is split into two arrays, as
shown in Figure 3.38. Array X 1,A contains all numbers smaller than 8, while array X 1,B
contains all numbers grater or equal to 8.