本文整理匯總了Golang中github.com/mumax/3/data.Mesh.PBC_code方法的典型用法代碼示例。如果您正苦於以下問題:Golang Mesh.PBC_code方法的具體用法?Golang Mesh.PBC_code怎麽用?Golang Mesh.PBC_code使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/mumax/3/data.Mesh
的用法示例。
在下文中一共展示了Mesh.PBC_code方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: SetMaxAngle
// SetMaxAngle sets dst to the maximum angle of each cells magnetization with all of its neighbors,
// provided the exchange stiffness with that neighbor is nonzero.
func SetMaxAngle(dst, m *data.Slice, Aex_red SymmLUT, regions *Bytes, mesh *data.Mesh) {
N := mesh.Size()
pbc := mesh.PBC_code()
cfg := make3DConf(N)
k_setmaxangle_async(dst.DevPtr(0),
m.DevPtr(X), m.DevPtr(Y), m.DevPtr(Z),
unsafe.Pointer(Aex_red), regions.Ptr,
N[X], N[Y], N[Z], pbc, cfg)
}
示例2: ExchangeDecode
// Finds the average exchange strength around each cell, for debugging.
func ExchangeDecode(dst *data.Slice, Aex_red SymmLUT, regions *Bytes, mesh *data.Mesh) {
c := mesh.CellSize()
wx := float32(2 * 1e-18 / (c[X] * c[X]))
wy := float32(2 * 1e-18 / (c[Y] * c[Y]))
wz := float32(2 * 1e-18 / (c[Z] * c[Z]))
N := mesh.Size()
pbc := mesh.PBC_code()
cfg := make3DConf(N)
k_exchangedecode_async(dst.DevPtr(0), unsafe.Pointer(Aex_red), regions.Ptr, wx, wy, wz, N[X], N[Y], N[Z], pbc, cfg)
}
示例3: SetTopologicalCharge
// Set s to the toplogogical charge density s = m · (m/∂x ❌ ∂m/∂y)
// See topologicalcharge.cu
func SetTopologicalCharge(s *data.Slice, m *data.Slice, mesh *data.Mesh) {
cellsize := mesh.CellSize()
N := s.Size()
util.Argument(m.Size() == N)
cfg := make3DConf(N)
icxcy := float32(1.0 / (cellsize[X] * cellsize[Y]))
k_settopologicalcharge_async(s.DevPtr(X),
m.DevPtr(X), m.DevPtr(Y), m.DevPtr(Z),
icxcy, N[X], N[Y], N[Z], mesh.PBC_code(), cfg)
}
示例4: AddZhangLiTorque
// Add Zhang-Li ST torque (Tesla) to torque.
// see zhangli.cu
func AddZhangLiTorque(torque, m, J *data.Slice, bsat, alpha, xi, pol LUTPtr, regions *Bytes, mesh *data.Mesh) {
c := mesh.CellSize()
N := mesh.Size()
cfg := make3DConf(N)
k_addzhanglitorque_async(torque.DevPtr(X), torque.DevPtr(Y), torque.DevPtr(Z),
m.DevPtr(X), m.DevPtr(Y), m.DevPtr(Z),
J.DevPtr(X), J.DevPtr(Y), J.DevPtr(Z),
float32(c[X]), float32(c[Y]), float32(c[Z]),
unsafe.Pointer(bsat), unsafe.Pointer(alpha), unsafe.Pointer(xi), unsafe.Pointer(pol),
regions.Ptr, N[X], N[Y], N[Z], mesh.PBC_code(), cfg)
}
示例5: AddExchange
// Add exchange field to Beff.
// m: normalized magnetization
// B: effective field in Tesla
// Aex_red: Aex / (Msat * 1e18 m2)
// see exchange.cu
func AddExchange(B, m *data.Slice, Aex_red SymmLUT, regions *Bytes, mesh *data.Mesh) {
c := mesh.CellSize()
wx := float32(2 * 1e-18 / (c[X] * c[X]))
wy := float32(2 * 1e-18 / (c[Y] * c[Y]))
wz := float32(2 * 1e-18 / (c[Z] * c[Z]))
N := mesh.Size()
pbc := mesh.PBC_code()
cfg := make3DConf(N)
k_addexchange_async(B.DevPtr(X), B.DevPtr(Y), B.DevPtr(Z),
m.DevPtr(X), m.DevPtr(Y), m.DevPtr(Z),
unsafe.Pointer(Aex_red), regions.Ptr,
wx, wy, wz, N[X], N[Y], N[Z], pbc, cfg)
}
示例6: AddZhangLiTorque
// Add Zhang-Li ST torque (Tesla) to torque.
// see zhangli.cu
func AddZhangLiTorque(torque, m *data.Slice, Msat, J, alpha, xi, pol MSlice, mesh *data.Mesh) {
c := mesh.CellSize()
N := mesh.Size()
cfg := make3DConf(N)
k_addzhanglitorque2_async(
torque.DevPtr(X), torque.DevPtr(Y), torque.DevPtr(Z),
m.DevPtr(X), m.DevPtr(Y), m.DevPtr(Z),
Msat.DevPtr(0), Msat.Mul(0),
J.DevPtr(X), J.Mul(X),
J.DevPtr(Y), J.Mul(Y),
J.DevPtr(Z), J.Mul(Z),
alpha.DevPtr(0), alpha.Mul(0),
xi.DevPtr(0), xi.Mul(0),
pol.DevPtr(0), pol.Mul(0),
float32(c[X]), float32(c[Y]), float32(c[Z]),
N[X], N[Y], N[Z], mesh.PBC_code(), cfg)
}
示例7: AddDMI
// Add effective field of Dzyaloshinskii-Moriya interaction to Beff (Tesla).
// According to Bagdanov and Röβler, PRL 87, 3, 2001. eq.8 (out-of-plane symmetry breaking).
// See dmi.cu
func AddDMI(Beff *data.Slice, m *data.Slice, Aex_red, Dex_red SymmLUT, regions *Bytes, mesh *data.Mesh) {
cellsize := mesh.CellSize()
N := Beff.Size()
util.Argument(m.Size() == N)
cfg := make3DConf(N)
k_adddmi_async(Beff.DevPtr(X), Beff.DevPtr(Y), Beff.DevPtr(Z),
m.DevPtr(X), m.DevPtr(Y), m.DevPtr(Z),
unsafe.Pointer(Aex_red), unsafe.Pointer(Dex_red), regions.Ptr,
float32(cellsize[X]*1e9), float32(cellsize[Y]*1e9), float32(cellsize[Z]*1e9), N[X], N[Y], N[Z], mesh.PBC_code(), cfg)
}