1 Introduction

Modern scientific computing involves complex geometries with various materials. Stable and accurate numerical schemes are often required to simulate physical or biological phenomena in complex geometry. The covariant derivative emerges in a complex geometry such as a curved surface, which is distinguishably different from the widely-used Euclidean derivative in the classical numerical differentiation methods.

1.1 Covariant Formulation

Suppose that \(x^i\) is the set of axes for a domain of two-dimensional (2D) surface. Let \(\frac{\partial} {\partial x^i}\) be the tangent vector of the axis. In the Euclidean domain, the magnitude and direction of the tangent vector \(\frac{\partial}{\partial x^i}\) can be made uniform across the surface. However, the tangent vector does not have the same magnitude and direction on a curved surface. Thus, comparing vectors on a curved domain should reflect the change of the axis. For this reason, a covariant derivative is needed on the curved surface where the axis changes accordingly. Therefore, the metric tensor and Christoffel symbols of the domain emerge because they represent the magnitude and rotation of the curved axes’ tangent vectors, respectively.

Consider a vector \({\mathbf {u}}\) on a 2D curved surface \(\Omega \). Suppose orthogonal curved axes \(x^i\) exist on the surface of domain for \(i=1,2\). The vector \({\mathbf {u}}\) is expressed as the expansion of the tangent vectors as follows:

$$\begin{aligned} {\mathbf {u}} = {\widetilde{u}}^1 \frac{\partial }{\partial x^1} + {\widetilde{u}}^2 \frac{\partial }{\partial x^2} . \end{aligned}$$
(1)

Differentiating Eq. (1) with respect to the \(x^j\)-axis, we obtain

$$\begin{aligned} \frac{\partial {\mathbf {u}}}{\partial x^j} = \sum _{i=1}^2 \left[ \frac{\partial {\widetilde{u}}^i}{\partial x^j} \frac{\partial }{\partial x^i} + {\widetilde{u}}^i \frac{\partial }{ \partial x^j} \left( \frac{\partial }{\partial x^i} \right) \right] . \end{aligned}$$
(2)

The first component in Eq. (2) is the directional derivative. The second component in Eq. (2) is the sum of two components: a component in the tangent plane and another component along the surface normal vector, denoted by \({\mathbf {k}}\). Then, the second component in Eq. (2) is expressed as follows:

$$\begin{aligned} \frac{\partial ^2}{\partial x^i \partial x^j} = \sum _{k=1}^2 \Gamma ^k_{ij} \frac{\partial }{\partial x^k} + {\mathbf {k}} , \end{aligned}$$
(3)

where \(\Gamma ^k_{ij}\) is known as the Christoffel symbol of the second kind to measure how the basis vector changes as it marches along each coordinate axis. By projecting Eq. (3) onto the surface, we obtain the following expression of the covariant derivative [30]:

$$\begin{aligned} \varvec{\nabla }_j {\mathbf {u}} = \varvec{\nabla }_{x^j} {\mathbf {u}} = \sum _{i=1}^2 \left( \frac{\partial {\widetilde{u}}^i}{\partial x^j} + \sum _{k=1}^2 \Gamma ^{i}_{kj} {\widetilde{u}}^{k} \right) \frac{\partial }{\partial x^{i}}, \end{aligned}$$
(4)

where we exchange indices i and k for the second component in Eq. (4) for convenience. We introduce the bold symbol \(\varvec{\nabla }_j\) to represent the covariant derivative along the axis \(x^j\). \(\frac{\partial u^i} {\partial x^j} \) can be viewed as the directional derivative of \(u^i\) along the axis \(x^j\). Consider a vector \({\mathbf {v}}\) expressed in the two axes of the domain as follows:

$$\begin{aligned} {\mathbf {v}} = {\widetilde{v}}^1 \frac{\partial }{\partial x^1} + {\widetilde{v}}^2 \frac{\partial }{\partial x^2} . \end{aligned}$$

The covariant derivative along the vector \({\mathbf {v}}\) can be formulated using the linearity of the covariant derivative as follows:

$$\begin{aligned} \varvec{\nabla }_{{\mathbf {v}}} {\mathbf {u}} = {\widetilde{v}}^1 \varvec{\nabla }_{1} {\mathbf {u}} + {\widetilde{v}}^2 \varvec{\nabla }_{2} {\mathbf {u}} . \end{aligned}$$
(5)

Equation (5) is also referred to as the Levi‐Civita connection which preserves the Riemann metric and is torsion-free [31].

The primary difficulty when computing Eq. (4) for the general 2D surface is to find a continuous and differentiable curved axis \(x^{i}\). This task is computationally and analytically challenging, particularly in regions with various curvatures or nonuniform anisotropic conductivity. The coordinate system should be constructed individually for every domain, even for the same PDE. For example, the spherical coordinate system for PDEs on the sphere provides the analytically-exact directional derivatives and Christoffel symbols in Eq. (4). However, a deformed sphere requires the new parametrization of the coordinate system, which is challenging. More practical applications to complex 2D surfaces such as human faces or biological tissues may not have a continuous coordinate system, which could be beyond the scope of the general mathematical expression.

The second difficulty involves accurately computing the corresponding metric tensor \(g_{ij}\) and the Christoffel symbol \(\Gamma ^{k}_{ij}\). The error of the geometric factors is often required to be sufficiently small compared to the discretization error. Otherwise, the error of the geometric factors significantly deteriorates the solution to the equations. The metric tensor is defined as the inner product of the tangent vectors as follows:

$$\begin{aligned} g_{i j} = \left( \frac{\partial }{\partial x^{i}}, \frac{\partial }{\partial x^{j}} \right) , \end{aligned}$$

where \(g_{ii}\) represent the square of the magnitude of the tangent vector of the \(x^i\)-axis. For example, \(g_{ij} = 0\) for \(i \ne j\) for the orthogonal axis. Correspondingly, the Christoffel symbol can be computed by differentiating the metric tensor \(g_{ij}\) as follows [2]:

$$\begin{aligned} \Gamma ^{k }_{ i j} = \sum _{m=1}^2 \frac{g^{k m}}{2} \left( \frac{\partial g_{m i}}{\partial x^{j}} + \frac{\partial g_{ m j}}{\partial x^{ i}} - \frac{\partial g_{i j}}{\partial x^{m}} \right) , \end{aligned}$$
(6)

where the tensor \(g^{ij}\) is the inverse of \(g_{ij}\). For example, \(g^{ii} = 1/g_{ii}\) and \(g_{ij}=0\) for \(i \ne j\) for the orthogonal axis. Computing the metric tensor is also challenging because it requires computing the length of the curved axis. An invalid construction of the curved axis or inaccurate computation of the length of the axis yields the Christoffel symbols with non-negligible errors. Inaccurate metric tensors or Christoffel symbol functions appear as corrupted coefficients of the PDEs, which cause nonphysical dynamics.

1.2 Applications of Covariant Formulation

The covariant derivative has been a crucial tool in image processing and surface PDEs. Recent works on the computation and application of covariant derivatives include the computation of covariant derivatives by discrete connection on a triangulated 2-manifold [27], the application of covariant derivatives to image regularization [4], and the reformation of covariant derivatives in Cartesian coordinates in the context of finite element methods [32].

The previous numerical schemes, which solve the PDEs with covariant derivatives, can be summarized as follows. The first type of numerical schemes computes the geometric factors of \(g_{ij}\) and \(\Gamma ^{k}_{ij}\) directly [10, 28, 33]. This method is similar to the classical Euclidean numerical scheme except for the geometric factors. For diffusion equations, it is equivalent to solving the Laplace‐Beltrami operator. For shallow water equations, using covariant derivatives has been one of the most popular methods for the spherical coordinate system on the sphere in recent years [25, 36, 39]. However, the stability and accuracy of the numerical scheme significantly depend on the accuracy and smoothness of the metric tensor and Christoffel symbols, particularly if the geometric factors cannot be derived analytically [42]. The geometric singularity is another critical problem, particularly for closed 2D surfaces such as a sphere.

The second type of numerical schemes for solving equations on curved surfaces is to use the surface’s ambient space. The ambient space is the space surrounding the domain. Using the ambient space either increases the dimensionality of the space or expands the given domain [20, 23, 38, 43]. For this scheme, a set of fixed axes is constructed by increasing or expanding the surface’s domain. Consequently, geometric factors are not required. The numerical scheme is similar to those in the Euclidean space, except for the extra operation that projects or extrapolates variables into the domain. However, the problem of dimensionality emerges for this type of numerical schemes.

Projecting vectors or the gradient onto the tangent plane has attracted considerable attention because of its simplicity. However, these projection methods seem to have intrinsic limitations in terms of the stability and accuracy depending on the surface type [5, 6, 22, 24]. Exterior calculus has been introduced to tackle this problem [26, 35], especially with finite-element approaches, known as finite-element exterior calculus (FEEC) [3, 21]. The exterior calculus approach has been known to be efficient in analyzing the stability of a scheme and identifying covariant derivatives. Moreover, spin-weighted spherical harmonics (SWSH) has been used for PDEs on the sphere [1]. SWSH, as the generalization of harmonics on the sphere, was implemented in the context of the spectral method to solve scalar and vector advection equations and 2 + 1 Maxwell’s equations on a deformed sphere [7].

1.3 Advantages and Limitations

We propose a novel scheme to compute covariant derivatives in the context of spectral/hp and finite element methods. The proposed scheme uses orthonormal basis vectors constructed at each grid point, called the moving frame. By moving frame, it means a set of orthonormal vectors \(\{{\mathbf {e}}_1, {\mathbf {e}}_2,{\mathbf {e}}_3 \}\) at each grid point of the domain as follows. For \(1 \leqslant i,j \leqslant 3\), the tangent vectors of each moving frame satisfy the following properties:

$$\begin{aligned} {\mathbf {e}}_i \cdot {\mathbf {e}}_j = \delta _{ij} , ~~~~ \Vert {\mathbf {e}}_i \Vert = 1, \end{aligned}$$

where \(\delta _{ij}\) is the Kronecker delta. Moving frames are plural when representing orthonormal basis vectors in the domain, denoted by \({\mathbf {e}}_i\) by omitting the index i and the corresponding location. On a 2D surface, \({\mathbf {e}}_1\) and \({\mathbf {e}}_2\) lie on the tangent plane, whereas \({\mathbf {e}}_3\) is aligned along the surface normal vector \({\mathbf {k}}\). When one vector for a moving frame should be mentioned, \({\mathbf {e}}_i\) is called the ith tangent vector with a specific index i for \(1 \leqslant i \leqslant 3\). We suppose that the domain is locally Euclidean such that any region of the domain can be approximated as a Euclidean domain. A moving frame can be built at every point in the domain. In addition, we suppose that \({\mathbf {e}}_i\) is differentiable in each curved element but may not be differentiable across the interfaces. Subsequently, moving frames do not need to be differentiable in the entire domain.

