Package ffx.potential.bonded
Class RestrainDistance
java.lang.Object
javax.swing.tree.DefaultMutableTreeNode
ffx.potential.bonded.MSNode
ffx.potential.bonded.BondedTerm
ffx.potential.bonded.RestrainDistance
- All Implemented Interfaces:
BondedEnergy
,LambdaInterface
,ROLS
,Serializable
,Cloneable
,Comparable<BondedTerm>
,MutableTreeNode
,TreeNode
RestraintDistance class.
- 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
Modifier and TypeFieldDescriptionstatic final double
static final double
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
ConstructorDescriptionRestrainDistance
(Atom a1, Atom a2, Crystal crystal, boolean lambdaTerm, double lamStart, double lamEnd, UnivariateSwitchingFunction sf) Creates a distance restraint between two Atoms. -
Method Summary
Modifier and TypeMethodDescriptiondouble
energy
(boolean gradient, int threadID, AtomicDoubleArray3D grad, AtomicDoubleArray3D lambdaGrad) energy.Find the other Atom in this Bond.Getter for the fieldbondType
.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
Get the current value of the state variable.boolean
Check if this BondedTerm is lambda-sensitive (e.g., a softcore dihedral).void
log()
Log details for this Bond energy term.void
setBondType
(BondType bondType) Set a reference to the force field parameters.void
setLambda
(double lambda) Set the current value of the state variable.toString()
Methods inherited from class ffx.potential.bonded.BondedTerm
applyLambda, compareTo, containsHydrogen, containsResolution, destroy, equals, getAtom, getAtomArray, getAtomArray, getAtoms, getBond, getID, getUse, getValue, hashCode, isConstrained, isNeuralNetwork, print, removeNeuralNetworkTerms, setAtoms, setBonds, setColor, setConstraint, setID, setID_Key, setSelected, setValue, setView
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
-
Field Details
-
DEFAULT_RB_LAM_START
public static final double DEFAULT_RB_LAM_START- See Also:
-
DEFAULT_RB_LAM_END
public static final double DEFAULT_RB_LAM_END- See Also:
-
bondType
-
-
Constructor Details
-
RestrainDistance
public RestrainDistance(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
- The 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 interfaceBondedEnergy
- Parameters:
gradient
- If true, compute the gradient.threadID
- The thread ID.grad
- aAtomicDoubleArray3D
object.lambdaGrad
- aAtomicDoubleArray3D
object.- Returns:
- a double.
-
get1_2
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
Getter for the fieldbondType
.- Returns:
- a
BondType
object.
-
setBondType
Set a reference to the force field parameters.- Parameters:
bondType
- aBondType
object.
-
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.
-
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).
-
isLambdaScaled
public boolean isLambdaScaled()Description copied from class:BondedTerm
Check if this BondedTerm is lambda-sensitive (e.g., a softcore dihedral).- Overrides:
isLambdaScaled
in classBondedTerm
- Returns:
- True if Lambda affects the energy of this term.
-
log
public void log()Log details for this Bond energy term. -
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 classBondedTerm
-