md.angle¶
Overview
Base class angle force. |
|
Harmonic angle force. |
|
Cosine squared angle force. |
|
Tabulated bond force. |
Details
Angle forces.
Angle force classes apply a force and virial on every particle in the simulation state commensurate with the potential energy:
Each angle is defined by an ordered triplet of particle tags in the
hoomd.State member angle_group. HOOMD-blue does not construct angle
groups, users must explicitly define angles in the initial condition.
In the angle group (i,j,k), \(\theta\) is the angle between the vectors \(\vec{r}_{ij}\) and \(\vec{r}_{kj}\).
Angle force classes assign 1/3 of the potential energy to each of the particles in the angle group:
and similarly for virials.
- class hoomd.md.angle.Angle¶
Bases:
ForceBase class angle force.
Angleis the base class for all angle forces.Warning
This class should not be instantiated by users. The class can be used for
isinstanceorissubclasschecks.
- class hoomd.md.angle.CosineSquared¶
Bases:
AngleCosine squared angle force.
CosineSquaredcomputes forces, virials, and energies on all angles in the simulation state with:\[U(\theta) = \frac{1}{2} k \left( \cos\theta - \cos\theta_0 \right)^2\]CosineSquaredis used in the gromos96 and MARTINI force fields.- params¶
The parameter of the harmonic bonds for each particle type. The dictionary has the following keys:
k(float, required) - potential constant \(k\) \([\mathrm{energy}]\)t0(float, required) - rest angle \(\theta_0\) \([\mathrm{radians}]\)
- Type
TypeParameter[
angle type, dict]
Examples:
cosinesq = angle.CosineSquared() cosinesq.params['A-A-A'] = dict(k=3.0, t0=0.7851) cosinesq.params['A-B-A'] = dict(k=100.0, t0=1.0)
- class hoomd.md.angle.Harmonic¶
Bases:
AngleHarmonic angle force.
Harmoniccomputes forces, virials, and energies on all angles in the simulation state with:\[U(\theta) = \frac{1}{2} k \left( \theta - \theta_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 \(k\) \([\mathrm{energy} \cdot \mathrm{radians}^{-2}]\)t0(float, required) - rest angle \(\theta_0\) \([\mathrm{radians}]\)
- Type
TypeParameter[
angle type, dict]
Examples:
harmonic = angle.Harmonic() harmonic.params['A-A-A'] = dict(k=3.0, t0=0.7851) harmonic.params['A-B-A'] = dict(k=100.0, t0=1.0)
- class hoomd.md.angle.Table(width)¶
Bases:
AngleTabulated bond force.
- Parameters
width (int) – Number of points in the table.
Tablecomputes computes forces, virials, and energies on all angles in the simulation given the user defined tables \(U\) and \(\tau\).The torque \(\tau\) is:
\[\tau(\theta) = \tau_\mathrm{table}(\theta)\]and the potential \(V(\theta)\) is:
\[U(\theta) =U_\mathrm{table}(\theta)\]Provide \(\tau_\mathrm{table}(\theta)\) and \(U_\mathrm{table}(\theta)\) on evenly spaced grid points points in the range \(\theta \in [0,\pi]\).
Tablelinearly interpolates values when \(\theta\) lies between grid points. The torque must be specificed commensurate with the potential: \(\tau = -\frac{\partial U}{\partial \theta}\).- params¶
The potential parameters. The dictionary has the following keys:
U((width,)numpy.ndarrayoffloat, required) - the tabulated energy values \([\mathrm{energy}]\). Must have a size equal towidth.tau((width,)numpy.ndarrayoffloat, required) - the tabulated torque values \([\mathrm{force} \cdot \mathrm{length}]\). Must have a size equal towidth.
- Type
TypeParameter[angle type,dict]