|
|
Line 1: |
Line 1: |
| '''Cell lists''' (also sometimes referred to as '''Cell linked-lists''') are a tool for finding all atom pairs within a given cut-off distance of each other in [[Molecular dynamics]] simulations. These pairs are needed to compute the short-range non-bonded interactions in a system, such as [[Van der Waals force]]s or the short-range part of the electrostatic interaction when using [[Ewald summation]]. | | The author's title is Andera and she thinks it seems fairly great. To climb is some thing she would by no means give up. For years he's been residing in Alaska and he doesn't plan on changing it. I am presently a travel agent.<br><br>Feel free to visit my website online psychic chat [[http://www.familysurvivalgroup.com/easy-methods-planting-looking-backyard/ Click On this site]] |
| | |
| ==Algorithm==
| |
| [[Image:CellLists.png|thumb|right|200px|The pairwise interactions for a single particle can be computed by a) computing the interaction to all other particles or b) by dividing the domain into ''cells'' with an edge length of at least the cut-off radius of the interaction potential and computing the interaction between the particle and all particles in the same (red) and in the adjacent (green) cells.]]
| |
| Cell lists work by subdividing the simulation domain into cells with an edge length greater than or equal to the cut-off radius of the interaction to be computed. The particles are sorted into these cells and the interactions are computed between particles in the same or neighbouring cells.
| |
| | |
| In its most basic form, the non-bonded interactions for a cut-off distance <math>r_c</math> are computed as follows:
| |
| | |
| :'''for all''' neighbouring cell pairs <math>(C_\alpha, C_\beta)</math> '''do'''
| |
| ::'''for all''' <math>p_\alpha \in C_\alpha</math> '''do'''
| |
| :::'''for all''' <math>p_\beta \in C_\beta</math> '''do'''
| |
| ::::<math>r^2 = \| \mathbf x[p_\alpha] - \mathbf x[p_\beta] \|_2^2</math>
| |
| ::::'''if''' <math>r^2 \le r_c^2</math> '''then'''
| |
| :::::Compute the interaction between <math>p_\alpha</math> and <math>p_\beta</math>.
| |
| ::::'''end if'''
| |
| :::'''end for'''
| |
| ::'''end for'''
| |
| :'''end for'''
| |
| | |
| Since the cell length is at least <math>r_c</math> in all dimensions, no particles within <math>r_c</math> of each other can be missed.
| |
| | |
| Given a simulation with <math>N</math> particles with a homogeneous particle density, the number of cells <math>m</math> is proportional to <math>N</math> and inversely proportional to the cut-off radius (i.e. if <math>N</math> increases, so does the number of cells). The average number of particles per cell <math>\overline{c} = N/m</math> therefore does not depend on the total number of particles. The cost of interacting two cells is in <math>\mathcal O(\overline{c}^2)</math>. The number of cell pairs is proportional to the number of cells which is again proportional to the number of particles <math>N</math>. The total cost of finding all pairwise distances within a given cut-off is in <math>\mathcal O(Nc) \in \mathcal O(N)</math>, which is significantly better than computing the <math>\mathcal O(N^2)</math> pairwise distances naively.
| |
| | |
| ==Periodic Boundary Conditions==
| |
| In most simulations, [[Periodic boundary conditions]] are used to avoid imposing artificial boundary conditions. Using cell lists, these boundaries can be implemented in two ways
| |
| | |
| ===Ghost Cells===
| |
| [[Image:CellLists Ghosts.png|thumb|right|250px|Periodic boundary conditions can be simulating by wrapping the simulation box in an additional layer of cells (shaded orange) containing periodic copies of the boundary cells (blue particles)]]
| |
| In the ghost cells approach, the simulation box is wrapped in an additional layer of cells. These cells contain periodically wrapped copies of the corresponding simulation cells inside the domain.
| |
| | |
| Although the data—and usually also the computational cost—is doubled for interactions over the periodic boundary, this approach has the advantage of being straightforward to implement and very easy to parallelize, since cells will only interact with their geographical neighbours.
| |
| | |
| ===Periodic Wrapping===
| |
| Instead of creating ghost cells, cell pairs that interact over a periodic boundary can also use a periodic correction vector <math>\mathbf q_{\alpha\beta}</math>. This vector, which can be stored or computed for every cell pair <math>(C_\alpha,C_\beta)</math> contains the correction which needs to be applied to "wrap" one cell around the domain to neighbour the other. The pairwise distance between two particles <math>p_\alpha \in C_\alpha</math> and <math>p_\beta \in C_\beta</math> is then computed as
| |
| | |
| :<math>r^2 = \| \mathbf x[p_\alpha] - \mathbf x[p_\beta] - \mathbf q_{\alpha\beta} \|^2_2</math>.
| |
| | |
| This approach, although more efficient than using ghost cells, is less straightforward to implement (the cell pairs need to be identified over the periodic boundaries and the vector <math>\mathbf q_{\alpha\beta}</math> needs to be computed/stored).
| |
| | |
| ==Improvements==
| |
| Despite reducing the computational cost of finding all pairs within a given cut-off distance from <math>\mathcal O(N^2)</math> to <math>\mathcal O(N)</math>, the cell list algorithm listed above still has some inefficiencies.
| |
| | |
| Consider a computational cell with edge length equal to the cut-off radius <math>r_c</math>. The pairwise distance between all particles in the cell and in one of the neighbouring cells is computed. The cell has 26 neighbours: 6 sharing a common face, 12 sharing a common edge and 8 sharing a common corner. Of all the pairwise distances computed, only about 16% percent will actually be less than or equal to <math>r_c</math>. In other words, 84% of all pairwise distance computations are spurious.
| |
| | |
| One way of overcoming this inefficiency is to partition the domain into cells of edge length smaller than <math>r_c</math>. The pairwise interactions are then not just computed between neighboring cells, but between all cells within <math>r_c</math> of each other (first suggested in <ref>{{cite book| first=M. P. | last=Allen | coauthors=D. J. Tildesley | title=Computer Simulation of Liquids | publisher=Clarendon Press | location=Oxford | year=1987}}</ref> and implemented and analysed in,<ref>{{cite journal | last=Mattson | first=W. | coauthors=B. M. Rice | title=Near-neighbor calculations using a modified cell-linked list method | journal=Computer Physics Communications | year=1999 | volume=119 | issue=2-3 | pages=135 | doi=10.1016/S0010-4655(98)00203-3 }}</ref><ref>{{cite journal | last=Yao | first=Z. | coauthors=Wang, J.-S.; Liu, G.-R.; Cheng, M | title=Improved neighbor list algorithm in molecular simulations using cell decomposition and data sorting method | journal=Computer Physics Communications | year=2004 | volume=161 | pages=27 | doi=10.1016/j.cpc.2004.04.004 }}</ref> and <ref>{{cite journal| last=Heinz | first=T. N. | coauthors=Hünenberger, P. H. | title=A fast pairlist-construction algorithm for molecular simulations under periodic boundary conditions | journal=Journal of Computational Chem istry | year=2004 | volume=25 | pages=1474 | doi=10.1002/jcc.20071| pmid=15224391| issue=12}}</ref>). This approach can be
| |
| taken to the limit wherein each cell holds at most one single particle, therefore reducing the number of spurious pairwise distance evaluations to zero. This gain in efficiency, however, is quickly offset by the number of cells <math>C_\beta</math> that need to be inspected for every interaction with a cell <math>C_\alpha</math>, which, for example in 3d, grows cubically with the inverse of the cell edge length. Setting the edge length to <math>r_c/2</math>, however, already reduces the number of spurious distance evaluations to 63%.
| |
| | |
| Another approach is outlined and tested in,<ref>{{cite journal| first=Pedro | last=Gonnet | title=A Simple Algorithm to Accelerate the Computation of Non-Bonded Interactions in Cell-Based Molecular Dynamics Simulations | journal=Journal of Computational Chemistry | volume=28 | issue=2 | pages=570–573 | doi=10.1002/jcc.20563 | year=2007| pmid=17183605 }}</ref> in which the particles are first sorted along the axis connecting the cell centers. This approach generates only about 40% spurious pairwise distance computations, yet carries an additional cost due to sorting the particles.
| |
| | |
| ==See also==
| |
| * [[Verlet list]]
| |
| | |
| ==References==
| |
| <references/>
| |
| | |
| [[Category:Molecular dynamics]]
| |
| [[Category:Computational chemistry]]
| |
| [[Category:Molecular physics]]
| |
| [[Category:Computational physics]]
| |
| [[Category:Numerical differential equations]]
| |
The author's title is Andera and she thinks it seems fairly great. To climb is some thing she would by no means give up. For years he's been residing in Alaska and he doesn't plan on changing it. I am presently a travel agent.
Feel free to visit my website online psychic chat [Click On this site]