Ejemplo n.º 1
0
import math
from nmag.common import SI, degrees_per_ns, Tesla, mu0, at, every
from nmag.nmag5 import Simulation, MagMaterial

# Applied field
Happ_dir = [0, 0, 10]  # in mT

# Material definition
mat = MagMaterial("Py", Ms=SI(860e3, "A/m"),
                  exchange_coupling=SI(13e-12, "J/m"),
                  llg_gamma_G=SI(221017, "m/s A"),
                  llg_damping=SI(0.014))

sim = Simulation("nmag_no_stt", do_demag=False)
nm = SI(1e-9, "m")
sim.load_mesh("mesh.nmesh", [("cube", mat)], unit_length=nm)
sim.set_m([1, 0.01, 0.01])
sim.set_H_ext(Happ_dir, 0.001 * Tesla / mu0)

# Define the tolerances for the simulation
ns = SI(1e-9, "s")
sim.set_params(stopping_dm_dt=0 * degrees_per_ns,
               ts_rel_tol=1e-8, ts_abs_tol=1e-8,
               ts_pc_rel_tol=1e-3, ts_pc_abs_tol=1e-8,
               demag_dbc_rel_tol=1e-6, demag_dbc_abs_tol=1e-6)
sim.relax(save=[("averages", every("time", 0.01 * ns))],
          do=[("exit", at("time", 10 * ns))])
Ejemplo n.º 2
0
from nsim.netgen import netgen_mesh_from_string

from nmag.common import SI, degrees_per_ns, Tesla, mu0, at, every

from nmag.nmag5 import Simulation, MagMaterial, cubic_anisotropy

from nsim.model import Value



ps = SI(1e-12, "s"); nm = SI(1e-9, "m")               # Useful definitions

theta_rad = 3.141592654

phi_rad = 1.570796327                             

#length, width, thick = (2*nm, 16*nm, 64*nm)       # System geometry

current_density = SI( 100e10, "A/m^2") # Applied current

Happ_dir = [0, 0, 0]                           # Applied field (mT)- 



# Material definition

anis = cubic_anisotropy(axis1=[1, 0, 0], axis2=[0,1,0], K1=SI(-1e4, "J/m^3"))

mat = MagMaterial("Co",

                  Ms=SI(9.0e5, "A/m"),
Ejemplo n.º 3
0
mesh_filename = "mesh.nmesh.h5"
mesh_geo = "mesh.geo"
#create mesh if required
if not os.path.exists(mesh_filename):
  netgen_mesh_from_file(mesh_geo, mesh_filename)


relaxed_m = "m0.h5"
film_centre = (5, 50, 50)

do_relaxation = not os.path.exists(relaxed_m)
ps = SI(1e-12, "s")

mat = MagMaterial("Py",
                  Ms=SI(0.86e6, "A/m"),
                  exchange_coupling=SI(13e-12, "J/m"),
                  llg_damping=SI(0.5 if do_relaxation else 0.01))

mat.sl_P = 0.0 if do_relaxation else 0.4  # Polarisation
mat.sl_d = SI(3e-9, "m")                  # Free layer thickness

sim = Simulation(do_sl_stt=True)
sim.load_mesh(mesh_filename, [("region1", mat)], unit_length=SI(1e-9, "m"))

def m0(r):
  dx, dy, dz = tuple(ri - ri0*1e-9 for ri, ri0 in zip(r, film_centre))
  v = (1.0e-9, dz, -dy)
  vn = (1.0e-9**2 + dy*dy + dz*dz)**0.5
  return tuple(vi/vn for vi in v)

sim.set_m(m0)
Ejemplo n.º 4
0
from nsim.netgen import netgen_mesh_from_file

mesh_filename = "mesh.nmesh.h5"
mesh_geo = "mesh.geo"
# create mesh if required
if not os.path.exists(mesh_filename):
    netgen_mesh_from_file(mesh_geo, mesh_filename)

relaxed_m = "m0.h5"
film_centre = (5, 50, 50)

do_relaxation = not os.path.exists(relaxed_m)
ps = SI(1e-12, "s")

mat = MagMaterial("Py",
                  Ms=SI(0.86e6, "A/m"),
                  exchange_coupling=SI(13e-12, "J/m"),
                  llg_damping=SI(0.5 if do_relaxation else 0.01))

mat.sl_P = 0.0 if do_relaxation else 0.4  # Polarisation
mat.sl_d = SI(10e-9, "m")  # Free layer thickness

sim = Simulation(do_sl_stt=True)
sim.load_mesh(mesh_filename, [("region1", mat)], unit_length=SI(1e-9, "m"))


def m0(r):
    dx, dy, dz = tuple(ri - ri0 * 1e-9 for ri, ri0 in zip(r, film_centre))
    v = (1.0e-9, dz, -dy)
    vn = (1.0e-9**2 + dy * dy + dz * dz)**0.5
    return tuple(vi / vn for vi in v)
Ejemplo n.º 5
0
from nmag.common import SI, degrees_per_ns, Tesla, mu0, at, every
from nmag.nmag5 import Simulation, MagMaterial
from nsim.model import Value

# Geometry
nm = SI(1e-9, "m")
length = width = 12.5 * nm
height = 2.5 * nm

# Applied field
Happ_dir = [0, 0, 10]  # in mT

# Material definition
mat = MagMaterial("Py",
                  Ms=SI(860e3, "A/m"),
                  exchange_coupling=SI(13e-12, "J/m"),
                  llg_gamma_G=SI(221017, "m/s A"),
                  llg_damping=SI(0.014))

# Parameters relevant to spin-torque transfer
# Current and Current Density
I = SI(5e-5, "A")
J = I / (length * width)

mat.sl_P = 0.4  # Polarisation
mat.sl_lambda = 2.0  # lambda parameter
mat.sl_d = height  # Free layer thickness

# Direction of the polarisation
theta = 40.0
phi = 90.0
Ejemplo n.º 6
0
Happ_dir = [0.2, 0.2, 10.0]                           # Applied field (mT)

# Create the mesh, if it does not exist
mesh_filename = "film.nmesh.h5"
if not os.path.exists(mesh_filename):
  mesh_geo = \
    ("algebraic3d\n"
     "solid cube = orthobrick (0, 0, 0; %s, %s, %s) -maxh = 2.5;\n"
     "tlo cube;\n" % tuple(map(lambda x: float(x/nm), (length, width, thick))))
  netgen_mesh_from_string(mesh_geo, mesh_filename, keep_geo=True)

# Material definition
anis = uniaxial_anisotropy(axis=[0, 0, 1], K1=-SI(0.1e6, "J/m^3"))
mat = MagMaterial("Py",
                  Ms=SI(860e3, "A/m"),
                  exchange_coupling=SI(13e-12, "J/m"),
                  llg_gamma_G=SI(221017, "m/s A"),
                  llg_damping=SI(0.014),
                  anisotropy=anis)

mat.sl_P = 0.4             # Polarisation
mat.sl_lambda = 2.0        # lambda parameter
mat.sl_d = SI(5.0e-9, "m") # Free layer thickness

sim = Simulation(do_sl_stt=True, do_demag=False)
sim.load_mesh(mesh_filename, [("region1", mat)], unit_length=nm)
sim.set_m([1, 0.01, 0.01])
sim.set_H_ext(Happ_dir, 0.001*Tesla/mu0)

# Direction of the polarization
theta_rad = math.pi*theta/180.0
phi_rad = math.pi*phi/180.0