... | @@ -16,20 +16,28 @@ The input contains two files: |
... | @@ -16,20 +16,28 @@ The input contains two files: |
|
- `pair_style lj/charmm/coul/long 8.0 10.0` This is the line that specifies that we are using the *lj/charmm/coul/charmm* *pair_style*. If a different *pair_style* was selected, then `PairLJCharmmCoulLong::compute` would not be executed, and the optimizations would not have any impact. Moreover, the `8.0`and `10.0` represent the *cutoff distances*, which can have an impact to the execution of the function. For more information, check the LAMMPS [documentation](https://docs.lammps.org/pair_charmm.html#pair-style-lj-charmm-coul-long-command).
|
|
- `pair_style lj/charmm/coul/long 8.0 10.0` This is the line that specifies that we are using the *lj/charmm/coul/charmm* *pair_style*. If a different *pair_style* was selected, then `PairLJCharmmCoulLong::compute` would not be executed, and the optimizations would not have any impact. Moreover, the `8.0`and `10.0` represent the *cutoff distances*, which can have an impact to the execution of the function. For more information, check the LAMMPS [documentation](https://docs.lammps.org/pair_charmm.html#pair-style-lj-charmm-coul-long-command).
|
|
- `data.protein`: contains the initial data for the atoms in the simulation and their properties
|
|
- `data.protein`: contains the initial data for the atoms in the simulation and their properties
|
|
|
|
|
|
# Algorithm and Data structures
|
|
# Overview of Algorithm and Data structures
|
|
|
|
|
|
|
|
|
|
FIXME neighbor
|
|
|
|
LAMMPS computes interactions between atoms.
|
|
LAMMPS computes interactions between atoms.
|
|
If a pair of atoms are "neighbors" (that is, they are placed the *pair_style* cutoff distance), it produces a *short-range* interaction in "real space" and is computed using a *pair_style*.
|
|
If a pair of atoms are "neighbors" (that is, the distance between them is smaller than the *pair_style* cutoff distance), it produces a *short-range* interaction in real space and is computed using a *pair_style*.
|
|
If atoms aren't within the cutoff distance, these become *long-range* interactions in "reciprocal space" (FFT domain).
|
|
If atoms aren't within the cutoff distance, these become *long-range* interactions in reciprocal space (FFT domain).
|
|
The `PairLJCharmmCoulLong::compute` computes short-range interactions.
|
|
The `PairLJCharmmCoulLong::compute` computes short-range interactions.
|
|
|
|
|
|
File `neigh_list.h` contains the `int **firstneigh` array.
|
|
File `neigh_list.h` contains the `int **firstneigh` array.
|
|
Note that the `**` denotes that it is a double pointer or pointer to pointer.
|
|
Note that the `**` denotes that it is a double pointer or pointer to pointer.
|
|
In other words, `int **firstneigh` is a pointer to an array of pointers to arrays of `int`.
|
|
In other words, `int **firstneigh` is a pointer to an array of pointers to arrays of `int`.
|
|
|
|
|
|
`firstneigh[i]` contains an array of the
|
|
`firstneigh[i]` contains an array of the atoms `j` that are neighbors of atom `i`.
|
|
|
|
In this protein input, there are 32.000 `i` atoms.
|
|
|
|
For example, `firstneigh[i][0]` would be the first neighbor of atom `i`.
|
|
|
|
Both `i` and are atoms `firstneigh[i][0]`, and are represented using a 32 bit `int`.
|
|
|
|
To retrieve the properties of an atom, this `int` value needs to be used as an index for the arrays found in file `atom_vec.h` or `atom.h` such as `double **x` (position), `**f` (force) or `*q` (charge).
|
|
|
|
`x` and `f` are pointer to pointer since the second index in needed to split the magnitudes in XYZ components.
|
|
|
|
|
|
|
|
Function `PairLJCharmmCoulLong::compute` has an inner and an outer for loop.
|
|
|
|
the outer loop (i-loop) iterates through all 32.000 atoms in the protein simulation, while the inner loop (j-loop) iterates through each atom `j` that is a neighbor of `i`.
|
|
|
|
|
|
|
|
For each pair of atoms `i, j`, the algorithm first computes the distance between the two atoms, and if it is smaller than the cutoff distance,
|
|
|
|
|
|
atom_vec.h -> contains `**x` and `**f` (3D)
|
|
atom_vec.h -> contains `**x` and `**f` (3D)
|
|
neigh_list.h -> contains `**firstneigh` (for each i, store array of neighbors j)
|
|
neigh_list.h -> contains `**firstneigh` (for each i, store array of neighbors j)
|
... | | ... | |