## Abstract

We solve a time-dependent three-dimensional spin-diffusion model coupled to the Landau-Lifshitz-Gilbert equation numerically. The presented model is validated by comparison to two established spin-torque models: The model of Slonzewski that describes spin-torque in multi-layer structures in the presence of a fixed layer and the model of Zhang and Li that describes current driven domain-wall motion. It is shown that both models are incorporated by the spin-diffusion description, i.e., the nonlocal effects of the Slonzewski model are captured as well as the spin-accumulation due to magnetization gradients as described by the model of Zhang and Li. Moreover, the presented method is able to resolve the time dependency of the spin-accumulation.

## Introduction

An electric or spin current of spin angular momentum acting on a ferromagnet exerts a torque on the magnetization, by doing that driving it out of equilibrium^{1,2}. Due to its non-conservative nature this spin torque can act either as effective negative or positive magnetic damping and thereby excite magnetization self-oscillations^{3,4}. Spin-torque oscillators (STO) have been realized in nanoscale spin valve systems^{5,6,7} ranging from point contact magnetic multilayer structures^{8,9} to nanoscale magnetic tunnel junction systems^{10,11,12}. Recently, a new type of nano spin-torque oscillator based on current-induced spin orbit torques in a permalloy(Py)/platinum(Pt) bilayer systems was introduced^{13,14}. Such spin orbit torques originate from the spin Hall effect in Pt^{15,16,17} and the Rashba effect at the Pt/Py interface^{18,19}. Applications for STOs include various nanoscale communication technologies. In the upcoming field of microwave assisted recording, a STO is used to generate fields in the GHz regime in order to locally assist the reversal process in hard disks^{20}. Another important application of spin torque is to switch magnetic layers in nano structures^{21}.

In order to obtain deeper understanding of the applications utilizing spin torque and to guide the design of novel devices, various numerical models have been developed: A model for the description of magnetic multi-layers was first introduced by Slonczewski^{1,22} and Berger^{23}. The model describes a current flow perpendicular to a layer system consisting of a fixed magnetic layer, a nonmagnetic layer and a free magnetic layer. The current is assumed to pick up its spin polarization in the fixed layer and to exert a torque on the magnetization in the free layer. While this model is successfully applied to MRAM like structures, it is not suited for the description of current driven domain-wall motion, where no magnetic fixed layer is involved.

A more general model to spin polarized currents introduces a spin-accumulation field that is bidirectionally coupled to the magnetization^{24,25}. The explicit computation of the spin-accumulation can be avoided by neglecting spin-diffusion effects and treating the spin-accumulation in an adiabatic fashion^{26}. This simplified model is able to describe domain-wall motion, but fails in the description of multi-layer structures.

In this work, we consider a spin-diffusion model that represents a more general approach to describe the interaction between spin current and magnetization. While similar models were implemented for two-dimensional problems^{27}, we consider a three-dimensional space and time regime in this work. While several extensions to this model were proposed, see e.g.^{28}, we stick to the original model in this work.

The model is compared to the results of the simplified models of Slonczewski^{1,22} and Zhang and Li^{25}. For the discretization, we implement a finite-element scheme that was introduced and mathematically analyzed in our previous work^{29}. In numerical simulations, we underline that our model generalizes and combines those of^{1,22,24,25,26} in the sense that the same results are also obtained with the more general model, demonstrating the capability to describe and predict more complex features that depend on an inhomogenous spin current distribution.

## Model

Let be some ferromagnetic material. The magnetization dynamics is described by the Landau-Lifshitz-Gilbert equation

subject to initial and boundary conditions

where * m* is the normalized magnetization,

*γ*is the gyromagnetic ratio, and

*α*is the Gilbert damping. The effective field

**h**_{eff}is given by the negative variational derivative of the total free energy

*U*

where *μ*_{0} is the magnetic constant and *M*_{s} is the saturation magnetization. Contributions to the effective field usually include the exchange field given by

with the material dependent exchange constant *A* and the demagnetization field generated by a magnetic region *ω* with the potential *u* defined by

