DOI:10.1111/cgf.14070 Eurographics Symposium on Geometry Processing 2020 Volume 39 (2020), Number 5 Q. Huang and A. Jacobson (Guest Editors)

A Simple Discretization of the Vector Dirichlet Energy

Oded Stein1, Max Wardetzky2, Alec Jacobson3 and Eitan Grinspun3,1

1Columbia University, USA 2University of Göttingen, Germany 3University of Toronto, Canada

Abstract We present a simple and concise discretization of the covariant derivative vector Dirichlet energy for triangle meshes in 3D using Crouzeix-Raviart finite elements. The discretization is based on linear discontinuous Galerkin elements, and is simple to implement, without compromising on quality: there are two degrees of freedom for each mesh edge, and the sparse Dirichlet energy matrix can be constructed in a single pass over all triangles using a short formula that only depends on the edge lengths, reminiscent of the scalar cotangent Laplacian. Our vector Dirichlet energy discretization can be used in a variety of applications, such as the calculation of Killing fields, parallel transport of vectors, and smooth vector field design. Experiments suggest convergence and suitability for applications similar to other discretizations of the vector Dirichlet energy.

1. Introduction

The covariant derivative ∇ generalizes the gradient of scalar func- tions to vector fields defined on surfaces. As the gradient does for scalar functions, the covariant derivative measures the infinitesimal change of a vector field in every direction. As with the gradient’s 1 R 2 scalar Dirichlet energy, Escalar(u) := 2 Ω k∇uk dx for a smooth scalar u and a smooth surface Ω, the covariant derivative has a corresponding vector Dirichlet energy,

Z 1 2 E(u) := k∇ukF dx , (1) transporting the 2 Ω red vector (enlarged) denoising a vector field by smoothing across the surface where u is a smooth vector-valued function on Ω, and k·kF is the Frobenius norm. Much like the scalar Dirichlet energy Escalar does Figure 1: Parallel transporting a vector across a surface with our for scalar functions, the vector Dirichlet energy E measures the Crouzeix-Raviart discretization of vector heat flow (left), and de- smoothness of a vector field. noising a vector field with our discretization of the vector diffusion equation (right). Just as Escalar is useful for scalar data processing, E has many uses in vector field processing. While E has been employed scalar Our discretization is based on Crouzeix-Raviart finite elements. in many geometry processing methods and applications, E has, in Its most notable features are its simplicity and ease of implementa- comparison, seen less usage in practice. A key reason for the wide tion, without sacrificing any quality: adoption of Escalar is the existence of a simple, reliable, and read- ily available finite element discretization: the cotangent Laplacian. • the real, sparse Dirichlet energy matrix can be built in a single There are a variety of existing discretizations of E, but they can pass over all faces using a simple formula depending only on not be implemented using quite as few lines of code as the cotan- each (individual) triangle’s edge lengths; gent Laplacian. The matrix for the cotangent Laplacian can be con- • the degrees of freedom directly correspond to the edges of the 1  structed using only the expression Lcotani j = 2 cotαi j + cotβi j mesh, making the results easy to understand and visualize; for each vertex pair i, j (where αi j,βi j are the two angles opposite • no preprocessing or intermediate data structures beyond simple the edge i j), as well as summation [MDSB03, (5)]. We advocate for matrices are required; a discretization of E that aspires to the simplicity of the cotangent • applications, performance and convergence are similar to other Laplacian. discretizations of E.

c 2020 The Author(s) Computer Graphics Forum c 2020 The Eurographics Association and John Wiley & Sons Ltd. Published by John Wiley & Sons Ltd.

https://www.eg.org https://diglib.eg.org 82 O. Stein, M. Wardetzky, A. Jacobson & E. Grinspun / A Simple Discretization of the Vector Dirichlet Energy

The sparse 2m×2m-matrix L of the discrete energy E for a mesh The covariant derivative on a smooth surface is this vector gradi- 3 with m edges ent of R restricted to the tangent space of the surface, where it 1: for all faces f , consecutive edges ei,e j ∈ f do becomes dependent on the surface’s curvature (while this defini- 3 2: li = len(ei), l j = len(e j), lk = len(ek) // ek 3rd edge tion only works for surfaces embedded inR , it generalizes to other 3: s = orientation(ei) · orientation(e j) // can be 1 or −1 kinds of surfaces [Lee97, Section 5]). 2 2 2 2 4: a = s(li + l j − lk ) /(4lil j area( f )) Operators like ∇u, which consume a vector field and return a 2 2 2 5: b = s(li + l j − lk )/(lil j) vector field, have an associated inner product : that generalizes the 2 2 scalar product · . The operation : for X,Y represented as matrices 6: L(ei,ei) += li /area( f ); L(ei +m,ei +m) += li /area( f ) can be written as X : Y := tr(X|Y), where X| is the transpose of // L(a,b) ← x expands to L(a,b) = x; L(b,a) = x an operator X that takes the surface’s metric into account [Lee97]. 7: L(ei,e j) ← a; L(ei + m,e j + m) ← a X|Y is sometimes also referred to as composing the adjoint of X 8: L(ei,e j + m) ← b; L(e j,ei + m) ← −b with Y. ∗ We demonstrate our discretization for three established applica- The covariant derivative ∇ has an adjoint operator ∇ , similar tions of the vector Dirichlet energy—smoothing vector fields, cre- to how the gradient of a scalar function is adjoint to the divergence ating Killing vector fields, and efficient parallel transport of vectors of a vector field. The adjoint covariant derivative is defined by in- (see Figure 1). We study the convergence of our method and two tegration by parts over a surface Ω, previous methods, and we find that our method converges at the Z Z Z ∇u : X dx = u · ∇∗X dx + u · X(n) dΓ same rate as previous methods. Ω Ω ∂Ω (2) The way we arrive at our discretization parallels the discretiza- n unit boundary normal at ∂Ω , tion of Escalar by the cotangent Laplacian for applications in scalar where X is an operator that takes a vector field and returns a vector geometry processing. Desbrun et al. [DMSB99] adopted the well- field, and u is a vector field. This adjoint operator is used to define established cotangent Laplacian [Mac49], demonstrated its utility, a for vector fields, the Bochner Laplacian (also and spurred its adoption in geometry processing. Similarly, we referred to as the connection Laplacian) [Pet06, pp. 209], employ a discretization introduced by Stein et al. [SJWG20] as part ∆ u = ∇∗∇u . of a routine to process scalar functions, and demonstrate its utility B n for vector field processing. Our discretization generalizes popular In R , the Bochner Laplacian is (up to sign) the usual vector field and extensively studied methods from numerical analysis of finite Laplacian defined by applying the scalar Laplacian in each coor- 2 elements for flat domains in R , which simplifies mathematical dinate. It appears, for example, in the Navier-Stokes equations for study of the method. fluid mechanics [Fan19].

2.2. The vector Dirichlet energy

2. Theoretical background The Bochner Laplacian ∆B defines a vector Laplace equation,

In this section we provide a brief overview of the covariant deriva- ∆Bu = 0 , (3) tive and the vector Dirichlet energy. Readers who are already fa- which shares many properties with the scalar Laplace equation miliar with these topics, or who want to get straight to the appli- ∆u = 0, such as smoothness of the associated flow [BGV96, Chap- cations, can safely skip this section. The discretization and matrix ter 2]. In general, the right-hand side can be any function, but we implementation follow in Section 3. will assume that it is zero for simplicity. The Bochner Laplacian has an associated energy, constructed us- 2.1. The covariant derivative ing integration by parts. Let u,v be smooth vector fields on the sur- face Ω. Then we can write (3), by multiplying with a test function For a vector field u, the covariant derivative ∇u generalizes the v and integrating, as gradient of a scalar function, ∇ f [Lee97, Section 4]. Z Z Z We will be working on a smooth, orientable surface Ω. The ∆Bu · v dx = ∇u : ∇v dx − ∇nu · v dΓ Ω Ω ∂Ω (4) covariant derivative is an operator ∇ : T ( ) × T ( ) → T ( ), Ω Ω Ω n unit boundary normal at ∂Ω , where T (Ω) is the space of tangent vector fields on the smooth surface Ω. It is usually written as ∇vu for two vector fields v,u, where we used (2). By calculus of variation [Eva92, Section 8], the and when the subscript v is omitted, ∇u is interpreted as the op- solution u of (4) is the minimizer of the vector Dirichlet energy, erator that takes v as an argument and returns ∇vu. In the flat Eu- 3 Z clidean space R , with a vector field u written as a column vector 1 2 | E(u) := k∇ukF dx , (5) u = ux uy uz , the covariant derivative is simply componen- 2 Ω twise differentiation,   2 ∂xux ∂yux ∂zux where kXkF := X : X is the Frobenius norm. The boundary term in ∇u = ∂xuy ∂yuy ∂zuy . (4) implies that minimizers will fulfill the Neumann boundary con- ∂xuz ∂yuz ∂zuz dition, ∇nu = 0 at ∂Ω, if no explicit boundary condition is applied

c 2020 The Author(s) Computer Graphics Forum c 2020 The Eurographics Association and John Wiley & Sons Ltd. O. Stein, M. Wardetzky, A. Jacobson & E. Grinspun / A Simple Discretization of the Vector Dirichlet Energy 83

(Neumann conditions are the natural boundary conditions [GF63, that have one L2-integrable weak derivative). Since the Crouzeix- I.6]). Raviart functions are not continuous, they are not themselves con- tained in the solution space. This is in contrast to, for example, La- The vector Dirichlet energy (5) quantifies the smooth- grangian piecewise linear per-vertex basis functions (the so-called ness of a vector field, just like the scalar Dirichlet energy hat functions). They are continuous and piecewise differentiable, E ( f ) = 1 R k∇ f k2dx does for scalar functions. This makes scalar 2 Ω and thus contained in the solution space—they are conforming. the vector Dirichlet energy and its associated Laplace equation useful for applications requiring a notion of vector field smooth- The finite element operators are constructed as one would with ness (see Section4 ). conforming elements, with one subtlety: differential operators are applied to the basis functions within triangles only, and we ig- nore the jumps caused by discontinuities. These jumps are nonzero, but they can be ignored without harming convergence for certain 3. Discretization classes of problems, such as the Poisson equation [Bra07, III]. The Laplace matrix, which discretizes E ( f ) = 1 R k∇ f k2 dx, is 3.1. Scalar Crouzeix-Raviart finite elements scalar 2 Ω given by Our discretization of the vector Dirichlet energy is based on Z

