当前位置: 首页>>代码示例>>Python>>正文


Python Sim.do_procession方法代码示例

本文整理汇总了Python中fidimag.atomistic.Sim.do_procession方法的典型用法代码示例。如果您正苦于以下问题:Python Sim.do_procession方法的具体用法?Python Sim.do_procession怎么用?Python Sim.do_procession使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在fidimag.atomistic.Sim的用法示例。


在下文中一共展示了Sim.do_procession方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_skx_num

# 需要导入模块: from fidimag.atomistic import Sim [as 别名]
# 或者: from fidimag.atomistic.Sim import do_procession [as 别名]
def test_skx_num():

    mesh = CuboidMesh(nx=120, ny=120, nz=1, periodicity=(True, True, False))

    sim = Sim(mesh, name='skx_num')
    sim.set_tols(rtol=1e-6, atol=1e-6)
    sim.alpha = 1.0
    sim.gamma = 1.0
    sim.mu_s = 1.0

    sim.set_m(init_m)

    sim.do_procession = False

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

    D = 0.09
    dmi = DMI(D)
    sim.add(dmi)

    zeeman = Zeeman([0, 0, 5e-3])
    sim.add(zeeman)

    sim.relax(dt=2.0, stopping_dmdt=1e-2, max_steps=1000,
              save_m_steps=None, save_vtk_steps=None)

    skn = sim.skyrmion_number()
    print 'skx_number', skn
    assert skn > -1 and skn < -0.99
开发者ID:River315,项目名称:fidimag,代码行数:33,代码来源:test_sky_number.py

示例2: relax_system

# 需要导入模块: from fidimag.atomistic import Sim [as 别名]
# 或者: from fidimag.atomistic.Sim import do_procession [as 别名]
def relax_system(mesh):
    
    sim=Sim(mesh,name='relax')
    sim.set_options(rtol=1e-12,atol=1e-14)
    sim.do_procession = False
    sim.alpha = 0.5
    sim.gamma = 1.0
    sim.mu_s = 1.0
    
    sim.set_m(init_m)

    J = 1.0
    exch = UniformExchange(J)
    sim.add(exch)
    
    D = 0.18
    dmi = DMI(D)
    sim.add(dmi)
    
    zeeman = Zeeman([0,0e-3,2e-2],name='H')
    sim.add(zeeman)
    
    sim.relax(dt=2.0, stopping_dmdt=1e-8, max_steps=10000, save_m_steps=None, save_vtk_steps=100)
    
    np.save('m0.npy',sim.spin)
开发者ID:River315,项目名称:fidimag,代码行数:27,代码来源:skx.py

示例3: test_dw_dmi_atomistic

# 需要导入模块: from fidimag.atomistic import Sim [as 别名]
# 或者: from fidimag.atomistic.Sim import do_procession [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)
开发者ID:River315,项目名称:fidimag,代码行数:46,代码来源:test_dw_atomistic.py

示例4: relax_system

# 需要导入模块: from fidimag.atomistic import Sim [as 别名]
# 或者: from fidimag.atomistic.Sim import do_procession [as 别名]
def relax_system(mesh):

    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.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)
开发者ID:River315,项目名称:fidimag,代码行数:38,代码来源:dw.py


注:本文中的fidimag.atomistic.Sim.do_procession方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。