How to use the micromagneticmodel.CubicAnisotropy function in micromagneticmodel

To help you get started, we’ve selected a few micromagneticmodel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ubermag / oommfc / oommfc / hamiltonian / cubicanisotropy.py View on Github external
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}]