Crouzeix-Raviart finite elements, a simple discontinuous finite Lscalareie j = ∇bei · ∇be j dx = −cotθeie j i 6= j , Ω element. In this section, we introduce the scalar Crouzeix- e ,e Raviart basis functions. More detail can be found in the book of for edges i j sharing a vertex, where θeie j denotes the angle be- Braess [Bra07], Chapter III. tween the edges ei,e j, and the diagonal terms are given by the fact that rows must sum to zero [WBH∗07, p. 504]. The mass matrix, Scalar Crouzeix-Raviart elements are used for applications in which discretizes 1 R | f |2 dx, and contains only diagonal terms ∗ ∗ 2 Ω computer graphics such as simulation [BWH 06,WBH 07,EB08] (without having to use a lumped matrix), is given by and geometry processing [HP04, HTWB11]. Z 2 1 Mscalareiei = bei dx = Aei , Ω 3 Consider a nondegenerate, manifold, and oriented triangle mesh where Aei is the area of the two faces incident on ei. with vertices v ∈ V, edges e ∈ E and faces f ∈ F. There is one As with every nonconforming finite element, one has to be care- Crouzeix-Raviart basis function per edge. The basis function be for edge e is ful for which problem the method is employed. As the functions themselves are not contained in a discrete subspace of the solu- • 0 outside the two triangles neighboring e; tion space, in general, they might not converge, or their limit might • constant 1 at the edge e, and −1 at the vertices opposite e; not solve the smooth PDE. One needs to make sure that the finite • 0 at the edge midpoints not on e; elements are actually amenable to the particular problem. For the • linear within the two triangles neighboring e. Poisson equation, the Crouzeix-Raviart finite element converges on the order of h2, where h is the maximum edge length, given certain Figure2 features an illustration of Crouzeix-Raviart basis func- triangle regularity conditions [Bra07, III.1.5]. tions. Linear combinations of the basis functions ∑e uebe are con- tinuous only at edge midpoints, and in general discontinuous ev- erywhere else. This makes the finite element nonconforming. When 3.2. Vector Crouzeix-Raviart finite elements formulating the Poisson equation, we look for solutions in the space Using the scalar Crouzeix-Raviart element from Section 3.1, we of all continuous, piecewise differentiable functions (to be more now construct a vector Crouzeix-Raviart element. This element ap- precise, we look for solutions in the Sobolev space H1 of functions pears in the work of Stein et al. [SJWG20], where it is used to

1

-1

-1 Crouzeix-Raviart Raviart-Thomas Nédélec

Crouzeix-Raviart basis function Crouzeix-Raviart function Figure 3: Trying to recover the linear planar vector field(x,0)| on the unit disk by fixing its values on the boundary and then min- Figure 2: A Crouzeix-Raviart basis function is 1 at its associ- imizing the Crouzeix-Raviart vector Dirichlet energy (left), as well ated edge, and −1 on the opposing vertices (left). In general, as vector Dirichlet energies constructed by integrating the point- Crouzeix-Raviart functions are discontinuous, except at edge mid- wise covariant derivatives of Raviart-Thomas (center) and Nédélec points (right). (right) basis functions. Only the Crouzeix-Raviart version succeeds.

c 2020 The Author(s) Computer Graphics Forum c 2020 The Eurographics Association and John Wiley & Sons Ltd. 84 O. Stein, M. Wardetzky, A. Jacobson & E. Grinspun / A Simple Discretization of the Vector Dirichlet Energy

compute the one-form Dirichlet energy as part of a larger routine Thomas can not represent functions with to minimize the Hessian energy of a scalar function (but not for curl within the triangle, and Nédélec can not any vector field processing). We use their approach to construct a represent functions with divergence. Even discrete function space for tangent vector fields and discretize the combining both spaces would not suffice, constant vector Dirichlet energy, and then minimize this energy directly for as one would still miss saddle-like linear vector field applications. Our matrices are almost the same as those vector fields (see inset, which shows a ba- of Stein et al. [SJWG20], but differ by a scale factor for each ba- sis of piecewise linear vector fields). These sis function, as our degrees of freedom correspond to unit vectors saddle-like vector fields have non-zero vec- missed by missed by (which is only a difference of convention, and does not have any tor Dirichlet energy E and thus matter for our Nédélec Rav.-Thom. practical implications beyond multiplying matrix entries by the re- purposes. spective edge lengths). This can also be seen by a short degree of The Crouzeix-Raviart finite element is used to discretize a va- freedom argument: since both Nédélec and missed by both n riety of problems in the numerical analysis of flat R . For an Raviart-Thomas have three degrees of freedom per triangle, and overview, we refer the reader to the survey by Brenner [Bre15]. both contain all constant functions (two per triangle), both com- bined can not cover more than four linearly independent functions The linear Raviart-Thomas element (different from our dis- per triangle. There are, however, six linearly independent linear cretization), which is related to the Crouzeix-Raviart element, is functions per triangle. These are exactly the functions represented another popular vector fields discretization [Gat14]. However, it by the six degrees of freedom of the vector Crouzeix-Raviart finite can only be safely used to compute divergence-like operations. The element per triangle. same holds true of the Nédélec linear triangle element for curl-like operations [Hip99] (also known as Whitney element), which is fea- In order to illustrate the need to capture all degrees of freedom tured in Discrete Exterior Calculus [Hir03], and can be used to dis- of linear vector fields, we compared our approach to using the cretize the Hodge Laplacian (but not the Bochner Laplacian ∆B). discontinuous Raviart-Thomas and as Nédélec basis functions. We employed Raviart-Thomas and as Nédélec basis functions Both Raviart-Thomas functions and Nédélec functions consist to construct a discrete vector Dirichlet energy by computing the of one degree of freedom per edge, and every face supports three integrand from (5) for each basis function, ignoring discontinuities basis functions: the two constant functions, plus (for Raviart- (just as one would for Crouzeix-Raviart discontinuous Galerkin), Thomas) functions with zero curl and constant divergence, or fix the boundary of a planar domain to the boundary values (for Nédélec) functions with zero divergence and constant curl. of a Bochner- u, and then trying to globally Since on a flat triangle the space of linear vector fields is six- recover u by minimizing the vector Dirichlet energy. For both dimensional, these approaches can not sample all linear vector Raviart-Thomas as well as Nédélec, the matrix was not invertible, fields on each triangle. Our approach, on the other hand, will so we regularized it with 10−14 Id. by minimizing the vector use six degrees of freedom supported in each triangle, two per Dirichlet energy. In Figure 3, this approach for a linear function edge, and feature exactly the six linear functions on each tri- u using Raviart-Thomas and Nédélec basis functions fails, while angle. Because they do not span all linear vector fields, both the Crouzeix-Raviart approach recovers the function exactly (up to Raviart-Thomas and Nédélec elements are ill-suited for discretiz- numerical error). ing the vector Dirichlet energy using simple per-face integrals. Nei- ther encompasses the full space of linear vector fields—Raviart-

L² error L² error L² error log scale 10⁰

⁻ h² h² 10 ¹ 10⁰ h²

10⁻² 10⁻³ 10⁻² Ours (CR) Ours (CR) 10⁻⁴ Ours (CR) [Knöppel et al. 2013] 10⁻⁵ [Knöppel et al. 2013] [Knöppel et al. 2013] [Knöppel et al. 2015] [Knöppel et al. 2015] [Knöppel et al. 2015] 10⁻⁴ 10⁰ edge length h 10⁻² 10⁰ edge length h 10⁻² 10⁰ edge length h 2·10⁻¹ Figure 4: L2 convergence plots of our method as well as the methods of Knöppel et al. [KCPS13, KCPS15] (the method of Knöppel et al. [KCPS15] is also used by Sharp et al. [SSC19]) for the Dirichlet boundary value problem. The flat (left) and cylindrical (middle) examples show convergence to the exact solution, the cow (right) shows convergence to the respective highest-resolution numerical solution. The figures in the corners are colored by vector magnitude.

c 2020 The Author(s) Computer Graphics Forum c 2020 The Eurographics Association and John Wiley & Sons Ltd. O. Stein, M. Wardetzky, A. Jacobson & E. Grinspun / A Simple Discretization of the Vector Dirichlet Energy 85

To extend the Crouzeix-Raviart element to vectors, we multiply L² error regular triangle refinement the scalar basis functions be with appropriate vectors [SJWG20]. h² At the midpoint of each edge e, we represent all tangent vectors as a linear combination of the following two vectors, 10-1 k • ve , the unit vector parallel to e that points in the same direction as the oriented edge e; ⊥ k 10-2 • ve , the unit vector normal to e that correspoints to ve rotated by Ours (CR) π/2 in the tangent space. [Knöppel et al. 2013] [Knöppel et al. 2015] ⊥ -3 At first glance, ve seems to be ⟂ 10 ambiguously defined, since there is ⟂ ve 0.8 edge length h 0.2 ve no unique normal at the midpoint L² error irregular triangle refinement of e to rotate around. However, in- h² trinsically, the tangent space of the extrinsic mesh (V,E,F), viewed as a polyhe- 10-1 dron, is well-defined away from ver- [Knöppel et al. tices [War06]. A pair of triangles on 2013, 2015] ⟂ its own is intrinsically flat. This means ve Ours (CR) ⟂ -2 that if, at each triangle adjacent to e, ve 10 k 0.8 edge length h 0.2 we rotate ve around the respective tri- angle normal, we get two different ex- Figure 5: Our method, like the methods of Knöppel et al. [KCPS13, ⊥ intrinsic trinsic representations of ve in each KCPS15], converges to the exact solution under regular triangle re- triangle, each corresponding to the same intrinsic tangent vector finement. If the refinement is irregular (for example, because the re- k finement adds many more vertices in one dimension than the other), (see inset). ve is well-defined at the midpoint of e in both adjacent triangles, as the edge e is contained in both triangles. no convergence is observed. k ⊥ The vectors ve and ve , defined at the midpoint of e, can be easily extended along each of the two faces adjacent to e by transporting terms are visited twice when looping over all faces and edges, and them along the flat triangles. This allows us to define two vector both entries must be accumulated. The off-diagonal entries must be basis-functions per edge: added in two places each, i.e., Lα,β = Lβ,α. k k we = beve 1 R 2 By the same approach, the discretization of Ω kukF dx, the ⊥ ⊥ 2 we = beve . diagonal mass matrix, is given by

k ⊥ The we ,we ∀e ∈ E form the basis of our discrete vector space. Ae M k k , M ⊥ ⊥ = , (7) We now use them to compute a discretization of the vector e ,e e ,e 3 Dirichlet operator (5) by plugging each pair of basis functions into the definition of the energy and integrating over triangles. The re- where Ae is the sum of the areas of the two triangles adjacent to e. sulting sparse symmetric matrix L has two degrees of freedom The formulas for the matrices in (6) and (7) are very concise. (DOFs) for each edge e ∈ E, which we will denote by the indices ek They involve no preprocessing, and no complicated mathematical and e⊥. For a DOF vector u, 1 u|Lu will discretize E(u). The ma- 2 operations—simply a loop over all faces, and short formulas in- trix L is constructed using the following formula, which is looped volving basic trigonometry with edge lengths. This is reminiscent over all faces f ∈ F, and all pairs of consecutive edges e ,e ∈ f , i j of the simple construction of the scalar cotangent Laplacian [PP93], which has become ubiquitous in geometry processing due to its 2 |ei| simple construction and good performance. L k k , Le⊥,e⊥ += ei ,ei i i | f | 3.2.1. Other vector Dirichlet energies in literature L k k , L ⊥ ⊥ = 2si j cotθi j cosθi j (6) e ,e ei ,e j i j Many discretizations of the vector Dirichlet energy for non-planar L k ⊥ , −L ⊥ k = 2si j cosθi j , triangle meshes exist, and in this section we aim to give a short ei ,e j ei ,e j overview over alternatives to our discretization. The main differ- ence between most of these methods and our discretization is the where |e | is the length of e , | f | is the area of f , and θ is the an- i i i j simplicity of our matrix assembly: the matrix expressions are very gle between e ,e . s is 1 if the local orientations of e ,e within f i j i j i j simple, and the operators for the entire mesh can be constructed in both agree or disagree with the global orientations of e ,e , and i j one parallelizable loop over all faces using basic operations. −1 if one of them disagrees (i.e., whether a halfedge in f has the same orientation as an arbitrarily chosen global orientation for Knöppel et al. [KCPS13] use a finite element method with de- every edge). We use the notation += to highlight that diagonal grees of freedom on vertices. At each vertex, the vertex neighbor-

c 2020 The Author(s) Computer Graphics Forum c 2020 The Eurographics Association and John Wiley & Sons Ltd. 86 O. Stein, M. Wardetzky, A. Jacobson & E. Grinspun / A Simple Discretization of the Vector Dirichlet Energy

Fitting a smooth vector field to the red vectors zero Dirichlet zero Neumann (natural)

right-hand side

Figure 6: Solving the Bochner-Poisson equation with nonzero [Knöppel et al. 2013] Ours (Crouzeix-Raviart) right-hand side (left). Fixing all boundary degrees of freedom to Figure 7: Minimizing the vector Dirichlet energy subject to con- zero gives a solution with zero Dirichlet boundary conditions (cen- straints is a useful tool for designing smooth vector fields. Our ter), where all isolines are parallel to the boundary. Fixing no de- Crouzeix-Raviart discretization (right) produces outputs similar to grees of freedom gives the natural zero Neumann boundary condi- the discretization of Knöppel et al. [KCPS13] (left). The figure is tions (right), where isolines are perpendicular to the boundary. in log scale.

hood is locally flattened, and its tangent space then parametrized using C. The local flattening of the vertex neighborhood requires a preprocessing step and introduces curvature at every point in the vector Dirichlet energy can be found in Figure 4. We observe con- 2 flattened triangle that needs to be accounted for when constructing vergence on the order of h , similar to the methods of Knöppel et finite element operators. The method of Knöppel et al. [KCPS13] al. [KCPS13] and Knöppel et al. [KCPS15], Sharp et al. [SSC19]. is generalized by Liu et al. [LTGD16], who introduce discrete con- Figure 5 shows that a certain degree of triangle regularity is re- nections to improve results for certain applications. The prepro- quired for convergence. Triangle regular refinement means that the cessing step for constructing globally optimal discrete operators in- maximum ratio between circumcircle and incircle for all triangles volves solving an optimization problem. Knöppel et al. [KCPS15] remains bounded. If this ratio is not appropriately bounded (irreg- and Sharp et al. [SSC19] use a finite-difference-like method that ular refinement) the method diverges. This regularity condition oc- evolves the approach of Knöppel et al. [KCPS13]: the same vertex curs in other finite element methods [Bra07]. flattening preprocessing is performed, but then a finite-difference- like approach is used to construct discrete operators. Custers and The boundary behavior of our Crouzeix-Raviart discretization is Vaxman [CV18] present a subdivision scheme for per-face tangent explored in Figure 6 where the Bochner-Poisson equation ∆Bu = f vectors using a data structure of scalar quantities on halfedges, and is solved with different boundary conditions. If all degrees of free- apply it to vector design and optimal transport. Their basis func- dom (parallel and perpendicular) corresponding to boundary edges tions are constructed using mesh subdivision. A different vertex- are fixed to a given value before minimizing the vector Dirichlet based approach is presented by Jakob et al. [JTPSH15] and ex- energy, the solution u is subject to Dirichlet boundary conditions, tended by Huang et al. [HJ16]. u|∂Ω = g. If no degrees of freedom are explicitly fixed, natural boundary conditions apply, the zero Neumann boundary conditions The methods mentioned so far place their degrees of freedom ∇ u| = 0 (see Section 2.2). This mirrors the standard way to (DOFs) on vertices or faces (halfedges). The fact that our method n ∂Ω enforce Dirichlet and Neumann boundary conditions for the cotan- has its DOFs on edges, is neither an advantage nor a drawback com- gent Laplacian [Bra07]. pared to vertices or faces. Some applications desire DOFs on edges, as vertex DOFs can lead to locking [EB08]. For other applications, Further evaluation of the discretization, such as analysis of its DOFs on vertices or faces might be more appropriate. For yet oth- performance and spectrum, can be found in Appendix A.1. ers, there is no preference. Some methods do not discretize vector fields on meshes di- rectly, and work on a proxy instead. In the work of Azencot et al. [AOCBC15], all computations are performed in the spectral do- 4. Applications main, circumventing the need for discretizing vector fields. This We use our discretization for three popular applications in geome- approach is extended by Azencot et al. [ACBCO17]. Corman and try processing: the design of smooth vector fields, the construction Ovsjanikov [CO19] leverage a functional approach to compute the of Killing fields, and efficient parallel transport of vectors. In all covariant derivative of vector fields. of these applications we take an established method and use our Crouzeix-Raviart discretization to discretize it. We achieve compa- 3.3. Experimental evaluation rable results to previous methods. Convergence experiments for the Dirichlet boundary value problem Unless otherwise noted, figures in this section are colored by of ∆Bu = 0 solved with our Crouzeix-Raviart discretization of the vector magnitude.

c 2020 The Author(s) Computer Graphics Forum c 2020 The Eurographics Association and John Wiley & Sons Ltd. O. Stein, M. Wardetzky, A. Jacobson & E. Grinspun / A Simple Discretization of the Vector Dirichlet Energy 87 mesh 15 steps closed at t=2·10-5 bottom to boundary improve fixed as method input output

Unperturbed function Noisy input Denoised with our method

Figure 9: Solving the vector diffusion equation, we can denoise noisy vector fields (center) to get a smooth result (right) which matches the unperturbed function before adding noise (left).

[Ben-Chen Rotation around Our method i.e., it does not change the geometry of the shape. Such flows can et al. 2010] symm. axis (exact) be useful to find intrinsic symmetries of shapes [BCBSG10], for vi- Figure 8: A Killing field generated with our Crouzeix-Raviart dis- sualization [GMDW09], to compute deformations [SBCBG11], for cretization with regularization α = 10−4 (right) is similar to the surface reconstruction [SBCI17], and as a part of a larger tangent vector field generated by rigidly rotating the shape around the z- vector field processing routine [ABCCO13, AOCBC15]. axis (center) (ground truth), and the Killing field generated with The vector field u is a Killing field if and only if its covari- the method of Ben-Chen et al. [BCBSG10] (left). ant derivative ∇u is a skew-symmetric tensor [Pet06, pp. 188], (∇u)| = −∇u. This motivates the definition of a Killing energy measuring how skew-symmetric the covariant derivative of u is, 4.1. Smooth vector field design Z 1 | 2 EKilling(u) = ∇u + (∇u) F dx . (8) A simple application of the vector Dirichlet energy is find- 2 Ω ing the smoothest vector field given certain constraints. This We can minimize the Killing energy E to find fields is an important basic operation of vector field design, and Killing that are as-Killing-as-possible, subject to certain constraints. The forms a building block for many such applications [KCPS13, 2 | 2 DVPSH14, DVPSH15, KCPS15, AOCBC15, dGDT16, LTGD16, discretization of k∇ukF and (∇u) F is given by our usual VCD∗16, BSEH18, LZC∗18]. Crouzeix-Raviart vector Dirichlet energy discretization. We also add a small amount of additional smoothing, αE(u), to the opti- For this application we solve the following quadratic optimiza- mization as a regularizer to make it more robust—otherwise there tion problem using the Crouzeix-Raviart vector Dirichlet energy L, are spurious minimizers. The mixed term containing both ∇u and (∇u)|, R ∇u : (∇u)| dx, can be straightforwardly implemented 1 | Ω argmin u Lu, u(x1) = u1,...,u(xk) = uk , u 2 following the vector Crouzeix-Raviart approach. Its entries are, looping over all faces f ∈ F and all pairs of consecutive edges for given fixed points x ,...,x , and given values u ,...,u . The 1 k 1 k e ,e ∈ f , result is a smooth vector field that satisfies the given constraints. i j 2 |ei| Figure7 shows an application of this energy minimization to S ⊥ ⊥ += , S k k = −2s sinθ , e ,e e ,e i j i j design a smooth vector field on a surface. The result is simi- i i | f | i j lar to the vector field produced by minimizing the same smooth S ⊥ ⊥ = 2si j cotθi j cosθi j , S k ⊥ , −S ⊥ k = 2si j cosθi j , ei ,e j e ,e e ,e vector Dirichlet energy with the discretization of Knöppel et i j i j al. [KCPS13]. where |ei| is the length of edge ei, | f | is the area of face f , and θ is the angle between e ,e . s is 1 if the local orientations of We can also use the vector Dirichlet energy to denoise data by i j i j i j e ,e within f both agree or disagree with the global orientations of smoothing it. This is achieved by performing one step of the diffu- i j e ,e , and −1 if one of them disagrees. The notation += signifies sion equation, ∂u = −∆ u. This is a popular approach for smooth- i j ∂t B that diagonal terms are visited twice when looping over all faces ing scalar data on meshes and images [DMSB99, YKWT94]. Us- and edges, and both entries must be accumulated. The off-diagonal ing our matrices L and M, the implicit Euler implementation is entries must be added in two places each, i.e., Sα,β = Sβ,α. (M +tL)ut = Mu0 for a noisy input function u0. Examples of de- noising can be seen in Figures 1 and 9. An example of an application of the minimization of EKilling can be seen in Figure 8, where we use it to find an approximate Killing field on a surface. The result is compared to the rotation around 4.2. Killing fields the object’s symmetry axis (an almost exact Killing field), and a A vector field u on the surface Ω is called a Killing field if the geo- discrete Killing field produced with the method of Ben-Chen et metric flow generated by following the vector field is an isometry, al. [BCBSG10].

c 2020 The Author(s) Computer Graphics Forum c 2020 The Eurographics Association and John Wiley & Sons Ltd. 88 O. Stein, M. Wardetzky, A. Jacobson & E. Grinspun / A Simple Discretization of the Vector Dirichlet Energy

transporting the red vector (enlarged) across the surface

101 Error of CR shape operator integrated mean (integrated quantities, with curvature error respect to exact solution) 101 (with respect to highest resolution) 10⁻2 [Sharp et al. 2019] Ours (Crouzeix-Raviart) 10-1 Gauss curv. h² Parallel transport of vectors using the heat method Ours (CR) 5 First principal curv. Figure 10: -3 10⁻ discretized with the Crouzeix-Raviart vector Dirichlet energy 10 Cot. Laplacian Second principal curv. 10-1 h 10-4 10-1 edge length h 10-3 (right) yields very similar results to the discretization of Sharp et edge length al. [SSC19] (left). The color on the mesh is the (scalar) heat dis- Figure 11: Top: computing principal curvature on a variety of tance from the prescribed vector location. The parameter t in the shapes colored by Gaussian curvature (log scale, also computed vector heat method is set to correspond to the mean edge length. using the shape operator). Bottom: preliminary convergence exper- iments suggest similar behavior as other methods (mean curvature compared to cotangent Laplacian [DMSB99]).

4.3. Efficient parallel transport Sharp et al. [SSC19] introduce the vector heat method, an efficient proofs exist for any of the discretizations of the vector Dirichlet way to compute the parallel transport of vectors based on the heat energy for non-planar surfaces mentioned in Section 3.2.1. method for geodesics [CWW13]. They employ the Bochner Lapla- Such a convergence proof is an interesting direction for future cian of vector fields, ∆ u, to solve a vector-valued heat equation, B work. A convergence proof exists for flat domains U ⊆ 2 [Bra07, which is then used in combination with a scalar heat equation to R Theorem II.1.5], forming a natural starting point for a proof of con- propagate vectors over the entire surface efficiently. vergence for our discretization. Additionally, it would be interest- We discretize the vector heat equation using our Crouzeix- ing to explore which features of the smooth vector Dirichlet energy Raviart vector Dirichlet energy L and the associated Crouzeix- carry over to our Crouzeix-Raviart discretization. Which no-free- Raviart vector mass matrix M for the vector parts, and the scalar lunch properties of Laplacian discretizations [WMKG07] hold for Crouzeix-Raviart Dirichlet energy Lscal and mass matrix Mscal for the vector Crouzeix-Raviart discretization? Does it admit a version the scalar parts. The discretized vector heat equation becomes of Rippa’s theorem [Rip90]? (M +tL)vt = Mv0, and the discretized scalar heat equation be- Crouzeix-Raviart finite elements can be unstable for some appli- comes (Mscal +tLscal)ut = Mscalu0. It is easy to naively com- cations (see, for example, the discussion by Quaglino [Qua12] for bine scalar functions and vector fields discretized with Crouzeix- the scalar case). While our discretization of the vector Dirichlet en- Raviart: as there are two vector degrees of freedom (DOFs) for each ergy appears to be robust under appropriate regularity conditions, scalar DOF, whenever a vector needs to be multiplied with a scalar the discretization of the Killing energy of Section 4.2 requires (which happens in step IV of Algorithm 1 by Sharp et al. [SSC19]), normalization with a small amount of the vector Dirichlet energy to both vector DOFs corresponding to the edge e are multiplied with have a good minimizer—otherwise spurious minimizers can occur. the scalar DOF corresponding to e. In Figure 10, we use this algorithm to efficiently compute the parallel transport of a vector across a complicated shape. The 6. Further uses of the Crouzeix-Raviart covariant derivative Crouzeix-Raviart discretization produces a similar result to the discretization used by Sharp et al. [SSC19]. Another example is The Crouzeix-Raviart discretization of the vector Dirichlet energy shown in Figure 1. is attractive because of its simplicity, which does not come at the cost of quality. The Crouzeix-Raviart approach itself, however, can also be used to discretize other differential geometric operators. While not our primary focus, and not necessarily as simple to im- 5. Discussion plement as our discretization of the vector Dirichlet energy, it is intriguing that the same approach can be used to discretize a whole A limitation of this work is the lack of a convergence proof of the family of operators, and we would be remiss not to mention this. Crouzeix-Raviart discretization of the vector Dirichlet energy, even though we do present numerical evidence. Without such a proof, we As an example, consider the Hessian of a function u, ∇∇u. It cannot be completely sure that our approach correctly discretizes can be used, among other things, to construct the shape operator S the Dirichlet energy. However, as far as we know, no convergence of a surface [Pet06, p. 96]. The shape operator encodes all extrin-

c 2020 The Author(s) Computer Graphics Forum c 2020 The Eurographics Association and John Wiley & Sons Ltd. O. Stein, M. Wardetzky, A. Jacobson & E. Grinspun / A Simple Discretization of the Vector Dirichlet Energy 89 sic curvature information of a shape: the largest and smallest local Centre for Quantitative Analysis and Modeling. This work is par- curvatures (the principal curvatures) and their directions. S can be tially supported by the DFG project 282535003: Geometric curva- expressed in terms of the coordinate functions of the embedding of ture functionals: energy landscape and discrete methods. 3 the surface in R , x,y,z. (∇∇x)(v,w) References S(v,w) = −N · (∇∇y)(v,w) , (9)   [ABCCO13] AZENCOT O.,BEN-CHEN M.,CHAZAL F., OVSJANIKOV (∇∇z)(v,w) M.: An operator approach to tangent vector field processing. In Pro- where N is the surface normal, and v,w are tangent vectors. The ceedings of the Eleventh Eurographics/ACMSIGGRAPH Symposium on Geometry Processing (Goslar, DEU, 2013), SGP ’13, Eurographics As- gradient can be discretized using standard piecewise linear hat sociation, pp. 73–82. 7, 9 functions, and the covariant derivative can be discretized using vec- [ACBCO17] AZENCOT O.,CORMAN E.,BEN-CHEN M.,OVSJANIKOV tor Crouzeix-Raviart finite elements (see Appendix A.2). M.: Consistent functional cross field design for mesh quadrangulation. A few preliminary results for this discretization of S can be seen ACM Trans. Graph. 36, 4 (July 2017). 6 in Figure 11, and suggest that integral operators derived from the [AOCBC15] AZENCOT O.,OVSJANIKOV M.,CHAZAL F., BEN-CHEN shape operator can be discretized in a convergent way. It would be M.: Discrete derivatives of vector fields on surfaces – an operator ap- proach. ACM Trans. Graph. 34, 3 (May 2015). 6, 7 interesting future work to try to apply this discretization to some of the applications of the shape operator, such as the computa- [BCBSG10] BEN-CHEN M.,BUTSCHER A.,SOLOMON J.,GUIBAS L.: On discrete killing vector fields and patterns on surfaces. Comput. tion and optimization of geometric energies like the Willmore en- Graph. Forum 29, 5 (2010), 1701–1711. 7 ergy [CPS13], thin shell bending energies [GSH∗04], and others, [BGV96] BERLINE N.,GETZLER E.,VERGNE M.: Heat kernels and and compare the discretization to the many existing discrete shape dirac operators. 2 operators [GGRZ06, GSH∗04, Wei12]. [Bra07] BRAESS D.: Finite Elements: Theory, Fast Solvers, and Appli- A natural question is whether the vector Crouzeix-Raviart ap- cations in Solid Mechanics, 3 ed. Cambridge University Press, 2007. 3, proach is suitable for all differential geometric operations involv- 6, 8 ing vectors. This is not the case. Non-conforming (discontinuous) [Bre15] BRENNER S. C.: Forty years of the crouzeix-raviart element. finite elements like Crouzeix-Raviart should always be used care- Numerical Methods for Partial Differential Equations 31, 2 (2015), 367– 396. 4 fully. Just because they correctly discretize one differential oper- ator of a certain order, does not mean that they can be used for [BSEH18] BRANDT C.,SCANDOLO L.,EISEMANN E.,HILDEBRANDT K.: Modeling n-symmetry vector fields using higher-order energies. other such operators. A simple example, for which our Crouzeix- ACM Trans. Graph. 37, 2 (Mar. 2018). 7 Raviart discretization of vector fields cannot be used, is the energy ∗ 1 R 2 [BWH 06] BERGOU M.,WARDETZKY M.,HARMON D.,ZORIN D., 2 Ω kcurluk dx. By definition, the curl of basis functions normal GRINSPUN E.: A quadratic bending model for inextensible surfaces. In to the edge is always zero, and thus these basis functions do not Proceedings of the Fourth Eurographics Symposium on Geometry Pro- contribute to the energy—any minimizer of the discretized energy cessing (Goslar, 2006), SGP ’06, Eurographics Association, pp. 227– can have an arbitrary normal component at any edge. For such op- 230. 3 erators, other discretization methods are more appropriate [Hip99]. [CO19] CORMAN E.,OVSJANIKOV M.: Functional characterization of deformation fields. ACM Trans. Graph. 38, 1 (Jan. 2019). 6 Beyond the shape operator, interesting future work would be [CPS13] CRANE K.,PINKALL U.,SCHRÖDER P.: Robust fairing via the direct application of the weak covariant derivative to vector conformal curvature flow. ACM Trans. Graph. 32, 4 (2013). 9 fields directly (which does not occur in this work, as we only [Cra20] CRANE K.: Keenan’s 3d model repository, 2020. compute the covariant derivative in the context of energies outside https://www.cs.cmu.edu/~kmcrane/Projects/ ∗ ∗ of this section) [ABCCO13, dGLB 14, HH16, YCL 19], as well ModelRepository/. 9 as discretizing higher-order vector Dirichlet energies used in data [CV18] CUSTERS B.,VAXMAN A.: Subdivision directional fields, 2018. processing and learning [SW12, LHZJ13, LYHY14, Wu17] or in arXiv:1810.06884. 6 physics [MTW73], where the covariant derivative appears in the [CWW13] CRANE K.,WEISCHEDEL C.,WARDETZKY M.: Geodesics Einstein field equations of general relativity. in heat: A new approach to computing distance based on heat flow. ACM Trans. Graph. 32, 5 (Oct. 2013). 8 [dal16] DALIBERATOR: Coca-cola bottle, Mar. 2016. https://www. thingiverse.com/thing:1419319. 9 Acknowledgements [dGDT16] DE GOES F., DESBRUN M.,TONG Y.: Vector field processing Meshes and images used in this work include Venus of Milo on triangle meshes. In ACM SIGGRAPH 2016 Courses (New York, NY, [smk16], cactus [Jac13], Spot the cow [Cra20], Mountain [las15], USA, 2016), SIGGRAPH ’16, Association for Computing Machinery. 7 koala [Yah13], Stanford bunny [Sta14], soda bottle [dal16], goat [dGLB∗14] DE GOES F., LIU B.,BUDNINSKIY M.,TONG Y., DES- head bone [str18], Brucewick and mushroom [Hol20]. BRUN M.: Discrete 2-tensor fields on triangulations. In Proceedings of the Symposium on Geometry Processing (Goslar, 2014), SGP ’14, Euro- We thank Anne Fleming, Henrique Maia, Honglin Chen, Josh graphics Association, pp. 13–24. 9 Holinaty, John Kanji, and Abhishek Madan for proofreading. [DMSB99] DESBRUN M.,MEYER M.,SCHRÖDER P., BARR A.H.: Implicit fairing of irregular meshes using diffusion and curvature flow. This work is supported by the National Science Foundation (NSF In Proceedings of the 26th Annual Conference on Computer Graph- Award IDs CCF-17-17268, IIS-1717178). This work is partially ics and Interactive Techniques (USA, 1999), SIGGRAPH ’99, ACM supported by the Canada Research Chairs Program and the Fields Press/Addison-Wesley Publishing Co., pp. 317–324. 2, 7, 8

c 2020 The Author(s) Computer Graphics Forum c 2020 The Eurographics Association and John Wiley & Sons Ltd. 90 O. Stein, M. Wardetzky, A. Jacobson & E. Grinspun / A Simple Discretization of the Vector Dirichlet Energy

[DVPSH14] DIAMANTI O.,VAXMAN A.,PANOZZO D.,SORKINE- [LHZJ13] LIN B.,HE X.,ZHANG C.,JI M.: Parallel vector field em- HORNUNG O.: Designing n-polyvector fields with complex polynomi- bedding. J. Mach. Learn. Res. 14, 1 (Jan. 2013), 2945–2977. 9 als. Comput. Graph. Forum 33, 5 (Aug. 2014), 1–11. 7 [LTGD16] LIU B.,TONG Y., GOES F. D., DESBRUN M.: Discrete [DVPSH15] DIAMANTI O.,VAXMAN A.,PANOZZO D.,SORKINE- connection and covariant derivative for vector field analysis and design. HORNUNG O.: Integrable polyvector fields. ACM Trans. Graph. 34, ACM Trans. Graph. 35, 3 (Mar. 2016). 6, 7 4 (July 2015). 7 [LYHY14] LIN B.,YANG J.,HE X.,YE J.: Geodesic distance function [EB08] ENGLISH E.,BRIDSON R.: Animating developable surfaces us- learning via heat flow on vector fields. In Proceedings of the 31st Inter- ing nonconforming elements. ACM Trans. Graph. 27, 3 (Aug. 2008), national Conference on International Conference on Machine Learning 1–5. 3, 6 - Volume 32 (2014), ICML’14, JMLR.org, pp. II–145–II–153. 9 ∗ [Eva92] EVANS L.C.: Partial Differential Equations. The American [LZC 18] LIU H.,ZHANG P., CHIEN E.,SOLOMON J.,BOMMES D.: Mathematical Society, 1992. 2 Singularity-constrained octahedral fields for hexahedral meshing. ACM Trans. Graph. 37, 4 (July 2018). 7 [Fan19] FANG C.: An Introduction to Fluid Mechanics. Springer Inter- national Publishing, 2019. 2 [Mac49] MACNEAL R.: The Solution of Partial Differential Equations by Means of Electrical Networks. PhD thesis, The California Institute of [Gat14] GATICA G.N.: A Simple Introduction to the Mixed Finite Ele- Technology, 1949. 2 ment Method. Springer Cham, 2014. 4 [MDSB03] MEYER M.,DESBRUN M.,SCHRÖDER P., BARR A.H.: ELFAND ORMIN [GF63] G I.M.,F S. V.: . Discrete differential-geometry operators for triangulated 2-manifolds. In Prentice-Hall Inc., 1963. 3 Visualization and Mathematics III. Mathematics and Visualization, Hege [GGRZ06] GRINSPUN E.,GINGOLD Y., REISMAN J.,ZORIN D.: Com- H., Polthier K., (Eds.). Springer Berlin Heidelberg, 2003. 1 puting discrete shape operators on general meshes. Comput. Graph. Fo- [MTW73] MISNER C. W., THORNE K.S.,WHEELER J. A.: Gravita- rum 25, 3 (2006), 547–556. 9 tion. 9 RAVE ÜLLER ACHSBACHER UNNER [GMDW09] G F., M T., D C.,W G.: [Pet06] PETERSEN P.: Riemannian Geometry. Springer Science + Busi- The gödel engine - an interactive approach to visualization in general ness Media, LLC, 2006. 2, 7, 8 relativity. In Proceedings of the 11th Eurographics / IEEE - VGTC Con- ference on Visualization (Chichester, 2009), EuroVis’09, The Eurographs [PP93] PINKALL U.,POLTHIER K.: Computing discrete minimal sur- Association & John Wiley & Sons, Ltd., pp. 807–814. 7 faces and their conjugates. Experiment. Math. 2, 1 (1993), 15–36. 5 [GSH∗04] GINGOLD Y., SECORD A.,HAN J. Y., GRINSPUN E.,ZORIN [Qua12] QUAGLINO A.: Membrane Locking in Discrete Shell Theories. D.: A discrete model for inelastic deformation of thin shells. preprint PhD thesis, University of Göttingen, May 2012. 8 (2004). 9 [Rip90] RIPPA S.: Minimal roughness property of the delaunay triangu- [HH16] HILL D.J.,HENDERSON R. D.: Efficient fluid simulation on lation. Computer Aided Geometric Design 7, 6 (1990), 489–497. 8 the surface of a sphere. ACM Trans. Graph. 35, 2 (Apr. 2016). 9 [SBCBG11] SOLOMON J.,BEN-CHEN M.,BUTSCHER A.,GUIBAS L.: [Hip99] HIPTMAIR R.: Canonical construction of finite elements. Math. As-killing-as-possible vector fields for planar deformation. Comput. Comp. 68 (1999), 1325–1346. 4, 9 Graph. Forum 30, 5 (2011), 1543–1552. 7 [Hir03] HIRANI A.N.: Discrete Exterior Calculus. PhD thesis, Califor- [SBCI17] SLAVCHEVA M.,BAUST M.,CREMERS D.,ILIC S.: Killing- nia Institute of Technology, 2003. 4 fusion: Non-rigid 3d reconstruction without correspondences. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR) [HJ16] HUANG Z.,JU T.: Extrinsically smooth direction fields. Com- (July 2017). 7 puters & Graphics 58 (2016), 109–117. Shape Modeling International 2016. 6 [SJWG20] STEIN O.,JACOBSON A.,WARDETZKY M.,GRINSPUN E.: A smoothness energy without boundary distortion for curved surfaces. [Hol20] HOLINATY J.: Meshes, 2020. provided by https:// ACM Trans. Graph. 39, 3 (Mar. 2020). 2, 3, 4, 5 github.com/odedstein/meshes/tree/master/objects/ brucewick and https://github.com/odedstein/meshes/ [smk16] SMKMUSEUM: Venus de milo (aphrodite of milos), Nov. 2016. tree/master/objects/mushroom. 9 https://www.thingiverse.com/thing:1892710. 9 [SSC19] SHARP N.,SOLIMAN Y., CRANE K.: The vector heat method. [HP04] HILDEBRANDT K.,POLTHIER K.: Anisotropic filtering of non- linear surface features. Comput. Graph. Forum 23, 3 (2004), 391–400. ACM Trans. Graph. 38, 3 (June 2019). 4, 6, 8 3 [Sta14] STANFORD GRAPHICS: The stanford 3d scanning repos- itory, 2014. http://graphics.stanford.edu/data/ [HTWB11] HUANG J.,TONG Y., WEI H.,BAO H.: Boundary aligned 3Dscanrep/ smooth 3d cross-frame field. ACM Trans. Graph. 30, 6 (Dec. 2011), 1–8. . 9 3 [str18] STRONGHERO: goat head bone, July 2018. https://www. thingiverse.com/thing:2995807. 9 [Jac13] JACOBSON A.: Algorithms and Interfaces for Real-Time Defor- mation of 2D and 3D Shapes. PhD thesis, ETH Zürich, 2013. 9 [SW12] SINGER A.,WU H.-T.: Vector diffusion maps and the connec- tion laplacian. Communications on Pure and Applied Mathematics 65, 8 [JTPSH15] JAKOB W., TARINI M.,PANOZZO D.,SORKINE-HORNUNG (2012), 1067–1144. 9 O.: Instant field-aligned meshes. ACM Trans. Graph. 34, 6 (Oct. 2015). 6 [VCD∗16] VAXMAN A.,CAMPEN M.,DIAMANTI O.,PANOZZO D., BOMMES D.,HILDEBRANDT K.,BEN-CHEN M.: Directional field [KCPS13] KNÖPPEL F., CRANE K.,PINKALL U.,SCHRÖDER P.: Glob- synthesis, design, and processing. Comput. Graph. Forum 35, 2 (2016). ally optimal direction fields. ACM Trans. Graph. 32, 4 (July 2013). 4, 5, 7 6, 7 [War06] WARDETZKY M.: Discrete Differential Operators on Polyhe- [KCPS15] KNÖPPEL F., CRANE K.,PINKALL U.,SCHRÖDER P.: Stripe dral Surfaces – Convergence and Approximation. PhD thesis, FU Berlin, patterns on surfaces. ACM Trans. Graph. 34, 4 (July 2015). 4, 5, 6, 7 November 2006. 5 [las15] LASTLOGINNAME: Mountain, Aug. 2015. https://www. [WBH∗07] WARDETZKY M.,BERGOU M.,HARMON D.,ZORIN D., thingiverse.com/thing:991578. 9 GRINSPUN E.: Discrete quadratic curvature energies. Computer Aided [Lee97] LEE J.M.: Riemannian Manifolds. Springer-Verlag New York Geometric Design 24, 8 (2007), 499–518. Discrete Differential Geome- Inc., 1997. 2 try. 3

c 2020 The Author(s) Computer Graphics Forum c 2020 The Eurographics Association and John Wiley & Sons Ltd. O. Stein, M. Wardetzky, A. Jacobson & E. Grinspun / A Simple Discretization of the Vector Dirichlet Energy 91

L² error 10-1 L² error varying triangle 100 h² sizes 10-3 h²

10-2 h Ours (CR) [Knöppel et al. 2013] Ours (CR) 10-5 [Knöppel et al. 2015] [Knöppel et al. 2013] 10-4 [Knöppel et al. 2015] 100 edge length h 2·10-1 (stream lines) 10-2 matrix solve time in s 100 Figure 12: Repeating the experiment from Figure 4 (right), with Repeating experiment from Figure 4 , plotting regular refinement, but on a mesh with varying triangle sizes. The Figure 13: (center) the error with respect to matrix solve time on a 2017 13” Mac- same convergence behavior is still observed. book Pro. All methods convergence at similar rates (have similar performance).

[Wei12] WEISCHEDEL C.: A Discrete Geometric View on Shear- error in 1ˢᵗ eigenvalue Deformable Shell Models. PhD thesis, University of Göttingen, 2012. 9 10-0

[WMKG07] WARDETZKY M.,MATHUR S.,KÄLBERER F., GRINSPUN h² E.: Discrete laplace operators: No free lunch. In Proceedings of the Fifth Eurographics Symposium on Geometry Processing (Goslar, 2007), SGP -2 ’07, Eurographics Association, pp. 33–37. 8 10

[Wu17] WU H.-T.: Embedding riemannian manifolds by the heat kernel of the connection laplacian. Advances in Mathematics 304 (2017), 1055– Ours (CR) 1079. 9 10-4 [Knöppel et al. 2013] [Yah13] YAHOOJAPAN: Koala, Nov. 2013. https://www. [Knöppel et al. 2015] thingiverse.com/thing:182225. 9 100 edge length h 10-1 10-2 [YCL∗19] YANG B.,CORSE W., LU J.,WOLPER J.,JIANG C.-F.: Real- time fluid simulation on the surface of a sphere. Proc. ACM Comput. Figure 14: Convergence plot of the first eigenvalue of the vector Graph. Interact. Tech. 2, 1 (June 2019). 9 Dirichlet energy on the sphere, the exact solution is 1. Convergence [YKWT94] YU-LI YOU,KAVEH M.,WEN-YUAN XU,TANNENBAUM is observed for all tested methods on the same order. A.: Analysis and design of anisotropic diffusion for image processing. In Proceedings of 1st International Conference on Image Processing (Nov 1994), vol. 2, pp. 497–501. 7

f ∈ F and all triples of consecutive edges ei,e j,ek ∈ f , the discrete Appendix gradient of a hat function u is

A.1. Further experiments G(u) = M−1D(u)

In this appendix, we present a few more evaluations of our si| f | D(u) k += (u j − ui) Crouzeix-Raviart discretization of the vector Dirichlet energy. Fig- ei 3ei ure 12 shows that convergence is not impacted by varying triangle si  2  D(u)e⊥ += − |ei| (u j + ui) + (|ek| − e j )(u j − ui) sizes across a mesh, as long as refinement is still regular. In Figure i 12|ei| 13, the error of the method with respect to runtime is evaluated, s e + i i u , and compared with previous methods. Asymptotically, all methods 6 k perform similarly. Figure 14 analyzes the spectrum of the vector Dirichlet energy. By comparing to a known exact solution, we see where |ei| is the length of edge ei, ui is the function u evaluated at that the first eigenvalue of our discretization converges on the same the tail of ei (with respect to the orientation of ei within the face), order as other methods. and | f | is the area of face f . si is 1 if the local orientation of ei within f agrees with the global orientation of ei, and −1 if it dis- agrees. The notation += signifies that a term is visited twice when A.2. Shape operator looping over all faces and edges, and both entries must be accu- mulated. The gradient G(u) is computed for all three coordinate To discretize the shape operator with Crouzeix-Raviart finite ele- functions. ments, (9) is discretized in two parts: the gradients ∇x,∇y,∇z are computed using the discrete gradient operator G that maps from the The discrete per-face shape operator S is computed using the dis- space of piecewise linear hat functions with degrees of freedom on crete gradient of the coordinate functions, G(x),G(y),G(z). Loop- vertices to tangent Crouzeix-Raviart vectors. Looping over all faces ing over all faces f ∈ F and all edges ei ∈ f , the discrete shape

c 2020 The Author(s) Computer Graphics Forum c 2020 The Eurographics Association and John Wiley & Sons Ltd. 92 O. Stein, M. Wardetzky, A. Jacobson & E. Grinspun / A Simple Discretization of the Vector Dirichlet Energy

operator is    G(x) k ei si|ei| ⊥ k  G(y) k  | S f += N f ·  e vi (v ) | f |   i  i G(z) k ei    G(x)e⊥ s |e | i i i ⊥ ⊥ | + N f · G(y)e⊥ vi (vi ) , | f |   i  G(z) ⊥ ei k where |ei| is the length of edge ei, vi is the normalized edge vector belonging to ei (with respect to the orientation of ei within the face), ⊥ k π vi is vi rotated by 2 , N f is the normal vector of the face f , and | f | is the area of face f . si is 1 if the local orientation of ei within f agrees with the global orientation of ei, and −1 if it disagrees. The notation += signifies that a term is visited twice when looping over all faces and edges, and both entries must be accumulated. The k term involving vi is zero away from the boundary.

c 2020 The Author(s) Computer Graphics Forum c 2020 The Eurographics Association and John Wiley & Sons Ltd.