2. Intramolecular bonds
Intramolecular bonds types in HyMD are specified in the configuration file. Once a simulation starts, the specific indices of bonded particles are inferred from the type information in the configuration file, see Configuration file. The construction of the bonds internally happens locally on each MPI rank after every explicit domain decomposition transfer, which is the only time during simulation when particles are permanently re-assigned to new CPUs. Ideally, you should be running HyMD with relatively few particles per MPI rank (see Benchmarks), around 200 being the optimal value for maximum efficiency. In this case, the computational cost involved in reconstructing the bond network subsequent to every domain decomposition swap is minuscule and not measurable.
All intramolecular potentials are computed in highly optimised Fortran kernels, and require no MPI communication (except for explicit domain decomposition swaps which are performed very rarely in practice [e.g. every hundreds of thousands time steps]).
2.1. Two-particle bonds
Stretching bonds in HyMD are implemented as harmonic spring potentials,
where \(r=|\mathbf{r}|\) is the inter-particle distance, \(k\) is a constant of dimension energy (units \(\text{kJ}\,\text{mol}^{-1}\)), and \(r_0\) is the equilibrum length of the bond (units: \(\text{nm}\)). The force is calculated as
where \(\mathbf{r}\) is the vector pointing from \(i\) to \(j\).
In the configuration file, two-particle bonds are specified per particle type:
[bonds]
bonds = [
["A", "A", 0.47, 1250.0],
["A", "B", 0.37, 940.0],
["B", "C", 0.50, 1010.0],
["C", "A", 0.42, 550.0],
...
]
The order of the specified names does not matter, but the order of the length and energy scales do.
2.2. Three-particle bonds
Bending bonds in HyMD are implemented as harmonic angular bonds, depending on the particle–particle–particle angle \(\theta\),
where \(k\) is a constant of dimension energy (units \(\text{kJ}\,\text{mol}^{-1}\)), and \(\theta_0\) is the equilibrum angle of the bond (units: \({}^\circ\)). Defining the particles with labels \(a\), \(b\), and \(c\), let \(\mathbf{r}_a\) denote the vector pointing from \(b\) to \(a\), and correspondingly let \(\mathbf{r}_c\) point from \(b\) to \(c\). The \(a\)–\(b\)–\(c\) may be computed through the law of Cosines,
Then the force acting on \(a\) and \(c\) is
and
In the configuration file, three-particle bonds are specified per particle type:
[bonds]
angle_bonds = [
["A", "A", "A", 180.0, 90.0],
["A", "B", "A", 120.0, 55.0],
["B", "C", "C", 30.0, 10.0],
["C", "A", "B", 110.0, 25.5],
...
]
The order of the specified names does not matter, but the order of the length and energy scales do.
2.3. Four-particle bonds
Torsional dihedral potentials in HyMD are implemented as Cosine series potentials, depending on the angle \(\phi\) between the \(a\)–\(b\)–\(c\) and \(b\)–\(c\)–\(d\) planes, for a dihedral bond quartet \(a\), \(b\), \(c\), and \(d\). The potential takes the form
where \(c_n\) is a constant of dimension energy (units \(\text{kJ}\,\text{mol}^{-1}\text{rad}^{-2}\)), and \(\phi_n\) are specified phase angles in the cosine series.
In the configuration file, four-particle bonds are specified per particle type:
[bonds]
dihedrals = [
["A", "B", "C", "D"],
[
[-1],
[449.08790868, 610.2408724, -544.48626121, 251.59427866, -84.9918564],
[0.08, 0.46, 1.65, -0.96, 0.38],
],
[1.0],
]