Beispiel #1
0
def excite_system(mesh):

    sim = Sim(mesh, name='dyn', driver='sllg')
    sim.set_options(dt=1e-14, gamma=const.gamma, k_B=const.k_B)
    sim.alpha = 0.1
    sim.mu_s = const.mu_s_1
    sim.T = temperature_gradient

    sim.set_m(np.load("m0.npy"))

    J = 50.0 * const.k_B
    exch = UniformExchange(J)
    sim.add(exch)

    D = 0.5 * J
    dmi = DMI(D)
    sim.add(dmi)

    Hz = 0.2 * J / const.mu_s_1
    zeeman = Zeeman([0, 0, Hz])
    sim.add(zeeman)

    dt = 2e-14 * 50  # 1e-12
    ts = np.linspace(0, 1000 * dt, 501)
    for t in ts:
        sim.run_until(t)
        sim.save_vtk()
        sim.save_m()
        print 'sim t=%g' % t
def excite_system(mesh):

    sim = Sim(mesh, name='dyn', driver='sllg')
    sim.set_options(dt=1e-14, gamma=const.gamma, k_B=const.k_B)
    sim.driver.alpha = 0.1
    sim.mu_s = const.mu_s_1
    sim.T = temperature_gradient

    sim.set_m(np.load("m0.npy"))

    J = 50.0 * const.k_B
    exch = UniformExchange(J)
    sim.add(exch)

    D = 0.5 * J
    dmi = DMI(D)
    sim.add(dmi)

    Hz = 0.2 * J / const.mu_s_1
    zeeman = Zeeman([0, 0, Hz])
    sim.add(zeeman)

    dt = 2e-14 * 50  # 1e-12
    ts = np.linspace(0, 1000 * dt, 501)
    for t in ts:
        sim.run_until(t)
        sim.save_vtk()
        sim.save_m()
        print 'sim t=%g' % t
Beispiel #3
0
def relax_system_stage2():

    mesh = CuboidMesh(nx=140 , ny=140, nz=1)

    sim = Sim(mesh, name='dyn', driver='llg')
    sim.alpha = 0.1
    sim.do_precession = True
    sim.gamma = const.gamma
    sim.mu_s = spatial_mu

    sim.set_m(np.load('skx.npy'))

    J = 50 * const.k_B
    exch = UniformExchange(J)
    sim.add(exch)

    D = 0.27 * J
    dmi = DMI(D)
    sim.add(dmi)

    zeeman = Zeeman(spatial_H)
    sim.add(zeeman)

    ts = np.linspace(0, 2e-9, 201)
    for t in ts:
        sim.run_until(t)
        sim.save_vtk()
        sim.save_m()
        print(t)
Beispiel #4
0
def dynamic(mesh):

    sim = Sim(mesh, name='dyn', driver='slonczewski')
    # sim.set_options(rtol=1e-10,atol=1e-14)
    sim.driver.gamma = 1.0
    sim.mu_s = 1.0

    sim.set_m(np.load('m0.npy'))

    J = 1.0
    exch = UniformExchange(J)
    sim.add(exch)

    Kx = Anisotropy(Ku=0.005, axis=(1, 0, 0), name='Kx')
    sim.add(Kx)

    sim.p = (0, 0, 1)

    sim.u0 = 0.03
    sim.driver.alpha = 0.1

    ts = np.linspace(0, 1e3, 101)
    for t in ts:
        sim.run_until(t)
        sim.save_vtk()
        print t
Beispiel #5
0
def dynamic(mesh):

    sim = Sim(mesh, name='dyn', driver='slonczewski')
    # sim.set_options(rtol=1e-10,atol=1e-14)
    sim.gamma = 1.0
    sim.mu_s = 1.0

    sim.set_m(np.load('m0.npy'))

    J = 1.0
    exch = UniformExchange(J)
    sim.add(exch)

    Kx = Anisotropy(Ku=0.005, axis=(1, 0, 0), name='Kx')
    sim.add(Kx)

    sim.p = (0,0,1)

    sim.u0 = 0.03
    sim.alpha = 0.1

    ts = np.linspace(0, 1e3, 101)
    for t in ts:
        sim.run_until(t)
        sim.save_vtk()
        print t
Beispiel #6
0
def relax_system(mesh):

    sim = Sim(mesh, name='relax')
    sim.mu_s = 1e-23
    sim.driver.gamma = 1.76e11
    sim.driver.alpha = 1.0
    J = 1e-22
    exch = UniformExchange(J)
    sim.add(exch)
    demag = Demag()
    sim.add(demag)
    sim.set_m(init_m)

    ts = np.linspace(0, 5e-10, 101)
    for t in ts:
        sim.driver.run_until(t)
        sim.save_vtk()
    np.save('m0.npy', sim.spin)
Beispiel #7
0
def relax_system(mesh):

    sim = Sim(mesh, name='relax')
    sim.alpha = 0.1

    sim.set_m(init_m)

    J = 1
    exch = UniformExchange(J)
    sim.add(exch)

    dmi = DMI(0.05 * J)
    sim.add(dmi)

    ts = np.linspace(0, 1, 11)
    for t in ts:
        print t, sim.spin_length() - 1
        sim.run_until(t)

    sim.save_vtk()

    return sim.spin
Beispiel #8
0
def relax_system(mesh):

    sim = Sim(mesh, name='relax')
    sim.alpha = 0.1

    sim.set_m(init_m)

    J = 1
    exch = UniformExchange(J)
    sim.add(exch)

    dmi = DMI(0.05 * J)
    sim.add(dmi)

    ts = np.linspace(0, 1, 11)
    for t in ts:
        print t, sim.spin_length() - 1
        sim.run_until(t)

    sim.save_vtk()

    return sim.spin
Beispiel #9
0
                                            norm=norm,
                                            ticks=[-1, 0, 1],
                                            orientation='vertical',
                                            )

    cbar.set_label(r'$m_z$', rotation=270, labelpad=10, fontsize=16)

    # Interactive mode (this needs so set up a proper backend
    # when importing matplotlib for the first time)
    plt.ion()
    # Set False to avoid the execution of the following code
    plt.show(False)

    # ---------------------------------------------------------------------

    sim.save_vtk()
    # Now run the simulation printing the energy
    for time in times:
        if not run_from_ipython():
            print('Time: ', time, ' s')
            print('Total energy: ', sim.compute_energy(), ' J')
            print('\n')
        sim.driver.run_until(time)

        # Update the vector data for the plot (the spins do not move
        # so we don't need to update the coordinates) and redraw
        m = np.copy(sim.spin)
        # reshape rows, transpose and filter according to top layer
        m = m.reshape(-1, 3)
        quiv.set_UVC(m[:, 0], m[:, 1], m[:, 2])