IPotential, IPotentialAtomic, IPotentialAtomicSecondDerivative, IPotentialTorque, PotentialSoftpublic class P2Spin extends Potential2 implements IPotentialTorque, IPotentialAtomicSecondDerivative
U = -J r1 dot r2
where J is a coupling parameter, and r1 and r2 are the vectors given by atom.coord.position. It is expected (but not verified here) that these vectors are normalized to unity, and that the simulation integrator's algorithm enforces this constraint.
| Modifier and Type | Field | Description |
|---|---|---|
protected Vector |
dr |
|
protected Vector |
dr2 |
|
protected Tensor[] |
secondDerivative |
|
protected Vector[] |
torque |
| Constructor | Description |
|---|---|
P2Spin(Space space) |
|
P2Spin(Space space,
double coupling) |
| Modifier and Type | Method | Description |
|---|---|---|
double |
energy(IAtomList atoms) |
Returns the energy for the given pair of atoms.
|
double |
getCoupling() |
* @return J the coupling parameter
|
double |
getRange() |
Returns 0, because potential operates on a lattice and range
should not be needed.
|
Vector[] |
gradient(IAtomList atoms) |
do nothing
|
Vector[] |
gradient(IAtomList atoms,
Tensor pressureTensor) |
do nothing
|
Vector[][] |
gradientAndTorque(IAtomList atoms) |
|
Vector[][] |
gradientAndTorque(IAtomList atoms,
Tensor pressureTensor) |
do nothing
|
Tensor[] |
secondDerivative(IAtomList atoms) |
compute the secondDerivative array of pair energy w.r.t theta1 or theta2
i.e d^2u/dtheta1_dtheta1 d^2u/dtheta1_dtheta2 and d^2u/dtheta2_dtheta2
theta1 is the angle between x axis and atom1's orientation etc.
|
void |
setBox(Box box) |
does nothing
|
void |
setCoupling(double coupling) |
set the coupling parameter J
|
double |
virial(IAtomList atoms) |
no virial is use here
|
nBodyprotected final Vector[] torque
protected final Tensor[] secondDerivative
protected Vector dr
protected Vector dr2
public P2Spin(Space space)
public P2Spin(Space space, double coupling)
public double energy(IAtomList atoms)
energy in interface IPotentialAtomicenergy in class Potentialatoms - java.lang.ClassCastException - if atoms is not an instance of AtomPairpublic double getRange()
getRange in interface IPotentialgetRange in class Potentialpublic double getCoupling()
public void setCoupling(double coupling)
coupling - public void setBox(Box box)
setBox in interface IPotentialsetBox in class Potentialbox - public double virial(IAtomList atoms)
virial in interface PotentialSoftjava.lang.Exception - when virial is usedpublic Vector[][] gradientAndTorque(IAtomList atoms)
gradientAndTorque in interface IPotentialTorqueatoms - public Vector[][] gradientAndTorque(IAtomList atoms, Tensor pressureTensor)
public Tensor[] secondDerivative(IAtomList atoms)
secondDerivative in interface IPotentialAtomicSecondDerivativeatoms - given pair of atomspublic Vector[] gradient(IAtomList atoms)
gradient in interface PotentialSoftpublic Vector[] gradient(IAtomList atoms, Tensor pressureTensor)
gradient in interface PotentialSoft