Sample Oxs_Energy Class

This sections provides an extended dissection of a simple
Oxs_Energy child class. The computational details are kept as
simple as possible, so the discussion can focus on the C++ class
structural details. Although the calculation details will vary between
energy terms, the class structure issues discussed here apply across the
board to all energy terms.

The particular example presented here is for simulating
uniaxial magneto-crystalline energy, with a single anisotropy constant,
K1, and a single axis, axis, which are uniform across the
sample.
The class definition (.h) and
code (.cc) files are included below.