mstk.forcefield.FFTerm¶
- class mstk.forcefield.FFTerm¶
Base class for all force field terms like
AtomType,BondTerm, etc…- version¶
Version is used mainly in
PPFformat by DFF.- Type:
str
- comments¶
Comments is useful for debugging when generating input files for simulation engines.
- Type:
list of str
Methods
__init__()evaluate_energy(val)Evaluate the energy for a force field term like HarmonicBondTerm, PeriodicDihedralTerm, etc...
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.
Header string to explain a line in ZFF format
Attributes
The name of this force field term.
- classmethod get_alias()¶
Return a short alias for the name of this class
It is used to keep the line more compact in ZFF file
- property name¶
The name of this force field term.
- Returns:
name
- Return type:
str
- to_zff()¶
Pack the attributes of a term into a string so that can be saved into a line in ZFF file.
Every class to be packed should have a class property _term_attrs. This dict records which attributes should be saved into ZFF file, and it is also used as the arguments for initializing a FFTerm. It also tells the data type of these attributes.
- Returns:
line
- Return type:
string
- to_zff_header()¶
Header string to explain a line in ZFF format
- Returns:
header
- Return type:
str
- 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