## 5 Examples
### Allen-Cahn Equation
Figure 6 shows the solutions of both schemes for solving the phase field evolution (Figure 6a) and for modeling interface position over time (Figure 6b). As can be observed, both schemes produce visually identical results. The quantitative differences in the numerical results are minimal and can be attributed to floating point errors that accumulate over the process of time integration. However, there is a considerable difference between the analytical and the numerical interface velocity, as visible in Figure 6b. The reason for this discrepancy is grid friction, which results from the limited numerical resolution of the diffuse interface profile and could be reduced by increasing the dimensionless ratio \(\xi/\Delta x=1.5\), where \(\Delta x\) denotes the grid spacing [61; 62]. Grid friction and pinning during stationary interface motion has been studied previously, for instance, by [75; 76]. So far, this detrimental effect has been only studied using finite-difference-based schemes. It relates to metastabilities that result from a broken translational invariance of the discrete numerical schemes [61; 62]. As a consequence, the current interface velocity oscillates as the center of the interface passes one grid point after the other. If, further, the time discretization error is small enough, the average interface velocity turns out to be considerably below the expectation. With decreasing phase-field width, we obtain increasingly larger deviations of the average velocity as well as increasing larger oscillations. This culminates in a vanishing velocity, where the phase field is pinned to the computational grid. Interestingly, spurious grid friction and pinning can be eliminated in

Figure 6: Solution of the one-dimensional Allen–Cahn equation using the finite difference and finite element method. (**a**) Evolution of the phase front at \(t=100\) s with respect to the initial condition. (**b**) Comparison of finite difference and finite element solutions to the analytical solution given by Equation (20). fast Fourier and finite difference implementation of the Allen-Chan equation, using the newly proposed sharp phase field method [77; 78]. For phase field models, which use a double-obstacle potential instead of the double-well potential, a comparable technique was proposed by [PERSON] [79]. It is quite interesting to note that this discretization error, which is very characteristic for the Allen-Cahn equation, turns out to be so very similar for the two different numerical schemes in this case. This again highlights the close relationship of the two different numerical schemes. Furthermore, we point out that computational resource usage differs considerably. Table 2 reports some descriptive statistics on the performance of both implementations. These differences in run times as well as memory consumption can be attributed to multiple factors. First, the nonlinear right-hand side changes each time step; thus, assembly has to be performed dynamically for the finite element method. The finite difference method in contrast can simply rely on point-wise evaluation of the strong form instead of numerically computing the weak form integrals. Secondly, the finite difference method does not need to perform any mapping during the time step as no assembly is required. During computation of the right-hand side integral, this is a necessity for the finite element method. The largest performance discrepancy, however, can be attributed to the fact that the finite difference method can operate in a matrix-free manner due to the Cartesian grid it is applied on. As all vertices are equispaced, there exists one global stencil that can be applied on each vertex independent of all other members of the grid. The finite element method, in contrast, uses the grid topology to accumulate the weak form integrals into corresponding entries of the global system matrices and vectors. Thus, it always produces a typically very sparse global system that cannot be vectorized similarly.