with jump and boundary conditions

where * n* is the outer unit normal of

*ω*and, e.g., is the Euclidean scalar product. Further possible contributions are the external field

**h**_{ext}and the anisotropy field

**h**_{aniso}whose analytical expression depends on the lattice structure of the magnetic material. The vector field

*in (1) is the spin-accumulation generated by a spin current*

**s**

**J**_{s}and

*c*is the corresponding coupling constant. Let be some conducting region with . According to

^{30}, the spin-accumulation obeys the equation of motion

subject to initial and boundary conditions

where *D*_{0} is the diffusion constant, λ_{sf} is related to the spin-flip relaxation time *τ*_{sf} by and with *h* being Planck’s constant and *J*_{ex} being the exchange integral. For some given current density **J**_{e}, the matrix-valued spin current **J**_{s} is given by

where *μ*_{B} is the Bohr magneton, *e* is the elementary charge and *β* and are dimensionless polarization parameters. Here, is the Jacobian of * s* and is the outer product.

Figure 1 shows a typical multi-layer structure for the investigation of spin-torque effects. A magnetic fixed layer *ω*_{fixed} is separated from a magnetic free layer *ω*_{free} by a nonmagnetic layer *ω*_{nm}. Additional nonmagnetic layers above and beneath the magnetic layers serve as electrical contacts. The Landau-Lifshitz-Gilbert equation (1) is solved on the magnetic regions only. The spin-accumulation is solved on the entire domain .

## Algorithm

The model introduced in the preceding section is discretized by an algorithm, we proposed and analyzed mathematically in^{29}. The vector fields * m*,

*, , and test functions*

**s***,*

**w****ζ**are discretized with piecewise affine, globally continuous functions constructed on a tetrahedral tessellation of the domain Ω. Material constants that differ from subdomain to subdomain, e.g., the diffusion constant

*D*

_{0}, are discretized by piecewise constant functions. A splitting scheme is used to decouple the Landau-Lifshitz-Gilbert equation (1) from the spin-accumulation equation (10).

Suppose that the magnetization **m**^{k} at the *k*-th timestep is known. Then, we use the tangent-plane scheme of^{31} to compute **m**^{k+1} at the next time-step, where the essential idea is to discretize at the *k*-th timestep by some **v**^{k} which mimics the continuous orthogonality . Following^{32,33,34}, all terms but the exchange term are treated explicitly. This also includes the spin-accumulation * s*. Based on

**m**^{k+1}and

**s**^{k}, we then use the implicit Euler scheme to compute the spin-accumulation

**s**^{k+1}at the next time-step. The complete algorithm for a timestep size

*τ*> 0 reads as follows, where we suppose that

**m**^{k}and

**s**^{k}are already known:

1. Consider the discrete tangent space to the known magnetization **m**^{k} defined by

Find such that, for all , it holds

where is the Frobenius inner product of two matrices . While the exchange field ist integrated implicitly, all other effective-field contributions are summarized in **h**_{explicit} and integrated explicitly.

2. Define the piecewise affine and globally continuous approximation **m**^{k+1} by

3. Find **s**^{k+1} such that, for all **ζ**, it holds

where * n* is the outer normal of

*ω*and

4. Update the timestep and iterate.

While our preceding work^{29} did not include any numerical simulations with the proposed time-marching scheme, we proved that the coupled system of LLG with spin-diffusion admits weak solutions and that the proposed integrator converges to these in an appropriate sense. With the present work, we aim to provide empirical evidence for the physical relevance of the proposed model and the numerical results that are obtained by the described discretization.

## Implementation

The presented algorithm is implemented within the finite-element micromagnetic code magnum.fe^{35,36}. magnum.fe uses FEniCS^{37} for the assembly and solution of the finite-element systems. The linear systems arising from discretization of (14) and (16) are solved iteratively by a GMRES solver. The demagnetization-field problem is solved by a hybrid finite-element boundary-element method^{38}, where our implementation couples FEniCS to the boundary-element library BEM++^{39}. Each timestep requires the solution of two linear systems of the dimension 3*N* × 3*N*, where *N* is the number of mesh nodes. The finite-element discretization leads to sparse matrices, whose storage requirements scale linearly with the number of mesh nodes. Hence systems with 100000 nodes and more may be handled in reasonable time by magnum.fe, which corresponds to system sizes up to the m regime depending on the spatial discretization.

