本文整理汇总了Python中fidimag.atomistic.Sim.p方法的典型用法代码示例。如果您正苦于以下问题:Python Sim.p方法的具体用法?Python Sim.p怎么用?Python Sim.p使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fidimag.atomistic.Sim
的用法示例。
在下文中一共展示了Sim.p方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_dynamic
# 需要导入模块: from fidimag.atomistic import Sim [as 别名]
# 或者: from fidimag.atomistic.Sim import p [as 别名]
def test_dynamic():
mesh = CuboidMesh(nx=1, ny=1, nz=1)
sim = Sim(mesh, name='dyn_spin', driver='llg_stt_cpp')
# sim.set_options(rtol=1e-10,atol=1e-14)
sim.driver.gamma = 1.0
sim.mu_s = 1.0
sim.set_m((0.8,0,-1))
Kx = Anisotropy(Ku=-0.05, axis=(0, 0, 1), name='Kz')
sim.add(Kx)
sim.p = (0,0,1)
sim.a_J = 0.0052
sim.alpha = 0.1
ts = np.linspace(0, 1200, 401)
for t in ts:
sim.driver.run_until(t)
mz = sim.spin[2]
alpha, K, u = 0.1, 0.05, 0.0052
print(mz, u/(2*alpha*K))
#########################################################
# The system used in this test can be solved analytically, which gives that mz = u/(2*alpha*K),
# where K represents the easy-plane anisotropy.
###
assert abs(mz - u/(2*alpha*K))/mz< 5e-4
示例2: dynamic
# 需要导入模块: from fidimag.atomistic import Sim [as 别名]
# 或者: from fidimag.atomistic.Sim import p [as 别名]
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
示例3: dynamic
# 需要导入模块: from fidimag.atomistic import Sim [as 别名]
# 或者: from fidimag.atomistic.Sim import p [as 别名]
def dynamic(mesh):
sim = Sim(mesh, name='dyn_spin', driver='slonczewski')
# sim.set_options(rtol=1e-10,atol=1e-14)
sim.driver.gamma = 1.0
sim.mu_s = 1.0
sim.set_m((0.8,0,-1))
Kx = Anisotropy(Ku=-0.05, axis=(0, 0, 1), name='Kz')
sim.add(Kx)
sim.p = (0,0,1)
sim.u0 = 0.005
sim.driver.alpha = 0.1
ts = np.linspace(0, 1200, 401)
for t in ts:
sim.run_until(t)
#sim.save_vtk()
print t