Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import oommfc.util as ou
import micromagneticmodel as mm
class UniaxialAnisotropy(mm.UniaxialAnisotropy):
"""Uniaxial anisotropy energy term.
This energy term models uniaxial anisotropy term, defined by the
anisotropy constant `K1` and the uniaxial anisotropy axis
`u`.
.. math::
w_{ua} = -K_{1}(\\mathbf{m} \\cdot \\mathbf{u})^{2}
`K1` is a scalar, given in J/m3, whereas `u` is a three-dimensional
vector with real component values and no units. The axis direction
must be non-zero at each point in the mesh, and will be normalized
to unit magnitude before being used.
Both the scalar parameter `K1` and the vector parameter `u` can be