An Adaptive Step Implicit Midpoint Rule for the Time Integration of Newton’s Linearisations of NonLinear Problems with Applications in Micromagnetics
 304 Downloads
Abstract
The implicit midpoint rule is a Runge–Kutta numerical integrator for the solution of initial value problems, which possesses important properties that are relevant in micromagnetic simulations based on the Landau–Lifshitz–Gilbert equation, because it conserves the magnetization length and accurately reproduces the energy balance (i.e. preserves the geometric properties of the solution). We present an adaptive step size version of the integrator by introducing a suitable local truncation error estimator in the context of a predictorcorrector scheme. We demonstrate on a number of relevant examples that the selected step sizes in the adaptive algorithm are comparable to the widely used adaptive secondorder integrators, such as the backward differentiation formula (BDF2) and the trapezoidal rule. The proposed algorithm is suitable for a wider class of nonlinear problems, which are linearised by Newton’s method and require the preservation of geometric properties in the numerical solution.
Keywords
Initial value problems Runge–Kutta methods Adaptive time integration Predictorcorrector methods Micromagnetics Landau–Lifshitz–Gilbert equation1 Background and Context
Initial value problems (IVP) arise in mathematical models of many important physical and engineering processes and phenomena. They either appear as standalone problems (as ordinary differential equations (ODEs), where the unknown functions depend only on a single variable, for example describing the motion in classical mechanics or chemical reactions), or in the context of applying the method of lines to partial differential equations (PDE), i.e. the problems where unknown functions have both spatial and time variation [1, p. 8]. The solutions of such problems frequently exhibit multiple spatiotemporal scales. In such cases implicit solvers allow the deployment of larger step sizes, while maintaining stability. Efficient integrators should also involve adaptivity [2, p. 73,74], which can be realised both with explicit and implicit methods. The design and development of these algorithms has been the topic of much previous research (see, for example [3, Sect. 3.16],[4, 5, 6, 7]). Many publicly available codes for the solution of IVPs (for example CVODE [8], or the various solvers in Matlab [9]) involve some adaptivity strategy. Adaptive IVP solvers allow the selection of the right step sizes at each stage of the solution process to satisfy the required accuracy, thus removing the need for a “trialanderror” approach. This also improves the computational efficiency and robustness of the overall algorithm.
In some problems the governing equations dictate that the solution vectors should have constant magnitude, and that the system’s energy should either be conserved or accurately reproduced. In such cases IVP solvers should preserve these properties at the discrete level, while computational efficiency is achieved by using the adaptive implicit methods. As an example, we consider micromagnetics [10]. Dynamical micromagnetic models are based on the Landau–Lifshitz–Gilbert (LLG) equation, a timedependent differential equation modelling the magnetization evolution in a ferromagnetic body. The classical LLG equation models the magnetization at zero temperature, which implies that the magnetization vector length is constant at any point of the domain. The second important property of the LLG equation is the energy conservation in the nondamped case, or equivalently, under a constant applied field the energy decreases at a rate proportional to the damping factor. Solutions of the LLG equation in practical cases often exhibit multiple spatiotemporal scales favouring the use of adaptive implicit time integration schemes [11]. An integration scheme that preserves (or, in the damped case, accurately reproduces) the length/energy properties of the solution is referred to as a geometric integrator. Most commonly used implicit schemes (such as the secondorder backward differentiation formula BDF2 or the trapezoidal rule (TR)) do not possess this property. By contrast, the implicit midpoint rule (IMR), combined with an appropriate spatial discretisation in the PDE cases, is a geometric integrator [12, 13]. The proposed adaptive version of IMR retains this favourable property. Some alternative numerical techniques aimed at preserving the magnetization length include peiodic renornalisation [14], length constraints imposed through Lagrange multipliers [15], penalty formulations [16], and the selfcorrecting LLG equation used by Nmag [16]. However, all these formulations change the energy of the system.
The implicit midpoint rule (IMR) is a wellknown second order implicit Runge–Kutta method [17, p. 204],[3, p. 262], that has been applied in fixedstep form to micromagnetic problems [12]. In this paper we present an adaptive version of the IMR based on the new local truncation error estimator in the context of a predictorcorrector scheme. We demonstrate the efficiency of the adaptive version of IMR by comparing its accuracy and computational cost with the fixed step version of the method [12], and with the adaptive versions of the BDF2 [3, p. 649] and the TR [3, p. 647] when applied to both ODE and PDE problems that arise in computational micromagetics.
The paper is organised as follows. In Sect. 2 we introduce the LLG equation and describe a method for its discretisation that is used in this paper. Section 3 introduces the IMR and details some of its properties. In Sect. 4 we present the new local truncation error (LTE) estimator for the IMR and introduce the adaptive integrator. Finally, in Sect. 5 we evaluate the effectiveness of the adaptive IMR when applied to ODE and PDE problems associated with the LLG equation. We also compare the adaptive IMR to adaptive BDF2 and the standard version of TR in terms of the computational cost, accuracy and the preservation of geometric properties.
2 The Dynamical Micromagnetic Model
2.1 The Landau–Lifshitz–Gilbert Equation
2.2 Finite Element Discretisation
Notice that J in (12) is a block skewsymmetric matrix. Linear systems with the coefficient matrix J are solved either directly, or by preconditioned Krylov solvers. In our experiments reported in Sects. 5.2 and 5.3 GMRES preconditioned by ILU(1) method is used [22].
2.3 Hybrid FiniteBoundary Element Method for the Exchange Field
Spatial discretisation of (6) with BCS (7)–(9) is problematic, as the domain \(\Omega ^*\) is infinite. The application of FEM in this context would require socalled “infinite elements” [23]. An alternative is to truncate the domain \(\Omega ^*\) or to use asymptotic BCs [24]. The asymptotic accuracy of such approaches is usually low. An alternative approach is to apply the hybrid finite/boundary element method, in which the external domain is replaced by a dipole layer placed on \(\partial \Omega \), which simulates the correct BC (9) [25]. Standard FEM is used to calculate the potentials in \(\Omega \).
The accuracy of the FEM/BEM method is better than that of the asymptotic BCs method [26]. The main drawback of the hybrid method is that it produces a dense coefficient matrix of size \(N_b\), leading to both the computational and storage cost of \(O(N^2_b)\) (in the discrete version of (18) the BEM matrix needs to be multiplied by a vector to impose the BCs). This cost can be prohibitive when modelling micromagnetic problems posed over thin domains, where \(N_b=O(N)\). This problem was circumvented by the approximation of the BEM matrix by low rank hierarchical matrices, as implemented in the library HLib [27, 28], reducing both the storage and computational cost from \(O(N_{b}^{2})\) to \(O(N_b\log N_b)\).
3 The Implicit MidPoint Rule
3.1 Local Truncation Errors and the Order of Convergence
3.2 Properties of the IMR

