How to use the micromagneticmodel.Precession 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 / scripts / driver.py View on Github external
if not hasattr(driver, 'evolver'):
            if mm.ZhangLi() in system.dynamics:
                driver.evolver = oc.SpinTEvolver()
            elif mm.Slonczewski() in system.dynamics:
                driver.evolver = oc.SpinXferEvolver()
            else:
                driver.evolver = oc.RungeKuttaEvolver()
        elif not isinstance(driver.evolver, (oc.EulerEvolver,
                                             oc.RungeKuttaEvolver,
                                             oc.SpinTEvolver,
                                             oc.SpinXferEvolver)):
            msg = f'Cannot use {type(driver.evolver)} for evolver.'
            raise TypeError(msg)

        # Extract dynamics equation parameters.
        if mm.Precession() in system.dynamics:
            driver.evolver.gamma_G = system.dynamics.precession.gamma0
        else:
            driver.evolver.do_precess = 0
        if mm.Damping() in system.dynamics:
            driver.evolver.alpha = system.dynamics.damping.alpha
        else:
            driver.evolver.alpha = 0
        if mm.ZhangLi() in system.dynamics:
            driver.evolver.u = system.dynamics.zhangli.u
            driver.evolver.beta = system.dynamics.zhangli.beta
        if mm.Slonczewski() in system.dynamics:
            driver.evolver.J = system.dynamics.slonczewski.J
            driver.evolver.mp = system.dynamics.slonczewski.mp
            driver.evolver.P = system.dynamics.slonczewski.P
            driver.evolver.Lambda = system.dynamics.slonczewski.Lambda
            driver.evolver.eps_prime = system.dynamics.slonczewski.eps_prime
github ubermag / oommfc / oommfc / dynamics / precession.py View on Github external
import micromagneticmodel as mm


class Precession(mm.Precession):
    """Precession dynamics term.

    This dynamics term models the precession in the
    Landau-Lifshitz-Gilbert equation. It is defined by the
    gyromagnetic ratio `gamma`. `gamma` is a scalar value with m/As
    units.

    .. math::

           \\frac{\\text{d}\\mathbf{m}}{\\text{d}t} = -\\gamma
           \\mathbf{m} \\times \\mathbf{H}_\\text{eff}

    `gamma` can be either contant in space or spatially varying. If it
    is constant, a single value is passed, e.g. `gamma = 2.211e5`. On
    the other hand, if it varies in space, there are two ways how that
    can be defined. The first one is using a dictionary, where the