## Numerical Experiments

As a first test the time development of the spin diffusion for a fixed magnetization configuration is computed. An ellipsoidal multi-layer structure as pictured in Fig. 1 with axis lengths 130 × 70 nm and layer thicknesses (5, 2, 3, 2, 5) nm is considered. In the following the coordinate system is chosen such that the long and short axes of the ellipse align with the *x* and *y*-axis respectively. The diffusion constant in the magnetic layers *ω*_{free} and *ω*_{fixed} is set to *D*_{0} = 1 × 10^{−3} m^{2}/s. In the nonmagnetic region the diffusion constant is chosen as *D*_{0} = 5 × 10^{−3} m^{2}/s. The remaining constants are λ_{sf} = 10 nm, λ_{J} = 2 nm, *β* = 0.9, , and . The magnetization * m* is initialized homogeneously parallel to the

*x*-axis in the fixed layer and parallel to

*y*-axis in the free layer. Equation (16) is then solved repeatedly for a homogeneous current density perpendicular to the layers , a time step

*τ*= 1 fs and an initial spin-accumulation of

*= 0.*

**s**Figure 2(a) shows the simulation results. The system relaxes within approximately 70 fs. This time scale is 2 orders of magnitude below the typical reaction time of the magnetization * m*. Hence the magnetization dynamics may be accurately described by assuming the spin-accumulation to be in equilibrium at any times

^{24}. However, the presented integration scheme for the spin-accumulation is able to handle very large time steps due to its implicit nature and the linearity of the problem. In fact it shows that even for an initial spin-accumulation of

*= 0 two integration steps with*

**s***τ*= 1 ps are sufficient to obtain the equilibrium state accurately. When moving from one magnetization configuration to the next during time integration of the Landau-Lifshitz-Gilbert equation, a single integration step of the spin-accumulation yields the equilibrium state. The presented algorithm is thus well suited for investigating the time evolution of both the spin diffusion using time steps as well as the magnetization using time steps .

Figure 2(b) shows the equilibrium spin-accumulation * s* on the

*z*-axis in the middle of the multi-layer structure. From (10) it is clear, that the source of the spin-accumulation is the spatial change of the magnetization

*. Since the magnetization is homogeneous within the magnetic regions, the spin-accumulation is expected to be generated at the layer interfaces and diffuse into the regions which is well reflected by the simulation results.*

**m**### Comparison to Model by Slonczewski

An established model for the description of spin-torque effects in magnetic multi-layers was introduced by Slonczewski in^{22}. The fixed layer in this model is homogeneously magnetized and fixed in the sense that the magnetization does not change in time. The electric current **J**_{e} is assumed to pick up its spin polarization in the fixed layer and then interact with the free layer by an additional term to the Landau-Lifshitz-Gilbert equation

Here * M* denotes the normalized magnetization of the fixed layer,

*d*is the thickness of the free layer and

*θ*is the angle between the magnetization in the fixed layer and the magnetization with . The additional contribution

*is added to the right-hand side of the Landau-Lifshitz-Gilbert equation (1) without spin-accumulation*

**N***. The angular coefficient for structures with equal height fixed and free layers is given by*

**s**where *q*, *A*, and *B* are constants that depend on the geometry and the material parameters of the system.
Consider the previously described ellipsoidal multi-layer structure with the magnetization being homogeneous and in-plane in both the fixed layer and the free layer. In this case the additional torque term in the free layer (18) is expected to be in-plane with a magnitude given by

Figure 3(a) shows the magnitude of the torque term * m* ×

*as computed by the spin-accumulation model. The result is split into the in-plane magnitude (*

**s***×*

**m***)*

**s**_{xy}and the out-of-plane magnitude (

*×*

**m***)*