It is Astable [17, p. 43,251], i.e. it can be applied to stiff problems.

It requires only one evaluation of the function \({\mathbf {f}}\) per step (a onestep method, unlike many other Runge–Kutta methods).
4 Adaptive Implicit MidPoint Rule
Implicit time integration of ODEs or semidiscretised PDEs is a computationally intensive task. Numerically effective integrators employ adaptivity, which enables an integrator to take steps of the size governed, within the prescribed tolerance, by the physics of the problem, rather than artificial (methodspecific) constraints. Adaptive step selection algorithms rely on computable estimates of the LTE. In this section we discuss the difficulties in applying the commonly used LTE estimation schemes to IMR and introduce the new approach.
4.1 Local Truncation Error Estimation
Typical LTE estimators used in implicit IVP integrators (such as TR or BDF2) are based on the solution estimate \({\mathbf {y}}^{{\text {E}}}_{n+1}\sim {\mathbf {y}}(t_{n+1})\) computed by an explicit method with the same asymptotic order of accuracy, using the history values computed by an implicit method. This is referred to as the predictor step. Algebraic rearrangements of the analytical expressions for the LTEs of an explicit and an implicit method lead to a computable estimate of the implicit LTE with a desired order of accuracy. This approach is known as Milne’s device [3, p. 707–716]. It is not straightforward to apply this approach to estimating the LTE of the IMR, due to the presence of the term II in (31). The difficulty of constructing a Milne device in this case lies in finding a suitable predictor which LTE involves the term II from (31). In the case of linear or linearised problems (such as the SimoArmero linearisation of the Navier–Stokes equations [31]), the IMR is numerically equivalent to TR, which implies that the use of the standard AB2 predictor will produce the same behaviour (in terms of the number and the size of the selected steps) for both AB2TR and AB2IMR integrators. This is no longer the case when \({\mathbf {f}}\) is nonlinear and we focus on this scenario in the remainder of this paper.
Adaptivity in explicit Runge–Kutta methods is achieved by finding a pair of methods of different orders and to obtain a LTE estimate by comparing the two solutions [17, p. 165]. The effectiveness of this approach relies on the existence of pairs of methods that share the most of their function evaluation points – the socalled embedded methods (the examples include the DormandPrince pair of order 4/5 deployed in Matlab’s function ode45 [9]). To deploy this approach in the context of the IMR would require a third order implicit method that involve a function evaluation in addition to \({\mathbf {f}}(t_{n+1/2},{\mathbf {y}}_{n+1/2})\). However, the function evaluation \({\mathbf {f}}(t_{n+1/2},{\mathbf {y}}_{n+1/2})\) at the “midpoint” of the interval \([t_n,t_{n+1}]\) leads to the cancellation of the secondorder terms in (28)–(29), and an additional function evaluation at a point in \([t_n,t_{n+1}]\) would break this symmetry. To restore it, we would require two additional function evaluations.
In order to bypass these problems, we consider explicit third order methods as predictors in the nonlinear case. Suitable candidates are AB3 [1, p. 127], RK3 [1, p. 73], and the eBDF3 method [17, p. 378]. The first two of these methods are computationally more expensive and/or require the storage of more history values than the AB2 method. This is, however, not the case with the eBDF3 method. In order to be a competitive predictor, it should lead either to the overall reduction in the number of time steps in nonlinear cases for a set LTE tolerance, or a better accuracy for a fixed number of steps performed compared to the AB2 predictor. In particular, the AB2 method requires the storage of the function values (the solution derivatives) at two history points. In the nonlinear case this ammounts to either storing the Jacobians at these points or assembling them on the fly. We notice that the function evaluations at multiple points also introduce additional implementation complications in ODE/PDE cases where the time derivative is given implicitly (such as in the LLG equation). The situation is even worse for AB3 and RK3 methods that require the computation or storage of the function values at three history points. Neither of these predictors is selfstarting, which is a drawback for a selfstarting IMR method. The eBDF3 method is not selfstarting either, but requires the storage of three history solution values, rather than its derivatives, and only one function evaluation (at \(\Delta _n\)). This makes it a competitive alternative to the AB2 method and the other two third order methods. The computational cost of applying the eBDF3 predictor consists of one sparse matrixvector multiplication (where we assume that a dense matrix block obtained in the BEM discretisation of the magnetostatic field is sparsified prior to its use) and, in PDE cases, the solution of one trivial linear system with a diagonal mass matrix (assuming that reduced quadratures are used). The eBDF3 predictor is therefore judiciously chosen among the other alternatives (AB2, AB3, RK3) due to its low computational and/or storage overhead.
The eBDF3 method is unstable for fixed step sizes [17, p. 378], however this is not an issue when used as a predictor, as we only perform a single step of it using IMRcomputed history values. Thus, the eBDF3 method can be viewed as an extrapolation of \({\mathbf {y}}\) at \(t_{n+1}\) using the history values.
4.2 The Variable Step eBDF3 Method
We notice that some public IVP solvers, such as CVODE [8, Sect. 2.1] keep the step size constant as long as feasible. This allows the use of the inexact Newton’s method, which does not require the assembly of the Jacobians at every iteration, thus reducing the computational cost. However, if the associated linear systems are solved by a preconditioned Krylov method, the gains in convergence speed obtained using exact Newton’s method can outweigh the savings obtained by not assembling the Jacobian matrices [34, p. 128]. The adaptive highorder explicit method from [7] also selects fairly constant time steps over long time intervals.
5 Numerical Examples
In this section we present numerical experiments that demonstrate the effectiveness, accuracy, and geometric properties of the proposed adaptive IMR scheme. The first case study is an ODE system modelling a magnetization reversal in a small spherical (both isotropic and anisotropic) ferromagnetic particle, while the two further cases are the PDE problems which involve spatial variation of the magnetization vector and are discretised using finite element method and the method of lines is applied to the semidiscretised system of IVPs [35]. The implementation of the ODE example in Sect. 5.1 is done in Matlab, while the PDE examples are implemented in oomphlib, an objectoriented multiphysics finite element library [36].
5.1 The Magnetic Reversal of a Spherical Particle
This is a widely used modelproblem from micromagnetics which is represented by an ODE system. We consider the magnetization of a small spherical particle made of either an isotropic or anisotropic ferromagnetic material under a spatially uniform applied field \({\mathbf {h}}_{\text{ ap }}\). The evolution of the magnetization vector \({\mathbf {m}}\in C^1(T)\) follows the LL Eq. (1) with \({\mathbf {h}}={\mathbf {h}}_{\text{ ap }}+k_1({\mathbf {m}}\cdot {\mathbf {e}}){\mathbf {e}}\) is the effective field. In case of an isotropic material (\(k_1=0\)) \({\mathbf {h}}\) has only the applied field component [18, p. 306]. For a sufficiently small sphere the magnetization is spatially uniform, i.e. \({\mathbf {m}}={\mathbf {m}}(t)\) and the problem (1) is a system of three ODEs for the unknown Cartesian components of \({\mathbf {m}}\). The problem has an analytical solution [37], which describes the process of the magnetization switching and can be expressed in spherical polar coordinates \((\theta ,\phi )\) as \(\theta =\cos ^{1}(m_z/1)\), \(\phi =\tan ^{1}(m_y/m_x)\), where \(\theta \) is the angle between \({\mathbf {m}}\) and \({\mathbf {h}}_{\text{ ap }}\). The energy of the system is in this case given by \(E={\mathbf {m}}\cdot {\mathbf {h}}_{\text{ ap }}\). In the ideal nondamped case (\(\alpha =0\)) the energy remains conserved throughout the magnetization reversal (i.e. the process of the realignment of \({\mathbf {m}}\) from the initial configuration \({\mathbf {m}}_0\) to the external field \({\mathbf {h}}_{\text{ ap }}\)) – the property that needs to be replicated by the time integrator. For anisotropic materials (\(k_1>0\)) we study the behaviour of the time integrators for the realistic values of the phenomenological anisotropy parameter \(k_1\in [0,4]\).
The number of the time steps \(N_t\) and the minimum of magnetization length \({\mathbf {m}}_{\min }\) for the spherical particle reversal problem with \(\alpha =0.01\) and \(k_1=0\) integrated over the time interval \(T=[0,1000]\) using GLBDF2, AB2TR, AB2IMR and eBDF3IMR schemes
\(\epsilon _T\)  Scheme  GLBDF2  AB2TR  IMR  