Moving frames have been successfully used as numerical solutions to various PDEs on 2D curved surfaces, such as conservation laws, diffusion equations, shallow water equations, and Maxwell’s equations [13, 14, 16, 17]. In the previous works [13, 14, 16, 17], the covariant derivative is computed in the weak Galerkin method, and the metric tensor or Christoffel symbols are not required. Integration by part either eliminates the geometric factors or replaces them with the compensation of Euclidean divergence or curl of moving frames. Therefore, the direct computation of covariant derivatives with moving frames should be naturally sought after without explicitly computing the metric tensor. This scheme can be similarly implemented in the context of the finite difference or finite volume methods for complex domains.

The proposed scheme has the following advantages. First, the covariant derivative can be computed without constructing any analytic curved axis. Thus, this proposed scheme can be effective for any complex domain where a curved axis cannot be analytically constructed. Complex geometry includes closed, irregular, or non-convex surfaces. Second, the new scheme employs a simple pre-processing to construct the discontinuous moving frames across the interfaces of curved or regular elements. Consequently, geometric singularities disappear to achieve almost-optimal exponential high-order convergence for any differential operator.

However, the computational efficiency of the proposed scheme is not significantly different from that of the covariant formulation. The most crucial factor in determining computational efficiency is the space dimension of the domain because it is critical to the scalability of the numerical scheme. For example, the covariant formulation and the proposed scheme with moving frames have the same basis dimension as 2D curved surfaces. Any scheme using the ambient space of the domain increases the basis dimension up to three.

This paper provides the convergence results of the sphere only for differential operators. Convergence results are compared with those by covariant formulation and spherical moving frames. The comparison for a more complex geometry is not included for two reasons. First, deriving the accurate metric tensor and Christoffel symbol for a complex domain is challenging, analytically and computationally, even for a relatively simple geometry other than the sphere and plane. Second, the proposed scheme is applied to a curved or regular element obtained from the tessellation of the domain. Therefore, the proposed scheme is not affected by the global shape of the domain. Instead, the accuracy of the scheme is only affected by the alignment of moving frames and the curvature in each element. From this perspective, the sphere can be not much different from a complex 2D surface in terms of the application and accuracy of the proposed scheme. In order to demonstrate this feature of the proposed scheme, the Helmholtz-Hodge decomposition (HHD) is considered for a complex 2D surface like an atrium or bunny.

1.4 Order of the Paper

This paper is organized as follows: Sect. 2 explains the mathematical scheme to compute covariant derivatives with moving frames. Section 3 provides examples of covariant derivatives on the sphere. Section 4 explains the algorithm used to construct local moving frames. In Sect. 5, we perform several test cases on a sphere to demonstrate the exponential convergence of the proposed scheme. Section 6 demonstrates the application of the proposed scheme using the HHD scheme on a bunny and an atrium. In Sect. 7, we conclude this paper with a discussion on the theory developed and the result of the proposed numerical scheme.

2 Covariant Derivative by Orthonormal Moving Frames

Consider a sufficiently smooth 2D curved surface, denoted by \(\Omega \). Let \(\Omega _{\text {e}}\) be the tessellation of the surface \(\Omega \), such that

$$\begin{aligned} \Omega = \cup \Omega _{\text {e}} \text{ and } \Omega _i \cap \Omega _j = \varnothing ~~\text{ if } ~ i \ne j , \end{aligned}$$

where the empty set \(\varnothing\) means that the common area between different elements is zero, excepts lines or points in common. Suppose that each element is locally Euclidean. Moving frames \({\mathbf {e}}_i\) are constructed at each point such that each tangent vector \({\mathbf {e}}_i\) for \(1 \leqslant i \leqslant 2\) is differentiable within each element. Let \({\widehat{x}}^i\) be the axis corresponding to the tangent vector \({\mathbf {e}}_i\). Consider a vector \({\mathbf {u}}\) on an element \(\Omega _{\text {e}}\). Expand the vector \({\mathbf {u}}\) in the tangent vectors \({\mathbf {e}}_i\) orthogonal to the surface normal vector as follows:

$$\begin{aligned} {\mathbf {u}} = u^1 {\mathbf {e}}_1+ u^2 {\mathbf {e}}_2. \end{aligned}$$
(7)

Remind that the moving frames are orthonormal. Thus, the magnitude of the curved axis’ tangent vector is incorporated into the coefficients \(u^i\). Differentiating Eq. (7) with respect to the axis \({\widehat{x}}^j\), we obtain

$$\begin{aligned} \frac{\partial {\mathbf {u}}}{\partial {\widehat{x}}^j} = \sum _{i=1}^2 \left[ (\nabla {u}^i \cdot {\mathbf {e}}_j ){\mathbf {e}}_i + {u}^i \frac{\partial {\mathbf {e}}_i}{ \partial {\widehat{x}}^j} \right] . \end{aligned}$$
(8)

The first component in Eq. (8) is the directional derivative, same as in the Euclidean space. The second component corresponds to the effects by the change of the coordinate system. The second component is similar to the covariant derivative formula with the Christoffel symbols, as shown in Eq. (4). However, a different measurement regarding changing axis is required. The orthonormal tangent vector \({\mathbf {e}}_i\) is not a holonomic basis for the domain because the magnitude of the tangent vector is incorporated into the coefficient \({u}^i\), not the basis vectors \({\mathbf {e}}_i\).

The change of moving frames can be measured by the same moving frames as follows [11, 12, 31]. Consider a small change of moving frames \(\text{d} {\mathbf {e}}_i\). This change is a vector meaning that the change of each tangent vector has a direction and magnitude. Then, this change of moving frames can be expanded by the moving frame itself as follows:

$$\begin{aligned} \text{d} {\mathbf {e}}_1&= \omega _{11} {\mathbf {e}}_1 + \omega _{12} {\mathbf {e}}_2 + \omega _{13} {\mathbf {e}}_3, \end{aligned}$$
(9)
$$\begin{aligned} \text{d} {\mathbf {e}}_2&= \omega _{21} {\mathbf {e}}_1 + \omega _{22} {\mathbf {e}}_2 + \omega _{23} {\mathbf {e}}_3, \end{aligned}$$
(10)
$$\begin{aligned} \text{d} {\mathbf {e}}_3&= \omega _{31} {\mathbf {e}}_1 + \omega _{32} {\mathbf {e}}_2 + \omega _{33} {\mathbf {e}}_3, \end{aligned}$$
(11)

where \(\text{d} {\mathbf {e}}_i\) is the vector-valued 1-form, which takes a vector to yield a vector. A scalar-valued 1-form takes a vector to yield a scalar. For example, \(\text{d} {\mathbf {e}}_i ( {\mathbf {e}}_j )\) yields a scalar to measure how \({\mathbf {e}}_i\) changes as it moves along \({\mathbf {e}}_j\). Note that \(\omega _{ij}\) in Eqs. (9)–(11) is also 1-form and is called the connection 1-form. The notation \(\omega _{ij}\) as used popularly in modern era [31, 34] is equivalent to Cartan’s classical notation of \(\omega ^i_j\) [12]. The orthonormality condition of moving frames yields the following equalities for \(1 \leqslant i,j \leqslant 3\):

$$\begin{aligned} \omega _{ii}&= 0, \end{aligned}$$
(12)
$$\begin{aligned} \omega _{ij}&= - \omega _{ji} . \end{aligned}$$
(13)

Then, we have the matrix expression of Eqs. (9)–(11) as follows:

$$\begin{aligned} \left[ \begin{array}{c} \text{d}{\mathbf {e}}_1 \\ \text{d}{\mathbf {e}}_2 \\ \text{d}{\mathbf {e}}_3 \end{array} \right] = \left[ \begin{array}{ccc} 0 &{} \omega _{12} &{} \omega _{13} \\ - \omega _{12} &{} 0 &{} \omega _{23} \\ - \omega _{13} &{} - \omega _{23} &{} 0 \end{array} \right] \left[ \begin{array}{c} {\mathbf {e}}_1 \\ {\mathbf {e}}_2 \\ {\mathbf {e}}_3 \end{array} \right] , \end{aligned}$$
(14)

or we have

$$\begin{aligned} \text{d} [ {\mathbf {e}} ] = [ \omega ] [ {\mathbf {e}} ], \end{aligned}$$
(15)

where the bracket represents that the corresponding quantity is a matrix. In the Cartesian coordinate system (xyz), moving frames are expanded as follows:

$$\begin{aligned} {\mathbf {e}}_i = e^x_i {\mathbf {x}} + e^y_i {\mathbf {y}} + e^z_i {\mathbf {z}} ,~~~~~ 1 \leqslant i \leqslant 3. \end{aligned}$$
(16)

In the matrix form, Eq. (16) is expressed as follows:

$$\begin{aligned} \left[ \begin{array}{c} {\mathbf {e}}_1 \\ {\mathbf {e}}_2 \\ {\mathbf {e}}_3 \end{array} \right] = \left[ \begin{array}{ccc} e_1^{x } &{} e_1^{y} &{} e_1^{z} \\ e_2^{x } &{} e_2^{y} &{} e_2^{z} \\ e_3^{x }&{} e_3^{y} &{} e_3^{z} \end{array} \right] \left[ \begin{array}{c} {\mathbf {x}} \\ {\mathbf {y}} \\ {\mathbf {z}} \end{array} \right] , \end{aligned}$$
(17)

or we have

$$\begin{aligned}{}[ {\mathbf {e}}] = [ A ] \left[ \begin{array}{c} {\mathbf {x}} \\ {\mathbf {y}} \\ {\mathbf {z}} \end{array} \right] , \end{aligned}$$
(18)

where \(({\mathbf {x}}, {\mathbf {y}}, {\mathbf {z}})\) is the tangent vector of the Cartesian coordinate (xyz), respectively. The notation T corresponds to the transpose of the vector or matrix. The matrix [A] consists of the coefficients of moving frames, known as the attitude matrix [31, 34]. Note that the coefficient \((e^x_i, e^y_i, e^z_i)\) represents only the angle of the tangent vector with respect to x, y, and z axes, respectively. Because the tangent vectors are orthonormal, The matrix [A]’s inverse, which exists all the times, is the same as its transpose, that is

$$\begin{aligned}{}[A]^{-1} = [A]^{\text{T}} . \end{aligned}$$
(19)

Then, Eq. (18) can be written as follows:

$$\begin{aligned} \left[ \begin{array}{c} {\mathbf {x}} \\ {\mathbf {y}} \\ {\mathbf {z}} \end{array} \right] = [ A ]^{\text{T}} [ {\mathbf {e}}] . \end{aligned}$$
(20)

In the following proposition, we propose that the covariant derivative can be equivalently computed without the metric tensor.

Proposition 1