**s**_{z}. Furthermore the in-plane magnitude is fitted with the magnitude as predicted by Slonczewski (20). Since the system is overdefined for fitting,

*q*is set to 1 and

*A*and

*B*are chosen as fitting parameters. As seen in Fig. 3(a) the fit is very accurate. The relative fitting error for both

*A*and

*B*is well below 10

^{−6}. Not only the in-plane magnitude, but also the in-plane angle of the torque term shows excellent accordance to the spin-torque model of Slonczewski as depicted in Fig. 3(b). However, the spin-accumulation model predicts a non-neglible out-of-plane torque that cannot be explained by the simplified model.

As pointed out in^{40} the expression for the angular coefficient (19) only holds for the symmetric case of equal height fixed and free layer. For the general case the angular coefficient reads

Figure 4(a) shows the computed in-plane torque for λ_{J} = 1 nm together with fitted curves for the symmetric model (19) and the asymmetric model (21) respectively. The computed torque is well fitted by the asymmetric model with relative errors below 2 × 10^{−4}, while the symmetric model obviously fails in the correct description of the asymmetric problem. However, again the spin-diffusion model predicts a *z*-component of the torque that is not described by the spin-torque model of Slonczewski. The ratio of in-plane torque to out-of-plane torque for a given structure is largely influenced by the choice of λ_{J}. Choosing large values for λ_{J} leads to high out-of-plane components of the torque, see Fig. 4(b).

The coefficients *A*, *B*, *q*, *q*_{+}, and *q*_{−} depend, among other things, on the geometry of the system. In the following the dependence of these constants on the thickness of the nonmagnetic layer and the fixed layer is investigated in detail. A physically motivated choice for the right-hand-side coefficients in (21) is introduced in^{40}

where , , *P*_{L}, and *P*_{R} describe the properties of the fixed and the free layer respectively. For symmetric structures, i.e. and *P*_{L} = *P*_{R}, (21) reduces to

Figure 5(a) shows the dependence of Λ from the thickness of the spacer layer in a symmetric multi-layer structure. The simulation results are well fitted with a shifted reciprocal square root . The dependence of Λ_{L} and Λ_{R} on the thickness of the fixed layer in an asymmetric structure is depicted in Fig. 5(b). Both coefficients are well fitted by a shifted reciprocal square function with *X*, *Y*, and Δ being fit parameters.

The model of Slonczewski provides a straightforward way to deal with multi-layer structures. However, it is obviously not suited for the description of spin-torque effects in smoothly variing magnetization configurations since it requires a separated fixed layer to generate the spin polarization of the current.

### Comparison to Model by Zhang and Li

An alternative spin-torque model was introduced by Zhang and Li in^{26}. The model of Zhang and Li can be derived from the spin-diffusion model (10) by introducing the following simplifications: The spin diffusion * s* is assumed to vary little in space and thus terms involving are omitted. The electric current is assumed to be divergence free within the simulated regions, i.e. . Furthermore the spin-accumulation is assumed to be in equilibrium at all times, i.e. . With these assumptions (10) reads

Applying basic vector algebra and yields

with the degree of non-adiabacity . The obvious advantage of this method is that the spin-accumulation does not have to be calculated explicitly. The spin-torque * m* ×

*does only depend on the magnetization*

**s***and other known entities and can be added directly to the Landau-Lifshitz-Gilbert equation (1).*

**m**Figure 6(a) shows the magnetization configuration * m* for a Néel-wall in a 600 × 100 × 2 nm thin film with the material parameters of permalloy , ,

*K*= 0) as computed with magnum.fe. The corresponding spin-torque

*×*

**m***is computed once by relaxation of the spin-diffusion model (10), see Fig. 6(b), and once by the model of Zhang and Li (29). The solution computed by the model of Zhang and Li shows a good agreement to the spin-diffusion solution with a relative*

**s***L*

^{2}error norm below 5 × 10

^{−3}. The assumption of a vanishing gradient of the spin-accumulation , made in the model by Zhang and Li, is valid within the magnetic regions as discussed in