AB2  eBDF3  
\(10^{4}\)  \(N_t\)  9693  5724  5724  8311 
\({\mathbf {m}}_{\min }\)  0.980221  0.997881  1.000000  
\(10^{5}\)  \(N_t\)  20,787  12,321  12,321  17,798 
\({\mathbf {m}}_{\min }\)  0.998045  0.999544  1.000000  
\(10^{6}\)  \(N_t\)  44,765  26,538  26,538  38,289 
\({\mathbf {m}}_{\min }\)  0.999754  0.999906  1.000000 
The switching times \(t_1\) for which \(m_z(t_1)=0\) with fixed number of time steps \(N_t\) for the spherical particle reversal problem with \(\alpha =0.01\) and \(k_1=0\)
Scheme  GLBDF2  AB2TR  IMR  

AB2  eBDF3  
\(\epsilon _T\)  \(3.808\cdot 10^{5}\)  \(1\cdot 10^{5}\)  \(1\cdot 10^{5}\)  \(3.032\cdot 10^{5}\) 
\(N_t\)  6231  6231  6231  6231 
\(t_1\)  \(>490\)  483.46  483.48  483.46 
\(\epsilon _T\)  \(4.659\cdot 10^{6}\)  \(1\cdot 10^{6}\)  \(1\cdot 10^{6}\)  \(3.010\cdot 10^{6}\) 
\(N_t\)  13,474  13,474  13,474  13,474 
\(t_1\)  485.90  482.09  482.09  482.09 
\(\epsilon _T\)  \(4.780\cdot 10^{7}\)  \(1\cdot 10^{7}\)  \(1\cdot 10^{7}\)  \(3.003\cdot 10^{7}\) 
\(N_t\)  29,053  29,053  29,053  29,053 
\(t_1\)  482.31  481.80  481.80  481.80 
From these results we see that the combination eBDF3IMR is as accurate as AB2TR. This is due to the character of the problem, which is only weakly nonlinear, implying a near equivalence of the TR and IMR schemes. Indeed, for the tight LTE tolerances \(\epsilon _T\) the TR and IMR schemes are virtually indistinguishable.
The number of the time steps \(N_t\) and the magnetization length interval \([{\mathbf {m}}_{\min },{\mathbf {m}}_{\max }]\) for (1) for the anisotropic spherical particle reversal problem with \(\alpha =0.01\) as a function of \(k_1\) with \(\epsilon _T=10^{5}\). The integration is done over the interval \(T=[0,t_{k_1}]\)
\(k_1\)  Scheme  GLBDF2  AB2TR  IMR  

