# Discrete Exterior Calculushelper.ipam.ucla.edu › publications › mbi2004 › mbi2004_3836.pdf•...

### Transcript of Discrete Exterior Calculushelper.ipam.ucla.edu › publications › mbi2004 › mbi2004_3836.pdf•...

Discrete Exterior Calculusand the Averaged Template Matching Equations

Anil N. Hirani

Jet Propulsion Laboratory

California Institute of Technologyhirani at caltech dot edu

http://www.cs.caltech.edu/˜hirani

Mathematics in Brain Imaging

Institute for Pure and Applied Mathematics, UCLA July 15, 2004

2

This talk is mostly based on my thesis :Discrete Exterior CalculusCaltech, 2003 (Hirani [2003])supervised by Prof. Jerrold E.Marsden. Thesis availablefrom my home page.

3

Main Points

• PDEs using differential forms and vector fields.

• Distinction between forms and vector fields.

• Examples : Template matching, Maxwell’s equations.

4

Introduction

5

What is Discrete Exterior Calculus (DEC) ?

• Exterior Calculus:

Generalization of vector calculus to nonlinear manifolds.

Operators and objects for full tensor analysis on manifolds.

Many theorems connecting the operators and objects.

• Discrete Exterior Calculus:

Discretization of EC for use in computations.

Operators defined without global coordinates.

Discrete versions of the theorems from smooth theory.

DEC is calculus, differential geometry, and tensor analysis ondiscrete spaces. We aim topreserve, in discrete case, thestructureofsmooth theory.

6

Template Matching

Diff(M) = Lie group of diffeomorphisms of image rectangle MDiffeomorphism = smooth map with smooth inverse

Geodesic on Diff(M)

Identity map Diffeomorphism that takes image g to image f

Image f Image g

Images to becompared

7

Averaged Template Matching Equations

• Euler-Poincare equation, called ATME (Hirani et al.[2001]).

• Nonlinear waves (IVP), work of Holm and Staley.

• BVP to IVP for ATME in 1D (Chapman et al.[2002]).

• DEC and irregular grids.

ATME in Div, Grad, Curl form∂

∂tv + (∇ · u)v +∇(u · v) + (∇× v)× u = 0 .

ATME in Lie derivative form∂

