Class RestraintBond

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

public class RestraintBond extends BondedTerm implements LambdaInterface
RestraintBond class.
Since:
1.0
Author:
Michael J. Schnieders
See Also:
  • Field Details

  • Constructor Details

    • RestraintBond

      public RestraintBond(Atom a1, Atom a2, Crystal crystal, boolean lambdaTerm, double lamStart, double lamEnd, UnivariateSwitchingFunction sf)
      Creates a distance restraint between two Atoms.
      Parameters:
      a1 - First Atom.
      a2 - Second Atom.
      crystal - Any Crystal used by the system.
      lambdaTerm - Whether lambda affects this restraint.
      lamStart - At what lambda does the restraint begin to take effect?
      lamEnd - At what lambda does the restraint hit full strength?
      sf - Switching function determining lambda dependence; null produces a ConstantSwitch.
  • Method Details

    • energy

      public double energy(boolean gradient, int threadID, AtomicDoubleArray3D grad, AtomicDoubleArray3D lambdaGrad)
      energy.

      Evaluate this Bond 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.
    • get1_2

      public Atom get1_2(Atom a)
      Find the other Atom in this Bond. These two atoms are said to be 1-2.
      Parameters:
      a - The known Atom.
      Returns:
      The other Atom that makes up this Bond, or Null if Atom a is not part of this Bond.
    • getBondType

      public BondType getBondType()
      Getter for the field bondType.
      Returns:
      a BondType object.
    • setBondType

      public void setBondType(BondType bondType)
      Set a reference to the force field parameters.
      Parameters:
      bondType - a BondType object.
    • getLambda

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

      public void setLambda(double lambda)
      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()
      Get the 2nd partial derivative of the energy with respect to lambda.
      Specified by:
      getd2EdL2 in interface LambdaInterface
      Returns:
      d2EdL2
    • getdEdL

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

      public void getdEdXdL(double[] gradient)
      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).
    • isLambdaScaled

      public boolean isLambdaScaled()
      Description copied from class: BondedTerm
      Check if this BondedTerm is lambda-sensitive (e.g., a softcore dihedral).
      Overrides:
      isLambdaScaled in class BondedTerm
      Returns:
      True if Lambda affects the energy of this term.
    • log

      public void log()
      Log details for this Bond energy term.
    • 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