^{26}. However, at the interfaces of magnetic multi-layers this assumption is violated. Hence the model by Zhang and Li is not suited for the description of such structures.

### Standard Problem #5

A suitable benchmark for the interplay of magnetization and spin-diffusion dynamics is the micromagnetic standard problem #5 that was recently proposed by the Mag group, see^{41}. A thin square of size 100 × 100 × 10 nm with material parameters similar to permalloy is prepared in a vortex state. Then a constant current *J*_{e} = 10^{12} A/m is applied in *x*-direction. The vortex core is expected to perform a damped rotation around a new equilibrium position. The spin-torque related costants in the problem definition are tailored to the model by Zhang and Li. Namely the degree of non-adiabacity *ξ* is given as well as a factor *b* that can be expressed in terms of spin-diffusion related constants as

according to (29). The spin-diffusion related parameters are chosen as , *β* = 0.9, , λ_{sf} = 10 nm, , and . In fact λ_{J} and *c* are chosen such that and is exactly fulfilled as required.

Figure 7 shows the simulation results in comparsion to a reference solution computed with the finite-difference code MicroMagnum^{42} that implements the model by Zhang and Li. Additionally the averaged magnetization in the new equilibrium computed with different simulation tools is compared in Table 1. The most notable difference is the shifted *y*-position of the vortex core in equilibrium. This aberration is a result of the missing terms in the model by Zhang and Li.

Note that the validity of the spin-diffusion model for Permalloy vortex structures is controversial. The derivation of this model assumes a short mean free path compared to the domain-wall width which is violated in this case^{43}. However, the purpose of this numerical experiment is to show that the presented model reproduces the results by the model of Zhang and Li and the standard problem #5 is a widely accepted test problem for current driven domain-wall motion.

### Switching of a multi-layer Structure

As another test the current induced switching of a magnetic multi-layer structure is simulated. The geometry considered is ellipsoidal with edge lengths 130 × 70 nm and layer thicknesses (3, 10, 3, 2, 3) nm. The material parameters in the magnetic layers are similar to those of permalloy, see preceeding section. In the nonmagnetic layers the diffusion constant is set to . Since the size of the ellipsoid is well under the single-domain limit, the energy of the system is minimal if the magnetization is aligned along the long axis of the ellipsoid in the magnetic layers. The thick and thin magnetic layers are referred to as fixed and free layer respectively, since the energy barrier for magnetic switching in the thick layer is higher than in the thin layer.

By applying a current perpendicular to the layer structure, the magnetization in the free layer can be switched. Figure 8(a) shows the hysteresis of the free layer for different currents. The shift of the curve is an expected consequence resulting from the strayfield coupling of the magnetic layers. An antiparallel configuration of the fixed and free layer is energetically favored over a parallel configuration.

Figure 8(b) shows the magnetization configuration of the free layer during switching. Note that the out-of plane component is small compared to the in-plane component, which is a consequence of the shape anisotropy caused by the small thickness of the layer. The out-of-plane component of the torque as predicted by the spin-diffusion model is compensated by the shape anisotropy as soon as the magnetization is driven slightly out of plane. This may serve as an justification for the missing out-of-plane spin-torque component in the model of Slonczewski.

## Conclusion

The presented method for the solution of the Landau-Lifshitz-Gilbert equation including spin-torque effects is able to describe both the spin transport in multi-layer structures as well as current driven domain-wall motion. The spin-torque in multi-layers as predicted by Slonczewski is essentially reproduced except for an out-of-plane component that is not present in the model by Slonczewski. However, the out-of-plane component is shown to play an inferior role in typical multi-layer structures since it is usually almost completely compensated by shape anisotropy effects. The presented method only requires the geometry and material parameters of the multilayer system as input. In contrast the model of Slonczewski requires some global parameters that depend on the system as a whole and that have to be determined by experiment in order to perform meaningful simulations. For the description of current-driven domain-wall motion the presented method is compared to a simplified model by Zhang and Li and shows a good agreement. Small deviations can be explained by diffusion terms that are omitted in the simplified model. While the present method is able to resolve the temporal evolution of the spin-accumulation exactly it can also be used for an adiabatic description since the time integrator for the spin-accumulation behaves very well even for large time steps.