∂tv[ + £uv[ + v[ div u = 0 .

wherev = (1 − α2∆)u.

8

Objects of Exterior Calculus and DEC

ExteriorCalculus

Examples Discrete Exterior Calculus

ManifoldsSurface, SO(3),RP2, G(k, n)

Simplicial complex and itsdual

Differentialforms

df, dx ∧ dy ∧ dz,vorticity, force

Numbers on oriented meshelements or their duals

Vector fields VelocityVectors on primal or dualvertices

Other tensorsStress tensor,metric tensor

Tensor product of1-forms ?

9

Operators of Exterior Calculus

Metric-dependent operators

• Hodge star (∗) relates complementary forms

• Flat ([), sharp (]) relate vector fields to forms

• These are used to define∇, ∇× and∆.

Metric-independent operators

• Exterior derivative (d)

• Wedge product (∧) to combine forms

• Interior product (iX) to combine forms and vector fields

• Lie derivative (£X) for derivatives along flows.

10

Review of Existing Results

11

Maxwell’s Equations and DEC

• Differential k-forms

Antisymmetrick-tensors on a manifold,M.

A k-form α atp ∈ M, α : TpM× . . .× TpM→ R.

For submanifoldSk (dim = k) of M∫Sk α ∈ R

• Exterior derivative(d), a differential operator subsuming allvector calculus operators,dα is a(k + 1)-form.

• Hodge star, (∗), isomorphism betweenk-forms and(n − k)-forms.

12

Maxwell’s Equations

Maxwell’s equations in presence of an isotropic, linear, medium.

• Faraday’s and Ampere’s laws :

∂tB +∇× E = 0 (Faraday’s law)−∂tD +∇× H = J (Ampere’s law)

• Constitutive relations :

D = εEB = µH

E is electric field B is magnetic flux densityD is electric induction H is magnetic fieldJ is current density.

13

Fields versus Global Quantities

• E cannot be measured, its work along a curve can :∫c

E · c .

• B cannot be measured, its flux through a surface can :∫S

B · n .

• E andB depend on choice inner product.

• Curl, used in the two laws, also depends on metric.

• Why not use differential forms instead ?

• Electric fielde is a 1-form andb a 2-form and∫ce =

∫c

E · c∫Sb =

∫S

B · n

14

Maxwell’s using Differential Forms

∂tb + de = 0

−∂td + dh = j

d = ∗εe

b = ∗µh

e, h are 1-formsb, d are 2-forms.

15

Discretizing Faraday’s Law

∂tb + de = 0 (Start with differential forms)

∂t

∫Sb +

∫S

de = 0 (Write in integral form)

• ForS, use all the facets of the tetrahedral mesh.

• This givesF (number of facets) DOF forb.

• Similarly there areE (number of edges) DOF fore.

• Semi-discrete Faraday’s law in matrix form :∂tb + Re = 0.

16

Discrete Differential Forms

11

80 52 17 9

6679

31

23

455

78

9632

98

66 9551

1

1033

834

321

57

115

8345

54

435

9

2611 89

47

33

61

• A primal discretep-form is a homomorphism from the chaingroupCp(K; R) to the additive groupR. Thus a discretep-form isan element of Hom(Cp(K), R) the space ofcochains.

• In discrete Faraday’s law,b is a discrete 2-form, ande is adiscrete 1-form.

17

Discrete Exterior Derivative

• Smooth exterior derivatived : Ωp(M)→ Ωp+1(M). Forexample inR2, in coordinates:

df =∂f

∂xdx +

∂f

∂ydy

• The boundary operator on chains gives a chain complex

0 −→ Cn (K)∂n−→ . . .

∂p+1−→ Cp (K)∂p−→ . . .

∂1−→ C0 (K) −→ 0

• The co-boundary operator gives a co-chain complex

0 ←− Cn (K)δn−1←− . . .

δp←− Cp (K)δp−1←− . . .

δ0←− C0 (K) ←− 0

• For a discrete formαp ∈ Cp(K) and a chaincp+1 ∈ Cp+1(K; R)

the co-boundary operatorδp is⟨δpαp, cp+1

⟩=

⟨αp, ∂p+1cp+1

⟩• Definediscrete exterior derivativeto be the co-boundary operator.

18

Discrete Exterior Derivative

78

9632

98

66 9551

1

1033

834

321

57

115

83453

45

−34

• Just add up values shown on little triangle on right.

• Discreted is the coboundary :〈dα1, σ2〉 = 〈α1, ∂σ2〉• Discrete Stokes’ theorem is true by definition.

• d d = 0.

• In discrete Faraday’s law,∂tb + Re, the matrixR is the discreteexterior derivative,b is a discrete 2-form ande is a discrete1-form.

19

Discretizing Constitutive Laws

• Next we do a count, using constitutive equations :

d = ∗εe

b = ∗µh

• Recall that :

e is a 1-form whiled is a 2-form

b is a 2-form whileh is a 1-form

• e lives on edges andd lives on surfaces. Which surfaces in themesh ? Need as many 2 dimensional surfaces as edges.

• Enter the dual mesh ...

20

Primal Simplicial Complex and its Dual

• If σp is p-simplex,?σp (dimensionn − p) is its dual defined by

? (σp) =∑

σp≺σp+1≺...≺σn

sσp,...,σn

[c(σp), c(σp+1), . . . , c(σn)

]wheresσp,...,σn is a sign given by a simple algorithm,c(σk) is thecircumcenter ofσk.

• Dual of dual is defined to be primal

? ? (σp) = (−1)p(n−p)σp

• We discovered a simple algorithm for orienting the dual.

21

Primal Simplicial Complex and its Dual

σ0, 0-simplex σ1, 1-simplex σ2, 2-simplex σ3, 3-simplex

?(σ0) 3-cell ?(σ1), 2-cell ?(σ2), 1-cell ?(σ3), 0-cell

22

Discrete Hodge Star

• Smooth hodge star∗ : Ωp(M)→ Ωn−p(M). Used, forexample, to define codifferential which in turn appears in div,curl, Laplace-Beltrami. The codifferential is defined byδβ = (−1)np+1 ∗ d ∗ β.

• Discrete Hodge Staris an information transfer between primaland dual meshes and defined as :

1

|σp|〈α, σp〉 =

1

| ? σp|〈∗α, ?σp〉 .

• For example for a primal 2-formα, forn = 3 :

1

Area(T)〈α, T〉 =

1

Length(e)〈∗α, e〉 .

e

T

23

Now on to New Stuff

What was Known Before DEC

• Forms should be used instead of proxy vector fields.

• Discrete forms are cochains on primal and dual meshes.

• Discrete exterior derivative is co-boundary operator.

What DEC Introduced

• Algorithm for orienting the dual mesh.

• Discrete wedge product.

• Reproduction of well-known formulas for Laplace-Beltrami etc.

• Vector fields as distinct from forms.

• Operators acting on vector fields (flat) or vector fields and formstogether (contraction, Lie derivative).

24

History and Previous Work

• Physics :Tonti [2002]; Sen et al.[2000]; Schwalm et al.[1999]

• Computational Electromagnetism :Bossavit[2002, 2001];Hiptmair [2001, 2002]; Teixeira[2001]; Gross and Kotiuga[2001]

• Mimetic Discretization :Robidoux and Steinberg[2003]; Hymanand Shashkov[1997a,b]

• Numerical Analysis :Nicolaides[1992]; Mattiussi[1997];Arnold [2003]; Trapp[2004]

• Computer Graphics :Meyer et al.[2002]; Gu [2002]

• Mathematics :Dodziuk[1976]; Harrison[1993]; Dezin[1995];Mitchell [1998]; Mansfield and Hydon[2001]

• Recent Work : WorkshopCompatible Spatial Discretization ofPartial Differential Equations, May 11-15, 2004, Institute forMathematics and its Applications (IMA), Minneapolis.

25

Contributions

26

Discrete Laplace-Beltrami

• With d and Hodge star, we can define Laplace-Beltrami.

• Definediscrete Laplace-de Rham operatorby the smoothdefinition∆ = dδ + δd .

1

|σ0|〈∆f, σ0〉 = −〈δdf, σ0〉

= −〈∗d ∗ df, σ0〉

= −1

| ? σ0|〈d ∗ df, ?σ0〉

= −1

| ? σ0|〈∗df, ∂(?σ0)〉

V

27

Discrete Laplace-Beltrami

= −1

| ? σ0|〈∗df,

∑σ1σ0

?σ1〉

= −1

| ? σ0|

∑σ1σ0

〈∗df, ?σ1〉

= −1

| ? σ0|

∑σ1σ0

| ? σ1|

|σ1|〈df, σ1〉

= −1

| ? σ0|

∑σ1σ0

| ? σ1|

|σ1|(f(v) − f(σ0))

V

• This is identical to the cotangents based formula found byMeyeret al.[2002] using a variational approach.

28

Moving Conductor and DEC

• Eddy current equation in vector field notation :

σ∂tA +∇× (ν∇× A) = Js

whereA = −∫t0 E(s)ds.

• If conductive material is moving with a velocity fieldv, theequation becomes :

σ(∂tA − v × B) +∇× (ν∇× A) = Js

• What isv × B in terms of forms ?

• Hint : F = q(E + v × B).

• v × B is ivb.

• What is a good discretization of contraction ?

• First we need to introduce discrete vector fields.

29

Discrete Vector Fields

30

Distinction Between Forms and Vector Fields

• Vector fields are related to 1-forms and 2-forms via metric.

• In R3 we have :Space Representative Dimension0-forms Scalar 11-forms Row Vector 32-forms Antisymmetric Matrix 33-forms Volume form 1

• Thus inR3, 1-forms and 2-forms have same dimension (i.e 3), asvector fields.

• But they shouldn’t be identified in a general theory since :

(£Xα)] 6= £X(α])

(∗(£Xβ))] 6= £X((∗β)])