The covariant derivative with the Christoffel symbol \(\Gamma ^i_{jk}\) shown in Eq. (4) can be equivalently computed with the connection 1-form \(\omega _{ij}\) without the metric tensor \(g_{ij}\) or Christoffel symbol \(\Gamma ^i_{jk}\) as follows:

$$\begin{aligned} \varvec{\nabla }_{{\mathbf {e}}_j} {\mathbf {u}} = \sum _{i=1}^2 \left[ \nabla {u}^{i} \cdot {\mathbf {e}}_{j} + \sum _{k=1}^2 \omega _{ik} ( {\mathbf {e}}_{j} ) {u}^{k} \right] {\mathbf {e}}_{i}. \end{aligned}$$
(21)

The covariant derivative of \({\mathbf {u}}\) along a vector \({\mathbf {v}}\) is given as follows:

$$\begin{aligned} \varvec{\nabla }_{{\mathbf {v}}} {\mathbf {u}} = {v}^1 \varvec{\nabla }_{{\mathbf {e}}_1} {\mathbf {u}} + {v}^2 \varvec{\nabla }_{{\mathbf {e}}_2} {\mathbf {u}} , \end{aligned}$$
(22)

where \(v^i = {\mathbf {v}} \cdot {\mathbf {e}}_i\). Correspondingly, the covariant derivative along an arbitrary vector computed by Eq. (4) is the same as that computed by Eq. (21).

Proof

By differentiating both sides in Eq. (18), we obtain

$$\begin{aligned} \text{d} [ {\mathbf {e}}] = \text{d} [ A ] [ {\mathbf {x}} ~ {\mathbf {y}}~ {\mathbf {z}}]^{\text{T}} . \end{aligned}$$
(23)

Using Eq. (20), Eq. (23) turns into the following equality:

$$\begin{aligned} \text{d} [ {\mathbf {e}}] = \text{d} [ A ] [A ]^{\text{T}} [ {\mathbf {e}} ] . \end{aligned}$$
(24)

By comparing Eq. (15) with Eq. (24), we obtain the following equality:

$$\begin{aligned}{}[\omega ] = \text{d} [ A ] [ A ]^{\text{T}} , \end{aligned}$$
(25)

or, in the matrix form, we have

$$\begin{aligned} \left[ \begin{array}{ccc} 0 &{} \omega _{12} &{} \omega _{13} \\ - \omega _{12} &{} 0 &{} \omega _{23} \\ - \omega _{13} &{} - \omega _{23} &{} 0 \end{array} \right] = \left[ \begin{array}{ccc} \text{d}e_1^{x } &{} \text{d}e_1^{y} &{} \text{d}e_1^{z} \\ \text{d}e_2^{x } &{} \text{d}e_2^{y} &{} \text{d}e_2^{z} \\ \text{d}e_3^{x }&{} \text{d}e_3^{y} &{} \text{d}e_3^{z} \end{array} \right] \left[ \begin{array}{ccc} e_1^{x } &{} e_2^{x} &{} e_3^{x} \\ e_1^{y } &{} e_2^{y} &{} e_3^{y} \\ e_1^{z }&{} e_2^{z} &{} e_3^{z} \end{array} \right] . \end{aligned}$$
(26)

In the component wise, Eq. (26) can be expressed as follows. For \(1 \leqslant i,j \leqslant 3\), we have

$$\begin{aligned} \omega _{ij} = \text{d} e^x_i e^x_j + \text{d} e^y_i e^y_j + \text{d} e^z_i e^z_j . \end{aligned}$$
(27)

Note that if \(i=j\), \(\omega _{ii} = \) for any vector. Note that \((\text{d} {e^x}, \text{d} {e^y}, \text{d} {e^z})\) and \(\omega _{ij}\) are all 1-form, thus for a specific tangent vector \({\mathbf {e}}_k\), we have the following equality:

$$\begin{aligned} \omega _{ij} ( {\mathbf {e}}_k) = \text{d} e^x_i ( {\mathbf {e}}_k) e^x_j + \text{d} e^y_i ( {\mathbf {e}}_k) e^y_j + \text{d} e^z_i ( {\mathbf {e}}_k) e^z_j . \end{aligned}$$
(28)

The component \((\text{d} e^x_i ( {\mathbf {e}}_k), \text{d} e^y_i ( {\mathbf {e}}_k), \text{d} e^z_i ( {\mathbf {e}}_k))\) can be computed by the following equalities:

$$\begin{aligned} \text{d} e^x_i ( {\mathbf {e}}_k)&= \nabla e^x_i \cdot {\mathbf {e}}_k, \end{aligned}$$
(29)
$$\begin{aligned} \text{d} e^y_i ( {\mathbf {e}}_k)&= \nabla e^y_i \cdot {\mathbf {e}}_k, \end{aligned}$$
(30)
$$\begin{aligned} \text{d} e^z_i ( {\mathbf {e}}_k)&= \nabla e^z_i \cdot {\mathbf {e}}_k . \end{aligned}$$
(31)

Let us introduce the Jacobian matrix, defined as follows:

$$\begin{aligned} J ({\mathbf {e}}_i ) = \left[ \begin{array}{c} \nabla e^{x}_i \\ \nabla e^{y}_i \\ \nabla e^{z}_i \end{array} \right] . \end{aligned}$$
(32)

Then, the above equations can be expressed as the following vector dot product:

$$\begin{aligned} \text{d} {\mathbf {e}}_i ({\mathbf {e}}_k) = \nabla J ({\mathbf {e}}_i ) \cdot {\mathbf {e}}_k . \end{aligned}$$
(33)

Then, the component \(\omega _{ij}\) for \({\mathbf {e}}_k\) is derived as follows:

$$\begin{aligned} \omega _{ij} ( {\mathbf {e}}_k ) = [ e_j^x ~ e_j^y~ e_j^z ] \left[ \begin{array}{c} \nabla e^{x}_i \cdot {\mathbf {e}}_k \\ \nabla e^{y}_i \cdot {\mathbf {e}}_k \\ \nabla e^{z}_i \cdot {\mathbf {e}}_k \end{array} \right] = {\mathbf {e}}_j \cdot \left( \nabla J ({\mathbf {e}}_i ) \cdot {\mathbf {e}}_k \right) . \end{aligned}$$
(34)

Consequently, \(\frac{\partial {\mathbf {e}}_i}{ \partial x^j}\) in Eq. (8) is obtained as follows:

$$\begin{aligned} \frac{\partial {\mathbf {e}}_i}{ \partial {\widehat{x}}^j} = \text{d} [ {\mathbf {e}}_i] ({\mathbf {e}}_j) = \text{d} [A ({\mathbf {e}}_j) ] [A ]^{\text{T}} [ {\mathbf {e}}_i ] . \end{aligned}$$
(35)

By substituting Eq. (35) into Eq. (8), we obtain the expression of the covariant derivative along \({\mathbf {e}}_j\) in Eq. (21).

The magnitude of the axis’ tangent vector is not required in Eq. (21). Instead, it is implicitly incorporated into the coefficient \(u^i\). The tangent vector is only required when initially computing the vector coefficient along each axis. The vector’s coefficients can also be directly obtained from the actual data or analytic expression. Therefore, the Christoffel symbol as the derivative of the metric tensor is not generally required. Nevertheless, the connection 1-form \(\omega _{ij}\) as the derivative of moving frames emerges in Eq. (21).

The computation of the connection 1-form is more convenient than that of the Christoffel symbol \(\Gamma ^i_{jk}\). The connection 1-form is computed by the directional derivative along the unit tangent vector \({\mathbf {e}}_j\), as shown in Eq. (34). On the other hand, in order to derive the Christoffel symbols, a continuous curved axis should be first constructed, followed by the differentiation of the metric tensor along the curved axis in Eq. (6). No metric tensor or Christoffel symbols enables the covariant derivative scheme by Eq. (21) to be applied to complex 2D surfaces such as irregular and non-convex surfaces.

2.1 Summary

A novel numerical scheme of a high-order direct covariant derivative is formulated on curved surfaces. Construct moving frames \(\{{\mathbf {e}}_i\}\) on a smooth curved surface \(\Omega \) such that \({\mathbf {e}}_1\) and \({\mathbf {e}}_2\) lie on the tangent plane when \({\mathbf {e}}_3\) is aligned along the surface normal vector. The velocity vectors \({\mathbf {u}}\) and \({\mathbf {v}}\) on the surface \(\Omega \) are expanded by moving frames as follows:

$$\begin{aligned} {\mathbf {u}}&= u^1 {\mathbf {e}}_1 + u^2 {\mathbf {e}}_2, \\ {\mathbf {v}}&= v^1 {\mathbf {e}}_1 + v^2 {\mathbf {e}}_2 . \end{aligned}$$

The covariant derivative of \(\nabla _{{\mathbf {v}}} {\mathbf {u}}\) is transformed into the following expression using the linearity of the covariant derivative:

$$\begin{aligned} \nabla _{{\mathbf {v}}} {\mathbf {u}} = \nabla _{v^1 {\mathbf {e}}_1 + v^2 {\mathbf {e}}_2} {\mathbf {u}} = v^1 \nabla _{{\mathbf {e}}_1} {\mathbf {u}} + v^2 \nabla _{{\mathbf {e}}_2} {\mathbf {u}} . \end{aligned}$$
(36)

The above equation can be written as follows:

$$\begin{aligned} \nabla _{{\mathbf {v}}} {\mathbf {u}} = \sum _{i=1}^2 v^i \nabla _{{\mathbf {e}}_i} {\mathbf {u}} . \end{aligned}$$
(37)

Or, it can be written as follows:

$$\begin{aligned} \nabla _{{\mathbf {v}}} {\mathbf {u}} = \sum _{j=1}^2 v^j \left[ ( \nabla _{{\mathbf {e}}_j} {\mathbf {u}} \cdot {\mathbf {e}}_1) {\mathbf {e}}_1 + ( \nabla _{{\mathbf {e}}_j} {\mathbf {u}} \cdot {\mathbf {e}}_2) {\mathbf {e}}_2 \right] . \end{aligned}$$
(38)

Substituting Eq. (21) into the above equation (38), we obtain

$$\begin{aligned} \nabla _{{\mathbf {v}}} {\mathbf {u}} = \sum _{i, j=1}^2 v^j \left[ \nabla u^i \cdot {\mathbf {e}}_j + \sum _{k=1}^2 \omega _{i k } ( {\mathbf {e}}_j ) u^k \right] {\mathbf {e}}_i . \end{aligned}$$
(39)

Each covariant derivative along the unit tangent vector \({\mathbf {e}}_i\) is provided as follows:

