Package ffx.potential.parameters
Class TorsionTorsionType
java.lang.Object
ffx.potential.parameters.BaseType
ffx.potential.parameters.TorsionTorsionType
- All Implemented Interfaces:
Comparator<String>
@FFXProperty(name="tortors",
clazz=java.lang.String[][].class,
propertyGroup=PotentialFunctionParameter,
description="[7 integers, then multiple lines of 2 integers and 1 real]\nProvides the values for a single torsion-torsion parameter.\nThe first five integer modifiers give the atom class numbers for the atoms involved in the two adjacent torsional angles to be defined.\nThe last two integer modifiers contain the number of data grid points that lie along each axis of the torsion-torsion map.\nFor example, this value will be 13 for a 30 degree torsional angle spacing, i.e., 360/30 = 12, but 13\nvalues are required since data values for -180 and +180 degrees must both be supplied.\nThe subsequent lines contain the torsion-torsion map data as the integer values in degrees of each\ntorsional angle and the target energy value in kcal/mole.\n")
public final class TorsionTorsionType
extends BaseType
implements Comparator<String>
The TorsionTorsionType class defines a Torsion-Torsion spline.
- Since:
- 1.0
- Author:
- Michael J. Schnieders
-
Field Summary
Modifier and TypeFieldDescriptionfinal int[]
Atom classes that form this Torsion-Torsion type.static final double
Default units to convert Torsion-Torsion energy to kcal/mole.final double[]
First derivative along x.final double[]
Second derivatives.final double[]
First derivative along y.final double[]
Energy values.final int
Number of points along x.final int
Number of point along y.double
Convert Torsion-Torsion energy to kcal/mole.final double[]
Torsion values along x.final double[]
Torsion values along y. -
Constructor Summary
ConstructorDescriptionTorsionTorsionType
(int[] atomClasses, int[] gridPoints, double[] torsion1, double[] torsion2, double[] energy) Constructor for TorsionTorsionType. -
Method Summary
Modifier and TypeMethodDescriptionstatic TorsionTorsionType
average
(TorsionTorsionType torsionTorsionType1, TorsionTorsionType torsionTorsionType2, int[] atomClasses) average.int
boolean
static Element
getXMLForce
(Document doc, ForceField forceField) Create an AmoebaTorsionTorsionForce Element.int
hashCode()
void
incrementClasses
(int increment) Increment the atom classes by a value.static TorsionTorsionType
Construct a TorsionTorsionType from a single input line.static TorsionTorsionType
parse
(String input, String[] tokens, BufferedReader br) Construct a TorsionTorsionType from multiple input lines.void
patchClasses
(HashMap<AtomType, AtomType> typeMap) Remap new atom classes to known internal ones.static String
reverseKey
(int[] c) Reversed key for the Torsion-Torsion lookup.static String
sortKey
(int[] c) No sorting is done for the Torsion-Torsion lookup.toString()
void
Write TorsionTorsionType 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
-
DEFAULT_TORTOR_UNIT
public static final double DEFAULT_TORTOR_UNITDefault units to convert Torsion-Torsion energy to kcal/mole.- See Also:
-
torTorUnit
@FFXProperty(name="tortorunit", propertyGroup=EnergyUnitConversion, defaultValue="1.0", description="Sets the scale factor needed to convert the energy value computed by the torsion-torsion 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 torTorUnitConvert Torsion-Torsion energy to kcal/mole. -
atomClasses
public final int[] atomClassesAtom classes that form this Torsion-Torsion type. -
energy
public final double[] energyEnergy values. -
nx
public final int nxNumber of points along x. -
ny
public final int nyNumber of point along y. -
tx
public final double[] txTorsion values along x. -
ty
public final double[] tyTorsion values along y. -
dx
public final double[] dxFirst derivative along x. -
dy
public final double[] dyFirst derivative along y. -
dxy
public final double[] dxySecond derivatives.
-
-
Constructor Details
-
TorsionTorsionType
public TorsionTorsionType(int[] atomClasses, int[] gridPoints, double[] torsion1, double[] torsion2, double[] energy) Constructor for TorsionTorsionType.- Parameters:
atomClasses
- an array of int.gridPoints
- an array of int.torsion1
- an array of double.torsion2
- an array of double.energy
- an array of double.
-
-
Method Details
-
average
public static TorsionTorsionType average(TorsionTorsionType torsionTorsionType1, TorsionTorsionType torsionTorsionType2, int[] atomClasses) average.- Parameters:
torsionTorsionType1
- aTorsionTorsionType
object.torsionTorsionType2
- aTorsionTorsionType
object.atomClasses
- an array ofinvalid reference
int
- Returns:
- a
TorsionTorsionType
object.
-
parse
Construct a TorsionTorsionType from multiple input lines.- Parameters:
input
- The overall input String.tokens
- The input String tokenized.br
- a BufferedReader instance.- Returns:
- a TorsionTorsionType instance.
-
parse
Construct a TorsionTorsionType from a single input line.- Parameters:
input
- The overall input String.tokens
- The input String tokenized.- Returns:
- a TorsionTorsionType instance.
-
reverseKey
Reversed key for the Torsion-Torsion lookup.- Parameters:
c
- atomClasses- Returns:
- lookup key
-
sortKey
No sorting is done for the Torsion-Torsion lookup.- Parameters:
c
- atomClasses- Returns:
- lookup key
-
compare
- Specified by:
compare
in interfaceComparator<String>
-
equals
- Specified by:
equals
in interfaceComparator<String>
- Overrides:
equals
in classObject
-
hashCode
public int hashCode() -
incrementClasses
public void incrementClasses(int increment) Increment the atom classes by a value.- 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.
-
toString
Basic toString method.
Nicely formatted torsion-torsion type.
-
getXMLForce
Create an AmoebaTorsionTorsionForce Element.- Parameters:
doc
- the Document instance.forceField
- the ForceField instance to grab constants from.- Returns:
- the AmoebaTorsionTorsionForce Element.
-
toXML
Write TorsionTorsionType to OpenMM XML format.- Parameters:
doc
- the Document instance.torTorNode
- the Element to attach TorsionTorsion and TorsionTorsionGrid to.label
- the label used to match TorsionTorsion and TorsionTorsionGrid.
-