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
  • Field Details

    • atomClasses

      public final int[] atomClasses
      Atom classes that for this Torsion angle.
    • terms

      public final int terms
      Number of terms in the Fourier series.
    • amplitude

      public final double[] amplitude
      Amplitudes of the Fourier series.
    • phase

      public final double[] phase
      Phases of the Fourier series in degrees.
    • cosine

      public final double[] cosine
      Cosine of the phase angle.
    • sine

      public final double[] sine
      Sine of the phase angle.
    • periodicity

      public final int[] periodicity
      Periodicity 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 torsionUnit
      Unit 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 - a TorsionType object.
      torsionType2 - a TorsionType object.
      atomClasses - an array of
      invalid reference
      int
      objects.
      Returns:
      a TorsionType object.
    • parse

      public static TorsionType parse(String input, String[] tokens)
      Construct a TorsionType from an input string.
      Parameters:
      input - The overall input String.
      tokens - The input String tokenized.
      Returns:
      a TorsionType instance.
    • parseImproper

      public static TorsionType parseImproper(String input, String[] tokens)
      Construct a TorsionType with TorsionMode.IMPROPER from an input string.
      Parameters:
      input - The overall input String.
      tokens - The input String tokenized.
      Returns:
      a TorsionType instance.
    • sortKey

      public static String sortKey(int[] c)
      This method sorts the atom classes for the torsion.
      Parameters:
      c - atomClasses
      Returns:
      lookup key
      Since:
      1.0
    • compare

      public int compare(String s1, String s2)
      Specified by:
      compare in interface Comparator<String>
      Since:
      1.0
    • equals

      public boolean equals(Object o)

      Override the default equals method.

      Specified by:
      equals in interface Comparator<String>
      Overrides:
      equals in class Object
      Since:
      1.0
    • hashCode

      public int hashCode()

      Implementation of the hashCode method.

      Overrides:
      hashCode in class Object
      Since:
      1.0
    • 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

      public TorsionType patchClasses(HashMap<AtomType,AtomType> typeMap)
      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

      public String toString()

      Basic toString method.

      Nicely formatted Torsion angle.

      Overrides:
      toString in class BaseType
      Since:
      1.0