Mumax3常用代码模板
start := now()
N := 64 // x,y grid number
Nz := 1 // z grid number // The thickness directly affects the dipole energy or demagnetization of the film
cs := 1e-9 // (m) cellsize
SetGridsize(N,N,Nz)
SetCellsize(cs,cs,cs/2)
SetPBC(5,5,0) // Period Boundary Conditions
edgesmooth = 8
// Cobalt parameters
Msat = 1400e3 // (A/m)
Aex = 30e-12 // (J/m)
Ku1 = 0.5e6 // (J/m^3) sufficient PMA
AnisU = vector(0, 0, 1) // Uniaxial anisotropy direction
// DMI
// Dind = 1e-3 // (J/m^2) // Positive <--> Left-handed
// Dbulk = 1e-3 //(J/m^2) // Positive <--> Left-handed
// Output some characteristic lengths
Ms := 1400e3 // (A/m)
Ax := 30e-12 // (A/m)
Ku := 1.3e6 // (J/m^3)
DMI := 5e-4 // (J/m^2)
Demag_Edens := 0.5 * mu0 * pow( Ms ,2) // (J/m^3)
print("Demagnetization energy density (J/m^3): ", Demag_Edens)
Exchange_len := sqrt(Ax / (0.5 * mu0 * pow( Ms ,2)))*(1e9) // define exchange length (nm)
print("exchange length (nm): ", Exchange_len)
DW_width := sqrt(2)*pi*sqrt(Ax / Ku)*(1e9) // define domian wall width (nm)
print("domain wall width (nm): ", DW_width)
Helical_len := 4*pi*Ax/abs(DMI)*(1e9) // define helical length (nm)
print("helical length (nm): ", Helical_len)
// add table
tableadd(ext_topologicalcharge)
tableadd(E_anis)
tableadd(E_demag)
tableadd(E_therm)
tableaddVar(seed,"seedN","")
// sweep seed or other parameters
seedmin := 1
seedmax := 1
seedstep := 1
seed := seedmin
for seed=seedmin ; seed<=seedmax; seed+=seedstep{}
// initial magnetization
m = RandomMagSeed(seed)
defregion(1, ...)
save(regions)
m.setRegion(1, ...)
frozenspins.setRegion(1, ...)
Dind.setRegion(1, ...)
//...
// relax to low energy state
saveas(m, "m_inital")
relax()
saveas(m, "m_final")
save(ext_topologicalchargedensity)
tablesave()
// print some values
print(MaxAngle) // maximum angle between neighboring spins (rad) ~ 0.35
print(m.comp(2))
// add Temperature or other excitations
Temp = 100 // (Kelvin)
autosave(m, 1e-11)
tableautosave(1e-11)
run(1e-9) // (ns) run LLG
end := since(start).Seconds()
print("Total run time: ", end) // print total run time
常用材料参数