$$\begin{aligned} \nabla _{{\mathbf {e}}_1} {\mathbf {u}} \cdot {\mathbf {e}}_1&= \nabla u^1 \cdot {\mathbf {e}}_1 - \omega _{21} ({\mathbf {e}}_1 ) u^2, \end{aligned}$$
(40)
$$\begin{aligned} \nabla _{{\mathbf {e}}_1} {\mathbf {u}} \cdot {\mathbf {e}}_2&= \nabla u^2 \cdot {\mathbf {e}}_1 + \omega _{21} ({\mathbf {e}}_1 ) u^1, \end{aligned}$$
(41)
$$\begin{aligned} \nabla _{{\mathbf {e}}_2} {\mathbf {u}} \cdot {\mathbf {e}}_1&= \nabla u^1 \cdot {\mathbf {e}}_2 - \omega _{21} ({\mathbf {e}}_2 ) u^2, \end{aligned}$$
(42)
$$\begin{aligned} \nabla _{{\mathbf {e}}_2} {\mathbf {u}} \cdot {\mathbf {e}}_2&= \nabla u^2 \cdot {\mathbf {e}}_2 + \omega _{21} ({\mathbf {e}}_2 ) u^1. \end{aligned}$$
(43)

For example, the covariant derivative of the unit tangent vector \({\mathbf {e}}_i\) is obtained by using \(v^i=u^j=1\):

$$\begin{aligned} \nabla _{{\mathbf {e}}_i} {\mathbf {e}}_j = \sum _{k=1}^2 \omega _{ij} ( {\mathbf {e}}_k ) {\mathbf {e}}_k = \omega _{ij} ({\mathbf {e}}_1) {\mathbf {e}}_1 + \omega _{ij} ({\mathbf {e}}_2) {\mathbf {e}}_2. \end{aligned}$$
(44)

Or, by solving the summation notation, we obtain

$$\begin{aligned} \nabla _{{\mathbf {e}}_1} {\mathbf {e}}_1&= 0, \end{aligned}$$
(45)
$$\begin{aligned} \nabla _{{\mathbf {e}}_1} {\mathbf {e}}_2&= \omega _{12} ( {\mathbf {e}}_1) {\mathbf {e}}_1 + \omega _{12} ( {\mathbf {e}}_2) {\mathbf {e}}_2, \end{aligned}$$
(46)
$$\begin{aligned} \nabla _{{\mathbf {e}}_2} {\mathbf {e}}_1&= - \omega _{12} ( {\mathbf {e}}_1) {\mathbf {e}}_1 - \omega _{12} ( {\mathbf {e}}_2) {\mathbf {e}}_2, \end{aligned}$$
(47)
$$\begin{aligned} \nabla _{{\mathbf {e}}_2} {\mathbf {e}}_2&= 0 . \end{aligned}$$
(48)

Note that Eqs. (45) and (48), representing the magnitude changes of \({\mathbf {e}}_i\) along the same tangent vector, hold due to the constant magnitude of orthonormal moving frames. Suppose that the curved axis of a 2D surface has two orthonormal tangent vectors; the tangent vectors are in unit length and orthogonal. Then, the covariant derivative in Eq. (4) is the same as Eq. (21):

$$\begin{aligned} \Gamma ^{i}_{k j} = \omega _{i k} ({\mathbf {e}}_j). \end{aligned}$$
(49)

For the general 2D curved surface, Eq. (49) is not generally true.

3 Mathematical Comparison on the Sphere

We should check whether the two different covariant derivatives in Eqs. (4) and (21) yield the same result. Let us choose a sphere for convenience. Consider the sphere of the unit radius with the following representation:

$$\begin{aligned} (x,y,z) = ( \sin \theta \cos \phi , \sin \theta \sin \phi , \cos \theta ), \end{aligned}$$
(50)

where \(\theta \) is the polar angle and \(\phi \) is the azimuthal angle. The infinitesimal length is computed as \(\text{d}s^2= \text{d}\theta ^2 + \sin ^2 \theta \text{d} \phi ^2\). Let the tangent vectors of each axis be denoted by \( \frac{\partial}{\partial \phi} \) and \(\frac{\partial}{\partial \theta }\). Let a velocity vector \({\mathbf {u}}\) be expanded in the spherical coordinate system as follows:

$$\begin{aligned} {\mathbf {u}} = {\widetilde{u}}^{\theta } \frac{ \partial }{ \partial \theta }+ {\widetilde{u}}^{\phi } \frac{ \partial }{ \partial \phi }. \end{aligned}$$
(51)

Note that \(\Vert \frac{\partial}{\partial \theta} \Vert = 1\) and \(\Vert \frac{\partial}{\partial \phi} \Vert = \sin \theta \). The metric tensor is obtained by the inner product of the tangent vector to obtain \(g_{\theta \theta } = 1\) and \(g_{\phi \phi } = \sin ^2 \theta \).

For the construction of orthonormal moving frames \(\{{\mathbf {e}}_i\}\), let the first and second tangent vectors \({\mathbf {e}}_{\phi }\) and \({\mathbf {e}}_{\theta }\) be aligned along the \(\frac{\partial}{\partial \phi} \) and \(\frac{\partial}{\partial \theta} \), respectively. Let them be normalized with the unit length. We call this set of moving frame as the spherical moving frames. Similar to Eq. (51), a vector \({\mathbf {u}}\) can be expanded in spherical moving frames as follows:

$$\begin{aligned} {\mathbf {u}} = {u}^{\theta } {\mathbf {e}}_{\theta }+ {u}^{\phi } {\mathbf {e}}_{\phi }, \end{aligned}$$
(52)

where the basis vectors and coefficients have the following relations:

$$\begin{aligned} \left[ \begin{array}{c} {\mathbf {e}}_{\theta } \\ {\mathbf {e}}_{\phi } \end{array} \right]&= \left[ \begin{array}{c} \frac{\partial}{\partial \theta} , \\ \big(\frac{1} {\sin \theta} \big) \frac{\partial}{\partial \phi} \end{array} \right] , \end{aligned}$$
(53)
$$\begin{aligned} \left[ \begin{array}{c} {u}^{\theta } \\ {u}^{\phi } \end{array} \right]&= \left[ \begin{array}{c} {\widetilde{u}}^{\theta }, \\ \sin \theta {\widetilde{u}}^{\phi } \end{array} \right] . \end{aligned}$$
(54)

The covariant derivative along the \(\theta \)-axis contains nontrivial Christoffel symbols and can be obtained as follows:

$$\begin{aligned} \varvec{\nabla }_{\theta } {\mathbf {u}} = \frac{\partial {\widetilde{u}}^{\theta }}{\partial \theta } \frac{\partial }{\partial \theta } + \left( \frac{\partial {\widetilde{u}}^{\phi }}{\partial \theta } + \Gamma ^{\phi }_{\theta \phi } {\widetilde{u}}^{\phi } \right) \frac{\partial }{\partial \phi } , \end{aligned}$$
(55)

where \(\Gamma ^{\phi }_{\theta \phi }\) on the sphere is computed as follows:

$$\begin{aligned} \Gamma ^{\phi }_{\theta \phi } = \sum _{m=1}^2 \frac{g^{\phi m}}{2} \left( \frac{\partial g_{\theta m}}{\partial \phi } + \frac{\partial g_{\phi m}}{\partial \theta } - \frac{\partial g_{\theta \phi }}{\partial x^m} \right) = \frac{\cos \theta }{\sin \theta } . \end{aligned}$$
(56)

The covariant derivative along the unit tangent vector \({\mathbf {e}}_{\theta }\) can be also computed by Eq. (21):

$$\begin{aligned} \varvec{\nabla }_{{\mathbf {e}}_{\theta } } {\mathbf {u}} = ( \nabla {u}^{\theta } \cdot {\mathbf {e}}_{\theta } ) {\mathbf {e}}_{\theta } + \left( \nabla {u}^{\phi } \cdot {\mathbf {e}}_{\theta } \right) {\mathbf {e}}_{\phi }. \end{aligned}$$
(57)

The corresponding connection form has only one nontrivial component \( \omega _{\phi \theta } ( {\mathbf {e}}_{\phi } )\), which can be computed as follows. Consider the unit tangent vector of the spherical moving frames as follows:

$$\begin{aligned} \left[ \begin{array}{c} {\mathbf {e}}_r \\ {\mathbf {e}}_{\theta } \\ {\mathbf {e}}_{\phi } \end{array} \right] = \left[ \begin{array}{ccc} \sin \theta \cos \phi &{} \sin \theta \sin \phi &{} \cos \theta \\ \cos \theta \cos \phi &{} \cos \theta \sin \phi &{} -\sin \theta \\ -\sin \phi &{} \cos \phi &{} 0 \end{array} \right] \left[ \begin{array}{c} {\mathbf {x}} \\ {\mathbf {y}} \\ {\mathbf {z}} \end{array} \right] . \end{aligned}$$

By using Eq. (34), the connection 1-form \(\omega _{\theta \phi }\) can be computed as follows:

$$\begin{aligned} \omega _{\theta \phi } ( {\mathbf {e}}_{\phi } ) = \frac{1}{\sin \theta } \left( - \sin \phi ~ \cos \phi ~ 0 \right) \left[ \begin{array}{c} - \cos \theta \sin \phi \\ \cos \theta \cos \phi \\ 0 \end{array} \right] = \frac{\cos \theta }{\sin \theta } . \end{aligned}$$
(58)

Swapping the indices of \(\omega _{ij}\) yields the following sign changes:

$$\begin{aligned} \omega _{\theta \phi } ( {\mathbf {e}}_{\phi } ) = - \omega _{\phi \theta } ( {\mathbf {e}}_{\phi } ). \end{aligned}$$
(59)

Comparing Eq. (55) with Eq. (57) yields the following corollary.

Corollary 1

For the sphere of the unit radius, the covariant derivatives of \({\mathbf {u}}\) along the \(\theta \)-axis computed by using the Christoffel symbol in Eq. (55) are the same as those computed by using the connection 1-form in Eq. (57).

Proof

Let us substitute Eqs. (53) and (54) into Eq. (55). Then, \(\Gamma ^{\phi }_{\theta \phi } {\widetilde{u}}^{\phi } \) cancels out to yield the following equation:

$$\begin{aligned} \varvec{\nabla }_{{\theta } } {\mathbf {u}} = ( \nabla {u}^{\theta } \cdot {\mathbf {e}}_{\theta } ) {\mathbf {e}}_{\theta } + \left( \nabla {u}^{\phi } \cdot {\mathbf {e}}_{\theta } \right) {\mathbf {e}}_{\phi }. \end{aligned}$$
(60)

Note that Eq. (57) is the same as Eq. (60), that is

$$\begin{aligned} \left\| \varvec{\nabla }_{\theta } {\mathbf {u}} - \varvec{\nabla }_{{\mathbf {e}}_{\theta } } {\mathbf {u}} \right\| = 0 . \end{aligned}$$
(61)

By similar calculus, we obtain the following covariant derivative along the \(\phi \)-axis:

