Class BondStretch

  • All Implemented Interfaces:
    EnergyTerm

    public class BondStretch
    extends java.lang.Object
    implements EnergyTerm
    Bond stretching energy term class. This energy term represents the bond stretching energy associated with two bonded atoms A1--A2.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int a1  
      int a2  
      double kb  
      double r0  
    • Constructor Summary

      Constructors 
      Constructor Description
      BondStretch​(Tables table, MMFFMolecule mol, int bond)
      Creates a new bond stretch given a force field and a bond.
      BondStretch​(Tables table, MMFFMolecule mol, int a1, int a2)
      Creates a new bond stretch given a force field and two bonded atoms.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<BondStretch> findIn​(Tables t, MMFFMolecule mol)
      Finds all bond stretch energy terms in the current molecule.
      double getEnergy​(double[] pos)
      Calculates the bond stretch energy.
      void getGradient​(double[] pos, double[] grad)
      Calculates the gradient and adds it to the gradients array.
      • 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
      • kb

        public final double kb
      • r0

        public final double r0
    • Constructor Detail

      • BondStretch

        public BondStretch​(Tables table,
                           MMFFMolecule mol,
                           int bond)
        Creates a new bond stretch given a force field and a bond. This is a wrapper constructor.
        Parameters:
        table - The tables parameter object.
        mol - The molecule.
        bond - The bond index.
      • BondStretch

        public BondStretch​(Tables table,
                           MMFFMolecule mol,
                           int a1,
                           int a2)
        Creates a new bond stretch given a force field and two bonded atoms.
        Parameters:
        table - The tables parameter object.
        mol - The molecule.
        a1 - Atom 1 index.
        a2 - Atom 2 index.
    • Method Detail

      • getEnergy

        public double getEnergy​(double[] pos)
        Calculates the bond stretch 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.
      • findIn

        public static java.util.List<BondStretch> findIn​(Tables t,
                                                         MMFFMolecule mol)
        Finds all bond stretch energy terms in the current molecule.
        Parameters:
        t - The tables parameter object.
        mol - The molecule.
        Returns:
        The bond stretch energy terms for this molecule.