## Additional Information

**How to cite this article**: Abert, C. *et al.* A three-dimensional spin-diffusion model for micromagnetics. *Sci. Rep.* **5**, 14855; doi: 10.1038/srep14855 (2015).

## References

- 1.
Slonczewski, J. C. Current-driven excitation of magnetic multilayers.

*J. Magn. Magn. Mater.***159**, L1–L7, 10.1016/0304-8853(96)00062-5 (1996). - 2.
Berger, L. Emission of spin waves by a magnetic multilayer traversed by a current.

*Phys. Rev. B***54**, 9353, 10.1103/PhysRevB.54.9353 (1996). - 3.
Kiselev, S. I.

*et al.*Microwave oscillations of a nanomagnet driven by a spin-polarized current.*Nature***425**, 380–383, 10.1038/nature01967 (2003). - 4.
Slavin, A. & Tiberkevich, V. Nonlinear auto-oscillator theory of microwave generation by spin-polarized current.

*IEEE Trans. Magn.***45**, 1875–1918, 10.1109/TMAG.2008.2009935 (2009). - 5.
Özyilmaz, B., Kent, A., Sun, J., Rooks, M. & Koch, R. Current-induced excitations in single cobalt ferromagnetic layer nanopillars.

*Phys. Rev. Lett.***93**, 176604, 10.1103/PhysRevLett.93.176604 (2004). - 6.
Mistral, Q.

*et al.*Current-driven microwave oscillations in current perpendicular-to-plane spin-valve nanopillars.*Appl. Phy. Lett.***88**, 192507, 10.1063/1.2201897 (2006). - 7.
Braganca, P.

*et al.*Nanoscale magnetic field detection using a spin torque oscillator.*Nanotechnology***21**, 235202, 10.1088/0957-4484/21/23/235202 (2010). - 8.
Rippard, W., Pufall, M., Kaka, S., Russek, S. & Silva, T. Direct-current induced dynamics in Co

_{90}Fe_{10}/Ni_{80}Fe_{20}point contacts.*Phys. Rev. Lett.***92**, 027201, 10.1103/PhysRevLett.92.027201 (2004). - 9.
Mohseni, S. M.

*et al.*Spin torque-generated magnetic droplet solitons.*Science***339**, 1295–1298, 10.1126/science.1230155 (2013). - 10.
Nazarov, A. V.

*et al.*Spin transfer stimulated microwave emission in MgO magnetic tunnel junctions.*Appl. Phys. Lett.***88**, 162504–162504, 10.1109/INTMAG.2006.375855 (2006). - 11.
Deac, A. M.

*et al.*Bias-driven high-power microwave emission from MgO-based tunnel magnetoresistance devices.*Nat. Phys.***4**, 803–809, 10.1038/nphys1036 (2008). - 12.
Rowlands, G. E., Katine, J. A., Langer, J., Zhu, J. & Krivorotov, I. N. Time domain mapping of spin torque oscillator effective energy.

*Phys. Rev. Lett.***111**, 087206, 10.1103/PhysRevLett.111.087206 (2013). - 13.
Demidov, V. E.

*et al.*Magnetic nano-oscillator driven by pure spin current.*Nat. Mater.***11**, 1028–1031, 10.1038/nmat3459 (2012). - 14.
Liu, R., Lim, W. & Urazhdin, S. Spectral characteristics of the microwave emission by the spin Hall nano-oscillator.

*Phys. Rev. Lett.***110**, 147601, 10.1103/PhysRevLett.110.147601 (2013). - 15.
D’yakonov, M. & Perel, V. Possibility of orienting electron spins with current.

*Soviet Journal of Experimental and Theoretical Physics Letters***13**, 467 (1971). - 16.
Hirsch, J. Spin Hall effect.

*Phys. Rev. Lett.***83**, 1834, 10.1103/PhysRevLett.83.1834 (1999). - 17.
Hoffmann, A. Spin Hall effects in metals.

