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 CubicAnisotropy(mm.CubicAnisotropy):
"""Cubic anisotropy energy term.
This energy term models cubic anisotropy term, defined by the
anisotropy constant `K1` and the cubic anisotropy axes `u1` and
`u2`. `u3` is then computed as a cross product of `u1` and `u2`.
.. math::
w_{ca} = -K_{1} [(\\mathbf{m} \\cdot
\\mathbf{u}_{1})^{2}(\\mathbf{m} \\cdot
\\mathbf{u}_{2})^{2} + (\\mathbf{m} \\cdot
\\mathbf{u}_{2})^{2}(\\mathbf{m} \\cdot
\\mathbf{u}_{3})^{2} + (\\mathbf{m} \\cdot
\\mathbf{u}_{1})^{2}(\\mathbf{m} \\cdot
\\mathbf{u}_{3})^{2}]