Package ffx.potential.nonbonded
Class RestrainPosition
java.lang.Object
javax.swing.tree.DefaultMutableTreeNode
ffx.potential.bonded.MSNode
ffx.potential.bonded.BondedTerm
ffx.potential.nonbonded.RestrainPosition
- All Implemented Interfaces:
BondedEnergy
,LambdaInterface
,ROLS
,Serializable
,Cloneable
,Comparable<BondedTerm>
,MutableTreeNode
,TreeNode
Restrain the position of atoms to their initial coordinates.
- Since:
- 1.0
- Author:
- Michael J. Schnieders
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class ffx.potential.bonded.BondedTerm
BondedTerm.BondedComparator
-
Field Summary
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
Fields inherited from interface ffx.potential.bonded.ROLS
MaxLengthScale
-
Constructor Summary
ConstructorDescriptionRestrainPosition
(Atom[] atoms, double[][] equilibriumCoordinates, double forceConst, double flatBottom, boolean lambdaTerm) Restrain atoms to a position in the global coordinate frame. -
Method Summary
Modifier and TypeMethodDescriptiondouble
energy
(boolean gradient, int threadID, AtomicDoubleArray3D grad, AtomicDoubleArray3D lambdaGrad) Calculates energy and gradients for this coordinate restraint.Atom[]
getAtoms()
Returns a copy of the atoms array.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 original coordinates of this restraint, indexed by atoms then x,y,z.double
Returns the force constant in kcal/mol/Angstrom^2.double
Get the current value of the state variable.int
getNumAtoms.static RestrainPosition
parseRestrainPosition
(String line, Atom[] atoms, boolean useLambda) Parse a Restrain-Position line and return a RestrainPosition instance.static RestrainPosition[]
parseRestrainPositions
(MolecularAssembly molecularAssembly) void
setLambda
(double lambda) Set the current value of the state variable.Methods inherited from class ffx.potential.bonded.BondedTerm
applyLambda, compareTo, containsHydrogen, containsResolution, destroy, equals, getAtom, getAtomArray, getAtomArray, getBond, getID, getUse, getValue, hashCode, isConstrained, isLambdaScaled, isNeuralNetwork, print, removeNeuralNetworkTerms, setAtoms, setBonds, setColor, setConstraint, setID, setID_Key, setSelected, setValue, setView, toString
Methods inherited from class ffx.potential.bonded.MSNode
contains, drawLabel, getAngleList, getAngleTorsionList, getAtomList, getAtomList, getBondList, getCenter, getChildList, getExtent, getImproperTorsionList, getList, getList, getMSCount, getMSNode, getMW, getName, getOutOfPlaneBendList, getPiOrbitalTorsionList, getStretchBendList, getStretchTorsionList, getTorsionList, getTorsionTorsionList, getTotalMass, getUreyBradleyList, isSelected, removeChild, setName, update
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ffx.potential.bonded.BondedEnergy
energy, energy, update
Methods inherited from interface ffx.potential.bonded.LambdaInterface
dEdLZeroAtEnds
-
Constructor Details
-
RestrainPosition
public RestrainPosition(Atom[] atoms, double[][] equilibriumCoordinates, double forceConst, double flatBottom, boolean lambdaTerm) Restrain atoms to a position in the global coordinate frame.- Parameters:
atoms
- The atoms to restrain.equilibriumCoordinates
- The equilibrium coordinates.forceConst
- The force constant in kcal/mol/A^2.flatBottom
- The flat bottom radius in Angstroms.lambdaTerm
- If true, apply lambda to this restraint.
-
-
Method Details
-
getAtoms
Returns a copy of the atoms array.- Overrides:
getAtoms
in classBondedTerm
- Returns:
- Copy of the atom array.
-
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.
-
getEquilibriumCoordinates
public double[][] getEquilibriumCoordinates()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).
-
energy
public double energy(boolean gradient, int threadID, AtomicDoubleArray3D grad, AtomicDoubleArray3D lambdaGrad) Calculates energy and gradients for this coordinate restraint.- Specified by:
energy
in interfaceBondedEnergy
- Parameters:
gradient
- Calculate gradientsthreadID
- The thread ID.grad
- aAtomicDoubleArray3D
object.lambdaGrad
- aAtomicDoubleArray3D
object.- Returns:
- Energy in the coordinate restraint
-
parseRestrainPositions
-
parseRestrainPosition
Parse a Restrain-Position line and return a RestrainPosition instance.- Parameters:
line
- The restraint line.atoms
- The atoms in the system.useLambda
- If true, apply lambda to this restraint.- Returns:
- A RestrainPosition object.
-