Page 113 - The Combined Finite-Discrete Element Method
P. 113

96     CONTACT DETECTION

              For array D to contain a meaningful representation of spatial distribution of discrete
            elements, all three arrays are sorted relative to the integerised x and y coordinates, i.e.
            relative to the content of arrays X and Y.
              The first sorting relative to the contents of array X is performed as shown in Figure 3.23.
              In the case where the content of array X is the same, sorting relative to the content of
            array Y is performed as shown in Figure 3.25.
              After the sorting operation is completed, no information is lost. Array D still contains
            the discrete element ‘names’ (i.e. numbers), while arrays X and Y contain the cell onto
            which a particular discrete element is mapped. For instance, after the sorting operation, it
            is still evident from arrays D, X and Y that discrete element 1 is mapped onto cell (4,7),
            while the discrete element 3 is mapped onto cell (4,6) and discrete element 7 is mapped
            onto cell (3,7) (Figure 3.24).



                         Sorted array X     3   4   4   4   5  5   5   6


                         Array Y            7   6   5   7   8  7   6   6


                         Array D            7   3   5   1   2  4   6   8

                           Figure 3.23  Arrays sorted relative to content of array X.



                        Sorted array X      3   4   4   4   5   5   5   6


                        Array Y             7   5   6   7   6   7   8   6


                        Array D             7   5   3   1   6   4   2   8

                         Figure 3.24 Sorting arrays relative to the content of array Y.





                        Sorted array X      3   4   4   4   5   5   5   6


                        Array Y             7   5   6   7   6   7   8   6


                        Array D             7   5   3   1   6   4   2   8




                          Figure 3.25  First stage of the binary search for cell (5,7).
   108   109   110   111   112   113   114   115   116   117   118