*IEEE Trans. Magn.***49**, 5172–5193, 10.1109/TMAG.2013.2262947 (2013). - 18.
Obata, K. & Tatara, G. Current-induced domain wall motion in rashba spin-orbit system.

*Phys. Rev. B***77**, 214429, 10.1103/PhysRevB.77.214429 (2008). - 19.
Miron, I. M.

*et al.*Current-driven spin torque induced by the rashba effect in a ferromagnetic metal layer.*Nat. Mater.***9**, 230–234, 10.1038/nmat2613 (2010). - 20.
Zhu, J.-G., Zhu, X. & Tang, Y. Microwave assisted magnetic recording.

*IEEE Trans. Magn.***44**, 125–131, 10.1109/TMAG.2007.911031 (2008). - 21.
Hosomi, M.

*et al.*A novel nonvolatile memory with spin torque transfer magnetization switching: Spin-RAM. In*Electron Devices Meeting, 2005. IEDM Technical Digest. IEEE International*459–462, 10.1109/IEDM.2005.1609379 (IEEE, 2005). - 22.
Slonczewski, J. C. Currents and torques in metallic magnetic multilayers.

*J. Magn. Magn. Mater.***247**, 324–338, 10.1016/S0304-8853(02)00291-3 (2002). - 23.
Berger, L. New origin for spin current and current-induced spin precession in magnetic multilayers.

*J. Appl. Phys.***89**, 5521–5525, 10.1063/1.1365080 (2001). - 24.
Zhang, S., Levy, P. & Fert, A. Mechanisms of spin-polarized current-driven magnetization switching.

*Phys. Rev. Lett.***88**, 236601, 10.1103/PhysRevLett.88.236601 (2002). - 25.
Shpiro, A., Levy, P. M. & Zhang, S. Self-consistent treatment of nonequilibrium spin torques in magnetic multilayers.

*Phys. Rev. B***67**, 104430, 10.1103/PhysRevB.67.104430 (2003). - 26.
Zhang, S. & Li, Z. Roles of nonequilibrium conduction electrons on the magnetization dynamics of ferromagnets.

*Phys. Rev. Lett.***93**, 127204, 10.1103/PhysRevLett.93.127204 (2004). - 27.
Strelkov, N.

*et al.*Spin-current vortices in current-perpendicular-to-plane nanoconstricted spin valves.*Phys. Rev. B***84**, 024416, 10.1103/PhysRevB.84.024416 (2011). - 28.
Petitjean, C., Luc, D. & Waintal, X. Unified drift-diffusion theory for transverse spin currents in spin valves, domain walls, and other textured magnets.

*Phys. Rev. Lett.***109**, 117204, 10.1103/PhysRevLett.109.117204 (2012). - 29.
Abert, C.

*et al.*Spin-polarized transport in ferromagnetic multilayers: An unconditionally convergent FEM integrator.*Comput. Math. Appl.***68**, 639–654, 10.1016/j.camwa.2014.07.010 (2014). - 30.
Garca-Cervera, C. J. & Wang, X.-P. Spin-polarized currents in ferromagnetic multilayers.

*J. Comput. Phys.***224**, 699–711, 10.1016/j.jcp.2006.10.029 (2007). - 31.
Alouges, F. A new finite element scheme for landau-lifchitz equations.

*Discrete Contin. Dyn. Syst. Ser. S***1**, 187–196 (2008). - 32.
Alouges, F., Kritsikis, E. & Toussaint, J.-C. A convergent finite element approximation for landau-lifschitz-gilbert equation.

*Physica B***407**, 1345–1349, 10.1016/j.physb.2011.11.031 (2012). - 33.
Goldenits, P., Hrkac, G., Praetorius, D. & Suess, D. An effective integrator for the landau-lifshitz-gilbert equation.

*Proceedings of MATHMOD 2012 - 7th Vienna Conference on Mathematical Modelling*493-497 (2012). - 34.
Bruckner, F.

