IPotential
, IPotentialAtomic
, PotentialSoft
public class P2EAM extends Potential2 implements PotentialSoft
PotentialEAM
.
To compute the energy, the P1EAM inner class should also be added to the potential master. The energy method should be called for all interacting pairs and then summed with the result of calling energy1.
To compute the gradient, the energy method should be called for all pairs. Then call prepForGradient. Then the gradient method should be called for all pairs and summed appropriately. To speed things up, disableEnergy may be called.
Modifier and Type | Field | Description |
---|---|---|
protected double |
a |
|
protected double |
a2 |
|
protected Boundary |
boundary |
|
protected double |
Ceps |
|
protected Vector |
dr |
|
protected boolean |
energyDisabled |
|
protected double |
eps |
|
protected Vector[] |
gradient |
|
protected double |
m2 |
|
protected double |
n2 |
|
protected double |
rc12 |
|
protected double |
rc22 |
|
protected double[] |
rho |
|
protected Vector |
rhograd |
Constructor | Description |
---|---|
P2EAM(Space space,
double n,
double m,
double eps,
double a,
double C,
double rc1,
double rc2) |
Modifier and Type | Method | Description |
---|---|---|
void |
disableEnergy() |
|
void |
enableEnergy() |
|
double |
energy(IAtomList atoms) |
Returns the interaction energy between the given atoms.
|
double |
energy1() |
|
double |
getRange() |
Returns the range over which the potential applies.
|
Vector[] |
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.
|
Vector[] |
gradient(IAtomList atoms,
Tensor pressureTensor) |
Returns the same gradient as gradient(AtomSet) and also adds in the
contribution of the AtomSet to the pressureTensor.
|
IntegratorListenerMD |
makeIntegratorListener(PotentialMaster potentialMaster,
Box box) |
Creates and returns an integrator listener that makes the integrator's
force sum work properly by running an energy calculation first.
|
void |
prepForGradient() |
|
void |
reset() |
|
void |
setBox(Box box) |
Informs the potential of the box on which it acts.
|
void |
setCutoff(double rc1,
double rc2) |
|
double |
virial(IAtomList atoms) |
nBody
protected double n2
protected double m2
protected double eps
protected double a
protected double a2
protected double Ceps
protected double rc12
protected double rc22
protected Boundary boundary
protected final Vector dr
protected Vector[] gradient
protected Vector rhograd
protected double[] rho
protected boolean energyDisabled
public P2EAM(Space space, double n, double m, double eps, double a, double C, double rc1, double rc2)
public double getRange()
IPotential
getRange
in interface IPotential
getRange
in class Potential
public void setCutoff(double rc1, double rc2)
public void disableEnergy()
public void enableEnergy()
public void reset()
public void prepForGradient()
public double energy(IAtomList atoms)
Potential
energy
in interface IPotentialAtomic
energy
in class Potential
public double energy1()
public void setBox(Box box)
Potential
setBox
in interface IPotential
setBox
in class Potential
public double virial(IAtomList atoms)
virial
in interface PotentialSoft
public Vector[] gradient(IAtomList atoms)
PotentialSoft
gradient
in interface PotentialSoft
public Vector[] gradient(IAtomList atoms, Tensor pressureTensor)
PotentialSoft
gradient
in interface PotentialSoft
public IntegratorListenerMD makeIntegratorListener(PotentialMaster potentialMaster, Box box)
potentialMaster
- box
-