How to use the micromagneticmodel.UniaxialAnisotropy 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 / uniaxialanisotropy.py View on Github external
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