IPotential, IPotentialAtomicpublic class P2Spin extends Potential2
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.
| 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() |
|
double |
getRange() |
Returns 0, becuase potential operates on a lattice and range
should not be needed.
|
void |
setBox(Box box) |
Informs the potential of the box on which it acts.
|
void |
setCoupling(double coupling) |
public P2Spin(Space space)
public P2Spin(Space space, double coupling)
public double energy(IAtomList atoms)
energy in interface IPotentialAtomicenergy in class Potentialjava.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 - The coupling to set.public void setBox(Box box)
PotentialsetBox in interface IPotentialsetBox in class Potential