etomica.potential
Class P4BondTorsion

java.lang.Object
  extended by etomica.potential.Potential
      extended by etomica.potential.P4BondTorsion
All Implemented Interfaces:
IPotential, IPotentialAtomic, PotentialSoft, Serializable

public class P4BondTorsion
extends Potential
implements PotentialSoft

Torsion potential. Jorgensen, W. L., Madura, J. D. and Swenson, C. J. J. Am. chem. Soc., 106, 6638-6646 (1984)

See Also:
Serialized Form

Field Summary
protected  double a0
           
protected  double a1
           
protected  double a2
           
protected  double a3
           
protected  IBoundary boundary
           
protected  IVectorMutable dr21
           
protected  IVectorMutable dr23
           
protected  IVectorMutable dr34
           
protected  IVectorMutable[] gradient
           
protected  IVectorMutable gtmp
           
protected  IVectorMutable v1
           
protected  IVectorMutable v2
           
 
Fields inherited from class etomica.potential.Potential
space
 
Constructor Summary
P4BondTorsion(ISpace space, double a0, double a1, double a2, double a3)
           
 
Method Summary
 double energy(IAtomList atomSet)
          Returns the interaction energy between the given atoms.
 double energyAtAngle(double cosphi)
           
 double getRange()
          Returns the range over which the potential applies.
 IVector[] gradient(IAtomList atoms)
          Returns the gradient of the potential as it applies to each atom in the given AtomSet, indicating how the energy would change as the position of the first atom is varied.
 IVector[] gradient(IAtomList atoms, Tensor pressureTensor)
          Returns the same gradient as gradient(AtomSet) and also adds in the contribution of the AtomSet to the pressureTensor.
static void main(String[] args)
           
 void setBox(IBox box)
          Informs the potential of the box on which it acts.
 double virial(IAtomList atoms)
           
 
Methods inherited from class etomica.potential.Potential
nBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface etomica.api.IPotential
nBody
 

Field Detail

dr21

protected final IVectorMutable dr21

dr23

protected final IVectorMutable dr23

dr34

protected final IVectorMutable dr34

v1

protected final IVectorMutable v1

v2

protected final IVectorMutable v2

gtmp

protected final IVectorMutable gtmp

boundary

protected IBoundary boundary

a0

protected double a0

a1

protected double a1

a2

protected double a2

a3

protected double a3

gradient

protected final IVectorMutable[] gradient
Constructor Detail

P4BondTorsion

public P4BondTorsion(ISpace space,
                     double a0,
                     double a1,
                     double a2,
                     double a3)
Method Detail

setBox

public void setBox(IBox box)
Description copied from class: Potential
Informs the potential of the box on which it acts. Typically this requires at least that it update the nearestImageTransformer of its coordinatePair (if it uses one), e.g.: cPair.setNearestImageTransformer(box.boundary());

Specified by:
setBox in interface IPotential
Specified by:
setBox in class Potential

energy

public double energy(IAtomList atomSet)
Description copied from class: Potential
Returns the interaction energy between the given atoms. There might be 0, 1, 2 or more atoms in the AtomSet.

Specified by:
energy in interface IPotentialAtomic
Specified by:
energy in class Potential

energyAtAngle

public double energyAtAngle(double cosphi)

getRange

public double getRange()
Description copied from interface: IPotential
Returns the range over which the potential applies. IAtoms with a greater separation do not interact.

Specified by:
getRange in interface IPotential
Specified by:
getRange in class Potential

gradient

public IVector[] gradient(IAtomList atoms)
Description copied from interface: PotentialSoft
Returns the gradient of the potential as it applies to each atom in the given AtomSet, indicating how the energy would change as the position of the first atom is varied. The method is allowed to return an array of Vectors with fewer elements than the number of atoms in the AtomSet.

Specified by:
gradient in interface PotentialSoft
Returns:

gradient

public IVector[] gradient(IAtomList atoms,
                          Tensor pressureTensor)
Description copied from interface: PotentialSoft
Returns the same gradient as gradient(AtomSet) and also adds in the contribution of the AtomSet to the pressureTensor. Their contribution is added to the given Tensor. This combined method exists for computational efficiency. Calculating the pressureTensor is generally trivial once the gradient is known but often requires intermediate information.

Specified by:
gradient in interface PotentialSoft

virial

public double virial(IAtomList atoms)
Specified by:
virial in interface PotentialSoft

main

public static void main(String[] args)