$$\begin{aligned} \varvec{\nabla }_{\phi } {\mathbf {u}} = \left( \frac{\partial {\widetilde{u}}^{\theta }}{\partial \phi } + \Gamma ^{\theta }_{\phi \phi } {\widetilde{u}}^{\phi } \right) \frac{\partial }{\partial \theta } + \left( \frac{\partial {\widetilde{u}}^{\phi }}{\partial \phi } + \Gamma ^{\phi }_{\theta \phi } {\widetilde{u}}^{\theta } \right) \frac{\partial }{\partial \phi } , \end{aligned}$$
(62)

where \(\Gamma ^{\phi }_{\theta \phi }\) is computed by Eq. (56). Similarly, \( \Gamma ^{\theta }_{\phi \phi }\) is derived as follows:

$$\begin{aligned} \Gamma ^{\theta }_{\phi \phi } = \sum _{m=1}^2 \frac{g^{\theta m}}{2} \left( \frac{\partial g_{\phi m}}{\partial \phi } + \frac{\partial g_{\phi m}}{\partial \phi } - \frac{\partial g_{\phi \phi }}{\partial x^m} \right) = -{\cos \theta }{\sin \theta } . \end{aligned}$$
(63)

The covariant derivative along \({\mathbf {e}}_{\phi }\) is computed by Eq. (21) as follows:

$$\begin{aligned} \varvec{\nabla }_{{\mathbf {e}}_{\phi } } {\mathbf {u}} = \left( \nabla {u}^{\theta } \cdot {\mathbf {e}}_{\phi } + \omega _{\theta \phi } ( {\mathbf {e}}_{\phi } ) {u}^{\phi } \right) {\mathbf {e}}_{\theta } + \left( \nabla {u}^{\phi } \cdot {\mathbf {e}}_{\phi } + \omega _{ \phi \theta } ( {\mathbf {e}}_{\phi } ) {u}^{\theta } \right) {\mathbf {e}}_{\phi }, \end{aligned}$$
(64)

where \(\omega _{\theta \phi } ( {\mathbf {e}}_{\phi } ) \) and \(\omega _{\phi \theta } ( {\mathbf {e}}_{\phi } ) \) are computed by Eq. (58). Then, we obtain the following Corollary.

Corollary 2

For the sphere of the unit radius, the covariant derivatives of \({\mathbf {u}}\) along the \(\phi \text{-axis}\) computed by using the Christoffel symbol in Eq. (62) are the same as those computed by using the connection 1-form in Eq. (64) multiplied by \(\sin \theta \).

Proof

By substituting Eqs. (53) and (54) into Eq. (62) and using the linearity of the covariant derivative, Eq. (62) is transformed into the following equation:

$$\begin{aligned} \varvec{\nabla }_{\phi } {\mathbf {u}} = \sin \theta \left[ \left( \nabla {u}^{\theta } \cdot {\mathbf {e}}_{\phi } -\frac{\cos \theta }{\sin \theta } u^{\phi } \right) {\mathbf {e}}_{\theta } + \left( \nabla {u}^{\phi } \cdot {\mathbf {e}}_{\phi } + \frac{\cos \theta }{\sin \theta } u^{\theta } \right) {\mathbf {e}}_{\phi } \right] . \end{aligned}$$
(65)

Comparing Eq. (65) with Eq. (64), we obtain

$$\begin{aligned} \left\| \frac{1}{\sin \theta } \varvec{\nabla }_{\phi } {\mathbf {u}} - \varvec{\nabla }_{{\mathbf {e}}_{\phi } } {\mathbf {u}} \right\| = 0 . \end{aligned}$$
(66)

Using Corollaries 1 and 2, we have the following proposition.

Proposition 2

On the sphere of the unit radius, the covariant derivative of \({\mathbf {u}}\) along a vector \({\mathbf {v}}\) by using the Christoffel symbol in Eq. (4) is the same as that by using the connection 1-form in Eq. (21).

Proof

Consider the following expansions of the vector \({\mathbf {v}}\):

$$\begin{aligned} {\mathbf {v}} = {\tilde{v}}^{\theta } \frac{\partial}{\partial \theta} + {\tilde{v}}^{\phi } \frac{\partial}{\partial \phi} = v^{\theta } {\mathbf {e}}_{\theta } + v^{\phi } {\mathbf {e}}_{\phi } . \end{aligned}$$
(67)

The covariant derivative of \({\mathbf {u}}\) along the vector \({\mathbf {v}}\) by the connection 1-form in Eq. (4) is provided as follows:

$$\begin{aligned} \varvec{\nabla }_{{\tilde{v}}^{\theta } \frac{\partial}{\partial \theta} + {\tilde{v}}^{\phi } \frac{\partial}{\partial \phi} } {\mathbf {u}} . \end{aligned}$$
(68)

Moreover, the covariant derivative of \({\mathbf {u}}\) along the vector \({\mathbf {v}}\) by the connection 1-form in Eq. (21) as follows:

$$\begin{aligned} \varvec{\nabla }_{v^{\theta } {\mathbf {e}}_{\theta } + v^{\phi } {\mathbf {e}}_{\phi } } {\mathbf {u}} . \end{aligned}$$
(69)

By substituting that \({\tilde{v}}^{\theta } = v^{\theta }\) and \({\tilde{v}}^{\phi } = v^{\phi }/ \sin \theta \), the difference between Eqs. (68) and (69) is given as follows:

$$\begin{aligned}&\left\| v^{\theta } \varvec{\nabla }_\frac{ \partial}{\partial \theta } {\mathbf {u}} + \left( \frac{v^{\phi }}{\sin \theta} \right) \varvec{\nabla }_\frac{\partial}{\partial \phi } {\mathbf {u}} - v^{\theta } \varvec{\nabla }_{{\mathbf {e}}_{\theta }} {\mathbf {u}} + v^{\phi } \varvec{\nabla }_{{\mathbf {e}}_{\phi } } {\mathbf {u}} \right\| \\\leqslant &\Vert v^{\theta } \Vert \left\| \varvec{\nabla }_\frac{ \partial}{\partial \theta } {\mathbf {u}} - \varvec{\nabla }_{{\mathbf {e}}_{\theta }} {\mathbf {u}} \right\| + \Vert v^{\phi } \Vert \left\| \left( \frac{1 }{ \sin \theta} \right) \varvec{\nabla }_\frac{\partial}{\partial \phi } {\mathbf {u}} - \varvec{\nabla }_{{\mathbf {e}}_{\phi } } {\mathbf {u}} \right\| = 0 , \end{aligned}$$

where we used Corollaries 1 and 2.

Proposition 2 confirms that the covariant derivative by using the Christoffel symbol is the same as that by using the connection 1-form on the sphere. The covariant derivative using the Christoffel symbol [2] is most popular in scientific computing. The Christoffel symbol requires a set of coordinate axis and their tangent vectors. Consequently, constructing a set of continuous coordinate axes is often required. However, this process is challenging for a complex surface. The connection 1-form requires only the surface normal vector, which is relatively easy to derive [29]. No continuous coordinate axis is required. The connection 1-form is relatively cheap and can be conveniently derived for a complex surface without constructing its coordinate system.

4 Local Moving Frames: Algorithm

The first advantage of the covariant derivative in moving frames is that the direction of the first unit tangent vector is arbitrary. Moving frames do not have to be aligned along the spherical coordinate axis as follows:

$$\begin{aligned} \varvec{\nabla }_{{\mathbf {v}}} {\mathbf {u}} = v^{\theta } \varvec{\nabla }_{\theta } {\mathbf {u}} + v^{\phi } \varvec{\nabla }_{\phi } {\mathbf {u}} = {v}^{1} \varvec{\nabla }_{{\mathbf {e}}_{1}} {\mathbf {u}} + {v}^{2} \varvec{\nabla }_{{\mathbf {e}}_{2}} {\mathbf {u}} , \end{aligned}$$
(70)

where \({\mathbf {e}}_1\) and \({\mathbf {e}}_2\) are arbitrarily aligned.

A question arises on which direction of \({\mathbf {e}}_1\) and \({\mathbf {e}}_2\) would yield the most optimal accuracy. Varying curvature affects the overall error because the differentiation along the unit tangent vector on a curved element is an approximation to the differentiation along the unit tangent vector on a plane [13]. However, moving frames for a constant or slowly-varying curvature would also be acceptable because the error caused by varying curvature is significantly smaller than the discretization error. Modern meshing software provides a sufficiently accurate approximation of an object using refinement such as smaller elements for a more highly curved area. Thus, varying curvature can be effectively dealt with in modern scientific computing.

The second critical problem is the geometric singularity, particularly for a closed 2D surface like a sphere. This singularity emerges due to a continuous curved axis built on the closed surface. For example, the north and the south poles are the location where differentiation along the \(\theta \)-axis is impossible. To overcome this problem, a set of discontinuous and almost-Euclidean moving frames is constructed, called the LOC moving frames, short for local moving frames.

The spherical coordinate system around \(\theta = \uppi /2\) on the sphere is primarily Euclidean. Applying this coordinate system to each element means that an individual spherical coordinate system is constructed for each element using the different location of its pole. Consequently, this kind of construction eliminates the continuity and differentiability of moving frames across the interface of the elements. Let us call these frames as LOC moving frames. Compare LOC moving frames with the moving frames that are aligned along the global spherical coordinate axis with the unique pole on the sphere. Figure 1 illustrates the alignment of moving frames across the interfaces of the elements. The LOC moving frames are a discontinuous reference coordinate system. Thus, no geometric singularity exists even for a closed 2D surface like a sphere. Moreover, the overall covariant divergence of LOC moving frames is significantly less than that of spherical moving frames.

Fig. 1
figure 1

Illustration to display the continuity of moving frames for spherical and LOC moving frames

This paper proposes an efficient algorithm to construct LOC moving frames with low covariant divergence. Consequently, LOC moving frames produce a relatively smaller error by directional differentiation. The proposed algorithm constructs the LOC moving frames that are generally aligned at various oblique angles with the \(\theta \)-axis of the spherical coordinate axis. The unit tangent vectors of LOC moving frames are not perfectly Euclidean. Thus, the divergence of the unit tangent vectors is not zero. However, the divergence of LOC moving frames is usually less than that of the spherical coordinate system.

Let us consider the mapping from the standard element to a curved triangular element as shown in Fig. 2. Suppose that \({\mathbf {X}} = {\mathbf {X}} (r,s)\) represents the coordinate axis of grid points for an element. \({\mathbf {X}} (r,s)\) is also a map because each grid point of \(\Omega ^i_{\text {e}} (r,s)\), denoted by \({\mathbf {X}} (r,s)\), is mapped from each grid point of the standard element \(\Omega _{\text {st}} (r,s)\). The differentiation of \({\mathbf {X}}(r,s)\) with respect to the s-axis produces the tangent vector \(\frac{\partial {\mathbf {X}} }{\partial s}\). This vector is parallel to the line in \(\Omega ^i_{\text {e}} (r,s)\), which is mapped from r = \(\text{ constant }\) in \(\Omega _{\text {st}} (r,s)\). A similar argument can be applied to \(\frac{\partial {\mathbf {X}}}{\partial r}\). In general, \(\frac{\partial {\mathbf {X}}}{\partial s}\) and \(\frac{\partial {\mathbf {X}}}{\partial r}\) are not orthogonal. The inner product is not zero, that is

