Class CoordRestraint

java.lang.Object
ffx.potential.nonbonded.CoordRestraint
All Implemented Interfaces:
LambdaInterface

public class CoordRestraint extends Object implements LambdaInterface
Restrain atoms to their initial coordinates.
Since:
1.0
Author:
Michael J. Schnieders
  • Constructor Summary

    Constructors
    Constructor
    Description
    CoordRestraint(Atom[] atoms, ForceField forceField)
    This CoordRestraint is based on the unit cell parameters and symmetry operators of the supplied crystal.
    CoordRestraint(Atom[] atoms, ForceField forceField, boolean useLambda)
    This CoordRestraint is based on the unit cell parameters and symmetry operators of the supplied crystal.
    CoordRestraint(Atom[] atoms, ForceField forceField, boolean useLambda, double forceConst)
    This CoordRestraint is based on the unit cell parameters and symmetry operators of the supplied crystal.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a copy of the atoms array.
    double[][]
    getCoordinatePin(double[][] xyz)
    getCoordinatePin.
    double
    Get the 2nd partial derivative of the energy with respect to lambda.
    double
    Get the partial derivative of the energy with respect to lambda.
    void
    getdEdXdL(double[] gradient)
    Get the gradient of dEdL with respect to each parameter.
    double
    Returns the force constant in kcal/mol/Angstrom^2.
    double
    Get the current value of the state variable.
    int
    getNumAtoms.
    double[][]
    Returns the original coordinates of this restraint, indexed by atoms then x,y,z.
    void
    resetCoordinatePin.
    double
    residual(boolean gradient, boolean print)
    Calculates energy and gradients for this coordinate restraint.
    void
    setCoordinatePin(double[][] newInitialCoordinates)
    Sets the initial coordinates to new values.
    void
    setIgnoreHydrogen(boolean ignoreHydrogen)
    Setter for the field ignoreHydrogen.
    void
    setLambda(double lambda)
    Set the current value of the state variable.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface ffx.potential.bonded.LambdaInterface

    dEdLZeroAtEnds
  • Constructor Details

    • CoordRestraint

      public CoordRestraint(Atom[] atoms, ForceField forceField)
      This CoordRestraint is based on the unit cell parameters and symmetry operators of the supplied crystal.
      Parameters:
      atoms - the Atom array to base this CoordRestraint on.
      forceField - the ForceField to apply.
    • CoordRestraint

      public CoordRestraint(Atom[] atoms, ForceField forceField, boolean useLambda)
      This CoordRestraint is based on the unit cell parameters and symmetry operators of the supplied crystal.
      Parameters:
      atoms - the Atom array to base this CoordRestraint on.
      forceField - the ForceField to apply.
      useLambda - If false, do not apply lambda term to this restraint.
    • CoordRestraint

      public CoordRestraint(Atom[] atoms, ForceField forceField, boolean useLambda, double forceConst)
      This CoordRestraint is based on the unit cell parameters and symmetry operators of the supplied crystal.
      Parameters:
      atoms - the Atom array to base this CoordRestraint on.
      forceField - the ForceField to apply.
      useLambda - If false, do not apply lambda term to this restraint.
      forceConst - Force constant to apply
  • Method Details

    • getAtoms

      public Atom[] getAtoms()
      Returns a copy of the atoms array.
      Returns:
      Copy of the atom array.
    • getCoordinatePin

      public double[][] getCoordinatePin(double[][] xyz)
      getCoordinatePin.
      Parameters:
      xyz - an array of
      invalid reference
      double
      objects.
      Returns:
      an array of
      invalid reference
      double
      objects.
    • getForceConstant

      public double getForceConstant()
      Returns the force constant in kcal/mol/Angstrom^2.
      Returns:
      a double.
    • 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.
    • getNumAtoms

      public int getNumAtoms()
      getNumAtoms.
      Returns:
      a int.
    • getOriginalCoordinates

      public double[][] getOriginalCoordinates()
      Returns the original coordinates of this restraint, indexed by atoms then x,y,z. This is the opposite order of the internal storage.
      Returns:
      Original coordinates [atoms][xyz]
    • 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).
    • resetCoordinatePin

      public void resetCoordinatePin()
      resetCoordinatePin.
    • residual

      public double residual(boolean gradient, boolean print)
      Calculates energy and gradients for this coordinate restraint.
      Parameters:
      gradient - Calculate gradients
      print - Unused
      Returns:
      Energy in the coordinate restraint
    • setCoordinatePin

      public void setCoordinatePin(double[][] newInitialCoordinates)
      Sets the initial coordinates to new values.
      Parameters:
      newInitialCoordinates - Indexed xyz,atom number.
    • setIgnoreHydrogen

      public void setIgnoreHydrogen(boolean ignoreHydrogen)
      Setter for the field ignoreHydrogen.
      Parameters:
      ignoreHydrogen - a boolean.