31

Interior Product (Contraction)

• Interior product iX : Ωp(M)→ Ωp−1(M), lowers the degree ofa form. For a vector fieldX andk-form α,

iXα := α(X, . . .) .

32

Discrete Interior Product (1)

• Definediscrete interior productof a discretek-form α and avector fieldX on ann-dimensional complex by :

iXα := (−1)k(n−k) ∗ (∗α ∧ X[) .

• For example for 2-formα = b and vector fieldX = v,

ivb = ∗(∗b ∧ v[) .

33

Discrete Interior Product (2)

• Another definition is based on the discretization of

Lemma. ∫S

iXβ =d

dt

∣∣∣∣t=0

∫EX(S,t)

β .

• Example : contract 2-formb and vector fieldv in 3D :

Result is a 1-form.

Value of iXα on an edge ?

Edge sweeps out a surface depending on time.

Evaluateα on surface, take time derivative at 0.

But swept surface may not be a facet.

Leads us to interpolation of discrete forms.

34

Interpolation of Discrete Forms : Whitney Forms

• Whitney form is to discrete form, as linear basis function is toscalar function in finite elements.

• Built from the linear basis functions over simplex.

• Example : Whitney 1-forms inR3. There are 6, corresponding toedges of a tetrahedron.

φmn = φmdφn − φndφm (invariant form)φmn = φm∇φn − φn∇φm (proxy form)

140 CHAPTER 5 Whitney Elements

tetrahedron T, equal to 1/vol(T) on T and 0 elsewhere. (Its analyticalexpression in the style of (9) and (10), which one may guess as an exercise,is of little importance.)

n

e

mm

n

l

k

x

f

FIGURE 5.4. Left: The “edge element”, or Whitney element of degree 1 associatedwith edge e = m, n, here shown on a single tetrahedron with e as one of itsedges. Right: The “face element”, or Whitney element of degree 2 associatedwith face f = l, m, n, here shown on a single tetrahedron with f as one of itsfaces. The arrows suggest how the vector fields we and w f, as defined in (9)and (10), behave. At point m on the left, for instance, we = ∇wn , after (9), andthis vector is orthogonal to the face opposite m. At point m on the right, w f =∇wn × ∇wl, after (10); this vector is orthogonal to both ∇wn and ∇wl, andhence parallel to the planes that support faces l, m, k and k, m, n, that is, totheir intersection, which is edge k, m.

Thus, to each simplex s is attached a field, scalar- or vector-valued.These fields are the Whitney elements. (The proper name is “Whitneyforms” in the context in which they were introduced [Wh].) We’ll reviewtheir main properties, all easy to prove. First,

- The value of wn at node n is 1 (and 0 at other nodes),

- The circulation of we along edge e is 1,

- The flux of wf across face f is 1,

- The integral of wT over tetrahedron T is 1,

(and also, in each case, 0 for other simplices).For degree 0, we already knew that, and for degree 3, it it so by way

of definition. Let us prove the point for degree 1, i.e., about the circulationof we. Since the tangent vector τ is equal to mn/|mn|, one has, withhelp of Lemma 4.1,

∫e τ · (wm ∇wn) = mn · ∇wn (∫e wm)/|mn| = (∫e wm)/|mn|,

Figure fromBossavit[1998]

35

Euler Equations of Fluid and Template Matching

• Euler equations for homogenous, incompressible fluid of constantdensity 1, and with no body force :

∂tu + (u · ∇)u = −∇p

∇ · u = 0 .

• Using differential forms :

∂tu + £uu[ −1

2d(u[(u)) = −dp .

• Averaged Template Matching Equations :

∂

∂tv[ + £uv[ + v[ div u = 0 .

• Thus we need discrete flat operator and discrete Lie derivative.

36

Lie Derivative

• Lie derivative of a tensor along a vector field is its derivativealong the flow. No need for a metric onM. For ak-form α andvector fieldX ∈ X(M) :

£Xα :=d

dt

∣∣∣∣t=0

ϕ∗tα

where

(ϕ∗tα)|p (v1, . . . , vk) = α|ϕt(p)

(Tpϕt(v1), . . . , Tpϕt(vk)

)

37

Discrete Lie Derivative (2 definitions)

• Definediscrete Lie derivativealgebraically using Cartan’sHomotopy formula

£Xω := iXdω + diXω .

• Define it dynamically using the following lemma :

Lemma. If at timet, submanifoldS is carried toSt by the flow ofX, then: ∫

S£Xβ =

d

dt

∣∣∣∣t=0

∫St

β

• Dotted magenta line shows edge[v0, v1]at timet as it is dragged by vector fieldX.Then〈£Xα, [v0, v1]〉 requires the value ofα at intermediate positions.

S 1

v2

v3

v0

t

v

X

S

38

Convergence and Stability

• SeeDodziuk[1976]; Bossavit[2002]; Arnold [2003]; Garimellaand Swartz[2003]; Xu [2003, 2004]; Trapp[2004] and slides ofseveral talks at the IMA Hot Topics workshop : CompatibleSpatial Discretizations of Partial Differential Equations. Alsosome new work by group at ZIB, Berlin.

39

Summary

• Discrete wedge product, sharp, flat, div, grad and curl have alsobeen developed but were not discussed today.

• Well-known discrete formulas are reproduced by DEC.

• DEC distinguishes between forms and vector fields.

• DEC also clarifies the role of Riemannian metric in numerics onnon-flat meshes (Hodge star, LB, flat and sharp).

• It is the first step towards a full tensor analysis on non-flat meshes.

• Vector fields allows for moving mesh applications.

• Discretizing the EC operators unifies diverse computational fields.

• DEC preserves some of the structure of smooth theory.

REFERENCES 40

*References

Douglas N. Arnold. Differential complexes and numerical stability. 2003.

Alain Bossavit.Computational Electromagnetism : Variational Formulations, Complementarity, Edge Elements.Academic Press, 1998.

Alain Bossavit. Generalized finite differences in computational electromagnetics. In F. L. Teixeira, editor,GeometricMethods for Computational Electromagnetics, chapter 2. EMW Publishing, 2001. URLhttp://ceta-mac1.mit.edu/pier/pier32/pier32.html .

Alain Bossavit. On “generalized finite differences” : a discretization of electromagnetic problems. 2002.

S. Jon Chapman, Anil N. Hirani, and Jerrold E. Marsden. Analysis of 1D template matching equations (talk athyp2002, caltech). 2002.

Aleksei A. Dezin.Multidimensional analysis and discrete models. CRC Press, Boca Raton, FL, 1995. Translated fromthe Russian by Irene Aleksanova.

Jozef Dodziuk. Finite-difference approach to the Hodge theory of harmonic forms.Amer. J. Math., 98(1):79–104,1976.

Rao V. Garimella and Blair K. Swartz. Curvature estimation for unstructured triangulations of surfaces. 2003.

P.W. Gross and P.R. Kotiuga. Data structures for geometric and topological aspects of finite element algorithm. In F. L.Teixeira, editor,Geometric Methods for Computational Electromagnetics, chapter 6. EMW Publishing, 2001. URLhttp://ceta-mac1.mit.edu/pier/pier32/pier32.html .

Xianfeng Gu.Parametrization for surfaces with arbitrary topology. PhD thesis, Harvard University, 2002.

REFERENCES 41

Jenny Harrison. Stokes’ theorem for nonsmooth chains.Bull. Amer. Math. Soc. (N.S.), 29(2):235–242, 1993.

R. Hiptmair. Discrete Hodge operators.Numer. Math., 90(2):265–289, 2001.

R. Hiptmair. Discretization of Maxwell’s equations. InNumerical Relativity Workshop, 2002.

Anil N. Hirani. Discrete Exterior Calculus. PhD thesis, California Institute of Technology, May 2003. URLhttp://resolver.caltech.edu/CaltechETD:etd-05202003-095403 .

Anil N. Hirani, Jerrold E. Marsden, and James Arvo. Averaged template matching equations. InEnergy MinimizationMethods in Computer Vision and Pattern Recognition, LNCS 2134, pages 528–543. Springer–Verlag, 2001. URLhttp://www.cs.caltech.edu/˜˜hirani/research/papers/HiMaAr2001_EMMCVPR.pdf .

J. M. Hyman and M. Shashkov. Natural discretizations for the divergence, gradient, and curl on logically rectangulargrids. Comput. Math. Appl., 33(4):81–104, 1997a.

James M. Hyman and Mikhail Shashkov. Adjoint operators for the natural discretizations of the divergence, gradientand curl on logically rectangular grids.Appl. Numer. Math., 25(4):413–442, 1997b.

Elizabeth L. Mansfield and Peter E. Hydon. On a variational complex for difference equations. InThe geometricalstudy of differential equations (Washington, DC, 2000), volume 285 ofContemp. Math., pages 121–129. Amer.Math. Soc., Providence, RI, 2001.

Claudio Mattiussi. An analysis of finite volume, finite element, and finite difference methods using some conceptsfrom algebraic topology.Journal of Computational Physics, 1997.

Mark Meyer, Mathieu Desbrun, Peter Schroder, and Alan H. Barr. Discrete differential-geometry operators fortriangulated 2-manifolds. InInternational Workshop on Visualization and Mathematics, VisMath, 2002.

Julie C. Mitchell.Hodge decomposition and expanding maps on flat tori. PhD thesis, Department of Mathematics,University of California, Berkeley, 1998.

REFERENCES 42

R. A. Nicolaides. Direct discretization of planar div-curl problems.SIAM J. Numer. Anal., 29(1):32–56, 1992.

Nicolas Robidoux and Stanly Steinberg. A discrete vector calculus in tensor grids. 2003.

W. Schwalm, B. Moritz, M. Giona, and M. Schwalm. Vector difference calculus for physical lattice models.Phys. Rev.E (3), 59(1, part B):1217–1233, 1999.

Samik Sen, Siddhartha Sen, James C. Sexton, and David H. Adams. Geometric discretization scheme applied to theabelian Chern-Simons theory.Phys. Rev. E (3), 61(3):3174–3185, 2000.

F. L. Teixeira. Geometric aspects of the simplicial discretization of Maxwell’s equations. In F. L. Teixeira, editor,Geometric Methods for Computational Electromagnetics, chapter 7. EMW Publishing, 2001. URLhttp://ceta-mac1.mit.edu/pier/pier32/pier32.html .

E. Tonti. Finite formulation of electromagnetic field.IEEE Trans. Mag., 38:333–336, 2002.

Kathryn A. Trapp.A class of compatible discretizations with applications to div-curl systems. PhD thesis, CarnegieMellon University, Department of Mathematics, 2004.

Guoliang Xu. Convergence of discrete laplace-beltrami operators over surfaces. Technical Report ICM-03-014,Institute of Computational Mathematics, Chinese Academy of Sciences, Beijing, 2003.

Guoliang Xu. Convergent discrete laplace-beltrami operators over triangular surfaces. 2004.