Package ffx.potential.bonded
Class Torsion
java.lang.Object
javax.swing.tree.DefaultMutableTreeNode
ffx.potential.bonded.MSNode
ffx.potential.bonded.BondedTerm
ffx.potential.bonded.Torsion
- All Implemented Interfaces:
BondedEnergy,LambdaInterface,ROLS,Serializable,Cloneable,Comparable<BondedTerm>,MutableTreeNode,TreeNode
The Torsion class represents a torsional angle formed between four bonded atoms.
- 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
FieldsFields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObjectFields inherited from interface ffx.potential.bonded.ROLS
MaxLengthScale -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancomparedoubleenergy(boolean gradient, int threadID, AtomicDoubleArray3D grad, AtomicDoubleArray3D lambdaGrad) energy.If the specified atom is not a central atom of this torsion, the atom at the opposite end is returned.doubleGet the 2nd partial derivative of the energy with respect to lambda.doublegetdEdL()Get the partial derivative of the energy with respect to lambda.voidgetdEdXdL(double[] gradient) Get the gradient of dEdL with respect to each parameter.doubleGet the current value of the state variable.doubleGet the torsion scale up factor.voidlog()Log details for this Torsional Angle energy term.static voidlogNoTorsionType(Atom a0, Atom a1, Atom a2, Atom a3, ForceField forceField) Log that no TorsionType exists.doublemeasure()Compute the torsional angle in degrees.voidsetLambda(double lambda) Set the current value of the state variable.voidsetTorsionScale(double torsionScale) Set the torsion scale up factor.voidsetTorsionType(TorsionType torsionType) Set the torsion type.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, isLambdaScaled, isNeuralNetwork, print, removeNeuralNetworkTerms, setAtoms, setBonds, setColor, setConstraint, setID, setID_Key, setSelected, setValue, setViewMethods 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, updateMethods 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, setUserObjectMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ffx.potential.bonded.BondedEnergy
energy, energy, updateMethods inherited from interface ffx.potential.bonded.LambdaInterface
dEdLZeroAtEnds
-
Field Details
-
torsionType
The force field Torsion type in use.
-
-
Constructor Details
-
Torsion
Create a Torsion from 3 connected bonds (no error checking)- Parameters:
b1- The first Bond.b2- The middle Bond.b3- The last Bond.
-
-
Method Details
-
logNoTorsionType
Log that no TorsionType exists.- Parameters:
a0- Atom 0.a1- Atom 1.a2- Atom 2.a3- Atom 3.
-
setTorsionType
Set the torsion type.- Parameters:
torsionType- The TorsionType.
-
setTorsionScale
public void setTorsionScale(double torsionScale) Set the torsion scale up factor.- Parameters:
torsionScale- The torsion scale up factor.
-
getTorsionScale
public double getTorsionScale()Get the torsion scale up factor.- Returns:
- The torsion scale up factor.
-
compare
compare -
measure
public double measure()Compute the torsional angle in degrees.- Returns:
- The torsion in degrees.
-
energy
public double energy(boolean gradient, int threadID, AtomicDoubleArray3D grad, AtomicDoubleArray3D lambdaGrad) energy.Evaluate the Torsional Angle energy.
- Specified by:
energyin interfaceBondedEnergy- Parameters:
gradient- If true, compute the gradient.threadID- The thread ID.grad- aAtomicDoubleArray3Dobject.lambdaGrad- aAtomicDoubleArray3Dobject.- Returns:
- a double.
-
get1_4
If the specified atom is not a central atom of this torsion, the atom at the opposite end is returned. These atoms are said to be 1-4 to each other.- Parameters:
a- Atom- Returns:
- Atom
-
getLambda
public double getLambda()Get the current value of the state variable.- Specified by:
getLambdain 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:
setLambdain interfaceLambdaInterface- Parameters:
lambda- a double.
-
getd2EdL2
public double getd2EdL2()Get the 2nd partial derivative of the energy with respect to lambda.- Specified by:
getd2EdL2in interfaceLambdaInterface- Returns:
- d2EdL2
-
getdEdL
public double getdEdL()Get the partial derivative of the energy with respect to lambda.- Specified by:
getdEdLin interfaceLambdaInterface- Returns:
- dEdL
-
getdEdXdL
public void getdEdXdL(double[] gradient) Get the gradient of dEdL with respect to each parameter.- Specified by:
getdEdXdLin interfaceLambdaInterface- Parameters:
gradient- - A double array of length the number of parameters in the model (commonly 3 * number of atoms).
-
log
public void log()Log details for this Torsional Angle energy term. -
toString
Overridden toString method returns the MSNode's name
Overridden toString Method returns the Term's id.
Overridden toString Method returns the Term's id.
- Overrides:
toStringin classBondedTerm
-