$$\begin{aligned} \left( \frac{\partial {\mathbf {X}}}{ \partial r} , \frac{ \partial {\mathbf {X}}}{ \partial s } \right) \ne 0. \end{aligned}$$
(71)

Let \(E_k\) represent each curved edge of the triangular element \(\Omega _{\text {e}}^i\) for \(1 \leqslant k \leqslant 3\). In Fig. 2, \(E_1\) and \(E_2\) are parametrized by r and s, respectively. For the construction of the edge \(E_3\), suppose that a new axis \(\zeta \) emanating from the vertex where \((r,s) = (0,1)\). The axis \(\zeta \) is represented such that \(\zeta = s + r\). Then, the edge \(E_3\) can be represented by \(\zeta = 1\). In summary, the unit tangent vectors along each edge are constructed as follows:

$$\begin{aligned} {\mathbf {e}}_{E_1}&= \frac{\partial {\mathbf {X}}}{ \partial r} \bigg {/} \left\| \frac{\partial {\mathbf {X}}}{ \partial r} \right\| , \end{aligned}$$
(72)
$$\begin{aligned} {\mathbf {e}}_{E_2}&= \frac{\partial {\mathbf {X}}}{ \partial s} \bigg {/} \left\| \frac{\partial {\mathbf {X}}}{ \partial s} \right\| , \end{aligned}$$
(73)
$$\begin{aligned} {\mathbf {e}}_{E_3}&= \left( \frac{ \partial {\mathbf {X}} }{ \partial r} + \frac{ \partial {\mathbf {X}} }{ \partial s } \right) \bigg {/} \left\| \left( \frac{ \partial {\mathbf {X}} }{ \partial r} + \frac{ \partial {\mathbf {X}} }{ \partial s } \right) \right\| . \end{aligned}$$
(74)
Fig. 2
figure 2

Mapping from the standard triangular element (\(\Omega _{\text {st}}\)) to a curved triangular element (\(\Omega _{\text {e}}^i\)). The coordinate is expressed as (rs)

For each kth edge, the covariant divergence of the unit tangent vector \({\mathbf {e}}_{E_k}\), or \(\nabla \cdot {\mathbf {e}}_{E_k}\), is computed for \(1\leqslant k \leqslant 3\). If the unit tangent vector’s axis is less curved in \(\Omega _{\text{e}}^i\), then the divergence of \({\mathbf {e}}_{E_k}\) is likely to be closer to zero. Thus, it is reasonable to choose \({\mathbf {e}}_{E_k}\), such that \({\mathbf {e}}_{E_k}\) is the smallest divergence among the three in Eqs. (72)–(74). The selected \({\mathbf {e}}_{E_k}\) becomes the first tangent vector \({\mathbf {e}}_1\). Because the third unit tangent vector \({\mathbf {e}}_3\) is the same as the surface normal vector \({\mathbf {k}}\), the second unit tangent vector \({\mathbf {e}}_2\) is obtained by the cross product as \({\mathbf {e}}_2 = {\mathbf {k}} \times {\mathbf {e}}_1\). Repeating this procedure for all the elements, we obtain a LOC moving frame at every grid point. Observe that the edge index k indicates that the edge to construct \({\mathbf {e}}_1\) could be different for each element. In summary, consider the following algorithm for LOC moving frames.

figure a
Fig. 3
figure 3

Distribution of the covariant divergence for spherical and LOC moving frames

Figure 3 presents the difference of \(\nabla \cdot {\mathbf {e}}_i\) between spherical and LOC moving frames for a tessellated spherical mesh with 498 elements and a \(4.99 \times 10^{-8}\) mesh error. For spherical moving frames \(\{{\mathbf {e}}_{\theta }, {\mathbf {e}}_{\phi } \}\), the maximum divergence magnitude of \({\mathbf {e}}_{\theta }\) and \({\mathbf {e}}_{\phi }\) in the \(L_2\) norm is 2.5 and 0.25, respectively. This divergence can be expected from Eqs. (40)–(43) as follows:

$$\begin{aligned} \nabla \cdot {\mathbf {e}}_{\theta }&= \omega _{\phi \theta } ({\mathbf {e}}_{\phi } ) = - \frac{\cos \theta }{\sin \theta }, \end{aligned}$$
(75)
$$\begin{aligned} \nabla \cdot {\mathbf {e}}_{\phi }&= \omega _{ \theta \phi } ({\mathbf {e}}_{\theta } ) = 0 . \end{aligned}$$
(76)

For LOC moving frames, the maximum divergence magnitude of \({\mathbf {e}}_1\) and \({\mathbf {e}}_2\) in the \(L_2\) norm is 0.35 and 0.4, respectively. Table 1 displays the convergence of divergence as the element size (h) varies. As h decreases, the covariant divergence of \({\mathbf {e}}_{\phi }\) decreases. The covariant divergence of \({\mathbf {e}}_{\theta }\) remains significantly large. For LOC moving frames, the covariant divergence of \({\mathbf {e}}_1\) or \({\mathbf {e}}_2\) does not converge to zero. However, the covariant divergence of LOC moving frames remains significantly smaller than that of \({\mathbf {e}}_{\theta }\). Moreover, the difference between the covariant and Euclidean divergence provides a vital indicator of moving frames for computational accuracy. The covariant divergence is the same as the Euclidean divergence if the Christoffel symbol or the connection 1-form is zero. In Table 1, this difference between the divergences for LOC moving frames is approximately equal to or less than \(0.1 \%\) of that for spherical moving frames, for both \({\mathbf {e}}_1\) and \({\mathbf {e}}_2\).

Table 1 Comparison between the divergence of spherical and LOC moving frames

5 Test Cases on the Unit Sphere

This section displays several test cases to display that the LOC moving frames with the connection 1-form (\(\omega _{ij}\)) compute the covariant derivative with sufficient accuracy. The proposed scheme can be applied to any 2D curved surface, including irregular or non-convex surfaces. For the convenience convergence error evaluation, we use the unit sphere with the following metric in this section. Thus, the invariant square of an infinitesimal length, known as an interval, is obtained as follows:

$$\begin{aligned} {\text {d}}s^2 = {\text {d}} \theta ^2 + \sin ^2 \theta {\text {d}} \phi ^2 . \end{aligned}$$
(77)

Two types of meshes of the sphere are used. The first mesh is a projected mesh. Place a cube of unit length inside the sphere such that each vertex lies on the sphere. The edges of the cube are equally dissected, respectively. Let each node in the kth edge be denoted by \({\mathbf {x}}_i\) for \(1 \leqslant i \leqslant N_k\). The vertices of the nodes \({\mathbf {x}}_i\) are projected onto a sphere such that \(\Vert {\mathbf {x}}_i^2 \Vert = 1\), i.e., the nodes of the mesh are exactly on the sphere. Let us call this mesh ProjMesh [18]. However, the grid points other than the nodes may slightly lie outside the sphere. Because of this approximation error, the mesh error of ProjMesh does not converge as the order of the solution polynomial (p) increases.

The second mesh is a high-order mesh, called NekMesh [37, 40]. By the optimal distribution of all the grid points by energy minimization, the location of grid points is redistributed to minimize the mesh error, even p increases. However, the vertices are not exactly on the exact domain. The mesh error of each mesh is displayed in Fig. 4. Table 2 shows the mesh error and \(\omega _{\phi \theta } ( {\mathbf {e}}_{\phi } )\) error versus p. NekMesh is generated by an open-source 3D high-order mesh generator NekMesh within the Nektar++ framework [9]. For further references of the two meshes and downloading the files, refer to [18].

Fig. 4
figure 4

Distribution of mesh error for ProjMesh and NekMesh

Table 2 Mesh error for both meshes to compute the location errors of grid points in the \(L_2\) norm. \(\omega _{\phi \theta } ( {\mathbf {e}}_{\phi })\) error measures the difference between the computational value and the exact value

In the following test problems, we demonstrate that the proposed scheme for covariant derivatives converges on both meshes. In contrast to weak formulations, the differentiation based on the grid points strongly depends on the point-wise location of grid points and the relative location of grid points along with a directional differentiation. Thus, the proposed scheme may yield different accuracy depending on the direction of differentiation. For example, the spherical coordinate axis may yield better accuracy than the proposed scheme with LOC moving frames for some meshes. The grid points in this mesh are more accurately aligned along the spherical coordinate axis than the direction of LOC moving frames. Therefore, the comparison between the spherical coordinate system and LOC moving frames conveys little meaning—only the convergence of every mesh matters.

To minimize the effect of the mesh error, LOC moving frames are projected into the exact domain. This projection implies that the third unit tangent vector \({\mathbf {e}}_3\) of LOC moving frames is aligned along with the exact surface normal vector, not the surface normal vector of the domain with some degree of the mesh error. The first step is to replace the third tangent vector \({\mathbf {e}}_3\) with the unit surface normal vector of the exact domain. The second step requires the projection of \({\mathbf {e}}_1\) and \({\mathbf {e}}_2\) to the new tangent plane orthogonal to the new \({\mathbf {e}}_3\). This type of moving frames is called LOCSPH, short for local spherical moving frames [19]. In a high-order mesh with a negligible mesh error, LOC moving frames are almost the same as LOCSPH moving frames.

Fig. 5
figure 5

Distribution of the velocity vector for various \(\alpha \). The contour represents the magnitude of the velocity vector. Some elements around the poles are removed to avoid the geometry singularities of the spherical coordinate system

5.1 Covariant Derivative on the Sphere

Construct a flow modified from the steady zonal flow [41]. The velocity vector of the steady zonal flow is multiplied by \(\sin \theta \) to remove the case that a component is divided by zero at \(\theta = 0\). For a vector on the sphere, consider the following expansion of the vector in moving frames:

$$\begin{aligned} {\mathbf {u}} = u^{\theta } {\mathbf {e}}_{\theta } + u^{\phi } {\mathbf {e}}_{\phi } = u^x {\mathbf {x}} + u^y {\mathbf {y}} + u^z {\mathbf {z}} . \end{aligned}$$
(78)

The vector components in the spherical coordinate system are derived as follows:

$$\begin{aligned} u^{\theta }&= - u_0 \sin \theta \sin \phi \sin \alpha , \end{aligned}$$
(79)
$$\begin{aligned} u^{\phi }&= u_0 \sin \theta ( \cos \theta \cos \alpha + \sin \theta \cos \phi \sin \alpha ) , \end{aligned}$$
(80)

where \(\alpha \) is the angle between the velocity flow and the north pole. Let \(\alpha \) be arbitrary. The vector component in the Cartesian coordinate system is expressed as follows:

