This class splits the molecule into smaller sub boxes and provides parallelized functions for pair-search.
The aim is reducing the workload on search algorithms for atom pairs. Normally the computational effort would be
with the number of atoms \(n\), because each atom has to be compared with all other atoms.
Since a bond distance is fixed, the idea is reducing the search space by dividing the molecule box into cubes and only performing the pair-search within these smaller boxes and their 26 immediate neighbors. Assuming that the grid structure is ideal in a geometrical sense, that all bond length and angles are constant, the number of atoms in each cube are a constant \(b\). The computational effort for each atom is thus a constant
Therefore, the computational effort for an entire search scales linear with the number of cubes. For example, doubling the cristobalite block size only increases the effort eightfold.
Furthermore, the search is easily parallelizable, since no communication is needed between the subprocesses that each cover a set of cubes. The effort therefore has an ideal speedup.
Note that the cube size must be strictly greater than the intended bond length searches.
Molecule to be divided
Cube edge size
True if periodic boundary conditions are needed
Methods
|
Step one cube to the back considering the z-axis. |
|
Step one cube to the bottom considering the y-axis. |
|
Based on their coordinates, the atom ids, as defined in the molecule object, are filled into the cubes. |
|
Step one cube to the front considering the z-axis. |
|
Step one cube to the left considering the x-axis. |
|
Calculate the cube index for a given position. |
|
Step one cube to the right considering the x-axis. |
|
Here the number of cubes is calculated for each dimension for the defined cube size and molecule dimension. |
|
Helper function for iterating through the cubes. |
|
Step one cube to the top considering the y-axis. |
|
Search for a bond in the given cubes. |
|
Parallelized bond search of function |
Return the number of cubes in each dimension. |
|
|
Return the molecule. |
Return the origin positions of the cubes. |
|
Return the list of atoms in each cube. |
|
|
Return the cubes size. |
|
Get the ids of the cubes surrounding the given one. |
|
Turn the periodic boundary conditions on or off. |