本文整理汇总了Python中fidimag.atomistic.Sim.set_default_options方法的典型用法代码示例。如果您正苦于以下问题:Python Sim.set_default_options方法的具体用法?Python Sim.set_default_options怎么用?Python Sim.set_default_options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fidimag.atomistic.Sim
的用法示例。
在下文中一共展示了Sim.set_default_options方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: relax_system
# 需要导入模块: from fidimag.atomistic import Sim [as 别名]
# 或者: from fidimag.atomistic.Sim import set_default_options [as 别名]
def relax_system(mesh):
sim = Sim(mesh, name='relax')
sim.set_default_options(gamma=const.gamma)
sim.driver.alpha = 0.5
sim.mu_s = const.mu_s_1
sim.set_m(init_m)
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)
ONE_DEGREE_PER_NS = 17453292.52
sim.relax(dt=1e-13, stopping_dmdt=0.01 * ONE_DEGREE_PER_NS,
max_steps=1000, save_m_steps=100, save_vtk_steps=50)
np.save('m0.npy', sim.spin)
示例2: test_dw_dmi_atomistic
# 需要导入模块: from fidimag.atomistic import Sim [as 别名]
# 或者: from fidimag.atomistic.Sim import set_default_options [as 别名]
def test_dw_dmi_atomistic(do_plot=False):
mesh = CuboidMesh(nx=300, ny=1, nz=1)
sim = Sim(mesh, name='relax')
sim.set_default_options(gamma=const.gamma)
sim.alpha = 0.5
sim.mu_s = const.mu_s_1
sim.do_procession = False
sim.set_m(m_init_dw)
J = 50.0 * const.k_B
exch = UniformExchange(J)
sim.add(exch)
D = 0.01 * J
dmi = DMI(D)
sim.add(dmi)
K = 0.005 * J
anis = Anisotropy(K, axis=[1,0,0])
sim.add(anis)
ONE_DEGREE_PER_NS = 17453292.52
sim.relax(dt=1e-13, stopping_dmdt=0.01 * ONE_DEGREE_PER_NS,
max_steps=1000, save_m_steps=100, save_vtk_steps=50)
np.save('m0.npy', sim.spin)
xs = np.array([p[0] for p in mesh.coordinates]) - 150
mx, my, mz = analytical(xs, A=J/2.0, D=-D, K=K)
mxyz = sim.spin.copy()
mxyz = mxyz.reshape(-1, 3).T
assert max(abs(mxyz[0, :] - mx)) < 0.001
assert max(abs(mxyz[1, :] - my)) < 0.001
assert max(abs(mxyz[2, :] - mz)) < 0.0006
if do_plot:
save_plot(xs, mxyz, mx, my, mz)
示例3: relax_system
# 需要导入模块: from fidimag.atomistic import Sim [as 别名]
# 或者: from fidimag.atomistic.Sim import set_default_options [as 别名]
def relax_system(mesh):
sim = Sim(mesh, name='relax')
sim.set_default_options(gamma=constant.gamma)
sim.driver.alpha = 0.5
sim.mu_s = constant.mu_s_1
sim.do_precession = False
sim.set_m(m_init_dw)
J = 50.0 * constant.k_B
exch = UniformExchange(J)
sim.add(exch)
D = 0.1 * J
dmi = DMI(D, dmi_type = 'interfacial')
sim.add(dmi)
K = 0.02 * J
anis = Anisotropy(K, axis=[0,0,1])
sim.add(anis)
ONE_DEGREE_PER_NS = 17453292.52
sim.relax(dt=1e-13, stopping_dmdt=0.01 * ONE_DEGREE_PER_NS,
max_steps=1000, save_m_steps=100, save_vtk_steps=50)
np.save('m0.npy', sim.spin)
xs = np.array([p[0] for p in mesh.pos]) - 150
mx, my, mz = analytical(xs, A=J/2.0, D=-D, K=K)
mxyz = sim.spin.copy()
mxyz.shape = (3, -1)
save_plot(xs, mxyz, mx, my, mz)