IPotential
, IPotentialAtomic
, IPotentialAtomicSecondDerivative
, IPotentialTorque
, PotentialSoft
public 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
|
nBody
protected 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 IPotentialAtomic
energy
in class Potential
atoms
- java.lang.ClassCastException
- if atoms is not an instance of AtomPairpublic double getRange()
getRange
in interface IPotential
getRange
in class Potential
public double getCoupling()
public void setCoupling(double coupling)
coupling
- public void setBox(Box box)
setBox
in interface IPotential
setBox
in class Potential
box
- public double virial(IAtomList atoms)
virial
in interface PotentialSoft
java.lang.Exception
- when virial is usedpublic Vector[][] gradientAndTorque(IAtomList atoms)
gradientAndTorque
in interface IPotentialTorque
atoms
- public Vector[][] gradientAndTorque(IAtomList atoms, Tensor pressureTensor)
public Tensor[] secondDerivative(IAtomList atoms)
secondDerivative
in interface IPotentialAtomicSecondDerivative
atoms
- given pair of atomspublic Vector[] gradient(IAtomList atoms)
gradient
in interface PotentialSoft
public Vector[] gradient(IAtomList atoms, Tensor pressureTensor)
gradient
in interface PotentialSoft