원시데이터 수집 시스템
선정목록으로

Numerical Methods for the Stray-Field Calculation: A Comparison of recently developed Algorithms

관련 산업용 섬유 · (9) 타이어코드

기본 정보

저자
  1. Abert, Claas
  2. Exl, Lukas
  3. Selke, Gunnar
  4. Drews, André
  5. Schrefl, Thomas
DOI
10.48550/arxiv.1204.4302
저널
arXiv (Cornell University)
발행년도
2022
발행기관
Cornell University
피인용수
0
라이선스
0
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.48550/arxiv.1204.4302
토픽
Composite Material Mechanics
OpenAlex ID
W6891862511

평가 내용

관련도
관련
사업분야
산업용 섬유 · (9) 타이어코드
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '산업용 섬유 > 타이어코드' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

Different numerical approaches for the stray-field calculation in the context of micromagnetic simulations are investigated. We compare finite difference based fast Fourier transform methods, tensor grid methods and the finite-element method with shell transformation in terms of computational complexity, storage requirements and accuracy tested on several benchmark problems. These methods can be subdivided into integral methods (fast Fourier transform methods, tensor-grid method) which solve the stray field directly and in differential equation methods (finite-element method), which compute the stray field as the solution of a partial differential equation. It turns out that for cuboid structures the integral methods, which work on cuboid grids (fast Fourier transform methods and tensor grid methods) outperform the finite-element method in terms of the ratio of computational effort to accuracy. Among these three methods the tensor grid method is the fastest. However, the use of the tensor grid method in the context of full micromagnetic codes is not well investigated yet. The finite-element method performs best for computations on curved structures.

본문 56,300자

