Class RestrainTorsion

All Implemented Interfaces:
BondedEnergy, LambdaInterface, ROLS, Serializable, Cloneable, Comparable<BondedTerm>, MutableTreeNode, TreeNode

public class RestrainTorsion extends BondedTerm implements LambdaInterface
RestraintTorsion is a class that restrains the torsion angle defined by four atoms.
Author:
Michael J. Schnieders
See Also:
  • Field Details

    • torsionType

      public final TorsionType torsionType
    • units

      public final double units
  • Constructor Details

    • RestrainTorsion

      public RestrainTorsion(Atom a1, Atom a2, Atom a3, Atom a4, TorsionType torsionType, boolean lambdaEnabled, boolean reverseLambda, double units)
      Constructor for RestrainTorsion.
      Parameters:
      a1 - First torsional atom.
      a2 - Second torsional atom.
      a3 - Third torsional atom.
      a4 - Fourth torsional atom.
      torsionType - TorsionType.
      lambdaEnabled - True if the lambda term is enabled.
      reverseLambda - True if the lambda term should be reversed.
      units - Units for the energy term.
  • Method Details

    • energy

      public double energy(boolean gradient, int threadID, AtomicDoubleArray3D grad, AtomicDoubleArray3D lambdaGrad)
      Description copied from interface: BondedEnergy
      energy.
      Specified by:
      energy in interface BondedEnergy
      Parameters:
      gradient - If true, compute the gradient.
      threadID - The thread ID.
      grad - a AtomicDoubleArray3D object.
      lambdaGrad - a AtomicDoubleArray3D object.
      Returns:
      a double.
    • getLambda

      public double getLambda()
      Description copied from interface: LambdaInterface
      Get the current value of the state variable.
      Specified by:
      getLambda in interface LambdaInterface
      Returns:
      state
    • getAtoms

      public Atom[] getAtoms()
      Description copied from class: BondedTerm
      Returns a reference to the Atoms contained in this BondedTerm, regardless of whether they are child nodes in the tree structure.
      Overrides:
      getAtoms in class BondedTerm
      Returns:
      Atoms in this BondedTerm
    • getAtom

      public Atom getAtom(int index)
      Description copied from class: BondedTerm
      Get the constituent Atom specified by index.
      Overrides:
      getAtom in class BondedTerm
      Parameters:
      index - The index of the Atom to return.
      Returns:
      a Atom object.
    • applyLambda

      public boolean applyLambda()
      Description copied from class: BondedTerm
      Check if any atom of this BondedTerm has the Lambda flag set.
      Overrides:
      applyLambda in class BondedTerm
      Returns:
      True if Lambda is applied to one of the BondedTerm atoms.
    • setLambda

      public void setLambda(double lambda)
      Description copied from interface: LambdaInterface
      Set the current value of the state variable. May be ignored if lambda is not being applied.
      Specified by:
      setLambda in interface LambdaInterface
      Parameters:
      lambda - a double.
    • getd2EdL2

      public double getd2EdL2()
      Description copied from interface: LambdaInterface
      Get the 2nd partial derivative of the energy with respect to lambda.
      Specified by:
      getd2EdL2 in interface LambdaInterface
      Returns:
      d2EdL2
    • getdEdL

      public double getdEdL()
      Description copied from interface: LambdaInterface
      Get the partial derivative of the energy with respect to lambda.
      Specified by:
      getdEdL in interface LambdaInterface
      Returns:
      dEdL
    • mapLambda

      public double mapLambda(double lambda)
    • getdEdXdL

      public void getdEdXdL(double[] gradient)
      Description copied from interface: LambdaInterface
      Get the gradient of dEdL with respect to each parameter.
      Specified by:
      getdEdXdL in interface LambdaInterface
      Parameters:
      gradient - - A double array of length the number of parameters in the model (commonly 3 * number of atoms).
    • toString

      public String toString()
      Description copied from class: BondedTerm

      Overridden toString method returns the MSNode's name

      Overridden toString Method returns the Term's id.

      Overrides:
      toString in class BondedTerm