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
def excite_system(T=0.1, H=0.15): mesh = CuboidMesh(nx=28 * 3, ny=16 * 5, nz=1, pbc='2d') 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.set_m(random_m) J = 50 * const.k_B exch = UniformExchange(J) sim.add(exch) D = 0.5 * J dmi = DMI(D) sim.add(dmi) Hz = H * J / const.mu_s_1 zeeman = Zeeman([0, 0, Hz]) sim.add(zeeman) sim.T = J / const.k_B * T ts = np.linspace(0, 5e-11, 51) for t in ts: sim.run_until(t) # sim.save_vtk() np.save('m.npy', sim.spin) plot_m(mesh, 'm.npy', comp='z')
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 single_spin(alpha=0.01): mat = Material() mesh = CuboidMesh(nx=1, ny=1, nz=1) sim = Sim(mesh, driver='sllg') sim.alpha = alpha sim.gamma = mat.gamma sim.mu_s = mat.mu_s sim.T = 10000 sim.set_m((1, 1, 1)) #sim.add(Zeeman(1,(0, 0, 1))) anis = Anisotropy(mat.K, direction=(0, 0, 1)) sim.add(anis) dt = 0.5e-12 ts = np.linspace(0, 1000 * dt, 1001) sx = [] sy = [] for t in ts: sim.run_until(t) sx.append(sim.spin[0]) sy.append(sim.spin[1]) print(t) plt.plot(sx, sy) plt.xlabel("$S_x$") plt.ylabel("$S_y$") plt.grid() plt.axis((-0.9, 0.9, -0.9, 0.9)) plt.axes().set_aspect('equal') plt.savefig("macrospin.pdf")