Package ffx.potential.bonded
Class Bond
java.lang.Object
javax.swing.tree.DefaultMutableTreeNode
ffx.potential.bonded.MSNode
ffx.potential.bonded.BondedTerm
ffx.potential.bonded.Bond
- All Implemented Interfaces:
BondedEnergy
,ROLS
,Serializable
,Cloneable
,Comparable<BondedTerm>
,MutableTreeNode
,TreeNode
The Bond class represents a covalent bond formed between two 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
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
-
Method Summary
Modifier and TypeMethodDescriptionint
double
energy
(boolean gradient, int threadID, AtomicDoubleArray3D grad, AtomicDoubleArray3D lambdaGrad) energy.Find the other Atom in this Bond.Return the BondType for this Bond.double
Gets the current distance between the two Atoms in this Bond.void
log()
Log details for this Bond energy term.static void
logNoBondType
(Atom a1, Atom a2, ForceField forceField) Log that no BondType exists.void
void
setBondType
(BondType bondType) Set a reference to the force field parameters.void
Set the color of this Bond's Java3D shapes based on the passed Atom.void
setRigidScale
(double rigidScale) Setter for the fieldrigidScale
.void
setView
(RendererCache.ViewModel newViewModel, List<org.jogamp.java3d.BranchGroup> newShapes) setViewvoid
setWire
(org.jogamp.java3d.LineArray l, int i) setWirevoid
update()
updateMethods inherited from class ffx.potential.bonded.BondedTerm
applyLambda, 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, 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
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, 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
-
Field Details
-
bondType
The force field BondType for this bond.
-
-
Constructor Details
-
Bond
Simple Bond constructor that is intended to be used with theequals
method.- Parameters:
n
- Bond id
-
Bond
Bond constructor.- Parameters:
a1
- Atom number 1.a2
- Atom number 2.
-
-
Method Details
-
logNoBondType
Log that no BondType exists.- Parameters:
a1
- Atom 1.a2
- Atom 2.forceField
- The force field in use.
-
compareTo
- Specified by:
compareTo
in interfaceComparable<BondedTerm>
- Overrides:
compareTo
in classBondedTerm
-
energy
public double energy(boolean gradient, int threadID, AtomicDoubleArray3D grad, AtomicDoubleArray3D lambdaGrad) energy.Evaluate this Bond energy.
- 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.
-
getCurrentDistance
public double getCurrentDistance()Gets the current distance between the two Atoms in this Bond.- Returns:
- Current distance.
-
log
public void log()Log details for this Bond energy term. -
removeFromParent
public void removeFromParent()- Specified by:
removeFromParent
in interfaceMutableTreeNode
- Overrides:
removeFromParent
in classDefaultMutableTreeNode
-
setBondType
Set a reference to the force field parameters.- Parameters:
bondType
- aBondType
object.
-
getBondType
Return the BondType for this Bond.- Returns:
- Returns the BondType.
-
setColor
Set the color of this Bond's Java3D shapes based on the passed Atom.- Parameters:
a
- Atom
-
setRigidScale
public void setRigidScale(double rigidScale) Setter for the fieldrigidScale
.- Parameters:
rigidScale
- a double.
-
setView
public void setView(RendererCache.ViewModel newViewModel, List<org.jogamp.java3d.BranchGroup> newShapes) setViewPolymorphic setView method.
- Specified by:
setView
in interfaceROLS
- Overrides:
setView
in classBondedTerm
- Parameters:
newViewModel
- aRendererCache.ViewModel
object.newShapes
- aList
object.
-
setWire
public void setWire(org.jogamp.java3d.LineArray l, int i) setWire- Parameters:
l
- aLineArray
object.i
- The index of the LineArray to use.
-
update
public void update()updateUpdate recomputes bonds length, Wireframe vertices, and Cylinder Transforms
-