mstk.forcefield.OplsImproperTerm¶
- class mstk.forcefield.OplsImproperTerm(type1, type2, type3, type4, k)¶
Improper term in OPLS cosine function form
The energy function is
>>> U = k * (1-cos(2*phi))
During the initialization, the three side atom types will be sorted by their string.
ImproperTerm allows wildcard(*) for side atoms. During force field matching, the terms with wildcard will have lower priority. The terms with wildcard will be used only if exact match cannot be found.
Care must be taken when exporting OplsImproperTerm. For improper a1-a2-a3-a4, a1 is the center atom. In OPLS convention, the value of the improper is defined as the angle between plane a2-a3-a1 and a3-a1-a4.
- Parameters:
type1 (str) –
type2 (str) –
type3 (str) –
type4 (str) –
k (float) –
- type1¶
- Type:
str
- type2¶
- Type:
str
- type3¶
- Type:
str
- type4¶
- Type:
str
- k¶
- Type:
float
Methods
__init__(type1, type2, type3, type4, k)evaluate_energy(val)Evaluate the energy for a force field term like HarmonicBondTerm, PeriodicDihedralTerm, etc...
get_alias()Return a short alias for the name of this class
to_zff()Pack the attributes of a term into a string so that can be saved into a line in ZFF file.
to_zff_header()Header string to explain a line in ZFF format
Attributes
nameThe name of this force field term.
- evaluate_energy(val)¶
Evaluate the energy for a force field term like HarmonicBondTerm, PeriodicDihedralTerm, etc…
It is mainly for debugging. It is not (and can not be) implemented for all terms.
- Parameters:
val (float) – The value of distance, angle, dihedral or improper.
- Returns:
energy
- Return type:
float