\(t_{k_1}\)  AB2  eBDF3  
0  \(N_t\)  20,787  12,321  12,323  17,798 
1000  \(\begin{array}{c}{\mathbf {m}}_{\min } \\ {\mathbf {m}}_{\max }\end{array}\)  \(\begin{array}{c} 0.998045 \\ 1.000000\end{array}\)  \(\begin{array}{c}0.999544 \\ 1.000000\end{array}\)  1.000000  
0.4  \(N_t\)  21,071  12,486  12,464  17,915 
1100  \(\begin{array}{c}{\mathbf {m}}_{\min } \\ {\mathbf {m}}_{\max }\end{array}\)  \(\begin{array}{c}0.998288 \\ 1.000000\end{array}\)  \(\begin{array}{c}0.999360 \\ 1.000083\end{array}\)  1.000000  
1  \(N_t\)  19,135  11,310  11,209  15,768 
1250  \(\begin{array}{c}{\mathbf {m}}_{\min } \\ {\mathbf {m}}_{\max }\end{array}\)  \(\begin{array}{c} 0.998386 \\ 1.000001\end{array}\)  \(\begin{array}{c}0.999360 \\ 1.000069\end{array}\)  1.000000  
2.5  \(N_t\)  19,501  11,665  11,530  15,926 
1250  \(\begin{array}{c}{\mathbf {m}}_{\min } \\ {\mathbf {m}}_{\max }\end{array}\)  \(\begin{array}{c} 0.997159 \\ 1.000001\end{array}\)  \(\begin{array}{c}0.997707 \\ 1.000001\end{array}\)  1.000000  
4  \(N_t\)  18,396  11,092  10,970  15,204 
1250  \(\begin{array}{c}{\mathbf {m}}_{\min } \\ {\mathbf {m}}_{\max }\end{array}\)  \(\begin{array}{c} 0.997139 \\ 1.000002\end{array}\)  \(\begin{array}{c}0.997560 \\ 1.000001\end{array}\)  1.000000 
Next, we report the accuracy of the first zero crossing in the z component of the magnetization for \(k_1=4\) (i.e. the smallest time \(t_1\) for which \(m_z(t_1)=0\)). We do this with respect to two different criteria: fixed number of time steps and fixed execution time for all tested integrators. The first criterion reflects the quality of a predictor, i.e. how the distribution of a prescribed number of the integration points that it produces affects the solution accuracy. The second criterion tests whether the computational overhead associated with adaptive step selection leads to a more accurate method than computationally cheaper fixed step counterpart within a set amount of wall clock time.
The computed minimum values of \(t_1\) for which \(m_z(t_1)=0\) for the anisotropic spherical particle reversal problem with \(\alpha =0.01\), \(k_1=4\) as a function of the number of time steps \(N_1\)
Scheme  GLBDF2  AB2TR  IMR  