$$\begin{aligned} u^x&= u^{\theta } \cos \theta \cos \phi - u^{\phi } \sin \phi , \\ u^y&= u^{\theta } \cos \theta \sin \phi + u^{\phi } \cos \phi , \\ u^z&= -u^{\theta } \sin \theta . \end{aligned}$$

The exact covariant derivative along each spherical coordinate axis is derived as follows:

$$\begin{aligned} \nabla _{\varvec{\theta }} {\mathbf {u}}&= \nabla _{\theta } u^{\theta } {\mathbf {e}}_{\theta } + \nabla _{\theta } u^{\phi } {\mathbf {e}}_{\phi } , \\ \nabla _{\varvec{\phi }} {\mathbf {u}}&= \left( \nabla _{\phi } u^{\theta } - \frac{\cos \theta }{\sin \theta } u^{\phi } \right) {\mathbf {e}}_{\theta } + \left( \nabla _{\phi } u^{\phi } + \frac{\cos \theta }{\sin \theta } u^{\theta } \right) {\mathbf {e}}_{\phi } , \end{aligned}$$

where the directional derivatives are given as follows:

$$\begin{aligned} \nabla _{\theta } u^{\theta }&= - u_0 \cos \theta \sin \phi \sin \alpha , \\ \nabla _{\theta } u^{\phi }&= u_0 ( \cos 2 \theta \cos \alpha + \sin 2 \theta \cos \phi \sin \alpha ), \\ \nabla _{\phi } u^{\theta }&= - u_0 \cos \phi \sin \alpha , \\ \nabla _{\phi } u^{\phi }&= - u_0 \sin \theta \sin \phi \sin \alpha . \end{aligned}$$

Two \(\alpha \)s are considered: \(\alpha =0\) and \(\alpha ={\uppi} /2\). The velocity vector for each \(\alpha \) is displayed in Fig. 5. Table 3 presents the exponential error convergence in the \(L_2\) norm in ProjMesh and NekMesh. For both meshes, the proposed scheme with LOCSPH moving frames shows almost exponential convergence. For ProjMesh, the mesh error does not converge as p increases as expected. However, the connection 1-form \(\omega _{\phi \theta } ( {\mathbf {e}}_{\phi } )\) converges as p increases. For \(\alpha =0\), the proposed scheme with moving frames shows a slightly better accuracy than that with spherical moving frames. For \(\alpha ={\uppi} /2\), it shows a different result; the scheme with spherical moving frames shows slightly better accuracy. The numerical accuracy of covariant derivative depends on the location accuracy of the grid points. This location accuracy varies from mesh to mesh, regardless of the mesh error. However, they all show an exponential convergence. For a sufficiently large p, the difference of errors for both \(\alpha \) is negligible.

For NekMesh, the mesh error converges as p increases, in contrast to ProjMesh. \(\omega _{\phi \theta } ( {\mathbf {e}}_{\phi } )\) also converges as p increases. The convergence with NekMesh is similar to that with ProjMesh. For \(\alpha =0\), the scheme with LOCSPH shows significantly better accuracy than that with spherical moving frames. For \(\alpha ={\uppi} /2\), the scheme with spherical moving frames shows better accuracy than that with LOCSPH. In spite of significantly lesser mesh error, the grid points along LOCSPH moving frames are less accurately aligned than those along with the spherical coordinate system.

Table 3 Covariant error of the vector shown in Eqs. (79) and (80) along the \(\theta \) and \(\phi \) axes. Error is computed in the \(L_2\) norm on a projection mesh for \(\alpha =0\) and \(\alpha =\uppi /2\). SPH spherical moving frames, LOCSPH LOCSPH moving frames

For the remaining test problems, a more complex velocity field is used. This velocity field is similar to the Rossby-Haurwitz wave popularly used as a test problem for the shallow water equations:

$$\begin{aligned} {\mathbf {v}} = v_{\phi } {\mathbf {e}}_{\phi } + v_{\theta } {\mathbf {e}}_{\theta } , \end{aligned}$$
(81)

where the vector components are derived as follows:

$$\begin{aligned} v_{\phi }&= \gamma \sin \theta + K \sin ^3 \theta ( 4 \cos ^2 \theta - \sin ^2 \theta ) \cos 4 \phi , \end{aligned}$$
(82)
$$\begin{aligned} v_{\theta }&= -4 K \sin ^3 \theta \cos \theta \sin 4 \phi , \end{aligned}$$
(83)

where \(\gamma = K = 7.848 \times 10^{-6}\) s\(^{-1}\). Equations (82) and (83) are normalized such that the radius of the earth corresponds to the unit length. In the following tests, only NekMesh is considered to remove the effects of the mesh error.

5.2 Gradient

The gradients of a scalar variable on a 2D curved surface should be independent of the chosen axis. In the spherical coordinate axis of \((\theta , \phi )\), the gradient of a scalar variable \(v_{\phi }\) is expressed as follows:

$$\begin{aligned} \nabla v_{\phi } = \frac{\partial v_{\phi } }{\partial \theta } \frac{\partial }{\partial \theta } + \frac{1}{\sin ^2 \theta } \frac{\partial v_{\phi } }{\partial \phi } \frac{\partial }{\partial \phi } , \end{aligned}$$
(84)

where each component is computed such as

$$\begin{aligned} \frac{\partial v_{\phi } }{\partial \theta }&= \omega \cos \theta + K \sin ^2 \theta [ 3 \cos \theta ( 4 \cos ^2 \theta - \sin ^2 \theta ) - 10 \sin ^2 \theta \cos \theta ] \cos 4 \phi , \\ \frac{\partial v_{\phi } }{\partial \phi }&= - 4 K \sin \theta ( 4 \cos ^2 \theta - \sin ^2 \theta ) \sin 4 \phi , \end{aligned}$$

where \(\omega \) and K are the same as Eq. (81) and (82). The computation of the gradient in spherical or LOC moving frames should produce the same gradient, expressed as follows:

$$\begin{aligned} \nabla v_{\phi } = ( \nabla v_{\phi } \cdot {\mathbf {e}}_1 ) {\mathbf {e}}_1 + ( \nabla v_{\phi } \cdot {\mathbf {e}}_2 ) {\mathbf {e}}_2 . \end{aligned}$$
(85)

Computationally, Eq. (85) should converge to Eq. (84), particularly as the space resolution increases. Table 4 confirms the the exponential convergence of the difference between the covariant differentiation and LOC moving frames for the gradient of \(v_{\phi }\) as p increases.

Table 4 Error between Eqs. (84) and (85) for the unit sphere. \(h=0.4\) and 498 elements. Some elements surrounding the poles are removed due to the singularities of the spherical coordinate axis

5.3 Divergence

In the spherical coordinate axis for the unit sphere, the divergence of the velocity vector \({\mathbf {v}}\) in Eq. (81) can be computed by the following covariant formulation:

$$\begin{aligned} \nabla \cdot {\mathbf {v}} = \frac{1}{\sin \theta } \left( \frac{\partial v_{\phi }}{\partial \phi } + \frac{\partial }{\partial \theta } ( v_{\theta } \sin \theta ) \right) . \end{aligned}$$
(86)

On the other hand, the divergence in moving frames can be computed as follows:

$$\begin{aligned} \nabla \cdot {\mathbf {u}} = \sum _{i=1}^2 \nabla _{{\mathbf {e}}_i} {\mathbf {u}} \cdot {\mathbf {e}}_i = \nabla _{{\mathbf {e}}_1} {\mathbf {u}} \cdot {\mathbf {e}}_1+ \nabla _{{\mathbf {e}}_2} {\mathbf {u}} \cdot {\mathbf {e}}_2. \end{aligned}$$
(87)

Note that the direction of the unit tangent vector \({\mathbf {e}}_1\) is arbitrary and possibly could be discontinuous across the interfaces of elements. Using the covariant derivatives in Eqs. (40)–(43), we obtain

$$\begin{aligned} \nabla \cdot {\mathbf {u}} = \nabla u^1 \cdot {\mathbf {e}}_1 - \omega _{21} ({\mathbf {e}}_1 ) u^2 + \nabla u^2 \cdot {\mathbf {e}}_2 + \omega _{21} ({\mathbf {e}}_2 ) u^1, \end{aligned}$$
(88)

where the connection 1-form \(\omega _{ij}({\mathbf {e}}_k)\) is computed by Eq. (34). Note that the divergence of the velocity vector in Eq. (81) is analytically zero.

Figure 6a displays the velocity vector \({\mathbf {v}}\) on the sphere and the distribution of the divergence. Figure 6b demonstrates the exponential convergence by Eq. (86), Eq. (88) with spherical moving frames, and LOC moving frames. Figure 6b confirms that Eq. (88) with LOC moving frames has the optimal convergence order. The difference between LOC moving frames and the other methods becomes larger as p increases. The geometric error’s contribution to the overall discretization error seems to increase as p increases. However, there is no noticeable difference in computational efficiency among the three methods. Their difference only lies in the magnitude and direction of the unit tangent vectors.

Table 5 presents the convergence order for the three methods of computing covariant divergence. Equation (88) with LOC moving frames is the most accurate with the optimal convergence order, closer to the theoretical expectation. The order should be theoretically the same as the order of p because it is the first derivative of a vector. However, the geometric error of the mesh undermines this order, ending up with 3.47,  5.3,  4.03 for covariant formulation and 3.27,  5.25,  4.04 for spherical moving frames. The order is increased to be nearly equivalent to the optimal order for LOC moving frames: 5.08,  4.79,  5.58. Consider that the divergence of the unit tangent vector \({\mathbf {e}}_{\theta }\) becomes larger as it is closer to the pole. Thus, it is possible that the lesser accuracy of spherical moving frames is caused by the geometric singularities of the sphere.

Table 5 h-convergence of divergence on the unit sphere by the three different methods for \(p=5\)
Fig. 6
figure 6

Distribution of the velocity vector \({\mathbf {v}}\) and the divergence \(\nabla \cdot {\mathbf {v}}\) by LOC moving frames for \(p=5\). The p-convergence of divergence on the sphere of the unit radius is shown for \(h=0.344 5\). Covariant: covariant formulation, SPH: spherical moving frames, LOC: local moving frames

5.4 Curl

Consider the projection of the curl of the vector onto the surface normal vector \({\mathbf {k}}\), denoted by \({\mathbf {k}} \cdot \nabla \times {\mathbf {v}}\). Note that the curl for the velocity vector of the Rossby-Haurwitz wave in Eq. (81) can be analytically obtained as follows:

$$\begin{aligned} {\mathbf {k}} \cdot (\nabla \times {\mathbf {v}} ) = - 2 \omega \cos \theta + 30 K \sin ^4 \theta \cos \theta \cos 4 \phi . \end{aligned}$$

The covariant curl operator in the spherical coordinate axis is provided as follows:

