Class TorsionAngle

  • All Implemented Interfaces:
    EnergyTerm

    public class TorsionAngle
    extends java.lang.Object
    implements EnergyTerm
    Torsional Angle energy term class. This energy term represents the energy associated with the torsional angle formed by four atoms A1..A4: A1 \ A2--A3 \ A4
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int a1  
      int a1t  
      int a2  
      int a2t  
      int a3  
      int a3t  
      int a4  
      int a4t  
      double v1  
      double v2  
      double v3  
    • Constructor Summary

      Constructors 
      Constructor Description
      TorsionAngle​(Tables table, MMFFMolecule mol, int a1, int a2, int a3, int a4)
      Construct a new torsion angle energy term.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<TorsionAngle> findIn​(Tables t, MMFFMolecule mol)
      Helper function that builds a list of TorsionAngles for a molecule.
      double getEnergy​(double[] pos)
      Calculates the torsional energy.
      void getGradient​(double[] pos, double[] grad)
      Calculates the gradient and adds it to the gradients array.
      boolean nonZero()
      Checks that at least one of the constants is non-zero.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • a1

        public final int a1
      • a2

        public final int a2
      • a3

        public final int a3
      • a4

        public final int a4
      • a1t

        public final int a1t
      • a2t

        public final int a2t
      • a3t

        public final int a3t
      • a4t

        public final int a4t
      • v1

        public final double v1
      • v2

        public final double v2
      • v3

        public final double v3
    • Constructor Detail

      • TorsionAngle

        public TorsionAngle​(Tables table,
                            MMFFMolecule mol,
                            int a1,
                            int a2,
                            int a3,
                            int a4)
        Construct a new torsion angle energy term.
        Parameters:
        table - The tables parameter object.
        mol - The molecule.
        a1 - Index of atom 1 in mol.
        a2 - Index of atom 2 in mol.
        a3 - Index of atom 3 in mol.
        a4 - Index of atom 4 in mol.
    • Method Detail

      • getEnergy

        public double getEnergy​(double[] pos)
        Calculates the torsional energy.
        Specified by:
        getEnergy in interface EnergyTerm
        Parameters:
        pos - The atoms current positions array.
        Returns:
        The energy.
      • getGradient

        public void getGradient​(double[] pos,
                                double[] grad)
        Calculates the gradient and adds it to the gradients array.
        Specified by:
        getGradient in interface EnergyTerm
        Parameters:
        pos - The atoms current positions array.
        grad - the atoms current gradients array.
      • nonZero

        public boolean nonZero()
        Checks that at least one of the constants is non-zero.
        Returns:
        True if any constant is non-zero, false otherwise.
      • findIn

        public static java.util.List<TorsionAngle> findIn​(Tables t,
                                                          MMFFMolecule mol)
        Helper function that builds a list of TorsionAngles for a molecule.
        Parameters:
        t - The tables object.
        mol - The molecule to generate torsions for.
        Returns:
        Am array of TorsionAngle.