본문 펼치기
## Numerical Methods for the Stray-Field Calculation: A Comparison of recently developed Algorithms Claas Abert <sup>_∗_</sup> Fachbereich Mathematik, Universit¨at Hamburg, Bundesstr. 55, 20146 Hamburg, Germany email: `cabert@physnet.uni-hamburg.de`, Lukas Exl <sup>_†_</sup> University of Applied Sciences, Department of Technology A-3100 St.Poelten, Austria email: `lukas.exl@fhstp.ac.at` - ♦ Gunnar Selke <sup>_‡_</sup> Arbeitbereich Technische Informatiksysteme, Universit¨at Hamburg, Vogt-K¨olln-Str. 30, 22572 Hamburg, Germany Andr´e Drews <sup>_§_</sup> Arbeitbereich Technische Informatiksysteme, Universit¨at Hamburg, Vogt-K¨olln-Str. 30, 22572 Hamburg, Germany Thomas Schrefl University of Applied Sciences, Department of Technology A-3100 St.Poelten, Austria November 27, 2024 Abstract Different numerical approaches for the stray-field calculation in the context of micromagnetic simulations are investigated. We compare _finite_ _difference_ _based_ _fast_ _Fourier_ _trans-_ _form_ _methods_, _tensor_ _grid_ _methods_ and the _finite-element_ _method_ _with_ _shell_ _transformation_ in terms of computational complexity, storage requirements and accuracy tested on several benchmark problems. These methods can be subdivided into integral methods (fast Fourier transform methods, tensor-grid method) which solve the stray field directly and in differential equation methods (finite-element method), which compute the stray field as the solution of a partial differential equation. It turns out that for cuboid structures the integral methods, which work on cuboid grids (fast Fourier transform methods and tensor grid methods) outperform the finite-element method in terms of the ratio of computational effort to accuracy. Among these three methods the tensor grid method is the fastest. However, the use _∗_ Funded by the Deutsche Forschungsgemeinschaft via the Graduiertenkolleg 1286 “Functional MetalSemiconductor Hybrid Systems” _†_ Funded by the Austrian Science Fund (FWF, project SFB F4112-N13) _‡_ Funded by the Deutsche Forschungsgemeinschaft via the Graduiertenkolleg 1286 “Functional MetalSemiconductor Hybrid Systems” _§_ Funded by the Sonderforschungsbereich 668 “Magnetism from the single atom to the nanostructure” 1 of the tensor grid method in the context of full micromagnetic codes is not well investigated yet. The finite-element method performs best for computations on curved structures. _Keywords:_ _micromagnetics,_ _stray-field,_ _fast_ _Fourier_ _transform,_ _tensor_ _grid_ _methods,_ _low-_ _rank_ _magnetization,_ _finite-element_ _method_ ### 1 Introduction Micromagnetic simulations nowadays are highly important for the investigation of ferromagnetic materials which are used in storage systems and electric motors and generators. In these simulations the magnetic state of the ferromagnet is represented by a classical magnetization vector field. The computation of the non-local magnetostatic interactions is thereby the most timeconsuming part. Naive implementation of the superposition-based integral operators (5) or solvers for the underlying differential equation (Poisson equation (3)) yield computational costs proportional to the square of the number of grid points, i.e. _O_ ( _N_ <sup>2</sup> ). Several methods have been introduced in literature in order to reduce these costs. The magnetic scalar potential can be computed by solving the Poisson equation. The solution of the Poisson equation with the finite-element method (FEM) has a complexity of _O_ ( _N_ ) if boundary conditions are given at the boundary of the sample and a multigrid preconditioner is used [28]. However, the stray-field problem has open boundary conditions, where the potential is known at infinity. Two possible solutions for the open boundary problem are the coupling of the boundary element method (BEM) with the finite-element method [16] and the application of a shell transformation [6]. BEM gives an additional complexity of _O_ ( _M_ <sup>2</sup> ) where _M_ is the number of boundary nodes. This complexity can be reduced to _O_ ( _M_ log _M_ ) by application of the _H_ -matrix approximation for the dense and unstructured boundary element matrices [7, 21, 27]. The storage requirements and computational complexity of the FEM with shell transformation will be described in the forthcoming text. Another class of methods rely on the evaluation of volume and/or surface integrals for the direct computation of the magnetostatic potential or the field, e.g. fast multipole methods [4, 5], nonuniform grid methods [23] and fast Fourier transform (FFT) methods [2, 25], scaling from _O_ ( _N_ ) to _O_ ( _N_ log _N_ ). The more recent tensor grid method (TG), which also belongs to this class scales even better under certain assumptions. In this paper we compare recently developed algorithms, namely the FFT-based methods for the computation of the field via the scalar potential (SP) and directly (DM) [1, 2, 11], a recently developed approach from numerical tensor-structered methods (TG) [13], and the finite-element method with shell transformation (FES), which is a FEM method that does not rely on BEM approaches and thus only introduces sparse matrices. ### 2 Stray-Field Problem Consider a magnetization configuration _M_ that is defined on a finite region Ω= _{_ _r_ : _M_ ( _r_ ) _̸_ = 0 _}_ . In order to perform minimization of the full micromagnetic energy functional or solve the Landau-Lifshitz-Gilbert (LLG) equation it is necessary to compute the stray field within the finite region Ω. The stray-field energy is given by Ω 2 _ed_ = _−M_ s <u>1</u> 2 _M_ _·_ _H_ d <sup>3</sup> _r_ _._ (1) The Landau-Lifshitz-Gilbert equation reads _<u>γ</u>_ _<u>αγ</u>_ _M_ _t_ = _−_ 1 + _α_ <sup>2</sup> <sup>_M_</sup> <sup>_×_</sup> <sup>_H_</sup> <sup>eff +</sup> _M_ s(1 + _α_ <sup>2</sup> ) <sup>_M_</sup> <sup>_×_</sup> <sup>(</sup> <sup>_M_</sup> <sup>_×_</sup> <sup>_H_</sup> <sup>eff)</sup> <sup>_,_</sup> (2) where _α_ is the Gilbert damping constant and _H_ eff is the effective field given by the negative variational derivative of the energy density. In both cases the stray field is only required to be known within Ω. The stray field _H_ has a scalar potential _φ_, which is the solution of a Poisson equation [19] _H_ = _−∇φ_ (3) ∆ _φ_ = _∇·_ _M_ (4) The stray field _H_ and thus also the scalar potential _φ_ are required to vanish at infinity. This boundary condition is often referred to as open boundary condition [15]. ### 3 Methods 3.1 FFT Methods (SP and DM) One way to reduce the computational complexity is to employ the fast Fourier transform (FFT). FFT methods solve an integral solution of the Poisson equation by applying the convolution theorem. The solution to the Poisson equation (3) is given by the integral, see [19], _<u>∇</u>_ <sup>_′_</sup> _<u>·</u>_ _<u>M</u>_ <u>(</u> _<u>r</u>_ <sup>_′_</sup> <u>)</u> _<u>n</u>_ <sup>_′_</sup> _<u>·</u>_ _<u>M</u>_ <u>(</u> _<u>r</u>_ <sup>_′_</sup> <u>)</u> d _A_ <sup>_′_</sup> (5) _|_ _r_ _−_ _r_ <sup>_′_</sup> _|_ _φ_ ( _r_ ) = _−_ <sup><u>1</u></sup> 4 _π_ Ω <sup>_′_</sup> _<u>·</u>_ _<u>M</u>_ <u>(</u> _<u>r</u>_ <sup>_′_</sup> <u>)</u> d <sup>3</sup> _r_ <sup>_′_</sup> + <sup><u>1</u></sup> _|_ _r_ _−_ _r_ <sup>_′_</sup> _|_ 4 _π_ 4 _π_ _∂_ Ω which directly fulfills the required open boundary condition. Performing integration by parts yields _φ_ ( _r_ ) = <sup><u>1</u></sup> 4 _π_ Ω <u>1</u> _M_ ( _r_ <sup>_′_</sup> ) _·_ _∇_ <sup>_′_</sup> _|_ _r_ _−_ _r_ <sup>_′_</sup> _|_ <sup>d3</sup> <sup>_r′_</sup> (6) = _S_ ( _r_ _−_ _r_ <sup>_′_</sup> ) _∗_ _M_ ( _r_ <sup>_′_</sup> ) _._ (7) By employing the convolution theorem _φ_ = _S_ _∗_ _M_ = _F_ <sup>_−_</sup> <sup>1�</sup> _F_ ( _S_ ) _· F_ ( _M_ ) _,_ (8) this convolution can be discretized and solved with the fast Fourier transform. A prerequisite for this procedure is the usage of an equidistant grid, which is required for a discrete convolution. The stray field _H_ ( _r_ ) = _−_ _∇_ _φ_ ( _r_ ) _,_ (9) can be obtained by applying finite differences. This method is referred to as the scalar-potential method (SP) in the following. It is described in detail in [2]. It is also possible to compute the stray field _H_ directly as a result of a matrix–vector convolution. _H_ ( _r_ ) = _−_ <sup><u>1</u></sup> 4 _π_ �� <u>1</u> _∇∇_ <sup>_′_</sup> _|_ _r_ _−_ _r_ <sup>_′_</sup> _|_ - _M_ ( _r_ <sup>_′_</sup> )d <sup>3</sup> _r_ <sup>_′_</sup> (10) = _N_ ( _r_ _−_ _r_ <sup>_′_</sup> ) _∗_ _M_ ( _r_ <sup>_′_</sup> ) _._ (11) Here _N_ denotes the demagnetization tensor. Similar to (8) the convolution can be solved as an element-wise matrix–vector multiplication in Fourier space. This method is referred to as the demagnetization-tensor method (DM) in the following and is implemented by different finitedifference codes [10, 11, 29]. For the numerical experiments we use MicroMagnum [1, 11] which implements both the SP and the DM method. 3 grid spacing midpoint spacing Figure 1: Grid spacing and midpoint spacing in TG Methods 3.2 Tensor Grid Methods (TG) Tensor grid methods (TG) for micromagnetic stray-field computation were recently introduced in [13] and [17]. They were developed for the purpose of handling so called low-rank tensor or compressed tensor magnetization, see [22] for a survey, in order to accelerate the computations and relieve storage requirements, see [12]. In the following we give a brief introduction into the ideas behind this method, also see [13] for a detailed description. 3.2.1 Analytical preparations The computation of the stray field within the magnetic body is based on the explicit integral formula for the scalar potential (6). The main idea is the usage of a representation for the integral kernel in (6) as an integral of a _Gaussian_ _function_ by the formula <u>1</u> <u>2</u> _|_ _r_ _−_ _r_ <sup>_′_</sup> _|_ <sup>3</sup> <sup>=</sup> _~~√~~_ _<u>π</u>_ R _τ_ <sup>2</sup> _e_ <sup>_−τ_</sup> <sup>2</sup> <sup>_|_</sup> <sup>_r_</sup> <sup>_−_</sup> <sup>_r_</sup> <sup>_′|_</sup> <sup>2</sup> d _τ,_ (12) which leads from (6) to <u>1</u> _φ_ ( _r_ ) = <u>3</u> 2 _π_ 2 R _τ_ <sup>2</sup> Ω _e_ <sup>_−τ_</sup> <sup>2</sup> <sup>_|_</sup> <sup>_r_</sup> <sup>_−_</sup> <sup>_r_</sup> <sup>_′|_</sup> <sup>2</sup> _M_ ( _r_ <sup>_′_</sup> ) _·_ ( _r_ _−_ _r_ <sup>_′_</sup> ) d <sup>3</sup> _r_ <sup>_′_</sup> d _τ._ (13) Equation (13) reduces the computation to independent spatial integrals along each principal direction (the part of the Ωintegral without the magnetization is now a product of independent 1–D integrals). This analytical preparation directly results in a reduction of the computational effort from _O_ ( _N_ <sup>2</sup> ) to _O_ ( _N_ <sup>4</sup> <sup>_/_</sup> <sup>3</sup> ) if discretized on a _tensor_ _product_ _grid_ before even using compressed/low-rank tensor formats for the discretized magnetization components. A similar method was introduced for the computation of the electrostatic scalar potential, [20]. The additional _τ_ -integration is carried out by the exponentially convergent _Sinc quadrature_ [18], the spatial integrals are computed by _Gauss-Legendre_ _quadrature_, both resulting in a numerical error of about the machine epsilon. 3.2.2 Discretization on a tensor product grid The magnetic body Ωis discretized on a _tensor_ _product_ _grid_ arising from the tensor outer product of three vectors _hp_ _∈_ R <sup>_Np_</sup> _, p_ = 1 _. . ._ 3 related to the grid spacings along each axis (see Fig. 1). This results in a not necessarily uniform _Cartesian_ _grid_ but in contrast to methods like DM/SP described before, tensor grid methods make use of the tensor-product interpretation of such grids. The magnetization on the center points of the cells is given as a 3-tensor [22] for each component, i.e. _M_ <sup>(</sup> <sup>_p_</sup> <sup>)</sup> _∈_ R <sup>_N_</sup> <sup>1</sup> <sup>_×N_</sup> <sup>2</sup> <sup>_×N_</sup> <sup>3</sup> _,_ _p_ = 1 _. . ._ 3 (14) 4 where _N_ 1 _, N_ 2 _, N_ 3 are the number of cells in the principal directions. Thereby it is possible to use _low-rank_ representation for the magnetization like _Canonical/Parallel_ _Factors_ _Decomposition_ (CP) or _Tucker_ _formats_, see the Appendix A or [22]. We obtain the potential on the center points of the computational cells, as the discrete analogue of (13), by a so-called _block-CP tensor_ [13] _R_ _l_ =1 <u>1</u> R <sup>_N_</sup> <sup>1</sup> <sup>_×N_</sup> <sup>2</sup> <sup>_×N_</sup> <sup>3</sup> _∋_ Φ = 2 _π_ <sup>3</sup> <sup>_/_</sup> <sup>2</sup> 3 _p_ =1 _ωl_ sinh( _τl_ ) <sup>2</sup> _M_ <sup>(</sup> <sup>_p_</sup> <sup>)</sup> _×_ 1 _D_ 1 <sup>_l_</sup> <sup>_×_</sup> <sup>2</sup> <sup>_D_</sup> <sup>_l_</sup> 2 <sup>_×_</sup> <sup>3</sup> <sup>_D_</sup> <sup>_l_</sup> 3 <sup>_._</sup> (15) _ωl_ sinh( _τl_ ) <sup>2</sup> _M_ <sup>(</sup> <sup>_p_</sup> <sup>)</sup> _×_ 1 _D_ 1 <sup>_l_</sup> Here ( _τl, ωl_ ) are the nodes and weights arising from the Sinc-quadrature with _R_ terms. The _Gaussian_ _matrices_ _D_ _q_ <sup>_l_</sup> <sup>_∈_</sup> <sup>R</sup> <sup>_Nq×Nq_</sup> <sup>come</sup> <sup>from</sup> _di_ <sup>_l_</sup> _q,jq_ <sup>:=</sup> _di_ <sup>_l_</sup> Ω _jq_ _g_ ( _x_ <sup>_c_</sup> _iq_ <sup>_, x′, τl_</sup> <sup>)</sup> <sup>_dx′,_</sup> (16) _D_ _q_ <sup>_l_</sup> - _d_ <sup>_l_</sup> _i_ _q_ <sup>_l_</sup> <sup>:=</sup> _iq jq_ - _._ (17) where Ω _jq_ denotes the _j_ -th interval on the (partitioned) _q_ -th axis with length ( _hq_ ) _j_ and _x_ <sup>_c_</sup> _iq_ <sup>is</sup> the midpoint of the _i_ -th interval on the _q_ -th axis. The Gaussian integrands are given by _g_ <sup>(</sup> <sup>_q_</sup> <sup>)</sup> ( _α, α_ <sup>_′_</sup> _, τ_ ) := - exp( _−_ sinh( _τ_ ) <sup>2</sup> ( _α −_ _α_ <sup>_′_</sup> ) <sup>2</sup> ) _q̸_ = _p,_ (18) ( _α −_ _α_ <sup>_′_</sup> ) exp( _−_ sinh( _τ_ ) <sup>2</sup> ( _α −_ _α_ <sup>_′_</sup> ) <sup>2</sup> ) _q_ = _p,_ and are approximated using Gauss-Legendre quadrature, as mentioned above. The field within Ωis derived from (9) by finite-difference operators of second order. 3.2.3 Low-Rank Magnetization Equation (15) allows the treatment of specially structured magnetization tensors, like CP or Tucker tensors [22] that have a reduced number of degrees of freedom, see Tab. 1, and accelerate the computation up to _sub-linear_ effort (below the volume size _N_ <sup>3</sup> ), see Tab. 2. As a consequence TG methods using low-rank magnetization allow larger models with finer discretization density than conventional methods. We now show by means of numerical experiments that typical single domain states [26] have highly accurate low-rank representations. Fig. 2 shows the approximation properties of a flower and a vortex state as described in Sec. 5 via the CP format and the Tucker format using an _alternating_ _least_ _squares_ _algorithm_ (ALS) [22] for the approximations. The plots 2a and 2b are computed independently from random initial guesses used in the ALS algorithm. We set the parameters in (27) as _a_ = _c_ = 0 _._ 5, _b_ = 1 and in (28) as _rc_ = 1 _/_ 2. Fig. 2a shows the dependence of the relative error (19) w.r.t. the rank for fixed discretization density, where Fig. 2b indicates the dependence w.r.t. the discretization density _N_ for fixed rank. The relative errors are measured in the Frobenius norm, i.e. - 21 _/_ �� _p_ = _x,y,z_ - <u>12</u> _._ (19) ���2 _F_ ��� _M_ dense( _p_ ) ���2 _F_ ��� _M_ dense( _p_ ) <sup>_−_</sup> <sup>_M_</sup> low-rank <sup>(</sup> <sup>_p_</sup> <sup>)</sup> _relerr_ = �� _p_ = _x,y,z_ The Tucker format generally leads to a better approximation, where Fig. 2b essentially shows no loss of accuracy while increasing the mesh density. 5 (a) 0.01 0.001 0.0001 1e-05 1e-06 1e-07 1e-08 1e-09 Flower/CP Flower/Tucker Vortex/CP Vortex/Tucker 2 3 4 5 6 7 8 9 10 Rank r Flower/CP Flower/Tucker Vortex/CP Vortex/Tucker 0 1 2 3 4 5 6 7 8 9 10 N [10 <sup>5</sup> ] (b) 0.001 0.0001 1e-05 1e-06 1e-07 1e-08 1e-09 Figure 2: Low-rank approximation of flower and vortex state via Tucker and CP decomposition. (a) Relative error w.r.t. approximation rank _r_ . _N_ = 1 _e_ +06. (b) Relative error w.r.t. discretization density _N_ . Rank _r_ = 5. (a) (b) Figure 3: Parallelepipedic shell surrounding the cuboid sample. (a) The transformation is carried out along the blue line. The origin of the transformation moves along the yellow middle plane. (b) Since the area of interest is the sample, the mesh is coarsened in the shell. 3.3 FEM Methods (FES) Within the finite-element framework the Poisson equation (3) is solved by the weak formulation Ω _∇φ · ∇v_ d <sup>3</sup> _x_ = Ω _M_ _· ∇v_ d <sup>3</sup> _x_ _∀_ _v, φ ∈_ _V_ (20) where Dirichlet boundary conditions are embedded in the trial function space _V_, i.e. the function space of the solution _φ_ . In the case of the stray-field problem the boundary conditions at the sample boundary _∂_ Ωare unknown. They are defined as zero at infinity. The treatment of these open boundary conditions is the main difficulty for finite-element stray-field calculations. We present the results for a transformation technique. The sample is surrounded by a finite shell which is also meshed. A bijective transformation from the finite shell to the complete exteriour of the sample is applied by introducing a metric tensor to the weak formulation. The particular transformation we use is known as “parallelepipedic shell transformation” [6]. The sample is put into a cuboid volume and a shell consisting of six parallelepipeds is created (see Fig. 3a). 6 X R2 R1 O x Figure 4: Sketch of the shell transformation in two dimensions. Within each shell patch the shell points are transformed in a radial sense. In order to achieve continuity between the patches the origin _O_ of the one-dimensional transformation has to be continuous between the patches. We choose the origin _O_ to move on the middle plane of the sample. The third dimension is treated in the same manner. The transformation is chosen such that points located at the inner boundary of the shell are mapped to themselves. Points on the outer boundary of the shell are mapped to infinity. The Jacobian of the transformation is requested to be 1 on the inner boundary of the shell in order to be continuous across the sample boundary. These conditions still leave some space for the choice of transformation. The most important aspect of this method is the distortion of the test and trial functions in the transformed area. In order to get a good result, the test and trial functions must be distorted such that they are able to model the natural decay of the magnetic potential. This obviously also depends on the choice of test and trial functions. From (6) it is seen that the potential decays with 1 _/r_ <sup>2</sup> . We choose our test and trial function _φh, vh_ _∈_ _Vh_ to be continuous and piecewise third-order polynomial ( _P_ 3) _Vh_ = - _vh_ _∈_ _H_ <sup>1</sup> (Ω) : _vh|T_ _∈P_ 3( _T_ ) _∀_ _T_ _∈Th_ (21) where _H_ <sup>1</sup> is a Sobolev space and _Th_ is a tetrehedron tesselation (see Fig. 3b). The transformation per shell patch is carried out in a radial sense as sketched in Fig. 4. The scalar transformation is given by _<u>R</u>_ <u>2</u> _<u>−</u>_ _<u>R</u>_ <u>1</u> _X_ = _R_ 1 (22) _R_ 2 _−|x|_ with _R_ 1, _R_ 2, _x_, and _X_ as shown in Fig. 4. This transforms the third order polynomial test and trial functions as _a_ + _bx_ + _cx_ <sup>2</sup> + _dx_ <sup>3</sup> _→_ _a_ <sup>_′_</sup> + _b_ <sup>_′_</sup> _X_ <sup><u>1</u></sup> _X_ <sup><u>1</u></sup> <sup>+</sup> <sup>_c′_</sup> _X_ <sup><u>1</u></sup> _X_ <sup><u>12</u></sup> <sup>+</sup> <sup>_d′_</sup> _X_ <sup><u>1</u></sup> (23) _X_ <sup><u>13</u></sup> <sup>_._</sup> The discretized weak formulation then reads - _M_ _· ∇vh_ d <sup>3</sup> _x_ _∀_ _vh_ _∈_ _Vh_ (24) ( _∇φh_ ) <sup>_T_</sup> _g_ _∇vh_ d <sup>3</sup> _x_ = Ω _g_ = Ω 1 if _x_ _∈_ Ωsample _J_ <sup>_−_</sup> <sup>1</sup> <sup>_T_</sup> _|_ _J_ _|_ _J_ <sup>_−_</sup> <sup>1</sup> if _x_ _∈_ Ωshell (25) where Ωsample and Ωshell denote the disjoint regions of the sample and the transformed shell with Ωsample _∪_ Ωshell = Ωand _J_ is the Jacobian matrix of the transformation. This directly translates to a linear system of equations, where the solution vector contains the coefficients in terms of the discrete function basis. The size of this solution vector is referred to as degrees of freedom (DoF). The implementation of this method is done with FEniCS [24]. 7 <u>Method</u> <u>Setup</u> <u>Magnetization</u> <u>Potential</u> <u>Field</u> <u>DM</u> <u>48</u> _<u>N</u>_ <u>3</u> _<u>N</u>_ <u>–</u> <u>3</u> _<u>N</u>_ <u>SP</u> <u>24</u> _<u>N</u>_ <u>3</u> _<u>N</u>_ _<u>N</u>_ <u>3</u> _<u>N</u>_ <u>TG</u> <u>(dense)</u> <u>6</u> _<u>RN</u>_ <sup>2</sup> <sup>_/_</sup> <sup>3</sup> <u>3</u> _<u>N</u>_ _<u>N</u>_ <u>3</u> _<u>N</u>_ <u>TG</u> <u>(Tucker)</u> <u>6</u> _<u>RN</u>_ <sup>2</sup> <sup>_/_</sup> <sup>3</sup> <u>3(</u> _<u>r</u>_ <sup>3</sup> <u>+ 3</u> _<u>rN</u>_ <sup>1</sup> <sup>_/_</sup> <sup>3</sup> <u>)</u> <u>9</u> _<u>R</u>_ <u>(</u> _<u>r</u>_ <sup>3</sup> <u>+ 3</u> _<u>rN</u>_ <sup>1</sup> <sup>_/_</sup> <sup>3</sup> <u>)</u> <u>27</u> _<u>R</u>_ <u>(</u> _<u>r</u>_ <sup>3</sup> <u>+ 3</u> _<u>rN</u>_ <sup>1</sup> <sup>_/_</sup> <sup>3</sup> <u>)</u> <u>TG</u> <u>(CP)</u> <u>6</u> _<u>RN</u>_ <sup>2</sup> <sup>_/_</sup> <sup>3</sup> <u>3(</u> _<u>r</u>_ <u>+ 3</u> _<u>rN</u>_ <sup>2</sup> <sup>_/_</sup> <sup>3</sup> <u>)</u> <u>9(</u> _<u>r</u>_ <u>+ 3</u> _<u>rRN</u>_ <sup>1</sup> <sup>_/_</sup> <sup>3</sup> <u>)</u> <u>27(</u> _<u>r</u>_ <u>+ 3</u> _<u>rRN</u>_ <sup>1</sup> <sup>_/_</sup> <sup>3</sup> <u>)</u> <u>FES</u> _<u>≈</u>_ <u>48</u> _<u>N</u>_ <u>3</u> _<u>N</u>_ _<u>N</u>_ <u>3</u> _<u>N</u>_ Table 1: Storage in number of floating point values w.r.t. number of computational cells/degrees of freedom _N_ . In TG methods _r_ denotes the tensor rank and _R_ denotes the number of Sincquadrature nodes. ### 4 Storage Requirements and Computational Complexity The costs of the different methods are compared in terms of storage requirements and computational complexity. Table 1 and 2 show the results. We choose _N_ to be the number of computational cells in the case of DM, SP and TG methods. In the case of finite-element methods (FES) _N_ refers to the number of degrees of freedom. Besides the memory needed for the storage of the magnetization configuration and the stray field, all methods require a certain amount of extra storage for auxiliary constants. In case of the DM and SP methods this includes the convolutions kernels, TG needs the one dimensional Gaussian matrices, and finite-element methods (FES) require the stiffness matrix as an auxiliary constant. These constants depend on the geometry and discretization only. This means that the computation of auxiliary constants has to be done only once for different magnetization configurations. Thus their complexity is almost irrelevant in the context of LLG computations and energy minimization. The storage requirements for these constants as well as the computational complexity of their calculation is summarized in the setup column in both tables. Storage requirements for TG methods depend on the rank _r_ used for the low-rank tensor representation of the magnetization components. Often the rank is much smaller than _N_ <sup>1</sup> <sup>_/_</sup> <sup>3</sup>, the discretization size in one spatial dimension. This makes the storage requirements for the magnetization, potential and field proportional to _rN_ <sup>1</sup> <sup>_/_</sup> <sup>3</sup> . For the setup the ( _N_ <sup>1</sup> <sup>_/_</sup> <sup>3</sup> _×_ _N_ <sup>1</sup> <sup>_/_</sup> <sup>3</sup> ) Gaussian matrices need to be computed and stored, thereby _R_ in Tab. 1 and 2 denotes the number of Sinc-quadrature nodes. The computational effort in TG methods also depends on the tensor format used for the representation of the magnetization, see Tab. 2. If the magnetization has a low-rank representation, TG methods usually reduce this complexity below the number of computational cells ( _sub-linear_ ), making this methods the fastest available nowadays. The storage requirements for the other three methods are proportional to _N_, which is a result of the dense representation of the magnetization, see Tab. 1. A well-known result is the _N_ log _N_ complexity of the convolution in FFT methods (DM/SP), likewise this is the asymptotic operation count for those methods, Tab. 2. In the FES method sparse linear systems have to be solved for the computation of the scalar potential. We used a conjugate gradient solver (CG) with an algebraic multigrid preconditioner (AMG) and measured the complexity w.r.t. _N_ (DoF) experimentally, finding a linear dependence on the system size (with a small logarithmic scaling factor). 8 <u>Method</u> <u>Setup</u> <u>Potential</u> <u>Field</u> <u>Energy</u> <u>DM</u> _<u>O</u>_ <u>(</u> _<u>N</u>_ <u>log</u> _<u>N</u>_ <u>)</u> <u>–</u> _<u>O</u>_ <u>(</u> _<u>N</u>_ <u>log</u> _<u>N</u>_ <u>)</u> _<u>O</u>_ <u>(</u> _<u>N</u>_ <u>)</u> <u>SP</u> _<u>O</u>_ <u>(</u> _<u>N</u>_ <u>log</u> _<u>N</u>_ <u>)</u> _<u>O</u>_ <u>(</u> _<u>N</u>_ <u>log</u> _<u>N</u>_ <u>)</u> _<u>O</u>_ <u>(</u> _<u>N</u>_ <u>)</u> _<u>O</u>_ <u>(</u> _<u>N</u>_ <u>)</u> <u>TG</u> <u>(dense)</u> _<u>O</u>_ <u>(</u> _<u>N</u>_ <sup>2</sup> <sup>_/_</sup> <sup>3</sup> <u>)</u> _<u>O</u>_ <u>(</u> _<u>N</u>_ <sup>4</sup> <sup>_/_</sup> <sup>3</sup> <u>)</u> _<u>O</u>_ <u>(</u> _<u>N</u>_ <u>)</u> _<u>O</u>_ <u>(</u> _<u>N</u>_ <u>)</u> <u>TG</u> <u>(Tucker)</u> _<u>O</u>_ <u>(</u> _<u>N</u>_ <sup>2</sup> <sup>_/_</sup> <sup>3</sup> <u>)</u> _<u>O</u>_ <u>(</u> _<u>rN</u>_ <sup>2</sup> <sup>_/_</sup> <sup>3</sup> <u>)</u> _<u>O</u>_ <u>(</u> _<u>rN</u>_ <sup>1</sup> <sup>_/_</sup> <sup>3</sup> <u>)</u> _<u>O</u>_ <u>(</u> _<u>r</u>_ <sup>2</sup> _<u>N</u>_ <sup>1</sup> <sup>_/_</sup> <sup>3</sup> <u>+</u> _<u>r</u>_ <sup>4</sup> <u>)</u> <u>TG</u> <u>(CP)</u> _<u>O</u>_ <u>(</u> _<u>N</u>_ <sup>2</sup> <sup>_/_</sup> <sup>3</sup> <u>)</u> _<u>O</u>_ <u>(</u> _<u>rN</u>_ <sup>2</sup> <sup>_/_</sup> <sup>3</sup> <u>)</u> _<u>O</u>_ <u>(</u> _<u>rN</u>_ <sup>1</sup> <sup>_/_</sup> <sup>3</sup> <u>)</u> _<u>O</u>_ <u>(</u> _<u>r</u>_ <sup>2</sup> _<u>N</u>_ <sup>1</sup> <sup>_/_</sup> <sup>3</sup> <u>)</u> <u>FES</u> _<u>O</u>_ <u>(</u> _<u>N</u>_ <u>)</u> _<u>O</u>_ <u>(</u> _<u>Nlog</u>_ <sup>_<u>α</u>_</sup> _<u>N</u>_ <u>)</u> _<u>, α ≪</u>_ <u>1</u> _<u>O</u>_ <u>(</u> _<u>N</u>_ <u>)</u> _<u>O</u>_ <u>(</u> _<u>N</u>_ <u>)</u> Table 2: Computational complexity w.r.t. number of computational cells/degrees of freedom _N_ . In TG methods _r_ denotes the tensor rank. Every column depends on its left neighbor, e.g. the calculation of the field requires the previous calculation of the potential etc. (a) (b) (c) Figure 5: Magnetization configurations in a 1 _×_ 1 _×_ 1 cube used for numerical experiments. The magnetization is normalized, its direction is color coded. (a) homogeneous magnetization (b) fower state (c) vortex state. (a) (b) Figure 6: Magnetization configurations in a 1 _×_ 1 _×_ 0 _._ 1 cuboid used for numerical experiments. The magnetization is normalized, its direction is color coded. (a) homogeneous magnetization (b) vortex state. 9 (a) 0.167 0.166 0.165 0.164 0.163 0.162 analytical DM PT TG FES DM PT TG FES (b) 0.154 0.153 0.152 0.151 0.15 0.149 0.148 0.147 0.146 0.145 0.093 0.092 0.091 0.090 0.089 0.088 0.087 0.086 0.085 (c) 0.032 0.030 0.028 1e3 1e4 1e5 1e6 1e7 1e8 Number of cells/DoF (FES) DM PT TG FES (d) 1e3 1e4 1e5 1e6 1e7 Number of cells/DoF (FES) analytical DM PT TG FES 0.026 0.024 0.022 0.020 0.018 1e3 1e4 1e5 1e6 1e7 Number of cells/DoF (FES) 1e3 1e4 1e5 1e6 Number of cells/DoF (FES) Figure 7: Convergence of the calculated stray-field energy for different geometries and magnetization configurations. Like in Tab. 1 and 2, _N_ is the number of cells for the tensor grid methods (DM, SP and TG) and the number of degrees of freedom in the case of finite elements (FES). (a) homogeneously magnetized 1 _×_ 1 _×_ 1 cube (b) flower state in 1 _×_ 1 _×_ 1 cube (c) vortex state in 1 _×_ 1 _×_ 1 state (c) homogeneously magnetized sphere with radius 0.5. 10 <u>Method</u> _<u>N</u>_ <u>relerr</u> _<u>e</u>_ <u>relerr</u> _<u>h</u>_ <u>av.</u> <u>relerr</u> _<u>h</u>_ <u>[</u> <sup>_◦_</sup> <u>]</u> <u>max.</u> <u>err</u> _<u>h</u>_ <u>[</u> <sup>_◦_</sup> <u>]</u> <u>DM</u> <u>40</u> _<u>×</u>_ <u>40</u> _<u>×</u>_ <u>40</u> <u>2</u> _<u>.</u>_ <u>9</u> _<u>e −</u>_ <u>09</u> _<u>−</u>_ _<u>−</u>_ _<u>−</u>_ <u>SP</u> <u>40</u> _<u>×</u>_ <u>40</u> _<u>×</u>_ <u>40</u> <u>1</u> _<u>.</u>_ <u>1</u> _<u>e −</u>_ <u>03</u> <u>1</u> _<u>.</u>_ <u>1</u> _<u>e −</u>_ <u>03</u> <u>2</u> _<u>.</u>_ <u>3</u> _<u>e −</u>_ <u>05</u> <u>5</u> _<u>.</u>_ <u>0</u> _<u>e</u>_ <u>+ 00</u> <u>TG</u> <u>(CP</u> _<u>r</u>_ <u>= 1)</u> <u>40</u> _<u>×</u>_ <u>40</u> _<u>×</u>_ <u>40</u> <u>3</u> _<u>.</u>_ <u>8</u> _<u>e −</u>_ <u>04</u> <u>2</u> _<u>.</u>_ <u>3</u> _<u>e −</u>_ <u>03</u> <u>6</u> _<u>.</u>_ <u>9</u> _<u>e −</u>_ <u>06</u> <u>2</u> _<u>.</u>_ <u>5</u> _<u>e</u>_ <u>+ 00</u> <u>FES</u> <u>7</u> _<u>.</u>_ <u>2</u> _<u>e</u>_ <u>+ 04</u> <u>8</u> _<u>.</u>_ <u>6</u> _<u>e −</u>_ <u>04</u> <u>2</u> _<u>.</u>_ <u>2</u> _<u>e −</u>_ <u>03</u> <u>3</u> _<u>.</u>_ <u>2</u> _<u>e −</u>_ <u>05</u> <u>5</u> _<u>.</u>_ <u>2</u> _<u>e</u>_ <u>+ 00</u> Table 3: Homogeneously magnetized unit cube, relative error in the energy, the average relative error in the field/field-angle (w.r.t. DM). ### 5 Numerical Experiments 5.1 Homogeneously Magnetized Cube As a first benchmark we take a homogeneously magnetized unit cube and compute the magnetostatic energy for varying grid-size _N_, where the exact value is _ed_ = 1 _/_ 6 [ _µ_ 0 _Ms_ <sup>2].</sup> <sup>Tab.</sup> <sup>3</sup> <sup>shows</sup> for each of the described methods the relative errors in the energy w.r.t. the exact value and the relative error in the field computed by (26), as well as the angular deviation (error in the field-angle) to the field computed by the FD-Demag method, see (10). We take the relative _l_ 2 _−_ error as a measurement for the field-error, i.e. _p_ = _x,y,z_ ���2 _F_ ��� _H_ demag( _p_ ) <sup>_−_</sup> <sup>_H_</sup> method <sup>(</sup> <sup>_p_</sup> <sup>)</sup> �1 _/_ 2 _._ (26) _relerr_ = - <u>1</u> _N_ The errors in the field-angle in Tab. 3 mostly occure at the edges of the cube. Fig. 7a shows magnetostatic energy calculations for different spatial discretizations. The DM method is almost exact and does not depend on spatial discretization. The reason is that the discretized demagnetization tensor is computed assuming homogeneously magnetized computational cells. Also the resulting stray field is analytically averaged per cell. Since the energy calculation is bilinear in the magnetization _M_ and the stray field _H_, the error is a pure rounding error. The FES method is the slowest converging method for this problem. A possible reason is the large external stray field of this setup. The numerical integration of the diverging metric tensor _g_ leads to an underestimation of the external space and consequently to an underestimation of the magnetic potential in the sample. Thus the FES method is particularly sensitive to setups with large external stray fields. SP and TG methods are also based on the computation of the scalar potential, whereby the field is obtained by finite differences. In [13] it is shown that the TG method essentially computes the scalar potential exactly for piecewise constant magnetization. The error in the energy in both methods (SP and TG) is mostly caused by numerical approximation of the gradient in the field computation, whereas TG shows the better approximation properties for this problem. In addition to it, TG uses an exact rank _−_ 1 representation for the uniform magnetization which makes the computation sub-linear (namely _O_ ( _N_ <sup>2</sup> <sup>_/_</sup> <sup>3</sup> )) with small scaling factor and allows computations for dozens of millions cells without any problems related to storage and computational cost. 11 <u>Method</u> _<u>N</u>_ _<u>e</u>_ <u>relerr</u> _<u>h</u>_ <u>av.</u> <u>relerr</u> _<u>h</u>_ <u>[</u> <sup>_◦_</sup> <u>]</u> <u>max.</u> <u>err</u> _<u>h</u>_ <u>[</u> <sup>_◦_</sup> <u>]</u> <u>DM</u> <u>40</u> _<u>×</u>_ <u>40</u> _<u>×</u>_ <u>40</u> <u>1</u> _<u>.</u>_ <u>528</u> _<u>e −</u>_ <u>01</u> _<u>−</u>_ _<u>−</u>_ _<u>−</u>_ <u>SP</u> <u>40</u> _<u>×</u>_ <u>40</u> _<u>×</u>_ <u>40</u> <u>1</u> _<u>.</u>_ <u>526</u> _<u>e −</u>_ <u>01</u> <u>1</u> _<u>.</u>_ <u>8</u> _<u>e −</u>_ <u>03</u> <u>5</u> _<u>.</u>_ <u>0</u> _<u>e −</u>_ <u>05</u> <u>7</u> _<u>.</u>_ <u>2</u> _<u>e</u>_ <u>+ 00</u> <u>TG</u> <u>(CP,</u> _<u>r</u>_ <u>= 6)</u> <u>40</u> _<u>×</u>_ <u>40</u> _<u>×</u>_ <u>40</u> <u>1</u> _<u>.</u>_ <u>529</u> _<u>e −</u>_ <u>01</u> <u>1</u> _<u>.</u>_ <u>8</u> _<u>e −</u>_ <u>03</u> <u>7</u> _<u>.</u>_ <u>8</u> _<u>e −</u>_ <u>06</u> <u>2</u> _<u>.</u>_ <u>6</u> _<u>e</u>_ <u>+ 00</u> <u>FES</u> <u>7</u> _<u>.</u>_ <u>2</u> _<u>e</u>_ <u>+ 04</u> <u>1</u> _<u>.</u>_ <u>526</u> _<u>e −</u>_ <u>01</u> <u>2</u> _<u>.</u>_ <u>5</u> _<u>e −</u>_ <u>03</u> <u>6</u> _<u>.</u>_ <u>0</u> _<u>e −</u>_ <u>05</u> <u>6</u> _<u>.</u>_ <u>8</u> _<u>e</u>_ <u>+ 00</u> Table 4: Flower state for magnetization in the unit cube, energy, the average relative error in the field/field-angle (w.r.t. DM). 5.2 Flower and Vortex State in a Cube We do the same comparison as in Sec. 5.1 for the flower state, see (27) and Fig. 5b, and Tab. 4 for the results. The main magnetization direction is taken to be along the _z_ - axis, and the flower is obtained through an in-plane perturbation along the _y_ - axis and an out-of-plane perturbation along the _x_ - axis. Assuming polynomial expressions for the perturbations, as in [8], our flower is the normalized version of _mx_ ( _r_ ) = _a_ <sup><u>1</u></sup> <sup>_xz,_</sup> _my_ ( _r_ ) = <sup><u>1</u></sup> _c_ <sup><u>1</u></sup> _c_ <sup>_yz_</sup> <sup>+</sup> _b_ <sup><u>13</u></sup> _b_ <sup><u>13</u></sup> <sup>_y_</sup> <sup>3</sup> <sup>_z_</sup> <sup>3</sup> <sup>_,_</sup> (27) _mz_ ( _r_ ) = 1 _,_ where the center of the cube is located at (0 _,_ 0 _,_ 0). We choose _a_ = _c_ = 1 and _b_ = 2. The results are similar to those of the homogeneously magnetized sample. In contrast the results of the DM method are not exact in this case, but Fig. 7b shows that the DM method converges faster than all other methods. The next comparison is for a vortex state in a unit cube, see Fig. 5c, described by the model in [14], i.e. _mx_ ( _r_ ) = _−_ <sup>_<u>y</u>_</sup> _r_ �1 _−_ exp - _−_ 4 <sup>_<u>r</u>_</sup> <sup>2</sup> _rc_ <sup>2</sup> �� 21 _,_ _my_ ( _r_ ) = <sup>_<u>x</u>_</sup> _r_ �1 _−_ exp - _−_ 4 <sup>_<u>r</u>_</sup> <sup>2</sup> _rc_ <sup>2</sup> �� 21 _,_ (28) _mz_ ( _r_ ) = exp _−_ 2 <sup>_<u>r</u>_</sup> <sup>2</sup> _rc_ <sup>2</sup> - _,_ where _r_ = ~~�~~ _x_ <sup>2</sup> + _y_ <sup>2</sup>, and we choose the radius of the vortex core as _rc_ = 0 _._ 14. The vortex center coincides with the center of the cube, and the magnetization is assumed to be rotationally symmetric about the _x/y_ - axis and translationally invariant along the _z_ - axis. The results can be found in Tab. 5. The most notable difference to the previous tests is the large field error in the FES method. It shows that the error occurs in the center of the vortex, where the gradient of the magnetization peaks. A possible solution for this problem would be an adaptive meshing, which is currenty not implemented in our FES code. 5.3 Thin Film We first take a homogeneously magnetized 1 _×_ 1 _×_ 0 _._ 1 thin film (magnetization out of plane), see Tab. 6 for the results. Tab. 7 shows the results for the vortex state (out of plane) in the same thin film geometry. 12 <u>Method</u> _<u>N</u>_ _<u>e</u>_ <u>relerr</u> _<u>h</u>_ <u>av.</u> <u>relerr</u> _<u>h</u>_ <u>[</u> <sup>_◦_</sup> <u>]</u> <u>max.</u> <u>err</u> _<u>h</u>_ <u>[</u> <sup>_◦_</sup> <u>]</u> <u>DM</u> <u>40</u> _<u>×</u>_ <u>40</u> _<u>×</u>_ <u>40</u> <u>2</u> _<u>.</u>_ <u>189</u> _<u>e −</u>_ <u>02</u> _<u>−</u>_ _<u>−</u>_ _<u>−</u>_ <u>SP</u> <u>40</u> _<u>×</u>_ <u>40</u> _<u>×</u>_ <u>40</u> <u>2</u> _<u>.</u>_ <u>163</u> _<u>e −</u>_ <u>02</u> <u>2</u> _<u>.</u>_ <u>4</u> _<u>e −</u>_ <u>03</u> <u>3</u> _<u>.</u>_ <u>4</u> _<u>e −</u>_ <u>04</u> <u>1</u> _<u>.</u>_ <u>2</u> _<u>e</u>_ <u>+ 01</u> <u>TG</u> <u>(Tucker,</u> _<u>r</u>_ <u>= 10)</u> <u>40</u> _<u>×</u>_ <u>40</u> _<u>×</u>_ <u>40</u> <u>2</u> _<u>.</u>_ <u>193</u> _<u>e −</u>_ <u>02</u> <u>4</u> _<u>.</u>_ <u>0</u> _<u>e −</u>_ <u>03</u> <u>3</u> _<u>.</u>_ <u>2</u> _<u>e −</u>_ <u>04</u> <u>1</u> _<u>.</u>_ <u>1</u> _<u>e</u>_ <u>+ 01</u> <u>FES</u> <u>7</u> _<u>.</u>_ <u>2</u> _<u>e</u>_ <u>+ 04</u> <u>2</u> _<u>.</u>_ <u>160</u> _<u>e −</u>_ <u>02</u> <u>2</u> _<u>.</u>_ <u>1</u> _<u>e −</u>_ <u>02</u> <u>6</u> _<u>.</u>_ <u>1</u> _<u>e −</u>_ <u>02</u> <u>1</u> _<u>.</u>_ <u>7</u> _<u>e</u>_ <u>+ 02</u> Table 5: Vortex state for magnetization in the unit cube, energy, the average relative error in the field/field-angle (w.r.t. DM). <u>Method</u> _<u>N</u>_ _<u>e</u>_ <u>relerr</u> _<u>h</u>_ <u>av.</u> <u>relerr</u> _<u>h</u>_ <u>[</u> <sup>_◦_</sup> <u>]</u> <u>max.</u> <u>err</u> _<u>h</u>_ <u>[</u> <sup>_◦_</sup> <u>]</u> <u>DM</u> <u>80</u> _<u>×</u>_ <u>80</u> _<u>×</u>_ <u>8</u> <u>4</u> _<u>.</u>_ <u>025</u> _<u>e −</u>_ <u>02</u> _<u>−</u>_ _<u>−</u>_ _<u>−</u>_ <u>SP</u> <u>80</u> _<u>×</u>_ <u>80</u> _<u>×</u>_ <u>8</u> <u>4</u> _<u>.</u>_ <u>021</u> _<u>e −</u>_ <u>02</u> <u>1</u> _<u>.</u>_ <u>7</u> _<u>e −</u>_ <u>03</u> <u>2</u> _<u>.</u>_ <u>6</u> _<u>e −</u>_ <u>05</u> <u>4</u> _<u>.</u>_ <u>5</u> _<u>e</u>_ <u>+ 00</u> <u>TG</u> <u>(CP,</u> _<u>r</u>_ <u>= 1)</u> <u>80</u> _<u>×</u>_ <u>80</u> _<u>×</u>_ <u>8</u> <u>4</u> _<u>.</u>_ <u>025</u> _<u>e −</u>_ <u>02</u> <u>3</u> _<u>.</u>_ <u>7</u> _<u>e −</u>_ <u>03</u> <u>6</u> _<u>.</u>_ <u>4</u> _<u>e −</u>_ <u>06</u> <u>2</u> _<u>.</u>_ <u>1</u> _<u>e</u>_ <u>+ 00</u> <u>FES</u> <u>4</u> _<u>.</u>_ <u>9</u> _<u>e</u>_ <u>+ 04</u> <u>3</u> _<u>.</u>_ <u>983</u> _<u>e −</u>_ <u>02</u> <u>5</u> _<u>.</u>_ <u>5</u> _<u>e −</u>_ <u>03</u> <u>1</u> _<u>.</u>_ <u>9</u> _<u>e −</u>_ <u>05</u> <u>5</u> _<u>.</u>_ <u>0</u> _<u>e</u>_ <u>+ 00</u> Table 6: Homogeneously magnetized 1 _×_ 1 _×_ 0 _._ 1 thin film (magnetization out of plane), energy, the average relative error in the field/field-angle (w.r.t. DM). The results for methods that do not rely on spatial discretization outside the sample perform equally well on this geometry. FES, instead, shows a deterioration of performance due to the worse ratio of shell and sample elements while leaving the number of DoF unchanged. 5.4 Sphere As the last test a homogeneously magnetized sphere with radius _R_ = 0 _._ 5 is simulated. The spatial discretization in case of cuboid grids is done by setting the magnetization _M_ = (0 _,_ 0 _, Mz_ ) in cells whose center lies within the sphere. This leads to staircase artifacts as shown in Fig. 8a. For the FES method the sphere is discretized such that the volume of the discretized sphere matches the anaytical volume. The magnetostatic energy for different spatial discretizations is displayed in Fig. 7d. The FES method shows the fastest convergence, which is obviously a consequence of the better approximation of the curved surface, see Fig. 8b. Also the field computation benefits from this better approximation, see Fig. 8c and 8d. Work was done on the treatment of curved surfaces within cartesian grid methods [9]. Still the use of irregular grids is a more natural way of describing curved surfaces and is thus preferable. <u>Method</u> _<u>N</u>_ _<u>e</u>_ <u>relerr</u> _<u>h</u>_ <u>av.</u> <u>relerr</u> _<u>h</u>_ <u>[</u> <sup>_◦_</sup> <u>]</u> <u>max.</u> <u>err</u> _<u>h</u>_ <u>[</u> <sup>_◦_</sup> <u>]</u> <u>DM</u> <u>80</u> _<u>×</u>_ <u>80</u> _<u>×</u>_ <u>8</u> <u>1</u> _<u>.</u>_ <u>569</u> _<u>e −</u>_ <u>03</u> _<u>−</u>_ _<u>−</u>_ _<u>−</u>_ <u>SP</u> <u>80</u> _<u>×</u>_ <u>80</u> _<u>×</u>_ <u>8</u> <u>1</u> _<u>.</u>_ <u>555</u> _<u>e −</u>_ <u>03</u> <u>2</u> _<u>.</u>_ <u>4</u> _<u>e −</u>_ <u>03</u> <u>4</u> _<u>.</u>_ <u>6</u> _<u>e −</u>_ <u>05</u> <u>3</u> _<u>.</u>_ <u>6</u> _<u>e</u>_ <u>+ 00</u> <u>TG</u> <u>(CP,</u> _<u>r</u>_ <u>= 1)</u> <u>80</u> _<u>×</u>_ <u>80</u> _<u>×</u>_ <u>8</u> <u>1</u> _<u>.</u>_ <u>569</u> _<u>e −</u>_ <u>03</u> <u>2</u> _<u>.</u>_ <u>9</u> _<u>e −</u>_ <u>03</u> <u>1</u> _<u>.</u>_ <u>8</u> _<u>e −</u>_ <u>05</u> <u>4</u> _<u>.</u>_ <u>0</u> _<u>e</u>_ <u>+ 00</u> <u>FES</u> <u>4</u> _<u>.</u>_ <u>9</u> _<u>e</u>_ <u>+ 04</u> <u>1</u> _<u>.</u>_ <u>496</u> _<u>e −</u>_ <u>03</u> <u>6</u> _<u>.</u>_ <u>0</u> _<u>e −</u>_ <u>03</u> <u>6</u> _<u>.</u>_ <u>4</u> _<u>e −</u>_ <u>04</u> <u>2</u> _<u>.</u>_ <u>1</u> _<u>e</u>_ <u>+ 01</u> Table 7: Vortex magnetization in 1 _×_ 1 _×_ 0 _._ 1 thin film (magnetization out of plane), energy, the average relative error in the field/field-angle (w.r.t. DM). 13 (a) (b) (c) (d) Figure 8: Spatial discretization and stray field of a homogeneously, in _z_ -direction magnetized sphere in the middle _xz_ -plane (a) Finite difference approximation of the spherical sample with 50 _×_ 50 _×_ 50 cells (b) Finite element approximation of the spherical sample with 9429 tetrahedra (including the shell elements) (c) _z_ component of the stray field, calculated with DM method (d) _z_ component of the stray field, calcualted with FES method 14 ### 6 Conclusion We investigated several test magnetization configurations with different methods for the strayfield computation and compared the results. There is no clear winner in this comparison of numerical methods for the stray-field calculation. Computations on cuboid structures are best done with methods that compute on cuboid grids, namely the DM, SP and TG methods. The TG method is not only the fastest choice, it is also able to handle very large grids due to lowrank tensor approximation or representation of the magnetization. However the TG method is not yet well investigated in the context of full micromagnetic simulations. In order to preserve the sublinear complexity and storage requirement features further research on the behaviour of low-rank magnetization during energy minimization or LLG integration has to be done. The SP method is faster than the DM method by a factor of 1.5 and needs about 30% less memory. This speedup comes at the expense of accuracy. Among the Cartesian grid methods, the DM method is most accurate since the stray field is computed directly. Both the SP and the TG method show an additional error due to the finite-difference gradient computation. For curved structures FES is a good choice. The obvious reason for this is the use of irregular meshes, which are able to model the curvature much better than cuboid grids. In contrast to FEM/BEM methods FES can be implemented using sparse matrices only, since the presence of the dense boundary element matrix is overcome with the shell transformation. ### Acknowledgements The authors want to thank Michael Hinze and Winfried Auzinger for fruitful discussions. Financial support by the Deutsche Forschungsgemeinschaft via the Graduiertenkolleg 1286 _‘_ ‘Functional Metal-Semiconductor Hybrid Systems”, the Austrian Science Fund (FWF) SFB ViCoM (F4112-N13), and the Sonderforschungsbereich 668 “Magnetism from the single atom to the nanostructure” is gratefully acknowledged. ### A Low-Rank Tensor Formats A tensor _A_ _∈_ R <sup>_N_</sup> <sup>1</sup> <sup>_×N_</sup> <sup>2</sup> <sup>_×N_</sup> <sup>3</sup> is said to be in _canonical_ _format_ _(CANDECOMP/PARAFAC_ _(CP)_ _decomposition)_ with _tensor_ _product_ _rank_ _r_, if _A_ = _r_ _l_ =1 _λl_ _u_ <sup>(1)</sup> _l_ _◦_ _u_ <sup>(2)</sup> _l_ _◦_ _u_ <sup>(3)</sup> _l_ (29) _λl_ _u_ <sup>(1)</sup> _l_ with _λl_ _∈_ R, vectors _u_ <sup>(</sup> _l_ <sup>_j_</sup> <sup>)</sup> _∈_ R <sup>_Nj_</sup>, and _◦_ is the vector outer product. A particular entry of a canonical tensor is given by _i_ _j_ - _u_ <sup>(2)</sup> _l_ _k_ <sup>_._</sup> (30) _aijk_ = _r_ _l_ =1 _λl_ - _u_ <sup>(1)</sup> _l_ - _u_ <sup>(3)</sup> _l_ Abbreviating notation as in [22], a tensor _A_ _∈_ R <sup>_N_</sup> <sup>1</sup> <sup>_×N_</sup> <sup>2</sup> <sup>_×N_</sup> <sup>3</sup> in CP format can be written as _A_ = � _λ_ ; _U_ <sup>(1)</sup> _,_ _U_ <sup>(2)</sup> _,_ _U_ <sup>(3)</sup> - _,_ (31) with weight vector _λ_ = [ _λ_ 1 _, . . ., λr_ ] _∈_ R <sup>_r_</sup> and factor matrices _U_ <sup>(</sup> <sup>_j_</sup> <sup>)</sup> = <sup>(</sup> 1 <sup>_j_</sup> <sup>)</sup> <sup>_|_</sup> <sup>_. . ._</sup> <sup>_|_</sup> <sup>_u_</sup> _r_ <sup>(</sup> <sup>_j_</sup> <sup>)</sup> - _u_ <sup>(</sup> 1 <sup>_j_</sup> <sup>)</sup> with weight vector _λ_ = [ _λ_ 1 _, . . ., λr_ ] _∈_ R <sup>_r_</sup> and factor matrices _U_ <sup>(</sup> <sup>_j_</sup> <sup>)</sup> = - _u_ <sup>(</sup> 1 <sup>_j_</sup> <sup>)</sup> <sup>_|_</sup> <sup>_. . ._</sup> <sup>_|_</sup> <sup>_u_</sup> _r_ <sup>(</sup> <sup>_j_</sup> <sup>)</sup> - _∈_ R <sup>_Nj_</sup> <sup>_×r_</sup> . From (31) it can be seen that the number of degrees of freedom (DoF) of a CP tensor is _r_ + _r_ <sup>�</sup> _j_ <sup>_Nj_</sup> <sup>(compare</sup> <sup>with</sup> <sup>�</sup> _j_ <sup>_Nj_</sup> <sup>for</sup> <sup>a</sup> <sup>dense</sup> <sup>tensor),</sup> <sup>also</sup> <sup>see</sup> <sup>Tab.</sup> <sup>1.</sup> _j_ <sup>_Nj_</sup> <sup>(compare</sup> <sup>with</sup> <sup>�</sup> _j_ <sup>_Nj_</sup> <sup>for</sup> <sup>a</sup> <sup>dense</sup> <sup>tensor),</sup> <sup>also</sup> <sup>see</sup> <sup>Tab.</sup> <sup>1.</sup> 15 A tensor _A_ _∈_ R <sup>_N_</sup> <sup>1</sup> <sup>_×N_</sup> <sup>2</sup> <sup>_×N_</sup> <sup>3</sup> is said to be in _Tucker_ _format_ (Tucker tensor) if it can be represented in the form _A_ = _C_ _×_ 1 _U_ 1 _×_ 2 _U_ 2 _×_ 3 _U_ 3 _,_ (32) with the so-called _core_ _tensor_ _C_ _∈_ R <sup>_r_</sup> <sup>1</sup> <sup>_×r_</sup> <sup>2</sup> <sup>_×r_</sup> <sup>3</sup> and _factor_ _matrices_ _U_ _j_ _∈_ R <sup>_Nj_</sup> <sup>_×rj_</sup> . Hereby the key-operation is the _n_ -mode (matrix) multiplication of a tensor _A_ _∈_ R <sup>_N_</sup> <sup>1</sup> <sup>_×N_</sup> <sup>2</sup> <sup>_×N_</sup> <sup>3</sup> with a matrix _U_ _∈_ R <sup>_M_</sup> <sup>_×Nn_</sup>, which is the multiplication of each mode- _n_ fiber of _A_ by the matrix _U_, i.e. _A_ _×n_ _U_ _∈_ R <sup>_×_</sup> <sup>3</sup> _j_ =1 <sup>_Mj_</sup> _,_ _Mj_ = - _Nj,_ _j̸_ = _n_ (33) _M,_ _j_ = _n._ In contrast to CP tensors, the ranks in the Tucker representation can be different in each mode (dimension). In the discussions of Sec. 4 and the experiments in Sec. 5 we used the same rank _r_ for each mode, i.e. _r_ _≡_ _rj_ . For a tensor in Tucker format <sup>�</sup> _j_ <sup>_rj_</sup> <sup>+</sup> <sup>�</sup> _j_ <sup>_rj Nj_</sup> <sup>entries have to be stored, which is a compression</sup> _j_ <sup>_rj_</sup> <sup>+</sup> <sup>�</sup> For a tensor in Tucker format <sup>�</sup> _j_ <sup>_rj_</sup> <sup>+</sup> <sup>�</sup> _j_ <sup>_rj Nj_</sup> <sup>entries have to be stored, which is a compression</sup> for _rj_ _≪_ _Nj_, also see Tab. 1. For a sum of Tucker tensors one can only store the factor matrices and core tensors of the summands, which is called _block-CP_ _format_ . Linear algebra operations for low-rank tensors, like the inner product, tensor–matrix product etc., can be performed without forming the dense tensors [3], which makes this operations faster than their conventional counterparts. ### References [1] MicroMagnum. URL `[http://micromagnum-tis.informatik.uni-hamburg.de/](http://micromagnum-tis.informatik.uni-hamburg.de/)` . [2] C. Abert, G. Selke, B. Kr¨uger, and A. Drews. A fast finite-difference method for micro magnetics using the magnetic scalar potential. _IEEE_ _Trans._ _Magn._, 48(3):1105 –1109, mar 2012. ISSN 0018-9464. doi: 10.1109/TMAG.2011.2172806. [3] Brett W. Bader and Tamara G. Kolda. Efficient MATLAB computations with sparse and factored tensors. _SIAM_ _J._ _Sci._ _Comput._, 30(1):205, 2008. ISSN 10648275. doi: 10.1137/ 060676489. URL `[http://link.aip.org/link/SJOCE3/v30/i1/p205/s1&Agg=doi](http://link.aip.org/link/SJOCE3/v30/i1/p205/s1&Agg=doi)` . [4] R. Beatson and L. Greengard. A short course on fast multipole methods. _Wavlets, Multilevel_ _Methods_ _and_ _Elliptic_ _PDEs_, pages 1–37, 1997. [5] J.L. Blue and M.R. Scheinfein. Using multipoles decreases computation time for magneto static self-energy. _IEEE_ _Trans._ _Magn._, 27(6):4778 –4780, nov 1991. ISSN 0018-9464. doi: 10.1109/20.278944. [6] X. Brunotte, G. Meunier, and J.F. Imhoff. Finite element modeling of unbounded problems using transformations: a rigorous, powerful and easy solution. _IEEE_ _Trans._ _Magn._, 28(2): 1663 –1666, mar 1992. [7] A. Buchau, W.M. Rucker, O. Rain, V. Rischmuller, S. Kurz, and S. Rjasanow. Comparison between different approaches for fast and efficient 3-d bem computations. _IEEE_ _Trans._ _Magn._, 39(3):1107 - 1110, may 2003. ISSN 0018-9464. doi: 10.1109/TMAG.2003.810167. 16 [8] R. P. Cowburn and M. E. Welland. Micromagnetics of the single-domain state of square ferromagnetic nanostructures. _Phys._ _Rev._ _B_, 58:9217–9226, Oct 1998. doi: 10.1103/ PhysRevB.58.9217. URL `[http://link.aps.org/doi/10.1103/PhysRevB.58.9217](http://link.aps.org/doi/10.1103/PhysRevB.58.9217)` . [9] M. J. Donahue and R. D. McMichael. Micromagnetics on curved geometries using rectan gular cells: Error correction and analysis. _IEEE_ _Trans._ _Magn._, 43(6):2878 - 2880, June 2007. doi: 10.1109/TMAG.2007.892865. [10] M.J. Donahue and D.G Porter. OOMMF user’s guido, version 1.0. _Interagency_ _Report_, NISTIR 6376, sep 1999. [11] A. Drews, G. Selke, and B. Kr¨uger. MicroMagnum: A novel simulation tool for fast physical simulations on CPU and GPU. _in_ _preparation_, 2012. [12] L. Exl. Micromagnetic energy minimization for low-rank tensor magnetization. _in_ _prepa-_ _ration_, (2012). [13] L. Exl, W. Auzinger, S. Bance, M. Gusenbauer, F. Reichel, and T. Schrefl. Fast stray field computation on tensor grids. _J._ _Comput._ _Phys._, 231(7):2840–2850, April 2012. ISSN 00219991. doi: 10.1016/j.jcp.2011.12.030. URL `[http://www.sciencedirect.com/science/](http://www.sciencedirect.com/science/article/pii/S0021999111007510)` `[article/pii/S0021999111007510](http://www.sciencedirect.com/science/article/pii/S0021999111007510)` . [14] Ernst Feldtkeller and Harry Thomas. Struktur und Energie von Blochlinien in d¨unnen ferromagnetischen Schichten. _Zeitschrift_ _f¨ur_ _Physik_ _B_ _Condensed_ _Matter_, 4:8–14, 1965. ISSN 0722-3277. URL `[http://dx.doi.org/10.1007/BF02423256](http://dx.doi.org/10.1007/BF02423256)` . 10.1007/BF02423256. [15] Josef Fidler and Thomas Schrefl. Micromagnetic modelling - the current state of the art. _J._ _Phys._ _D:_ _Appl._ _Phys._, 33(15):R135, 2000. URL `[http://stacks.iop.org/0022-3727/](http://stacks.iop.org/0022-3727/33/i=15/a=201)` `[33/i=15/a=201](http://stacks.iop.org/0022-3727/33/i=15/a=201)` . [16] D.R. Fredkin and T.R. Koehler. Hybrid method for computing demagnetizing fields. _IEEE_ _Trans._ _Magn._, 26(2):415 –417, mar 1990. ISSN 0018-9464. doi: 10.1109/20.106342. [17] A.V. Goncharov, G. Hrkac, J.S. Dean, and T. Schrefl. Kronecker product approximation of demagnetizing tensors for micromagnetics. _Journal_ _of_ _Computational_ _Physics_, 229(7):2544–2549, April 2010. ISSN 0021-9991. doi: 10.1016/j.jcp.2009. 12.004. URL `[http://www.sciencedirect.com/science/article/B6WHY-4XX1606-3/2/](http://www.sciencedirect.com/science/article/B6WHY-4XX1606-3/2/29863d27f2c27f31627061a6cc252899)` `[29863d27f2c27f31627061a6cc252899](http://www.sciencedirect.com/science/article/B6WHY-4XX1606-3/2/29863d27f2c27f31627061a6cc252899)` . [18] W. Hackbusch and B. N. Khoromskij. Low-rank kronecker-product approximation to multi dimensional nonlocal operators. part I. separable approximation of multi-variate functions. _Computing_, 76(3-4):177–202, 2006. ISSN 0010-485X. doi: 10.1007/s00607-005-0144-0. URL `[http://www.springerlink.com/content/74v20851143034q1/](http://www.springerlink.com/content/74v20851143034q1/)` . [19] J. D. Jackson. Classical electrodynamics, 3rd ed. _Am._ _J._ _Phys_, 67(9):841, 1999. ISSN 00029505. doi: 10.1119/1.19136. URL `[http://link.aip.org/link/?AJP/67/841/2&Agg=](http://link.aip.org/link/?AJP/67/841/2&Agg=doi)` `[doi](http://link.aip.org/link/?AJP/67/841/2&Agg=doi)` . [20] Jonas Jus´elius and Dage Sundholm. Parallel implementation of a direct method for calcu lating electrostatic potentials. _The Journal of Chemical Physics_, 126(9):094101, 2007. ISSN 00219606. doi: 10.1063/1.2436880. URL `[http://link.aip.org/link/JCPSA6/v126/i9/](http://link.aip.org/link/JCPSA6/v126/i9/p094101/s1&Agg=doi)` `[p094101/s1&Agg=doi](http://link.aip.org/link/JCPSA6/v126/i9/p094101/s1&Agg=doi)` . 17 [21] A. Knittel, M. Franchin, G. Bordignon, T. Fischbacher, S. Bending, and H. Fangohr. Compression of boundary element matrix in micromagnetic simulations. _J._ _Appl._ _Phys._, 105(7):07D542, 2009. doi: 10.1063/1.3072032. URL `[http://link.aip.org/link/?JAP/](http://link.aip.org/link/?JAP/105/07D542/1)` `[105/07D542/1](http://link.aip.org/link/?JAP/105/07D542/1)` . [22] Tamara G Kolda and Brett W Bader. Tensor decompositions and applications. _SIAM_ _Rev._, 51:455–500, August 2009. ISSN 0036-1445. doi: 10.1137/07070111X. URL `[http:](http://portal.acm.org/citation.cfm?id=1655228.1655230)` `[//portal.acm.org/citation.cfm?id=1655228.1655230](http://portal.acm.org/citation.cfm?id=1655228.1655230)` . [23] Boris Livshitz, Amir Boag, H. Neal Bertram, and Vitaliy Lomakin. Nonuniform grid algorithm for fast calculation of magnetostatic interactions in micromagnetics. _J._ _Appl._ _Phys._, 105(7):07D541, 2009. doi: 10.1063/1.3076048. URL `[http://link.aip.org/link/](http://link.aip.org/link/?JAP/105/07D541/1)` `[?JAP/105/07D541/1](http://link.aip.org/link/?JAP/105/07D541/1)` . [24] Anders Logg, Kent-Andre Mardal, Garth N. Wells, et al. _Automated Solution of Differential_ _Equations_ _by_ _the_ _Finite_ _Element_ _Method_ . Springer, 2012. ISBN 978-3-642-23098-1. [25] H.H. Long, E.T. Ong, Z.J. Liu, and E.P. Li. Fast fourier transform on multipoles for rapid calculation of magnetostatic fields. _IEEE_ _Trans._ _Magn._, 42(2):295 - 300, feb. 2006. ISSN 0018-9464. doi: 10.1109/TMAG.2005.861505. [26] R.D. McMichael. Standard problem number 3, problem specification and reported solu tions. _Micromagnetic_ _Modeling_ _Activity_ _Group_, 1998. URL `[http://www.ctcms.nist.gov/](http://www.ctcms.nist.gov/~rdm/mumag.html)` `~` <sup>`[rdm/mumag.html](http://www.ctcms.nist.gov/~rdm/mumag.html)`</sup> <sup>.</sup> [27] N. Popovi´c and D. Praetorius. Applications of _H_ -matrix techniques in micromagnetics. _Computing_, 74:177–204, 2005. ISSN 0010-485X. URL `[http://dx.doi.org/10.1007/](http://dx.doi.org/10.1007/s00607-004-0098-7)` `[s00607-004-0098-7](http://dx.doi.org/10.1007/s00607-004-0098-7)` . 10.1007/s00607-004-0098-7. [28] Igor Tsukerman, Alexander Plaks, and H. Neal Bertram. Multigrid methods for computa tion of magnetostatic fields in magnetic recording problems. _J._ _Appl._ _Phys._, 83(11):6344– 6346, 1998. doi: 10.1063/1.367730. URL `[http://link.aip.org/link/?JAP/83/6344/1](http://link.aip.org/link/?JAP/83/6344/1)` . [29] Arne Vansteenkiste and Ben Van De Wiele. MuMax: a new high-performance micromagnetic simulation tool. _J._ _Magn._ _Magn._ _Mater._, 323(21):2585–2591, 2011. URL `[http://arxiv.org/abs/1102.3069](http://arxiv.org/abs/1102.3069)` . 18

섹션 본문

섹션 본문이 없습니다.

참고문헌

참고문헌 정보가 없습니다.