Class BondStretch
- java.lang.Object
-
- com.actelion.research.chem.forcefield.mmff.BondStretch
-
- All Implemented Interfaces:
EnergyTerm
public class BondStretch extends java.lang.Object implements EnergyTerm
Bond stretching energy term class. This energy term represents the bond stretching energy associated with two bonded atoms A1--A2.
-
-
Constructor Summary
Constructors Constructor Description BondStretch(Tables table, MMFFMolecule mol, int bond)
Creates a new bond stretch given a force field and a bond.BondStretch(Tables table, MMFFMolecule mol, int a1, int a2)
Creates a new bond stretch given a force field and two bonded atoms.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.List<BondStretch>
findIn(Tables t, MMFFMolecule mol)
Finds all bond stretch energy terms in the current molecule.double
getEnergy(double[] pos)
Calculates the bond stretch energy.void
getGradient(double[] pos, double[] grad)
Calculates the gradient and adds it to the gradients array.
-
-
-
Constructor Detail
-
BondStretch
public BondStretch(Tables table, MMFFMolecule mol, int bond)
Creates a new bond stretch given a force field and a bond. This is a wrapper constructor.- Parameters:
table
- The tables parameter object.mol
- The molecule.bond
- The bond index.
-
BondStretch
public BondStretch(Tables table, MMFFMolecule mol, int a1, int a2)
Creates a new bond stretch given a force field and two bonded atoms.- Parameters:
table
- The tables parameter object.mol
- The molecule.a1
- Atom 1 index.a2
- Atom 2 index.
-
-
Method Detail
-
getEnergy
public double getEnergy(double[] pos)
Calculates the bond stretch energy.- Specified by:
getEnergy
in interfaceEnergyTerm
- Parameters:
pos
- The atoms current positions array.- Returns:
- The energy.
-
getGradient
public void getGradient(double[] pos, double[] grad)
Calculates the gradient and adds it to the gradients array.- Specified by:
getGradient
in interfaceEnergyTerm
- Parameters:
pos
- The atoms current positions array.grad
- the atoms current gradients array.
-
findIn
public static java.util.List<BondStretch> findIn(Tables t, MMFFMolecule mol)
Finds all bond stretch energy terms in the current molecule.- Parameters:
t
- The tables parameter object.mol
- The molecule.- Returns:
- The bond stretch energy terms for this molecule.
-
-