Package ffx.potential.parameters
Class TorsionType
java.lang.Object
ffx.potential.parameters.BaseType
ffx.potential.parameters.TorsionType
- All Implemented Interfaces:
Comparator<String>
@FFXProperty(name="improper",clazz=java.lang.String.class,propertyGroup=PotentialFunctionParameter,description="[4 integers and 2 reals]\"\nProvides the values for a single CHARMM-style improper dihedral angle parameter.\nThe integer modifiers give the atom class numbers for the four kinds of atoms involved in the torsion which is to be defined.\nThe real number modifiers give the force constant value for the deviation from the target improper torsional angle, and the target value for the torsional angle, respectively.\nThe default units for the improper force constant are kcal/mole/radian^2, but this can be controlled via the impropunit keyword.\n") @FFXProperty(name="torsion",clazz=java.lang.String.class,propertyGroup=PotentialFunctionParameter,description="[4 integers and up to 6 real/real/integer triples]\nProvides the values for a single torsional angle parameter.\nThe first four integer modifiers give the atom class numbers for the atoms involved in the torsional angle to be defined.\nEach of the remaining triples of real/real/integer modifiers give the amplitude,\nphase offset in degrees and periodicity of a particular torsional function term, respectively.\nPeriodicities through 6-fold are allowed for torsional parameters.\n")
public final class TorsionType
extends BaseType
implements Comparator<String>
The TorsionType class defines a torsional angle.
- Since:
- 1.0
- Author:
- Michael J. Schnieders
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Torsion modes include Normal or In-Plane -
Field Summary
Modifier and TypeFieldDescriptionfinal double[]
Amplitudes of the Fourier series.final int[]
Atom classes that for this Torsion angle.final double[]
Cosine of the phase angle.static final double
final int[]
Periodicity of the Fourier series.final double[]
Phases of the Fourier series in degrees.final double[]
Sine of the phase angle.final int
Number of terms in the Fourier series.double
Unit conversion. -
Constructor Summary
ConstructorDescriptionTorsionType
(int[] atomClasses, double[] amplitude, double[] phase, int[] periodicity) TorsionType Constructor.TorsionType
(int[] atomClasses, double[] amplitude, double[] phase, int[] periodicity, TorsionType.TorsionMode torsionMode) TorsionType Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic TorsionType
average
(TorsionType torsionType1, TorsionType torsionType2, int[] atomClasses) average.int
boolean
static Element
getXMLForce
(Document doc, ForceField forceField) Create a PeriodicTorsionForce Element.int
hashCode()
void
incrementClasses
(int increment) Increment the atom classes by a specified amount.static TorsionType
Construct a TorsionType from an input string.static TorsionType
parseImproper
(String input, String[] tokens) Construct a TorsionType withTorsionMode.IMPROPER
from an input string.patchClasses
(HashMap<AtomType, AtomType> typeMap) Remap new atom classes to known internal ones.static String
sortKey
(int[] c) This method sorts the atom classes for the torsion.toString()
Write TorsionType (Proper) to OpenMM XML format.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
atomClasses
public final int[] atomClassesAtom classes that for this Torsion angle. -
terms
public final int termsNumber of terms in the Fourier series. -
amplitude
public final double[] amplitudeAmplitudes of the Fourier series. -
phase
public final double[] phasePhases of the Fourier series in degrees. -
cosine
public final double[] cosineCosine of the phase angle. -
sine
public final double[] sineSine of the phase angle. -
periodicity
public final int[] periodicityPeriodicity of the Fourier series. -
DEFAULT_TORSION_UNIT
public static final double DEFAULT_TORSION_UNIT- See Also:
-
torsionUnit
@FFXProperty(name="torsionunit", propertyGroup=EnergyUnitConversion, defaultValue="1.0", description="Sets the scale factor needed to convert the energy value computed by the torsional angle potential into units of kcal/mole.\nThe correct value is force field dependent and typically provided in the header of the master force field parameter file.\n") public double torsionUnitUnit conversion.
-
-
Constructor Details
-
TorsionType
public TorsionType(int[] atomClasses, double[] amplitude, double[] phase, int[] periodicity) TorsionType Constructor.- Parameters:
atomClasses
- Atom classes.amplitude
- Amplitudes of the Fourier series.phase
- Phases of the Fourier series in degrees.periodicity
- Periodicity of the Fourier series.
-
TorsionType
public TorsionType(int[] atomClasses, double[] amplitude, double[] phase, int[] periodicity, TorsionType.TorsionMode torsionMode) TorsionType Constructor.- Parameters:
atomClasses
- Atom classes.amplitude
- Amplitudes of the Fourier series.phase
- Phases of the Fourier series in degrees.periodicity
- Periodicity of the Fourier series.torsionMode
- Define the TorsionMode for this TorsionType.
-
-
Method Details
-
average
public static TorsionType average(TorsionType torsionType1, TorsionType torsionType2, int[] atomClasses) average.- Parameters:
torsionType1
- aTorsionType
object.torsionType2
- aTorsionType
object.atomClasses
- an array ofinvalid reference
int
- Returns:
- a
TorsionType
object.
-
parse
Construct a TorsionType from an input string.- Parameters:
input
- The overall input String.tokens
- The input String tokenized.- Returns:
- a TorsionType instance.
-
parseImproper
Construct a TorsionType withTorsionMode.IMPROPER
from an input string.- Parameters:
input
- The overall input String.tokens
- The input String tokenized.- Returns:
- a TorsionType instance.
-
sortKey
This method sorts the atom classes for the torsion.- Parameters:
c
- atomClasses- Returns:
- lookup key
- Since:
- 1.0
-
compare
- Specified by:
compare
in interfaceComparator<String>
- Since:
- 1.0
-
equals
Override the default
equals
method.- Specified by:
equals
in interfaceComparator<String>
- Overrides:
equals
in classObject
- Since:
- 1.0
-
hashCode
public int hashCode()Implementation of the
hashCode
method. -
incrementClasses
public void incrementClasses(int increment) Increment the atom classes by a specified amount.- Parameters:
increment
- The increment to add to the atom classes.
-
patchClasses
Remap new atom classes to known internal ones.- Parameters:
typeMap
- a lookup between new atom types and known atom types.- Returns:
- a
TorsionType
object.
-
toString
Basic toString method.
Nicely formatted Torsion angle.
-
getXMLForce
Create a PeriodicTorsionForce Element.- Parameters:
doc
- the Document instance.forceField
- the ForceField that contains the Torsion types.- Returns:
- the PeriodicTorsionForce instance.
-
toXML
Write TorsionType (Proper) to OpenMM XML format.- Parameters:
doc
- the Document instance.torsUnit
- scale torsion force constants by this factor.- Returns:
- the Proper torsion Element.
-