Package ffx.potential.nonbonded
Class CoordRestraint
java.lang.Object
ffx.potential.nonbonded.CoordRestraint
- All Implemented Interfaces:
LambdaInterface
Restrain atoms to their initial coordinates.
- Since:
- 1.0
- Author:
- Michael J. Schnieders
-
Constructor Summary
ConstructorsConstructorDescriptionCoordRestraint
(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 TypeMethodDescriptionAtom[]
getAtoms()
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
getdEdL()
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 fieldignoreHydrogen
.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
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
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
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
Returns a copy of the atoms array.- Returns:
- Copy of the atom array.
-
getCoordinatePin
public double[][] getCoordinatePin(double[][] xyz) getCoordinatePin.- Parameters:
xyz
- an array ofinvalid reference
double
- Returns:
- an array of
invalid reference
double
-
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 interfaceLambdaInterface
- 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 interfaceLambdaInterface
- 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 interfaceLambdaInterface
- Returns:
- d2EdL2
-
getdEdL
public double getdEdL()Get the partial derivative of the energy with respect to lambda.- Specified by:
getdEdL
in interfaceLambdaInterface
- Returns:
- dEdL
-
getdEdXdL
public void getdEdXdL(double[] gradient) Get the gradient of dEdL with respect to each parameter.- Specified by:
getdEdXdL
in interfaceLambdaInterface
- 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 gradientsprint
- 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 fieldignoreHydrogen
.- Parameters:
ignoreHydrogen
- a boolean.
-