Package ffx.potential.parameters
Class ImproperTorsionType
java.lang.Object
ffx.potential.parameters.BaseType
ffx.potential.parameters.ImproperTorsionType
- All Implemented Interfaces:
Comparator<String>
@FFXProperty(name="imptors",
clazz=java.lang.String.class,
propertyGroup=PotentialFunctionParameter,
description="[4 integers and up to 3 real/real/integer triples]\nProvides the values for a single AMBER-style improper torsional angle parameter.\nThe first four integer modifiers give the atom class numbers for the atoms involved in the improper torsional angle to be defined.\nBy convention, the third atom class of the four is the trigonal atom on which the improper torsion is centered.\nThe torsional angle computed is literally that defined by the four atom classes in the order specified by the keyword.\nEach of the remaining triples of real/real/integer modifiers give the half-amplitude,\nphase offset in degrees and periodicity of a particular improper torsional term, respectively.\nPeriodicities through 3-fold are allowed for improper torsional parameters.\n")
public final class ImproperTorsionType
extends BaseType
implements Comparator<String>
The ImproperTorsionType class defines an improper torsion.
- Since:
- 1.0
- Author:
- Michael J. Schnieders
-
Field Summary
Modifier and TypeFieldDescriptionfinal int[]
Atom classes that for this Improper Torsion angle.final double
Value of cos(toRadians(phase)).static final double
double
Convert angle bending energy to kcal/mole.final double
Force constant in kcal/mol.final int
Periodicity (should be 2 for an Improper Torsion).final double
Phases in degrees.final double
Value of sin(toRadians(phase)). -
Constructor Summary
ConstructorDescriptionImproperTorsionType
(int[] atomClasses, double k, double phase, int periodicity) TorsionType Constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
assigned
(int[] inputClasses, boolean allowInitialWildCards, boolean allowFinalWildCard) Returns true if the atoms can be assigned this improperTorsionType.static ImproperTorsionType
average
(ImproperTorsionType improperTorsionType1, ImproperTorsionType improperTorsionType2, int[] atomClasses) Average two ImproperTorsionType instances.int
boolean
int
hashCode()
void
incrementClasses
(int increment) incrementClassesboolean
Check if this Improper Torsion Type is defined by 1 or more atom classes equal to zero.static ImproperTorsionType
Construct an ImproperTorsionType from an input string.void
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 improper torsion.toString()
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 Improper Torsion angle. -
k
public final double kForce constant in kcal/mol. -
phase
public final double phasePhases in degrees. -
periodicity
public final int periodicityPeriodicity (should be 2 for an Improper Torsion). -
cos
public final double cosValue of cos(toRadians(phase)). -
sin
public final double sinValue of sin(toRadians(phase)). -
impTorUnit
@FFXProperty(name="imptorunit", propertyGroup=EnergyUnitConversion, defaultValue="1.0", description="Sets the scale factor needed to convert the energy value computed by the AMBER-style improper\ntorsional 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 impTorUnitConvert angle bending energy to kcal/mole. -
DEFAULT_IMPTOR_UNIT
public static final double DEFAULT_IMPTOR_UNIT- See Also:
-
-
Constructor Details
-
ImproperTorsionType
public ImproperTorsionType(int[] atomClasses, double k, double phase, int periodicity) TorsionType Constructor.- Parameters:
atomClasses
- Atom classes.k
- Force constant.phase
- The phase.periodicity
- The periodicity.
-
-
Method Details
-
average
public static ImproperTorsionType average(ImproperTorsionType improperTorsionType1, ImproperTorsionType improperTorsionType2, int[] atomClasses) Average two ImproperTorsionType instances. The atom classes that define the new type must be supplied.- Parameters:
improperTorsionType1
- aImproperTorsionType
object.improperTorsionType2
- aImproperTorsionType
object.atomClasses
- an array ofinvalid reference
int
- Returns:
- a
ImproperTorsionType
object.
-
parse
Construct an ImproperTorsionType from an input string.- Parameters:
input
- The overall input String.tokens
- The input String tokenized.- Returns:
- an ImproperTorsionType instance.
-
sortKey
This method sorts the atom classes for the improper torsion.- Parameters:
c
- atomClasses- Returns:
- lookup key
- Since:
- 1.0
-
assigned
public boolean assigned(int[] inputClasses, boolean allowInitialWildCards, boolean allowFinalWildCard) Returns true if the atoms can be assigned this improperTorsionType.- Parameters:
inputClasses
- The atom classes will be re-ordered if its member atoms match this ImproperTorsionType. The trigonal atom will not change position.allowInitialWildCards
- Allow wildcard match to first two classes.allowFinalWildCard
- Allow wildcard match for final class.- Returns:
- True if this torsionType is assignable to the atom array.
-
compare
Implements the Comparator interface.
- 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) incrementClasses- Parameters:
increment
- The increment to add to the atom classes.
-
noZeroClasses
public boolean noZeroClasses()Check if this Improper Torsion Type is defined by 1 or more atom classes equal to zero.- Returns:
- True if there are no zero "wildcard" atom classes for this type.
-
patchClasses
Remap new atom classes to known internal ones.- Parameters:
typeMap
- a lookup between new atom types and known atom types.
-
toString
Basic toString method.
Nicely formatted Torsion angle.
-