AB2  eBDF3  
\(\epsilon _T\)  \(4.083\cdot 10^{5}\)  \(1\cdot 10^{5}\)  \(9.660\cdot 10^{6}\)  \(2.607\cdot 10^{5}\) 
\(N_1\)  4142  4142  4142  4142 
\(t_1\)  \(>150\)  145.160  145.144  145.136 
\(\epsilon _T\)  \(4.690\cdot 10^{6}\)  \(1\cdot 10^{6}\)  \(9.640\cdot 10^{7}\)  \(2.558\cdot 10^{6}\) 
\(N_1\)  8967  8967  8967  8967 
\(t_1\)  145.100  145.063  145.060  145.059 
\(\epsilon _T\)  \(4.782\cdot 10^{7}\)  \(1\cdot 10^{7}\)  \(9.642\cdot 10^{8}\)  \(2.547\cdot 10^{7}\) 
\(N_1\)  19,336  19,336  19,336  19,336 
\(t_1\)  145.051  145.044  145.043  145.042 
For the second criterion (fixed execution time) we compare only the adaptive and the fixed step versions of the IMR integrator. We consider again three different levels of precision for adaptive IMR and adjust the number of time steps for the fixed step variant so that both methods have the same execution time to perform the integration over the time interval [0, 500]. In Table 5 we report the values of \(t_1\) at which the first zero crossing \(m_z(t_1)\) occurs. From these figures it can be concluded that fixed step IMR completes more steps in a set amount of time (due to an increased computational cost per step in the adaptive method), but still has lower accuracy, justifying the additional costs of the adaptive version. We remark that the number of steps reported in Table 5 suggest that the computational cost of an adaptive step is only \(5{}10\%\) larger than that of a fixed step. This is expected in the case of nonlinear problems, with the cost of computing a predictor consists of a matrixvector multiplication, while the cost of the corrector is dominated by multiple linear system solves that are costly.
The computed minimum values of \(t_1\) for which \(m_z(t_1)=0\) for the anisotropic spherical particle reversal problem with \(\alpha =0.01\), \(k_1=4\) for fixed step and adaptive IMR method under the condition of the same execution time
Method  eBDF3IMR  Fixed step IMR  