*et al.*Multiscale modeling in micromagnetics: Well-posedness and numerical integration.*Math. Models Methods Appl. Sci.***24**, 2627–2662, 10.1142/S0218202514500328 (2014). - 35.
Abert, C., Exl, L., Bruckner, F., Drews, A. & Suess, D. magnum.fe: A micromagnetic finite-element simulation code based on FEniCS.

*J. Magn. Magn. Mater.***345**, 29–35, 10.1016/j.jmmm.2013.05.051 (2013). - 36.
Abert, C. magnum.fe. http://micromagnetics.org/magnum.fe (2013). (Date of access: 06/04/2015).

- 37.
Logg, A., Mardal, K.-A., Wells, G. N.

*et al.**Automated Solution of Differential Equations by the Finite Element Method*(Springer, 2012). - 38.
Fredkin, D. & Koehler, T. Hybrid method for computing demagnetizing fields.

*IEEE Trans. Magn.***26**, 415–417, 10.1109/20.106342 (1990). - 39.
Smigaj, W., Betcke, T., Arridge, S., Phillips, J. & Schweiger, M. Solving boundary integral problems with BEM++.

*ACM Trans. Math. Software***41**, Article #6 (2015). - 40.
Xiao, J., Zangwill, A. & Stiles, M. Boltzmann test of Slonczewskis theory of spin-transfer torque.

*Phys. Rev. B***70**, 172405, 10.1103/PhysRevB.70.172405 (2004). - 41.
MAG standard problem #5. http://www.ctcms.nist.gov/rdm/std5/spec5.xhtml (2014). (Date of access: 06/04/2015).

- 42.
MicroMagnum. http://magnum.physnet.uni-hamburg.de (2013). (Date of access: 06/04/2015).

- 43.
Akosa, C. A.

*et al.*Role of spin diffusion in current-induced domain wall motion for disordered ferromagnets.*Phys. Rev. B***91**, 094411, 10.1103/PhysRevB.91.094411 (2015). - 44.
Najafi, M.

*et al.*Proposal for a standard problem for micromagnetic simulations including spin-transfer torque.*J. Appl. Phys.***105**, 113914 (2009).

## Acknowledgements

The financial support by the Austrian Federal Ministry of Science, Research and Economy and the National Foundation for Research, Technology and Development as well as the Austrian Science Fund (FWF) under grant W1245 and F4102 SFB ViCoM, the innovative projects initiative of Vienna University of Technology, the Vienna Science and Technology Fund (WWTF) under grant MA14-044, and the Royal Society under UF080837 is gratefully acknowledged.

## Author information

## Affiliations

### Christian Doppler Laboratory of Advanced Magnetic Sensing and Materials, Institute of Solid State Physics, Vienna University of Technology, Austria

- Claas Abert
- , Florian Bruckner
- & Dieter Suess

### Institute for Analysis and Scientific Computing, Vienna University of Technology, Austria

- Michele Ruggeri
- & Dirk Praetorius

### Institute of Solid State Physics, Vienna University of Technology, Austria

- Christoph Vogler

### College of Engineering, Mathematics and Physical Sciences, University of Exeter, United Kingdom

- Gino Hrkac

## Authors

### Search for Claas Abert in:

### Search for Michele Ruggeri in:

### Search for Florian Bruckner in:

### Search for Christoph Vogler in:

### Search for Gino Hrkac in:

### Search for Dirk Praetorius in:

### Search for Dieter Suess in:

### Contributions

C.A. implemented the presented algorithm, performed the simulations, and wrote the main manuscript. M.R. and D.P. developed the algorithm and wrote the corresponding section. F.B., C.V., G.H. and D.S. developed the numerical experiments. G.H. and D.S. wrote the introduction. All authors reviewed the manuscript.

### Competing interests

The authors declare no competing financial interests.

## Corresponding author

Correspondence to Claas Abert.

## Comments

By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.

This work is licensed under a Creative Commons Attribution 4.0 International License. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in the credit line; if the material is not included under the Creative Commons license, users will need to obtain permission from the license holder to reproduce the material. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/