$$\begin{aligned} {\mathbf {k}} \cdot ( \nabla \times {\mathbf {v}} ) = \frac{1}{\sin \theta } \left( \frac{\partial v_{\theta }}{\partial \phi } - \frac{\partial }{\partial \theta } ( v_{\phi } \sin \theta ) \right) . \end{aligned}$$
(89)

Similar to covariant divergence, the above projected curl can be computed with orthonormal moving frames as follows:

$$\begin{aligned} {\mathbf {k}} \cdot ( \nabla \times {\mathbf {u}} ) = \nabla _{{\mathbf {e}}_1} {\mathbf {u}} \cdot {\mathbf {e}}_2 - \nabla _{{\mathbf {e}}_2} {\mathbf {u}} \cdot {\mathbf {e}}_1 . \end{aligned}$$
(90)

Using the covariant derivatives in Eqs. (40)–(43), we obtain

$$\begin{aligned} {\mathbf {k}} \cdot ( \nabla \times {\mathbf {u}} ) = \nabla u^2 \cdot {\mathbf {e}}_1 + \omega _{21} ({\mathbf {e}}_1 ) u^1 - \nabla u^1 \cdot {\mathbf {e}}_2 + \omega _{21} ({\mathbf {e}}_2 ) u^2 . \end{aligned}$$
(91)

Figure 7a displays the velocity vector on the unit sphere and the distribution of the projected curl \({\mathbf {k}} \cdot ( \nabla \times {\mathbf {v}} )\). Figure 7b shows the similar exponential convergence as that of the divergence test by Eq. (89), Eq. (91) with spherical moving frames, and Eq. (91) with LOC moving frames. Similarly, Eq. (91) with LOC moving frames shows the optimal convergence. Table 6 presents the convergence order for the three methods. Equation (91) with LOC moving frames shows an improved convergence order of 5.077 5,  4.786 5,  5.584 0, closer to the optimal convergence of p. Similar to the divergence case, no geometric singularity for LOC moving frames seems to provide better accuracy.

Table 6 h-convergence of curl on the sphere by the three methods for \(p=5\)
Fig. 7
figure 7

Distribution of the velocity vector \({\mathbf {v}}\) (arrow) and the curl \({\mathbf {k}} \cdot ( \nabla \times {\mathbf {v}} )\) by LOC moving frames for \(p=5\) (contour). The p-convergence of the curl on the sphere of the unit radius is shown for \(h=0.344 5\). Covariant: covariant formulation, SPH: spherical moving frames, LOC: local moving frames

6 Application: Helmholtz-Hodge Decomposition

This section illustrates an example of the proposed scheme using a complex surface. As an application of the proposed scheme for covariant derivatives, the numerical scheme of the HHD was proposed for a complex curved surface. On a 2D curved surface \(\Omega \) with either a Neumann boundary or no boundary, the HHD finds the three unique components of a vector field \({\mathbf {v}}\) [8]

$$\begin{aligned} {\mathbf {v}} = \nabla u + \nabla \times {\mathbf {R}} + {\mathbf {h}}, \end{aligned}$$
(92)

where \(\nabla u\) is a curl-less irrotational vector, \(\nabla \times {\mathbf {R}}\) is a divergence-less incompressible vector, and \({\mathbf {h}}\) is a harmonic vector with zero vector Laplacian such as \(\nabla ^2 {\mathbf {h}} = {\mathbf {0}}\). The irrotational component is obtained by applying the divergence to Eq. (92). The incompressible component is first expressed as \(\nabla \times {\mathbf {R}} = J \nabla r\) for the linear operator J and a scalar variable r, transforming \({\mathbf {v}} = v^1 {\mathbf {e}}_1 + v^2 {\mathbf {e}}_2\) into the following:

$$\begin{aligned} J {\mathbf {v}} = -v^2 {\mathbf {e}}_1 + v^1 {\mathbf {e}}_2. \end{aligned}$$
(93)

Then, the following is obtained by applying the divergence to Eq. (92):

$$\begin{aligned} \nabla ^2 u&= \nabla \cdot \varvec{\xi } - \frac{1}{A} \int \nabla \cdot \varvec{\xi } {\text {d}}x, \end{aligned}$$
(94)
$$\begin{aligned} \nabla ^2 v&= - \nabla \cdot J \varvec{\xi } + \frac{1}{A} \int \nabla \cdot J \varvec{\xi } {\text {d}}x, \end{aligned}$$
(95)

where A is the surface area of the domain \(\Omega \). The second components on the right-hand side were added, because the domain has either a Neumann boundary condition or no boundary. Then, the vector \({\mathbf {h}}\) is obtained by subtracting the two components from \({\mathbf {v}}\) as follows:

$$\begin{aligned} \nabla \cdot {\mathbf {h}}&= \frac{1}{A} \int \nabla \cdot \varvec{\xi } {\text {d}}x , \end{aligned}$$
(96)
$$\begin{aligned} \nabla \cdot J {\mathbf {h}}&= \frac{1}{A} \int \nabla \cdot J \varvec{\xi } {\text {d}}x . \end{aligned}$$
(97)

Equations (96) and (97) are constant in the domain. Also, note that the vector Laplacian of \(\nabla ^2 {\mathbf {h}}\) is zero, that is

$$\begin{aligned} \nabla ^2 {\mathbf {h}} = \nabla (\nabla \cdot {\mathbf {h}} ) + \nabla \times (\nabla \times {\mathbf {h}}) = 0 . \end{aligned}$$
(98)

On a 2D surface, Eqs. (94) and (95) contain covariant divergence, i.e., \(\nabla \cdot \varvec{\xi }\) and \(\nabla \cdot J \varvec{\xi }\), which can be computed by Eq. (88). Inaccurate computation on the right-hand side of Eqs. (94) and (95) fails to locate the exact source of the flow that is represented as the irrotational and incompressible components. Equations (94) and (95) are solved by the Helmholtz solver, which was implemented at the open-source spectral/hp library and is referred to as Nektar++ [9], in the context of continuous or discontinuous Galerkin methods.

For computational tests, a curl-less vector is derived from spherical moving frames and is multiplied by \(\sin \theta \). A divergenceless-vector was also derived from the aforementioned Rossby-Haurwitz vector in Eq. (81). Figures 8 and 9 represent the HHD of a curl-less vector and a divergence-less vector. The error for each component in both HHD is shown in Table 7.

Table 7 Error of HHD on the sphere. \(p=5\). * is in comparison to \((1/A) \int \nabla \cdot \varvec{\xi } {\text {d}}x\). ** is in comparison to \((1/A) \int \nabla \cdot J \varvec{\xi } {\text {d}}x\)
Fig. 8
figure 8

HHD of a curl-less vector, spherical moving frames multiplied by \(\sin \theta \). a The irrotational component of the vector with the potential u, b the potential of the incompressible flow v, and c the potential of the harmonic flow U such as \({\mathbf {h}} = \nabla U\), h=0.2, \(p= 10\)

Fig. 9
figure 9

HHD of a divergence-less vector, the Rossby-Haurwitz velocity vector. a The potential u of the irrotational component, b the potential v of the incompressible flow, and c the potential U of the harmonic flow such as \({\mathbf {h}} = \nabla U\), h=0.2, p=10

Two complex domains are introduced to demonstrate the HHD for complexly-curved 2D surfaces: the first is the surface model of the human atrium, and the second is the Stanford bunny. The initial vector was obtained by propagating a diffusion-reaction type wave, such as the two-variable Aliev-Panfilov model. The wave was initiated from a point and then moving frames are aligned along with the gradient of the action potential. The geometry has no holes, corresponding to zero Betti number [3]. However, the wave propagation on the geometry is depicted by eliminating the initial and final stages of point-wise propagation. Therefore, the geometry of the vector field is equivalent to a domain with a hole as if a circular cylinder penetrated the initial and final region of excitation. Thus, the Betti number is actually one, and consequently, the harmonic field vector has at most a dimension of one.

Fig. 10
figure 10

HHD by the aligned moving frames along the propagational direction on an atrium. a Irrotational vector with the potential u, b incompressible vector with the potential v, and c harmonic vector with the potential U

Figures 10 and 11 present the HHD of the propagation vector field, which is decomposed into three HHD components for both the atrium and bunny, respectively. For the atrium in Fig. 10, we have the following error by the 2D discontinuous Helmholtz solver with moving frames:

$$\begin{aligned} \Vert \nabla \times \nabla u \Vert&= 4.71 \times 10^{-13}, \end{aligned}$$
(99)
$$\begin{aligned} \Vert \nabla \cdot J \nabla v \Vert&= 1.91 \times 10^{-12} \end{aligned}.$$
(100)

For the bunny in Fig. 11, we have the following error by the 2D continuous Helmholtz solver with moving frames:

$$\begin{aligned} \Vert \nabla \times \nabla u \Vert&= 4.52 \times 10^{-11}, \end{aligned}$$
(101)
$$\begin{aligned} \Vert \nabla \cdot J \nabla v \Vert&= 1.46 \times 10^{-9} \end{aligned}.$$
(102)

The magnitude of the vector Laplacian is not negligible in some regions of the domains, particularly near the boundaries of the atrium and non-smooth junctions of the bunny. However, the proposed scheme still yields the smooth harmonic potential U in this region.

Fig. 11
figure 11

HHD by the aligned moving frames along the propagational direction on the Stanford Bunny. a Irrotational vector with the potential u, b incompressible vector with the potential v, and c harmonic vector with the potential U

7 Discussion

The proposed scheme provides an efficient high-order algorithm for computing covariant derivatives on any 2D curved surface with optimal accuracy. The scheme requires no metric tensor or Christoffel symbol from the analytically-known curved axis. This paper verifies that the covariant derivative using the tangent vectors is the same as that using orthonormal basis vectors on the sphere of the unit radius. Therefore, this scheme can be directly applied to various numerical schemes in more complex 2D realistic geometries. However, the drawbacks are as follows. The proposed scheme can have poor accuracy for a curved element with a highly-varying curvature and Jacobian. However, a modern adaptive mesh generator usually takes care of this issue by constructing a smaller highly curved element in a region of higher curvature. Moreover, the computational efficiency of the proposed scheme is almost the same as the covariant formulation with the Christoffel symbols.

Future studies should consider the difference between the Riemann curvature tensors using the tangent vector and orthonormal basis vectors. The Riemann curvature tensor means the Riemann curvature tensor of a wave propagation such that the first tangent vector of moving frames is aligned along with the propagation. The Riemann curvature tensor is closed related to the relative acceleration of propagation. Consider a biological signal propagation, such as cardiac action potential or neural spike propagation. The relative acceleration in a biological signal propagation is known to provide the stopping condition of the propagation as a representation of sink and source ratio [15]. Consequently, we investigate how the relative acceleration of propagation can be computed by orthonormal moving frames, not by using the metric tensor and the Christoffel symbols.