\(\epsilon _T\)  \(N_t\)  \(t_1\)  \(N_t\)  \(t_1\) 
\(10^{4}\)  7426  145.297  7459  146.896 
\(10^{5}\)  15,652  145.089  16,951  145.112 
\(10^{6}\)  33,439  145.049  35,238  145.063 
The energy \(E={\mathbf {m}}\cdot ({\mathbf {h}}_{\text{ ap }}+{\mathbf {h}}_\mathrm{mc})\) for the anisotropic spherical particle reversal problem at \(t=600\) with \(\alpha =0.01\) and \(k_1=4\), as the function of the LTE tolerance \(\epsilon _T\)
\(\epsilon _T\)  GLBDF2  AB2TR  eBDF3IMR 

\(10^{4}\)  \(\,3.7685\)  \(\,3.8038\)  \(\,4.0000\) 
\(10^{5}\)  \(\,3.9771\)  \(\,3.9817\)  \(\,4.0000\) 
\(10^{6}\)  \(\,3.9976\)  \(\,3.9981\)  \(\,4.0000\) 
5.2 The PDE Example with an Analytical Solution
5.3 The NIST \(\mu \)MAG Standard Problem #4
We compare the accuracy of the solutions obtained by the adaptive IMR scheme to the results from [12] obtained by the IMR scheme with fixed step sizes and finite difference method applied to spatial discretisation (magnetostatic effects are handled by the FFT and monolithically coupled to the LLG model). In Fig. 10 we present the mean magnetization and the time step sizes \(\Delta _n\) generated by the proposed adaptive scheme for the field \({\mathbf {h}}_{\text{ ap }, 1},\) while Fig. 11 plots the same results for \({\mathbf {h}}_{\text{ ap }, 2}.\)
When compared to adaptive BDF2 and TR methods, IMR selects significantly smaller steps during the initial relaxation phase (for \(t<0\)). This effect may be attributed to order reduction observed in IMR when applied to very stiff problems. For \(t>0\) time steps selected by all three methods are commensurate. We notice that recently introduced adaptive highorder explicit midpoint method [7] keeps the step size fairly constant both in the highlighted time interval [100, 200] and during the entire simulation for the case \({\mathbf {h}}_{\text{ ap }, 1}.\) The time step of \(200\,fs\) reported in [7] is between 3 and 20 times smaller than the step sizes taken by the eBDF3IMR method for \(t>0\) (cf. Fig. 10).
The comparison of the computational cost per time step between the explicit method from [7] and the coupled FEM/BEM method is not straightforward. Results from Table 1 in [7] indicate approximately between 25 and 40 total (effective and stray) field evaluations per time step. If we assume that the cost of one field computation is proportional to \(C_{mv}\), we can conclude that the overall computational times of both methods are broadly comparable in this particular case.^{2}
The maximum pointwise error (47) in the magnetization length observed during the simulation was in both cases \(4\cdot 10^{10}\), in line with the adopted Newton’s tolerance.
6 Conclusions
In this paper we have introduced an adaptive IMR method. Using the example domain of micromagnetic problems we have shown that the method conserves the magnetisation length and accurately reproduces the energy balance (i.e. it preserves the geometric properties of the solution even for loose LTE tolerances). The method uses a computationally efficient and reliable method for the LTE estimation in the IMR and is based on the use of a thirdorder explicit method as the predictor. In our experiments the selected step sizes of the adaptive IMR were commensurate to the other commonly used secondorder methods, while the geometric integration properties were preserved. We also remark that geometric integrator properties of IMR are relevant for other problems (for example, if the Navier–Stokes problem is solved, the kinetic energy \({\mathbf {u}}^t{\mathbf {u}}\) will be correctly reproduced independently of the step size, where \({\mathbf {u}}\) is the fluid velocity [3, p. 651], provided that an appropriate spatial discretisation is used, see [41]). This makes the proposed adaptive integrator suitable choice for a much wider class of problems than studied in this paper.
The codes used to produce the results in Sect. 5.1 are publicly available at https://github.com/davidshepherd7/LandauLifshitzGilbertODEmodel, and for the PDE examples from Sects. 5.2 and 5.3 at https://github.com/davidshepherd7/oomphlibmicromagnetics.
Footnotes
Notes
References
 1.Ascher, U., Petzold, L.: Computer Methods for Ordinary Differential Equations and DifferentialAlgebraic Equations. SIAM, Philadelphia (1998)CrossRefzbMATHGoogle Scholar
 2.Ascher, U., Mattehij, R., Russell, R.: Numerical Solution of Boundary Value Problems for Ordinary Differential Equations. SIAM, Philadelphia (1995)CrossRefGoogle Scholar
 3.Gresho, P.M., Sani, R.L.: Incompressible Flow and the Finite Element Method: AdvectionDiffusion and Isothermal Laminar Flow, 1st edn. Wiley, Chichester (1998)zbMATHGoogle Scholar
 4.Gresho, P.M., Griffiths, D.F., Silvester, D.J.: Adaptive timestepping for incompressible flow part I: scalar advectiondiffusion. SIAM J. Sci. Comput. 30(4), 2018–2054 (2008)MathSciNetCrossRefzbMATHGoogle Scholar
 5.Kay, D., Gresho, P., Griffiths, D., Silvester, D.: Adaptive time stepping for incompressible flow; part II: Navier–Stokes equations. SIAM J. Sci. Comput. 32, 111–128 (2010). https://doi.org/10.1137/070688018 MathSciNetCrossRefzbMATHGoogle Scholar
 6.Elman, H., Mihajlović, M., Silvester, D.: Fast iterative solvers for buoyancy driven flow problems. J. Comput. Phys. 230, 3900–3914 (2011). https://doi.org/10.1016/j.jcp.2011.02.014 MathSciNetCrossRefzbMATHGoogle Scholar
 7.Exl, L., Mauser, N., Schrefl, T., Suess, D.: The extrapolated explicit midpoint scheme for variable order and step size controlled integration of the Landau–Lifshitz–Gilbert equation. J. Comput. Phys. 346, 14–24 (2017). https://doi.org/10.1016/j.jcp.2017.06.005 MathSciNetCrossRefzbMATHGoogle Scholar
 8.Hindmarsh, A.C., Serban, R.: User Documentation for \(\mathtt {cvode}\) v2.7.0 (2012)Google Scholar
 9.MathWorks, ode45 (2014). http://www.mathworks.co.uk/help/matlab/ref/ode45.html
 10.Aharoni, A.: Introduction to the Theory of Ferromagnetism, 2nd edn. Oxford University Press, Oxford (1996)Google Scholar
 11.Shepherd, D., Miles, J., Heil, M., Mihajlović, M.: Discretisation induced stiffness in micromagnetic simulations. IEEE Trans. Magn. 50, 7201304 (2014). https://doi.org/10.1109/TMAG.2014.2325494 CrossRefGoogle Scholar
 12.d’Aquino, M., Serpico, C., Miano, G.: Geometrical integration of Landau–Lifshitz–Gilbert equation based on the midpoint rule. J. Comput. Phys. 209(2), 730–753 (2005). https://doi.org/10.1016/j.jcp.2005.04.001 MathSciNetCrossRefzbMATHGoogle Scholar
 13.Shepherd, D.: Numerical methods for dynamical micromagnetics, Ph.D. thesis, The University of Manchester (2015)Google Scholar
 14.Fidler, J., Schrefl, T.: Micromagnetic modelling—the current state of the art. J. Phys. D Appl. Phys. 33(15), R135–R156 (2000). https://doi.org/10.1088/00223727/33/15/201 CrossRefGoogle Scholar
 15.Szambolics, H., BudaPrejbeanu, L., Toussaint, J., Fruchart, O.: A constrained finite element formulation for the Landau–Lifshitz–Gilbert equations. Comput. Mater. Sci. 44, 253–258 (2008). https://doi.org/10.1016/j.commatsci.2008.03.019 CrossRefzbMATHGoogle Scholar
 16.Fischbacher, T., Fangohr, H.: Continuum multiphysics modeling with scripting languages: the Nsim simulation compiler prototype for classical field theory, arXiv (2009) 1–50. arXiv:0907.1587v1
 17.Hairer, E., Morsett, S.P., Wanner, G.: Solving Ordinary Differential Equations I: Nonstiff Problems, 2nd edn. Springer, Berlin (1991)CrossRefGoogle Scholar
 18.Coey, J.: Magnetism and Magnetic Materials, 1st edn. Cambridge University Press, Cambridge (2010)CrossRefGoogle Scholar
 19.Elman, H., Silvester, D., Wathen, A.: Finite Elements and Fast Iterative Solvers, 2nd edn. Oxford University Press, Oxford (2014)CrossRefzbMATHGoogle Scholar
 20.Bartels, S., Prohl, A.: Convergence of an implicit finite element method for the Landau–Lifshitz–Gilbert equation. SIAM J. Numer. Anal. 44(4), 1405 (2006). https://doi.org/10.1137/050631070 MathSciNetCrossRefzbMATHGoogle Scholar
 21.Cimrák, I.: A survey on the numerics and computations for the Landau–Lifshitz equation of micromagnetism. Arch. Comput. Methods Eng. 15(3), 277–309 (2008). https://doi.org/10.1007/s1183100890212 MathSciNetCrossRefzbMATHGoogle Scholar
 22.Suess, D., Tsiantos, V., Schrefl, T., Fidler, J., Scholtz, W., Forster, H., Dittrich, R., Miles, J.: Time resolved micromagnetics using a preconditioned time integration method. J. Magn. Magn. Mater. 248(2), 298–311 (2002). https://doi.org/10.1016/S03048853(02)003414 CrossRefGoogle Scholar
 23.Ying, L.: Infinite Element Methods. Springer, Berlin (1995)zbMATHGoogle Scholar
 24.Yang, B.: Numerical studies of dynamical micromagnetics, Ph.D. thesis, University of California (1997)Google Scholar
 25.Fredkin, D., Koehler, T.: Hybrid method for computing demagnetizing fields. IEEE Trans. Magn. 26(2), 415–417 (1990)CrossRefGoogle Scholar
 26.Bottauscio, O., Chiampi, M., Manzin, A.: A finite element procedure for dynamic micromagnetic computations. IEEE Trans. Magn. 44(11), 3149–3152 (2008). https://doi.org/10.1109/TMAG.2008.20016 CrossRefGoogle Scholar
 27.Knittel, A., Franchin, M., Bordignon, G., Fischbacher, T., Bending, S., Fangohr, H.: Compression of boundary element matrix in micromagnetic simulations. J. Appl. Phys. 105(7), 07D542 (2009)CrossRefGoogle Scholar
 28.Borm, S., Grasedyck, L.: HLib. http://www.hlib.org/
 29.Atkinson, K.E., Han, W., Stewart, D.E.: Numerical Solution of Ordinary Differential Equations, 1st edn. Wiley, Hoboken (2009)CrossRefzbMATHGoogle Scholar
 30.Lee, J., Nam, J., Pasquali, M.: A new stabilization of adaptive step trapezoid rule based on finite difference interrupts. SIAM J. Sci. Comput. 37, A725–A746 (2015). https://doi.org/10.1137/140966915 MathSciNetCrossRefzbMATHGoogle Scholar
 31.Simo, J., Armero, F.: Unconditional stability and longterm behaviour of transient algorithms for the incompressible Navier–Stokes and Euler equations. Comput. Methods Appl. Mech. Eng. 111, 111–154 (1994). https://doi.org/10.1016/00457825(94)900426 CrossRefzbMATHGoogle Scholar
 32.SymPy: Python library for symbolic mathematics. http://www.sympy.org/
 33.Shepherd, D.: symbdf3.py. https://github.com/davidshepherd7/LandauLifshitzGilbertODEmodel/blob/master/algebra/symbdf3.py
 34.Iserles, A.: A First Course in the Numerical Analysis of Differential Equations, 2nd edn. Cambridge University Press, Cambridge (2009)zbMATHGoogle Scholar
 35.Gilbert, T.: A phenomenological theory of damping in ferromagnetic materials. IEEE Trans. Magn. 40(6), 3443–3449 (2004). https://doi.org/10.1109/TMAG.2004.836740 MathSciNetCrossRefGoogle Scholar
 36.Heil, M., Hazel, A.L.: oomphlib—An objectoriented multiphysics finiteelement library. In: FluidStructure Interaction, Lecture Notes in Computational Science and Engineering, vol. 53, pp. 19–49. Springer, Berlin (2006)Google Scholar
 37.Mallinson, J.: Damped gyromagnetic switching. IEEE Trans. Magn. 36(4), 1976–1981 (2000)CrossRefGoogle Scholar
 38.Jeong, D., Kim, J.: An accurate and robust numerical method for micromagnetics simulations. Curr. Appl. Phys. 14(3), 476–483 (2014). https://doi.org/10.1016/j.cap.2013.12.028 CrossRefGoogle Scholar
 39.Fuwa, A., Ishiwata, T., Tsutsumi, M.: Finite difference scheme for the Landau–Lifshitz equation. Proc. CzechJpn. Semin. Appl. Math. 29, 107–113 (2006)Google Scholar
 40.McMichael, B.: \(\mu \)MAG – Micromagnetic modelling activity group. http://www.ctcms.nist.gov/rdm/mumag.org.html
 41.Cliffe, K.: On conservative finite element formulations of the inviscid Boussinesq equations. Int. J. Numer. Methods Fluids 1(2), 117–127 (1981)MathSciNetCrossRefzbMATHGoogle Scholar
Copyright information
Open AccessThis article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.