md.bond¶
Overview
Base class bond force. |
|
FENE and WCA bond force. |
|
Harmonic bond force. |
|
Tabulated bond force. |
|
Tether bond force. |
Details
Bond forces.
Bond force classes apply a force and virial on every particle in the simulation state commensurate with the potential energy:
Each bond is defined by an ordered pair of particle tags in the
hoomd.State member bond_group. HOOMD-blue does not construct bond groups,
users must explicitly define bonds in the initial condition.
In the bond group (j,k), \(r\) is the length of the bond between the particle positions \(r= |\mathrm{minimum\_image}(\vec{r}_k - \vec{r}_j)|\).
Bond force classes assign 1/2 of the potential energy to each of the particles in the bond group:
and similarly for virials.
- class hoomd.md.bond.Bond¶
Bases:
ForceBase class bond force.
Bondis the base class for all bond forces.Warning
This class should not be instantiated by users. The class can be used for
isinstanceorissubclasschecks.
- class hoomd.md.bond.FENEWCA¶
Bases:
BondFENE and WCA bond force.
FENEWCAcomputes forces, virials, and energies on all bonds in the simulation state with:\[V(r) = - \frac{1}{2} k r_0^2 \ln \left( 1 - \left( \frac{r - \Delta}{r_0} \right)^2 \right) + U_{\mathrm{WCA}}(r)\]where
\[\begin{split}U_{\mathrm{WCA}}(r) = \begin{cases} 4 \varepsilon \left[ \left( \frac{\sigma}{r - \Delta} \right)^{12} - \left( \frac{\sigma}{r - \Delta} \right)^{6} \right] + \varepsilon & r-\Delta < 2^{\frac{1}{6}}\sigma\\ 0 & r-\Delta \ge 2^{\frac{1}{6}}\sigma \end{cases}\end{split}\], \(k\) is the attractive force strength, \(r_0\) is the size of the bond, \(\varepsilon\) is the repulsive interaction energy, and \(\sigma\) is the repulsive interaction width.
- params¶
The parameter of the FENEWCA potential bonds. The dictionary has the following keys:
k(float, required) - attractive force strength \(k\) \([\mathrm{energy} \cdot \mathrm{length}^{-2}]\).r0(float, required) - size parameter \(r_0\) \([\mathrm{length}]\).epsilon(float, required) - repulsive force strength \(\varepsilon\) \([\mathrm{energy}]\).sigma(float, required) - repulsive force interaction width \(\sigma\) \([\mathrm{length}]\).delta(float, required) - radial shift \(\Delta\) \([\mathrm{length}]\).
- Type
TypeParameter[
bond type, dict]
Examples:
fenewca = bond.FENEWCA() fenewca.params['A-A'] = dict(k=3.0, r0=2.38, epsilon=1.0, sigma=1.0, delta=0.0) fenewca.params['A-B'] = dict(k=10.0, r0=1.0, epsilon=0.8, sigma=1.2, delta=0.0)
- class hoomd.md.bond.Harmonic¶
Bases:
BondHarmonic bond force.
Harmoniccomputes forces, virials, and energies on all bonds in the simulation state with:\[U(r) = \frac{1}{2} k \left( r - r_0 \right)^2\]- params¶
The parameter of the harmonic bonds for each particle type. The dictionary has the following keys:
k(float, required) - potential constant \([\mathrm{energy} \cdot \mathrm{length}^{-2}]\)r0(float, required) - rest length \([\mathrm{length}]\)
- Type
TypeParameter[
bond type, dict]
Examples:
harmonic = bond.Harmonic() harmonic.params['A-A'] = dict(k=3.0, r0=2.38) harmonic.params['A-B'] = dict(k=10.0, r0=1.0)
- class hoomd.md.bond.Table(width)¶
Bases:
BondTabulated bond force.
- Parameters
width (int) – Number of points in the table.
Tablecomputes computes forces, virials, and energies on all bonds in the simulation given the user defined tables \(U\) and \(F\).Note
For potentials that diverge near r=0, to set r_min to a non-zero value.
The force \(\vec{F}\) is:
\[\begin{split}\vec{F}(\vec{r}) = \begin{cases} 0 & r < r_{\mathrm{min}} \\ F_\mathrm{table}(r)\hat{r} & r_{\mathrm{min}} \le r < r_{\mathrm{max}} \\ 0 & r \ge r_{\mathrm{max}} \\ \end{cases}\end{split}\]and the potential \(U(r)\) is:
\[\begin{split}U(r) = \begin{cases} 0 & r < r_{\mathrm{min}} \\ U_\mathrm{table}(r) & r_{\mathrm{min}} \le r < r_{\mathrm{max}} \\ 0 & r \ge r_{\mathrm{max}} \\ \end{cases}\end{split}\]where \(\vec{r}\) is the vector pointing from one particle to the other in the bond.
Warning
Bonds that stretch to a length \(r \ge r_{\mathrm{max}}\) result in an error.
Provide \(F_\mathrm{table}(r)\) and \(U_\mathrm{table}(r)\) on evenly spaced grid points points between \(r_{\mathrm{min}}\) and \(r_{\mathrm{max}}\).
Tablelinearly interpolates values when \(r\) lies between grid points and between the last grid point and \(r=r_{\mathrm{max}}\). The force must be specificed commensurate with the potential: \(F = -\frac{\partial U}{\partial r}\).- params¶
The potential parameters. The dictionary has the following keys:
r_min(float, required) - the minimum distance to apply the tabulated potential, corresponding to the first element of the energy and force arrays \([\mathrm{length}]\).r_max(float, required) - the minimum distance to apply the tabulated potential, corresponding to the first element of the energy and force arrays \([\mathrm{length}]\).U((width,)numpy.ndarrayoffloat, required) - the tabulated energy values \([\mathrm{energy}]\). Must have a size equal towidth.F((width,)numpy.ndarrayoffloat, required) - the tabulated force values \([\mathrm{force}]\). Must have a size equal towidth.
- Type
TypeParameter[bond type,dict]
- class hoomd.md.bond.Tether¶
Bases:
BondTether bond force.
The tethered network is described in Refs. Gompper, G. & Kroll, D. M. Statistical Mechanics of Membranes and Surfaces 2nd edn (eds Nelson, D. R. et al.) 359-426 (World Scientific, 2004) and Noguchi, H. & Gompper, G., Phys. Rev. E 72 011901 (2005).
Tethercomputes forces, virials, and energies on all bonds in the simulation state with:\[U(r) = U_{\mathrm{att}}(r) + U_{\mathrm{rep}}(r)\]where \(r\) is the distance from one particle to the other in the bond.
\[\begin{split}U_{\mathrm{att}}(r) = \begin{cases} k_b \frac{\exp(1/(l_{c0}-r)}{l_{max}-r} & r > l_{c0} \\ 0 & r \leq l_{c0} \\ \end{cases}\end{split}\]\[\begin{split}U_{\mathrm{rep}}(r) = \begin{cases} k_b \frac{\exp(1/(r-l_{c1})}{r-l_{min}} & r < l_{c1}\\ 0 & r \ge l_{c1} \end{cases}\end{split}\]\[l_{min} < l_{c1} < l_{c0} < l_{max}\]- params¶
The parameter of the Tethering potential bonds. The dictionary has the following keys:
k_b(float, required) - bond stiffness \([\mathrm{energy}]\)l_min(float, required) - minimum bond length \([\mathrm{length}]\)l_c1(float, required) - cutoff distance of repulsive part \([\mathrm{length}]\)l_c0(float, required) - cutoff distance of attractive part \([\mathrm{length}]\)l_max(float, required) - maximum bond length \([\mathrm{length}]\)
- Type
TypeParameter[
bond type, dict]
Examples:
bond_potential = bond.Tether() bond_potential.params['A-A'] = dict(k_b=10.0, l_min=0.9, l_c1=1.2, l_c0=1.8, l_max=2.1)