DISCRETEVECTORAND 2 -TENSORANALYSESANDAPPLICATIONS By BeibeiLiu ADISSERTATION Submittedto MichiganStateUniversity inpartialful˝llmentoftherequirements forthedegreeof ComputerScienceDoctorofPhilosophy 2015 ABSTRACT DISCRETEVECTORAND 2 -TENSORANALYSESANDAPPLICATIONS By BeibeiLiu Wepresentnovelanalysismethodsforvector˝eldsandanintrinsicrepresentationof 2 -tensor˝elds onmeshes,andshowthebene˝tstheybringtodiscretecalculus,geometryprocessing,texturesyn- thesisand˛uidsimulation.Forinstance,suchvector˝eldsandtensor˝eldsin˛at2Dspaceare necessaryforexample-basedtexturesynthesis.However,manyexistingmethodscannotensurethe continuityautomaticallyorcontrolthesingularitiesaccurately.Moreover,extendingsuchanaly- sestocurvedsurfacesinvolvesseveralknownchallenges.First,vectorsatdi˙erentsurfacepoints arede˝nedindi˙erenttangentplanes,sotheircomparisonnecessarilyinvolvesaconceptcalled connection totransportvectorsfromonetangentplanetoanotherinaparallelway.Thefewexist- ingapproachesfordiscreteconnectionso˙erneitheragloballyoptimalprincipledde˝nitionnora consistentdisretizationofdi˙erentialoperators.Second,symmetric 2 -tensors,whichplayacru- cialroleingeometryprocessing,areoftendiscretizedascomponentsstoredintheprede˝nedlocal frames.Thereisnoconvenientwaytoperformcoordinate-independentcomputationswitharbi- trary 2 -tensor˝eldsontriangulatedsurfacemeshes.Finally,thepersistentpursuefore˚ciency intheprocessingofvector˝eldsinapplicationssuchasincompressible˛uidsimulationoftenre- sultsinundesiredartifactssuchasnumericalviscosity,whichpreventsapredictivepreviewforthe ˝ne-resolutionsimulationatcoarsespatialandtemporalresolutions. Weo˙ersolutionstoaddresstheseissuesusingournovelrepresentationandanalysistools. First,wepresentaframeworkforexample-basedtexturesynthesiswithfeaturealignmentto vector˝eldswithtwowayrotationalsymmetry,alsoknownasorientation˝elds.Ourcontribution istwofold:adesigntoolfororientation˝eldswithanaturalboundaryconditionandsingularity control,andaparalleltexturesynthesisadaptedspeci˝callyforsuch˝eldsinfeaturealignment. Second,wede˝nediscreteconnectionontrianglemeshes,whichinvolvesclosed-formexpres- sionswithinedgesandtrianglesand˝niterotationsbetweenpairsofincidentvertices,edges,or triangles.The˝nitesetofparametersofthisconnectioncanbeoptimallycomputedbyminimizing aquadraticmeasureofthedeviationfromtheconnectioninducedbytheembeddingoftheinput trianglemesh.Localintegralsofother˝rst-orderderivativesaswellasthe L 2 -basedenergiescan alsobecomputed. Third,weo˙eracoordinate-freerepresentationofarbitrary 2 -tensor˝eldsontrianglemeshes, whereweleverageadecompositionofcontinuous 2 -tensorsintheplanetoconstructa˝nite- dimensionalencodingoftensor˝eldsthroughscalarvaluesonorientedpiecesofamanifoldtrian- gulation.Wealsoprovideclosed-formexpressionsofcommonoperatorsfortensor˝elds,including pairing,innerproduct,andtraceforthisdiscreterepresentation,andformulateadiscretecovari- antderivativeinducedbythe 2 -tensorsinsteadofthemetricofthesurface.Otheroperators,such asdiscreteLiebracket,canbeconstructedbasedontheseoperators.Thisapproachextendscom- putationaltoolsfortensor˝eldsando˙ersanumericalframeworkfordiscretetensorcalculuson triangulations. Finally,aspectralvector˝eldcalculusonembededirregularshapeisintroducedtobuilda model-reducedvariationalEulerianintegratorforincompressible˛uid.Theresultingsimulation combinesthee˚ciencygainsofdimensionreduction,thequalitativerobustnesstocoarsespatial andtemporalresolutionsofgeometricintegrators,andthesimplicityofsub-gridaccurateboundary conditionsonregulargridstodealwitharbitrarily-shapeddomains.Afunctionalmapapproach to˛uidsimulationisalsoproposed,wherescalar-valuedandvector-valuedeigenfunctionsofthe Laplacianoperatorcanbeeasilyusedasreducedbases.Usingavariationalintegratorintimeto preservelivelinessandasimple,yetaccurateembeddingofthe˛uiddomainontoaCartesiangrid, ourmodel-reduced˛uidsimulatorcanachieverealisticanimationsinsigni˝cantlylesscomputation timethanfull-scalenon-dissipativemethodsbutwithoutthenumericalviscosityfromwhichcurrent reducedmethodssu˙er. Tomydearfamily iv ACKNOWLEDGMENTS My˝veyearsstudyinthePhDprogramislikeachallengingbutexcitingjourney,whichwouldnot havebeenpossiblewithouttheguidanceandhelpfrommanypeople. Foremost,IwouldliketoexpressmysincerestgratitudetomyadvisorYiyingTong,whohas beensupportingandguidingmethewholetimeduringthePhDprogram.Thisthesiswouldnot havebeenpossiblewithouthispatientguidanceandendlessencouragement.Icanstillrecallmany deadlineswehadtoworkhardtogetherandthegreatjoywesharedinthelast˝veyears.Yiying isfullofcreativeideasandvaluablesuggestions,whichiswhyInicknamedhimas'AWalking Wikipedia'.Atthesametime,healwaysgenerouslyshareshisownexperienceandwishesthebest forhisstudents.YiyingTonghassetanexampleofexcellenceasaresearcher,instructor,teacher androlemodel,inspiringmetobeabetterperson.Besidesmyadvisor,Iwouldliketothanktherest ofmycommitteemembers:LeslieKuhn,CharlesB.OwenandJoyceChaifortheirencouragement, insightfulcommentsandquestions. Ithasbeenagreathonorformetocollaboratewithmanyawesomeresearchers.Myspecial thanksgotoMathieuDesbrunforgenerouslyrecommendingmethesummerinternshipando˙er- ingmethepostdoctoralscholarpositionwithhim.Wehavesuccessfulcollaborationsonmultiple projectswherehisintuitiveandinsightfulinterpretationoftheresearchproblemsalwaysbroadens myhorizon.Iamalsogratefultohimforpatientlyreadingandrevisingmythesis.MeanwhileI wouldliketothankFernandodeGoesforthetirelessandinspiringdiscussion,YuanzhenWang forhispatientguidanceonthecodingandexplanationaboutthedi˙erentialforms,GemmaMason forherexcellentwritingofthe˛uidproject,JulianHodgsonfortheappealingrenderingresults, JiannanWangforthenice-annotatedcodeofthetextureproject,XiaojunWangandFengXinfor theirvaluablehelpininstallingmultiplelibraries,DanielDault,JieLi,RundongZhaoandBala- subramaniamShankerfortheircreativeideasinthesubdivisionprojects. Lastbutnottheleast,Iwouldliketothankmyparentsfortheirunconditionalloveandsupport. v TheyrespecteverybigdecisionImadeandarealwaysmystrongestbacking.Iamparticularly gratefultomyhusbandandsoulmate,LanboSheforgivinguphisgraduateprograminChinaonly tojoinmeinMSU.Healwaystoleratesmeandencouragesmetoembracedi˙erentchallenges bravely.IwouldalsoliketothankmydearestfriendswhomIsharedtheupsanddownsduringthis wonderfuljourney. vi TABLEOFCONTENTS LISTOFTABLES ....................................... xii LISTOFFIGURES ....................................... xiii CHAPTER1INTRODUCTION ............................... 1 1.1VectorFieldAnalysisandApplication........................1 Discreterepresentationofvector˝elds................2 N -wayRotationalSymmetryField..................3 1.1.1Orientation˝eldguidedtexturesynthesis..................4 Challenges...............................5 1.1.2Vector˝eldanalysis..............................6 1.1.3Spectralvector˝eldprocessingfor˛uidsimulation.............8 1.2Discrete 2 -TensorFieldsonTriangulatedSurfaceMesh...............10 1.3Organization......................................11 CHAPTER2MATHEMATICALBACKGROUND ..................... 13 2.1BasicConceptsfromDi˙erentialGeometry.....................13 2.1.1Tensors....................................14 Tangentvector.............................14 Covector................................14 Tensor..................................14 Di˙erentialforms............................15 2.1.2Exteriorcalculus................................15 2.2ConnectionsonSmoothManifolds..........................16 2.2.1De˝nition...................................16 2.2.2Connection 1 -form..............................17 Curvatureofconnection.......................19 2.2.3Covariantderivativeonsmoothmanifolds..................19 Geometricintuition..........................19 2.2.4Metric-preservingcovariantderivative....................19 Geometricdecomposition.......................20 Paralleltransport...........................20 2.2.5Relevantenergies...............................21 2.3DecompositionofTensorFieldonSmoothManifolds................22 2.3.1Antisymmetricvs.symmetrictensors....................22 2.3.2Decompositionofantisymmetric 2 -tensors..................22 2.3.3Decompositionofsymmetric 2 -tensors....................23 Divergence-basedexpression......................23 Curl-basedexpression.........................24 Trace-basedexpression.........................24 vii 2.3.4Remarks....................................24 Boundaryconditions..........................24 PhysicalInterpretation.........................25 CovariantDerivative..........................25 GeneralizedLaplacian.........................25 2.4DiscreteExteriorCalculus..............................26 CHAPTER3ORIENTATIONFIELDGUIDEDTEXTURESYNTHESIS ......... 27 3.1Introduction......................................27 3.2RelatedWork.....................................27 Vector˝elddesign..........................27 Texturesynthesis...........................28 Relationtoourwork.........................29 3.3VectorFieldDesignwithNaturalBoundaryConditions...............29 3.3.1Setup.....................................30 3.3.2Naturalboundaryconditions.........................30 3.4OrientationFieldDesign...............................33 Representationofthedirection˝eld.................33 3.5TextureSynthesisfor2-RoSyField..........................35 3.5.1Anisotropictexturesynthesis.........................35 3.5.2Handlingorientation.............................37 3.6Results.........................................39 Limitations..............................39 3.7Conclusion......................................40 CHAPTER4DISCRETECONNECTIONANDCOVARIANTDERIVATIVEFORVEC- TORFIELDANALYSISANDDESIGN ................... 43 4.1Introduction......................................43 4.1.1Relatedwork.................................43 4.1.1.1Vector˝elds............................44 4.1.1.2Fromvector˝eldsto n -direction˝elds..............44 4.1.2Outlineandnotations.............................44 4.2ConnectionsonSimplicialManifolds.........................45 4.2.1Rationale...................................45 Oftheseeminginadequacyoftrianglemeshes............45 OftheimportanceoftheLevi-Civitaconnection...........46 Previousattempts...........................46 Approach...............................47 4.2.2Discreteconnection 1 -form..........................48 Simplicialframes...........................48 Whitney-basedconnectionswithinsimplices.............48 Impulseconnectionsbetweenincidentsimplices...........49 Curvatureofdiscreteconnection...................50 4.2.3Reducedparametersfordiscreteconnections.................51 viii 4.3ComputingLevi-CivitaConnections.........................53 4.3.1Connectionderivedfromgeodesicpolarmaps................53 4.3.2Locallyoptimalconnection 1 -form......................55 4.3.3As-Levi-Civita-as-possibleconnection 1 -form................56 4.3.4Trivialconnections..............................57 4.4Connection-basedOperators.............................57 4.4.1Basisfunctionsforvector˝elds.......................58 4.4.2Discretecovariantderivative.........................59 4.4.3Discreteoperatorsbasedoncovariantderivative...............60 Triangle-basedIntegrals.......................61 Edge-basedIntegrals.........................62 4.5Vectorand n -DirectionFieldDesign.........................62 4.5.1Variationalapproach.............................63 Controllingsingularityorientation..................64 Constrainingalignment........................65 4.5.2Eigendesign.................................65 4.6Results.........................................66 4.6.1Accuracyofdiscreteoperators........................67 4.6.2Vectorand n -direction˝eldonmeshes....................67 4.7Conclusion......................................68 CHAPTER5DISCRETE2-TENSORFIELDSONTRIANGULATIONS ......... 71 5.1Introductionandrelatedwork.............................71 Analysisandvisualization.......................71 Metrics.................................72 Elasticity................................72 5.1.1Notations...................................72 Continuoussetup............................72 Discretesetup..............................73 5.2TensorFieldsover 2 D EuclideanSpace.......................74 Killingdecomposition.........................74 ConjugateKillingdecomposition...................75 Completedecomposition........................75 5.3TensorFieldsoverTriangulations...........................76 5.3.1Discreteantisymmetric 2 -tensors.......................76 5.3.2Discretesymmetric 2 -tensors.........................77 Encoding................................77 Interpolation..............................78 Extractinglocalmeantensor ˙ .....................78 Residualedge-basedDiractensors...................79 5.3.3Discussion...................................80 5.4DiscreteDi˙erentialTensor-basedOperators.....................80 5.4.1DiscretegeneralizedLaplacian r ( ˙ r ) ...................81 Ellipticity................................82 ix 5.4.2Pairingthroughdiscretetensors.......................82 Innerproductswithsymmetrictensors.................82 Crossproductswithantisymmetrictensors..............83 5.4.3Trace.....................................83 5.4.4ChoiceofdiscreteHodgestars........................83 5.5Applications......................................84 5.5.1Discretecovariantderivative.........................84 5.5.2DiscreteLiebracket..............................86 5.5.3Anisotropicheatmethod...........................87 5.6FutureWork......................................88 CHAPTER6SPECTRALVECTORCALCULUSFORVARIATIONALFLUIDSIM- ULATION ................................... 90 6.1Introduction......................................90 6.1.1Relatedworkformodel-reductionmethods.................91 6.2RecapofVariationalEulerianIntegration......................92 6.2.1Discretizationprocess.............................93 6.2.2TheEulerianLiealgebraviewpoint.....................94 6.2.3Non-holonomicconstraint..........................94 6.2.4Creatingavariationalnumericalmethod...................95 6.3Model-reducedVariationalIntegrator.........................96 6.3.1Spectralbases.................................96 Choiceofbases.............................96 Discretization..............................97 6.3.2SpectralLiegroup..............................98 Liegroup................................98 Liealgebra...............................99 Non-holonomicconstraint.......................100 6.3.3Spectralvariationalintegrator........................100 Timeintegrator.............................101 Discussion...............................102 6.3.4EmbeddingcomplexdomainsonCartesiangrids..............102 6.3.5Variantsandextensions............................105 Viscosity................................105 Magnetohydrodynamics(MHD)....................107 Subgridscalemodeling........................107 Movingobstaclesandexternalforces.................108 6.3.6Generalizationtootherbases.........................109 6.4Results.........................................110 Reducedvs.fullsimulation.......................110 Arbitrarydomains...........................111 Advanced˛uidmodels.........................112 Computationale˚ciency........................113 Selectionoffrequencies........................114 x Timestepping.............................115 Quantitativeexperiments........................115 6.5Conclusion......................................116 Discussion...............................117 CHAPTER7SUMMARYANDFUTUREWORK ..................... 119 APPENDICES ......................................... 122 AppendixAExplicitevaluationofoperatorsbasedoncovariantderivative ..... 123 AppendixBDetailsfor 2 -Tensorrelatedoperators .................. 126 AppendixCDetailsfor˛uidsimulationcomputation ................. 130 BIBLIOGRAPHY ........................................ 136 xi LISTOFTABLES Table4.1 Approximationerrors. Usingmeshesofincreasingresolutionsthatallinter- polateasphere,weevaluatethe L 2 errorsforthedivergence(topleft),curl (topright),andDirichletenergyoperators(bottom)evaluatedpertriangleus- ingouredge-basedapproach(viaStokes).Thespheremeshhasonly162ver- tices,andwere˝neitsconnectivityviaLoopsubdivisions,leadingtomeshes of642,2562,and10242vertices.Weaveragedtheerrorsincurredfor100ran- domvector˝eldsthatarelinearcombinationsofthe˝rst 40 vectorspherical harmonics,normalizedtohaveunit L 2 norm.Theoptimal(as-Levi-Civita-as- possible)connectionsystematicallyproducesthesmallesterrorexceptforex- tremelycoarseresolutions.Wealsoimproveonthe L 2 normproducedby[1], evenifouroptimalvertex-to-vertexangles ˆ ij areusedintheirformulae.....70 Table4.2 ApproximationsofEulercharacteristic. Forapointwiseunitvector˝eld u ,thedi˙erenceofantiholomorphicandholomorphicenergiesis E A ( u ) E H ( u )= R T K (Eq.2.5).Usingrandomlinearcombinationsofthe30lowest vectorsphericalharmonics,weevaluatethedi˙erenceofourdiscreteenergies E A and E H for 100 vector˝elds(withnormalizedcoordinatesateachvertex), dividedby ˇ ;weindicateboththemeanandthestandarddeviationofthese 100 integrations.Onvariousmeshes(ofgenus 0 and 2 ),ouredge-basedeval- uationsexhibitsigni˝cantlylowererrorsthanallotherarea-basedestimations, includingresultsfrom[1]..............................70 xii LISTOFFIGURES Figure1.1 Exampleapplicationofvector˝elds:Point-to-pointmeshcorrespondence. TheP2Pmappingbetweendogandcatmodelswithonlysegmentationinfor- mationasinput...................................2 Figure1.2 Example-basedtexturesynthesisonsurfaceandplane[2]. Thesquare tilesshowexamplarsthatareusedtosynthesizeatextureonsurfacesguided byprecomputedvector˝elds............................3 Figure1.3 n -vector˝eldsonspheremesh. Aspheremesh(a)andavector˝eldwith onesaddlesingularity(b).Itscorresponding 2 -RoSy˝eldis(c)andits 4 - RoSy˝eldis(d).ResultscomputedbythemethodinChapter4.........4 Figure1.4 Vector˝eld(left)anditscorresponding 4 -RoSy˝eld(right). .........5 Figure1.5 Smoothest n -vector˝eldondi˙erentshapes. Asurfacemesh(a)andits correspondingsmoothestvector˝eld(b), 2 -RoSy˝eld(c)and 4 -Rosy˝eld (d).ResultscomputedbythemethodinChapter4.................8 Figure1.6 Model-reduced˛uidsonregulargrids. Ourproposedenergy-preserving approachintegratesa˛uid˛owvariationallyusingasmallnumberofdivergence- freevelocity˝eldbasesoveranarbitrarydomain(visualizedherearethe 5 th , 10 th ,and 15 th eigenvectorsofthe 2 -formLaplacian)computedwithsubgrid accuracyonaregulargrid(here,a 42 42 32 grid)throughthemethodin- troducedinChapter6.Thisintegratorisversatile:itcanbeusedforrealtime ˛uidanimation,magnetohydrodynamics,andturbulencemodels,witheither explicitorimplicitintegration...........................9 Figure1.7 In˛uenceofthemetrictensorongeodesics. (a)visualizationofanisotropic geodesicwherethedistanceisgeneratedbytheheatmethod[3].Thecurva- turetensorofasurfaceisappliedtocomputeanisotropicgeodesics(b)with ourgeneralizedLaplacianoperatorproposedinChapter5.............12 Figure2.1 Smoothconnection. Onasmoothmanifold,aconnectionindicateshowa tangentvectoratpoint p isparalleltransportedalongapath C toanearby point p 0 = p + w ,accountingforthechangeofframebetweenthetwotangent spaces.Fromaconnectionthenotionof(covariant)derivativeofvector˝elds isderived,asnearbyvectorscannowbecompared................17 Figure3.1 Twoconsecutiveedgesalongtheboundary. ..................31 xiii Figure3.2 Comparisonofresults. Userinput:asinglesource(top);asinglevortex (bottom).Fisheretal.'sdesignmethodproducedmultiplespurioussingular- ities(left);ourmethodproducedtheminimizeroftheDirichletenergy(right)..33 Figure3.3 Basicsingularitiesfororientation˝elds:wedge(left)andtrisector(right). Oursystemalsoprovidescontrolovertheorientations.Top:original;Bot- tom:45 rotated..................................34 Figure3.4 Oneofthethreepredictedtexturelocationsfortheupper-rightcornerin thefour-cornerneighborhood. .........................35 Figure3.5 Comparisonoftheresultsfromtheparallelanisometrictexturesynthesis methodwithout(left)andwith(right)ourmodi˝cations. Therepresenta- tivevector˝eldhasdiscontinuitywithintheredcircle..............37 Figure3.6 Reasonforthedisconituityofthesynthesizedimage. Followingthedashed directionwouldhaveproducedawrongprediction,while ~ P properlytakes intoaccountthemutualorientation.........................38 Figure3.7 Examplesforthe˝vemajorcategoriesof˝ngerprintsgeneratedbyour texturesynthesis. .................................40 Figure3.8 Resultswithvarioustexturesonplanarregions. ................41 Figure3.9 Resultsfororientation˝eldsoncurvedpatches. ................42 Figure4.1 Simplicialconnection. (left)Eachvertex v i isgivenanimpulserotationan- gle ˆ v i ! e ij toedge e ij and ˆ v i ! t ijk totriangle t ijk .(right)Acontinuous connectionwithinsimplicesisencodedthroughedgerotation ij andhalf- edgerotation ˝ ij;k interpolatedviaWhitneybasisfunctions............47 Figure4.2 CurvatureandParameters. Left:Curvatureisaccumulatedalongaclosed patharoundtheinteriorofatriangle( K ijk )oraclosedpatharoundasection ofahalf-edge( K ij;k ( p ; q ) ).Right:Adiscreteconnection ˆ with˝nitecur- vature( K ij;k =0 )isencodedthroughonlyvertex-triangle,vertex-to-edge, andvertex-to-vertexrotationangles........................52 Figure4.3 Locallyinterpolatedvectorbydi˙erentconnections. .............59 Figure4.4 Fromvector˝eldto n -vector˝elds. Adiscretevector˝eld,evenonacoarse mesh,canbedirectlyconvertedintoan n -vectoror n -direction˝eldbyscaling theconnectionangles.Here,abunnymesh(a)andavector˝eldwithasource andasaddleononeside(b)isconvertedintoa 2 -RoSy(direction)˝eld(c) anda 4 -RoSy(cross)˝eld(d)............................60 xiv Figure4.5 Orientationcontrolfornegativeindexsingularities. Fromavector˝eld (a)onaspherewithasaddlepointwithindex 1 (resp.,itscorresponding 2 -RoSy˝eld(b)formingatrisectorofindex 1 = 2 ),theusercandirectly controltheorientation(c)ofthesaddle(resp.,theorientationofthetrisector (d))withouta˙ectingitspositiononthesurface..................62 Figure4.6 Orientationcontrolofpositiveindexsingularities. Bysettingadiver- gence/curlpair (1 ; 0) onatriangle,asource(singularityofindex 1 )isformed inthevector˝eld(resp.,awedgesingularityofindex 1 = 2 ontheassociated 2 -RoSy˝eld).Changingthispairto (cos( ˇ 3 ) ; sin( ˇ 3 )) ,avortex(c)isaddedto thesource(creatinglog-spiralingstreamlines)whilethecorrespondingori- entation˝eld(d)hasitswedgerotatedby ˇ= 3 ...................64 Figure4.7 Designbystroke. (a)Froman n -vectoror n -direction˝eldwitharbitrary singularities,(b)theusercandrawastroke(blue)inordertoeasilyin˛uence thedirectionofthe˝eld.Theresultisupdatedinteractivelybysolvingthe linearsystemresultingfromthevariationalapproachofSec.4.5.1........65 Figure4.8 Comparisons. Whilethemethodof[1]˝ndssimilarsingularities,ourap- proachleadstotraightervector˝elds(seeneckofbunny(a)&(b);nose oflion(e)&(f)),andthepositionsofoursingularitiesarefoundcloserto corners(seeinsetsoffandisk,(c)&(d)).Yellowandbluemarkersindicate thepresenceofsingularitiesinthevector˝elds..................69 Figure4.9 Eigendesign. Whileanunconstrainedgeneralizedeigenvalueproblem(a) willresultinthesmoothestvector˝eld(i.e.,withthelowestDirichletenergy fora˝xed L 2 norm)fortheas-Levi-Civita-as-possibleconnection,wecan also˝ndthesmoothestvector˝eldthatmatchesuser-speci˝edstrokes(b). Moreover,theusercanprescribeatrivialconnection(c)withgivensingular- ities(bothpositiveandnegativeones,placedonthevector˝eldsingularities of(a)inthisexample),andthetreatmentofstrokeconstraintsremainsthe same(d).......................................69 Figure5.1 Notationsfordiscretesetup. ...........................73 Figure5.2 Encodingunitfordiscretetensorrepresentation. Weuse onepatchper edge ij de˝nedasthe˛yscontainingthetwotrianglesadjacent to ij andtheirimmediateneighbors(top),aswellas onepatchperface ijk de˝nedasthefaceanditsimmediate˛aps(bottom)................77 xv Figure5.3 Discretecovariantderivativeforplanarmeshes. Covariantderivativeofa 1 -form = 2 xydx x 2 dy (top-left)along = dx (bottom-left)foraplanar meshwithconcaveboundary.Resulting 1 -form ! hasanumericalresidual w.r.t.theanalyticalsolutionof 0 : 7% (center, jVj =173 )and 0 : 1% (right, jVj =609 ),respectively.Vector˝eldsaredisplayedbyinterpolating 1 -forms attrianglebarycenters...............................84 Figure5.4 Discretecovariantderivativeforspheremeshes. For 1 -forms =sin( ) (topleft)and =sin( ) d˚ (bottomleft)(expressedinsphericalcoordinates), ourdiscretecovariantderivative ! = r ] onanirregularmesh(center)is consistentwiththeresultonauniformmesh(right)(meshesshownasinsets). Vector˝eldsdisplayedbyinterpolating 1 -formsatbarycentersofasubsetof triangles......................................86 Figure5.5 Discretecovariantderivativeonmeshesofarbitraryshapeandtopology. Wechose (top)and (bottom)asthesmoothest 1 -formsfromthe 1 -form Laplacian[4].Centralimagesshowtheresulting 1 -form r ] ,visualizedwith sampledintegralcurves(bunny)andlineintegralconvolution[5](twistedtorus).86 Figure5.6 Anisotropicgeodesicsonplanarmeshes. Ourtensor-baseddiscretedi˙er- entialoperatorscanbeusedtocomputeanisotropicgeodesics.Wetestedour methodonadiskwithconstanttensorsofvariousanisotropyratio(fromleft toright: 1 , 0 : 5 , 0 : 3 , 0 : 2 ,and 0 : 1 ),withthelargermagnitudealongthe x -axis. Noticethattheiso-levelsstretchtoellipseswiththeanisotropyasexpected...87 Figure5.7 DiscreteLiebracketoperator. OurdiscretenotionofLiebracketreproduces thetorusexamplepresentedin[6]bothqualitativelyandquantitatively.For two 1 -forms (left)and z (middle),where z isascalingfunction,there- sultingLiebracket =[ ; ] (right)isparallelto ,asexpectedinthesmooth case.Pseudo-colorsindicatethenormof z and ,respectively..........88 Figure5.8 Anisotropicgeodesicsonsurfacemeshes. Anisotropicgeodesicscanbe computedguidedbythecurvaturetensorofasurface.Left:isotropicgeodesic distancegeneratedbytheheatmethod[3].Right:anisotropic(curvature- aware)geodesicdistancecomputedwithourgeneralizedLaplacianoperator (see....................................89 xvi Figure5.9 Convergenceoftheerrorplot. Errorplotinlog-logscaleoftheresidualof thediscretecovariantderivativew.r.t.itsanalyticalsolution,indicatinglinear convergenceondi˙erentmeshes.Foradiskmesh(left)andaconcaveshape (middle),weanalyzedfourscenarios:[inblue] =( x y ) dx +( x + y ) dy , = xdx + ydy , r ] =( x y ) dx +( x + y ) dy ;[inpink] = 2 xydx x 2 dy , = dx , r ] = 2( ydx + xdy ) ;[inyellow] = sin (2 x ) dx + cos (2 y ) dy , = cos (2 x ) dx , r ] =2 cos (2 x ) 2 dx ;[ingreen] = x 2 dx 2 xydy , = dx , r ] =2( xdx ydy ) .Forthesphere(right),weevaluatedthreecases whichare,insphericalcoordinates,[inblue] = sin (2 ) , = cos (2 ) , r ] =2 cos 2 (2 ) ;[inpink] = sin (2 ) d˚ , = cos (2 ) , r ] = 2 cos 2 (2 ) d˚ ;[inyellow] = sin (2 ) + sin (2 ) d˚ , = cos (2 ) , r ] = 2 cos 2 (2 ) +2 cos 2 (2 ) d˚ .Errorsmeasuredusingonlythemeantensor ˙ (withnoedge-basedresidualtensors)canbeupto 27% larger..........89 Figure6.1 3Dbunnybuoyancytest :Ahotcubeofairinitiallylocatedatthecenterofa 3Dbunny-shapeddomainisadvectedthroughbuoyancy.Computationswere performedusingamodi˝edHodgestarona 42 42 32 grid,withonly 100 modes........................................91 Figure6.2 Functionalmaprepresentationofthe˛uid˛ow. Wediscretizeacontin- uousfunction f ( x ) onourspacebytakinganaverage(integrated)value f i pergridcell i ofthemesh,whichwearrangeinavector f .Thisde˝nitionof discretefunctionsallowsustodiscretizethesetofpossible˛ows ˚ t usinga functionalmap (orKoopmanoperator) ( f ˚ 1 t )( x )= f ( ˚ 1 t ( x )) ........93 Figure6.3 E˙ectofshapeonspectralbases :TheLaplacianeigenvectorsdependsheav- ilyonthedomain .Here,rectangle(top)vs.ellipse(bottom)domains(both computedon2Drectangulargridofsize 60 2 )exhibitverydi˙erenteigenvec- tors 10 and 10 ..................................99 Figure6.4 Curveddomain :Whileallother˝gureswereachievedonaregulargrid,our approachappliestoarbitrarydomains,hereonthe surface ofatriangulated domain;asimplelaminar˛owwithinitialhorizontalvelocitysmoothlyvary- ingalongtheverticaldirectionquicklydevelopsvorticalstructuresonthis complexsurface...................................103 Figure6.5 Hodgestarsadjustedtotheboundary. Thedomain isde˝nedimplicitly byafunction ˜ via = f x j ˜ ( x ) 0 g .......................103 Figure6.6 Comparisionofthegeneratedeigenvector˝eldsonacoarsegrid. Theleft ˝gureisgeneratedthroughavoxelizedapproximationoftheboundary(red) whiletheright˝gureisbyourHodgemodi˝cation(blue).............104 xvii Figure6.7 Domain-alteredHodgestars :Ourframeworkcangeneratevectorbasessat- isfyingprescribedboundaryconditionforarbitrarydomainsembeddedina Cartesiangrid.Hedge-hogvisualizationof 5 ona 256 2 gridforthreedif- ferent2Ddomainshapes,obtainedthroughasimplealterationoftheHodge star ? operator...................................106 Figure6.8 ConvergenceofLaplacians :OurdiscretizationofthetwoLaplacianscreates (vectorandscalar)eigen˝eldsthatconvergeunderre˝nementoftheregular gridusedtocomputethem,extendingthelinearconvergenceprovedin[7]. Here,particle-tracingvisualizationofthe 15 th eigenbasisforvector˝eldson theellipse(top)atresolution 30 2 , 60 2 , 120 2 ,and 240 2 ,and 15 th eigenfunction (bottom)atthesameresolutions..........................106 Figure6.9 Spectralenergydistribution :Withforcingtermskeepingthelowwave numberamplitudes˝xed[8],our3DreducedmodelappliedtotheLANS- modelofturbulenceproducesanaveragespectralenergydistribution(blue) muchclosertotheexpectedKolmogorovdistribution(black)thanwiththe usualNavier-Stokesequations(red)........................108 Figure6.10 Smokerising. Usingonly230modes(about0.003%ofthefullspectrum simulation),both[9]'s(left)andourapproachalreadyexhibittheexpected volutesforabuoyancy-driven˛owoverasphere.................109 Figure6.11 Robustnesstoresolution :Withthehomogenizedboundaryconditionon gridsofresolution 40 2 (blue), 80 2 (green),and 160 2 (red),nostaircasearti- factsareobserved,andthesimulationresultsareconsistentacrossresolutions..110 Figure6.12 Convergenceofsimulation :A˛owinaperiodicdomainisinitializedwith aband-limitedvelocity˝eldswith120wavenumbervectors.Fluidmarkers (formingablueandredcircle)areaddedforvisualization.After 12 sofsim- ulation,theresultsofourreducedapproach(left: 120 ; middle: 300 modes) vs.thefull 256 2 dynamics(right)arequalitativelysimilar.............111 Figure6.13 Log(error)-log(resolution)plotforeigenvectorstestedonaunitdisk. ....112 Figure6.14 Interactivity :Wecanalsousetheanalyticexpressionsfor k and C k;ij ina periodic3Ddomaintohandlealargenumberofmodesdirectly.Theexplicit updateruleexhibitsnoarti˝cialdampingoftheenergyasexpected,buto˙ers realtime˛ows....................................114 Figure6.15 Frequencyshaping :ForthesamesetupasFig.6.1,usingonlythelowest10 eigenbasisfunctionsforvector˝eldsleadstoaverylimitedmotion.However, addinganother10basisfunctionsofhighfrequenciescreatesamuchmore detailedanimationatverylittlecost,insteadofusingallthefrequenciesfrom lowtohigh.....................................115 xviii Figure6.16 Relativeerrors. Relative L 2 (left)and L 1 errorsmeasuredwithrespect toafull-spectrum(spatial)simulationaresystematicallyimprovedwithour structuralcoe˚cientscomparedto[9],evenifthesametimeintegrationis usedtoallowforafaircomparison.Top:errorsfortherisingsmokeexample ofFig.6.10;bottom:errorsfortwomergingvortices(seevideo).........116 Figure6.17 Immersedmovingobjects. Asthecarmakesarightturn,thelowfrequency motionoftheairdisplacedarounditliftsthedeadleaves.Thevelocity˝eld aboveisvisualizedthrougharrows.........................117 Figure6.18 MHDrotortest :Therotortestformagnetohydrodynamicsconsistsofa denserotatingdiskof˛uidinaninitiallyuniformmagnetic˝eld(left-right, top-middle: t =0 : 042 ; 0 : 126 ; 0 : 210 ; 0 : 336 ).Ourspectralintegratorcaptures thecorrectbehavior(seefulldynamicsin[10])evenwithonly 100 modes. Discreteenergy(blue)andcross-helicity(red)are,aspredicted,preserved overtime(bottom).................................118 xix CHAPTER1 INTRODUCTION Intheincreasinglydigitizedworld,smoothshapesareoftenapproximatedbytheirdiscretecounter- parts,ascomputerscanonlystoreandprocessa˝nitenumberofdigits.Furthermore,continuous processesdescribedbydi˙erentialequationsalsoneedtobeadaptedtoanalyzevaluesstoredon thesediscretizeddomains,describedby, e.g. ,spatialortemporalsamplepoints.However,ad-hoc discretizationoftenfailstokeeptheglobalgeometricstructures,i.e.,the symmetries and invariants thatde˝nethegeometry.Anemergentresearch˝eld,calledDiscreteDi˙erentialGeometry(DDG), seekstosystematicallyconstructthediscretecounterpartofgeometricmodels(inparticular,smooth surfaces)fromthesmooththeorywhilepreservingitsfundamentalproperties.DDGdrawsupon bothdi˙erentialgeometryocusedonpropertiesofsmoothmanifthe˝eldofcompu- tationalgeometrynedwithdiscretecombinatorialgeometricobjects.Theapplicationsof DDGincludegeometryprocessing,appliedmathematics,computergraphics,andphysicalsimula- tion.ReadersinterestedinthebroadconceptofDDGcanrefertorecentsurveys,suchas[11,4] formoredetails. Inthisdissertation,wemainlyfocusonvectorandtensor˝eldanalysisandtheirapplications suchastexturesynthesisand˛uidsimulation.We˝rstprovidemathematicalbackgroundonthese speci˝ctopicsinChapter2,andthengooverthevariouschallengesinscienti˝ccomputinginvolv- ingvectorsandtensorsontessellateddomains,thecurrentissueswithexistingmethodsthattackle thesechallenges,andourapproachtoaddressingtheseissues. 1.1VectorFieldAnalysisandApplication Vector˝eld,whichassignsadirectionandamagnitudeperpoint,isessentialinawiderangeof applications,includinggeometryprocessing,example-basedtexturesynthesis,nonphotorealistic 1 rendering,and˛uidsimulation.Forinstance,inexample-basedtexturesynthesis,avector˝eldis usedasaguidanceforthelocaldirectionandsizingwhentilingexemplarsinordertosynthesize alargeimage(Fig.1.2).Fig.1.1showsanotherapplicationwherevector˝eldshelp˝ndanatural point-to-pointmappingbetweentwodi˙erentshapes. Targetsegmentation Reference Reference Reference Sourcesegmentation P2P P2P P2P Figure1.1 Exampleapplicationofvector˝elds:Point-to-pointmeshcorrespondence. The P2Pmappingbetweendogandcatmodelswithonlysegmentationinformationasinput. Discreterepresentationofvector˝elds Vector˝eldsontriangulatedsurfacesareoftendis- cretizedthroughlocalcoordinatesinorthogonalframesde˝nedeitheronverticesoronfaces. Acontinuousvector˝eldoverameshistypicallyevaluatedfromthis˝nitesetofvectorsbased onpiecewiseconstantinterpolation[12]or,toincreasesmoothness,usingnonlinearbasisfunc- tionsderivedfromthegeodesicpolarmap[13,1].Inane˙orttoremovetheneedforcoordinate systems,scalarpotentialswereproposedasanintrinsicencodingoftangentvector˝elds:while Tongetal.[14]usedtwopotentialvaluespernodeinterpolatedwithlinear˝niteelements,Polth- ierandPreuss[15]o˙eredadiscretenotionofHodgedecompositionwithpropercohomologyby usingonevaluepernodeandonevalueperunorientededgeinterpolatedwithconformingandnon- conforminglinearbasisfunctionsrespectively.Thisrepresentationis,however,limitingasitonly leadstoper-faceconstantvector˝elds.Operator-basedrepresentationshavealsobeenrecentlypro- posed[16,6],buttheiruseis,todate,toorestrictivetobewidelyadopted.Finally,acoordinatefree approachtovector˝eldrepresentationwasintroducedthroughtheuseofalgebraictopologyand 2 exteriorcalculus[17]wherevector˝eldsareidenti˝edtodiscretedi˙erential 1 -forms(i.e.,rank- 1 tensorsoftype (0 ; 1) )andinterpolationisperformedviaWhitneybasisfunctions[18].These edge-baseddiscretetangentvector˝eldshavesincethenbeenshownusefulinavarietyofappli- cations[19,20].Thediscrete 2 -tensor˝eldsproposedinChapter5arefullycompatiblewiththis speci˝cform-basedrepresentation,andevenprovideadiscretenotionofcovariantderivativeof vectorandcovector˝elds. Figure1.2 Example-basedtexturesynthesisonsurfaceandplane[2]. Thesquaretilesshow examplarsthatareusedtosynthesizeatextureonsurfacesguidedbyprecomputedvector˝elds. N -wayRotationalSymmetryField An N -wayrotationalsymmetry(RoSy)˝eldisamoregen- eralcaseofdirection˝eld,wherethedirectionisconsideredinvariantunderrotation 2 ˇ=N (see Fig.1.3),orastheequivalenceclassofthe N directionsalongevenlydistributedangles.Thespe- cialcaseof2-RoSy˝eldhasbeenknownasorientation˝eld,andlongbeenusedin˝ngerprint research,e.g.,in[21],sincetheridgesandvalleysona˝ngerprintimagedonothavedistinctfor- wardorbackwarddirectionsalongthem.Themodelscommonlyusedfordetectingsingularitiesin ˝ngerprintsareoftenwithfewparameters,butmoreaccurateorientation˝eldsareprovenimportant inenhancinglatent˝ngerprintscollectedatcrimescenes[22].Ingraphics,Zhangetal.[23]intro- ducedinteractive2-RoSydesignonsurfaces,andPalaciosetal.[24]extendedthisideato N -RoSy ˝eldswith N 3 .Building N -RoSy˝eldscanalsobeachievedthroughspecifyingcompatible 3 singularitiesandmodifyingparalleltransport:Laietal.[25]focusedondesigningRiemannian metricscompatiblewiththelocalsymmetryofN-RoSy˝elds,whileCraneetal.[26]proposed todirectlydesignaconnectionthatis˛atalmosteverywhereexceptatsingularities,insteadofus- ingtheLevi-CivitaconnectioninducedbytheRiemannianmetric.Rayetal.[27]introducedthe conceptofturningnumbersando˙eredanotherequivalentde˝nitionforsingularitiesofN-RoSy ˝elds. (a)spheremesh (b)vector˝eld (c)orientation˝eld (d)cross˝eld Figure1.3 n -vector˝eldsonspheremesh. Aspheremesh(a)andavector˝eldwithonesaddle singularity(b).Itscorresponding 2 -RoSy˝eldis(c)andits 4 -RoSy˝eldis(d).Resultscomputed bythemethodinChapter4. 1.1.1Orientation˝eldguidedtexturesynthesis Adirectapplicationoforientation˝eldsingraphicsistexturesynthesis.Texture,carryinginfor- mationaboutgeometricdetailsormaterialpropertiesandstoredasa2Dimage,isindispensablein decorating3Dsurfaces.Whilemanuallyproducingatextureislabor-intensiveandrequiresartistic skills,texturesynthesistechniqueisautomaticwhenexamplarsaregivenandlocaldirectionsare speci˝ed.Itiswidelyusedinapplicationssuchasrendering,imageeditingandvideosynthesis, andextensivelypracticedinindustry,e.g.,ingameenginesandfeature˝lms[28].However,apre- computedvector˝eldusedtoguidethetilingofatexturestillneedstobedesigned.Fortextures withtwowayrotationalsymmetry,theguidance˝eldsdonothavetobecontinuouseverywhere, wherethevectorsshouldbeallowedtohavenearlyoppositedirectionstohavemorenaturalcontrol. Togeneratelargetexturessatisfyinguserspeci˝cation,somekeyrequirementsneedtobeinplace forthemethodtobepractical. 4 Challenges An intuitive controlisoftenhighlybene˝cialinthedesignprocessofguidance˝elds. Forinstance,ifnonintuitiveDirichletorNeumannboundaryconditionsareused(i.e,thepre- designedvector˝eldistangential/perpendiculartotheboundary),anartistmayhavetospend extratime˝guringouttheirin˛uencewhenpreparingfeaturealignment˝elds,whereasanatu- ralboundaryconditioncanleadtoanexpectedsmooth˝eldwithoutadditionaluserintervention. Smoothness inthe˝naltextureisanotherbasicrequirementforseamlessappearanceoftheobjects beingdecorated.Too˙eradditional˛exibility,guidance˝eldscanbe N -RoSy˝elds. Figure1.4 Vector˝eld(left)anditscorresponding 4 -RoSy˝eld(right). Forinstance,the 4 -RoSy˝eldgeneratedfromthevector˝eld(inFig.1.4)allowsmoreways toputtogethercheckerboardorcross-liketextures.Ateachpoint,wehaveanequivalentsetof fourvectors,andwecanchooseanyofthemasthe representative vector.Sucha representative vector˝eldisnotcontinuous,whiletheassociated crosses canstillbecontinuouseverywherein thepicture.Real-worldtexturesoftencontain N -wayrotationalsymmetries,thatis,thepattern wouldnearlycoincidewithitselfafterrotatingbyanangleof 2 ˇ N .Thesesymmetriesallowpatterns tobealignedcontinuouslynotonlywithsmoothvector˝elds,butwithdirection˝eldsthatarenot smoothinthetraditionalsense.Thus,usingproceduresdesignedwithvector˝eldsasaninput forgeneratingseamlesstexturescanbechallengingwhenorientation˝eldsareusedinregions withdiscontinuityinthechoiceofforwardorbackwarddirections.Specialattentionmustbepaid 5 inthetreatmentofneighborhoodscontainingsuchdiscontinuity,whichisinevitableforgeneric orientation˝elds.Furthermore,adesignalgorithmshouldbee˚cientenoughtomakethesystem interactiveand˛exible. InChapter3weintroduceanovelframeworkfortheentirepipelineoforientation˝eldguided texturesynthesis[29].Ourmaincontributionsinclude Atangentvector˝elddesigntoolwithnaturalboundaryconditionsbasedontheminimization oftheDirichletenergy. Anorientation˝elddesigntoolbasedonanassociatedvector˝eld,withstraightforward controloversingularitiesandtheirorientations. Aparalleltexturesynthesisadaptedtohandleanydiscontinuityinanorientation˝eld. 1.1.2Vector˝eldanalysis Asdi˙erentialcalculusisoneoffundamentalmathematicstoolfor curved surfaces,di˙erential analysisofvector˝eldsisoftenmandatoryforgeometryprocessing,˛uidsimulation,etc.InSec2.2 weintroducethemathematicalbackgroundforcomparingnearbytangentvectorsinageometric sense,throughtheconceptofconnection.Intuitively,aconnectionprescribesinagivenlocalframe ˝eldhowtheframeatonepointshouldbemodi˝edtoproducea parallel frameatanearbypoint, soastoallowthecomparisonbetweenvectors(andtensors)innearbyframes. Variousdiscretizationmethodsofconnectionhavebeenproposed.Forinstance,[30]usedwhat conceptuallyamountstoChristo˙elsymbolsbetweenvertex-basedtangentplanestodescribethe e˙ectsofparalleltransport,inane˙orttointroducelinearrotation-invariantcoordinates.However, thesecoe˚cientsendupbearinglittleresemblancetotheircontinuousequivalents.Kircherand Garland[31]proposedatriangle-to-triangleconnectioninthecontextoffree-formdeformation, butnonotionofdi˙erentiationwasdiscussed.Aformaldiscreteversionofconnectionsbetween triangleswasde˝nedin[26],encodingthealignmentangleforparalleltransportfromonetriangle 6 toanadjacentone,andwithwhichpiecewise-constantunitvectorand n -direction˝eldscanbe derivedforanygivensetofsingularities. Therecentworkof[1]de˝nesanotionofparalleltransportthroughtheblendingofgeodesic polarmapssimilarto[13],whichdeterminesaconnectionbetweenverticesasopposedtotriangles. Thisapproachresultsinacontinuousnotionofvector˝elds(and n -vector˝elds)comparedtothe piecewiseconstantdiscretizationperfaceof[26,32,33],andthusallowsaformalevaluationof theDirichletenergy.TheirchoiceofconnectionisbasedontheevendistributionoftheGaussian curvatureoftheinputmeshfromverticestofaces,whichleadstoclosed-formexpressionsofthe L 2 integralstheysought.However,thedeviation(andthus,thediscretizationerror)oftheirconnection fromtheLevi-Civitaconnection,acanonicalconnectioninducedbytheembeddingofthemeshin R 3 ,isdi˚culttoquantifysincenoclosed-formexpressionofthecovariantderivativeitselfwas provided.Finally,˝rst-orderderivativeoperatorssuchasdivergenceorcurlcannotbeevaluated intheirframeworkpointwise,noraslocalintegrals.Theworkof[34]providesdiscrete covariantderivativesinducedbydiscretesymmetric2-tensorsasaglobalmappingfromapairof discrete1-formstoanotherdiscrete1-form,buto˙ersnopointwiseexpressionseither. Overall,nocurrentapproacheso˙eradiscreteconnectionsthatcanbearguedtobeoptimally closetothecanonicalconnectionintroducedbyitsembedding,neitherdotheyprovidethediscrete operatorstocapturelocalorglobalderivativesconsistently.InChapter4,weintroducediscrete counterpartsoftheseterms.Ourcontributionsinclude: Adiscreteconnectionwithclosed-formwhichisas-Levi-Civita-as-possible. Aclosed-formexpressionforthecovariantderivative,o˙eringpointwiseorintegralevalua- tionsof˝rst-orderderivativeoperatorsandrelevantenergies. Signi˝cantnumericalimprovementsoverpreviousmethodsareobtainedforanalyticalvector˝elds whenthisas-Levi-Civita-as-possiblediscreteconnectionisusedfordiscreteoperatorsonvector ˝elds.Wealsodemonstratetherelevanceandpracticaluseofourdiscreteconnectionsbycontribut- 7 ingnewnumericaltoolsfor n -vector˝eldand n -direction˝eldeditingthatcontrolthepositionand orientationofbothpositiveandnegativesingularities. (a)cowmesh (b)vector˝eld (c)orientation˝eld (d)cross˝eld (a)tripletorusmesh (b)vector˝eld (c)orientation˝eld (d)cross˝eld Figure1.5 Smoothest n -vector˝eldondi˙erentshapes. Asurfacemesh(a)anditscorresponding smoothestvector˝eld(b), 2 -RoSy˝eld(c)and 4 -Rosy˝eld(d).Resultscomputedbythemethod inChapter4. 1.1.3Spectralvector˝eldprocessingfor˛uidsimulation Accuratesimulationofincompressible˛uidsisanotherapplicationofvector˝elds,andawell- studiedtopicincomputational˛uiddynamics.Fluidanimationresearchisdrivenbyadi˙erent emphasis:inthecontextofcomputergraphics,thefocusisoncapturingthevisualcomplexityof typicalincompressible˛uidmotions(suchasvorticesandvolutes)withminimumcomputational cost.EarlycomputeranimationEulerianmethodsforincompressible˛uidsimulationwerebased onexplicit˝nitedi˙erences[35]whichsu˙eredfromtheslowconvergenceoftheiriterativeap- proachtodivergence-freeprojection.Stam[36]introducedsemi-Lagrangianadvectionandasparse Poissonsolverwhichbroughtmuchimprovede˚ciencyandstability.However,theseimprove- mentscameatthecostofsigni˝cantcommonissuethatonecanpartiallymitigate viavorticitycon˝nement[37],reinjectionofvorticitywithparticles[38],orcurlcorrection[39]. Signi˝cantlylessdissipativetimeintegratorswerealsoproposedthroughsemi-Lagrangianadvec- 8 Figure1.6 Model-reduced˛uidsonregulargrids. Ourproposedenergy-preservingapproach integratesa˛uid˛owvariationallyusingasmallnumberofdivergence-freevelocity˝eldbasesover anarbitrarydomain(visualizedherearethe 5 th , 10 th ,and 15 th eigenvectorsofthe 2 -formLaplacian) computedwithsubgridaccuracyonaregulargrid(here,a 42 42 32 grid)throughthemethod introducedinChapter6.Thisintegratorisversatile:itcanbeusedforrealtime˛uidanimation, magnetohydrodynamics,andturbulencemodels,witheitherexplicitorimplicitintegration. tionofvorticity[19],orevenenergy-preservingmethods[40].However,theseimprovednumerical methodsoftencarryhighercomputationalcosts.Consequently,coupledEulerian-Lagrangian(hy- brid)methods(see,forinstance,[41,42])have˛ourishedrecently,astheyo˙eragoodcompromise betweene˚ciencyanddissipation. Handlingboundarieswellisalsocrucialforincompressible˛uids,asboundarylayerscansig- ni˝cantlyimpact˛uidmotion.Avoidingthestaircasee˙ectsthatvoxelizeddomainsgeneratewas achievedusingsimplicialmeshesorhybridmeshes[43],butirregularconnectivityoftena˙ects thee˚ciencyofthesolversinvolved.Inspiredbytheimmersedboundaryandinterfacemethods, theuseofregulargridswithmodi˝ednumericaloperatorstohandlearbitrarydomainswaspro- posedin[44],thenmadeconvergentby[7]whilemaintainingsymmetryofthesolvesneededby theintegrators.Anotherapproachusingvirtualnodeswasalsoproposedrecently[45]. Fluidsimulationovernon-˛atdomainshasreceivedsigni˝cantattentionaswell.Mostnotably, StamadaptedhisStableFluidmethodtohandlecurvilinearcoordinates[46],whileAzencotet al.[47]recentlyproposedtousetheLiederivativeoperatorrepresentationinthespectraldomain torepresentavelocity˝eldonanarbitrarysurface,andperformedadvectionofvorticitythrough alinearizedexponentialmapoftheoperatorrepresentation.Methodsthatareusingonlyintrinsic 9 operatorscanalsohandlecurveddomainswithoutalterations[19,40]. InChapter6,weformulateamodel-reducedvariational˛uidintegratorthatcombinestheben- e˝tsof non-dissipative integratorswiththeuseof dimensionreduction and Cartesiangrids over arbitrarydomains.Basedonadescriptionofthe˛uidmotionthroughfunctionalmaps,avaria- tionalintegratorisderivedfromHamilton'sprinciple[48,49],resultinginaLiealgebraintegrator withnon-holonomicconstraints[50,10].Weusespectralapproximationofthefunctionalmap through(cell-based)scalarand(face-based)vectorLaplacianeigenvectorsinordertoo˙ermodel reductionwithoutlosingthevariationalpropertiesoftheintegrator,withcontrollableenergycas- cading.Thissetupallowsustousenotonlylowfrequenciestocapturethebasicbehaviorofa ˛ow,butalsoafewselectedhigherfrequenciestoaddrealismatlowcost.Furthermore,weextend theembedded-boundaryapproachof[7]toourframeworkinordertocomputespectral(scalar- andvector-valued)basisfunctionsofarbitrarydomainsdirectlyon regulargrids forfastcompu- tationswithsub-gridaccuracy.Finally,ourapproachusesthetypicalEuleriansetupof˛ux-based solvers;consequently,additionof˝nedetailsthroughspectralnoise[51],wavelet[52],empirical modedecomposition[53],subgridturbulence[54,55],curlcorrection[39],orthroughenforcing Lagrangiancoherentstructure[56]canbedonestraightforwardly.Wedemonstratethee˚ciency ofourresultingintegratorthroughanumberofexamplesin2D,3D,andcurved2Ddomains,as wellasitsversatilitybypointingouthowtoextenditsusetomagnetohydrodynamics,subgridscale models,andother˛uidequations.Ourapproachthusextendsthevariationalapproachof[40,10]to arbitraryreducedbases,adoptsthe(nowEulerian)vorticityadvectionof[57],ando˙ersastructure- preservingversionoftheLaplacian-basedintegratorof[9]. 1.2Discrete 2 -TensorFieldsonTriangulatedSurfaceMesh Tensorsofranktwoarecommonplaceingeometryprocessing,e.g.,asawaytoencodesizing andorientation˝eldsformeshingpurposes[58,59,60].Whilediscreterepresentationsoftan- gentvector˝eldsandantisymmetrictensors(i.e.,forms)ontriangulationshavebeenwidelyused, 10 fewapproachesprovideconvenientwaystoperformcomputationswitharbitrary 2 -tensor˝eldson triangulatedsurfacemesh,unliketheirlowerrankcouterparts.Muchlikeearlyworkondiscrete vector˝elds,theyareoftende˝nedby˝rstestablishingalocaltangentspacebasispervertex[59], edge[61],orface[62,63,64],thenstoringthefourcomponentsofthetensorineachofthese frames.Anotablecoordinate-freealternativeexistsforpurely antisymmetric 2 -tensors(called 2 - forms):theyarescalarmultiplesof J = 0 - 1 10 inanyorthogonalcoordinateframesince RJR t = J foranarbitraryrotationmatrix R .Theycanthusbeencodedasdiscretedi˙erential 2 -formsviaone scalarperfaceandWhitneybasisfunctions[65,4].(Dual 2 -forms,de˝nedperdualcell,canalsobe used.)Incomparison,symmetrictensorshaverarelybeendiscussedinthediscreterealm[66,67], yettheyareimplicitlybehindallinnerproductsofformsorvectors,generalizedLaplacianopera- tors[68],andthenotionofHodgestar[69].Ourdiscreteencodingoftensorsencompassesboth symmetricandantisymmetrictensorsinaconsistentframework. InChapter5,weintroduceanumericalframeworktoencodeandmanipulate 2 -tensorsontri- anglemeshes.Ourwork[34]isbasedonanovelcoordinate-freedecompositionofcontinuous 2 -tensor˝eldsintheplane.Byleveragingthisdecomposition,weconstructa˝nite-dimensional representationof 2 -tensorsondiscretesurfacesthatisfullycompatiblewiththeDEC[4]and FEEC[65]machinery.Ourdiscrete 2 -tensorsexactlymimicthecontinuousnotionofdivergence- free,curl-free,andtracelesstensors,andrecovermanywell-knowndiscreteoperatorscommonly usedingeometryprocessing.Finally,ourapproacho˙ersadiscretecounterparttobothcovari- antderivativeandLiebracketof 1 -forms(orvector˝elds),andprovidesanextensionoftheheat method[3]tocomputeanisotropicgeodesics. 1.3Organization Therestofdissertationisorganizedasfollows.We˝rstrecapimportantmathematicalconcepts usedthroughoutthedissertationinChapter2.Then,wediscussthe2Dorientation˝elddesign withnaturalboundaryconditionsinChapter3.Aprincipledapproachtoconnectiondiscretization 11 (a)isotropicgeodesic (a)isotropicgeodesic (a)isotropicgeodesic (b)anisotropicgeodesic (b)anisotropicgeodesic (b)anisotropicgeodesic Figure1.7 In˛uenceofthemetrictensorongeodesics. (a)visualizationofanisotropicgeodesic wherethedistanceisgeneratedbytheheatmethod[3].Thecurvaturetensorofasurfaceisap- pliedtocomputeanisotropicgeodesics(b)withourgeneralizedLaplacianoperatorproposedin Chapter5. oncurvedsurfacesanditsapplicationto N -RoSydesignispresentedinChapter4.Discretization of 2 -tensor˝eldsanditsapplicationinanisotropicgeodesiccalculationisdiscussedinChapter5 andaspectralvector˝eldprocessingonirregularlyshaped3Ddomainisintroducedtobuildanovel model-reducedvariationalintegratorfor˛uidsimulationinChapter6.Finally,wesummarizethe contributionsfromthisthesisanddiscussfutureworkinChapter7. 12 CHAPTER2 MATHEMATICALBACKGROUND Inthischapter,wepresentthenecessarymathematicalbackgroundofthecontinuoustheoryand anexistingdiscretestructure-preservingcounterpartofacollectionoftoolsincontinuousvector ˝eldanalysiscalled exteriorcalculus .Somebasicconcepts,includingmanifolds,tangentvectors, tensors,di˙erentialformsareintroducedinSec2.1. Connection and covariantderivative operators arediscussedinSec2.2,whosediscretecounterpartsareproposedinChapter4.Sec2.3presents thedecompositionoftensor˝eldsintosimplerbuildingblocks,whichenablesourintrinsicrepre- sentationsinChapter5.Finally,Sec2.4introducesatoolusedthroughoutthisdissertation,namely, Discreteexteriorcalculus (DEC),whichprovidesadiscreterepresentationofthe di˙erentialforms withtheirdi˙erentialandintegralcalculus.NotethatwerestricttheexpositioninSec2.2and Sec2.3tothesurfacecaseonly. 2.1BasicConceptsfromDi˙erentialGeometry Classicaldi˙erentialgeometryfocusesonthestudyofthegeometry(likecurvesandsurfaces) throughthetechniquesoflinearalgebra,di˙erentialcalculusandintegralcalculus.Inthissection, weintroducesomebasicconceptsinvolvedinourworkandrestrictourdiscussiontosubsetsof R 3 . Notethatthegoalhereistoprovidereaderswithsomepriorknowledgeindi˙erentialgeometry andtheintuitionbehindkeyconcepts,ratherthanrigorousmathematicalde˝nitionsoftheseterms. Referto, e.g. ,Lee'sbook[70]iffurtherdetailsaredesired. Thebasicshapesordomainsusedindi˙erentialgeometryaredescribedbymanifolds.An n- manifold M isaspacethatlocallylookslike˛atEuclideanspace R n ,butmayhavedi˙erentglobal topology.Forinstance,thesurfaceofEarthcanbetreatedasa 2 -manifold,sincenomatterwhere youstandonEarth,itlookslocallylikea˛at 2 D domain.Euclideanspaces,curves,andsurfaces 13 areallspecialcasesofmanifolds. 2.1.1Tensors Quantitiesstoredonmanifoldscanberepresentedthroughfunctionswithmultiplecomponents.A particularlyimportantclassofmultiplecomponentfunctionsarecalledtensors.Weintroducethe vectorsandcovectorsbeforedescribingthetensors.Wethendiscussthedi˙erentialandintegral calculusoftensors. Tangentvector. Forapoint p onasurface M embeddedin R 3 ,atangentvector v at p isjusta tangentvectortoacurveonthesurface M thatpassesthrough p .Thesetofalltangentvectorsto M at p iscalledthe tangentplane ofmanifold M atpoint p ,whichisoftendenotedas T p M . Covector. Fora˝nite-dimensionalvectorspace V .A covector on V isde˝nedasareal-valued linearfunctionon V as ! : V ! R .Thespaceofallthecovectorson V isalsoavectorspace,which isthe dualspace to V andisoftendenotedas V . T p M isthusthedualspaceof T p M ,sometimes calledthecotangentspace,theelementsofwhicharecalled(tangent)covectors,cotangentvectors, or 1 -forms. Tensor. Justasacovectorcanbeseenasalinearoperatorthatmapsavectortoarealnumber, vectorcanbeseenasalinearoperatorwhichmapsacovectortoarealnumber,sincefor˝nite- dimensionalvectorspaces,thedualspaceofthedualspaceisidenticaltotheoriginalspace.A rank- ( m;n ) tensor isageneralizationofbothvectorandcovector,inthesensethatitcanbetreated asamultilinearoperatormapping m covectorsand n vectorstoascalar.Scalar˝elds,vector˝elds andcovector˝eldsarejustrank-0,rank-(1,0),andrank-(0,1)tensor˝elds,respectively.A metric tensor isasymmetricrank- (0 ; 2) tensorthatispositivede˝nite.Ittakesapairoftangentvectorsas inputandproducesascalarvalue,whichprovidesadistancemeasurementonthemanifold.Given abasisframeofthetangentspace,ametrictensorcanberepresentedasasymmetricpositive- de˝nitematrix.Inalocalbasis˝eld ( X u ; X v ) oftangentspacesonasurface,avector˝eldcanbe 14 expressedas w = u X u + v X v .Thelengthofavectorcanbecalculatedas: g ( w ; w )=( u;v ) 0 B @ EF FG 1 C A ( u;v ) T (2.1) where E = X u X u , F = X u X v and G = X v X v providesthecanonicalembeddingmetric g ofthesurface.Thelengthofapathcanbeevaluatedastheintegralofthetangentvectorsalongthe path.Fora˛atplanewithCartesiancoordinatesystem,themetrictensorisjusttheidentitymatrix. Di˙erentialforms. Aparticularlyusefultensoristheantisymmetricrank- (0 ;p ) tensor.Atensor isantisymmetricifswappingtwovectorsintheinputlistofthetensor,theoutputchangessign. Suchtensorsarecalled p di˙erentialforms,orjust p -forms.Theyaretensor˝eldswhoseintegral on p dimensionalsubmanifoldsareindependentofthecoordinatesystems.Forinstance,di˙erential formscanbeintegratedovercurves( 1 -form),surfaces( 2 -form)andvolumes( 3 -form). Thus,covectorsare 1 -formsandantisymmetricrank- (0 ; 2) tensorsare 2 -forms.In R 3 , p -forms canbeexpressedinbasesspannedbyformssuchas dx , dxdy or dxdydz : 0 -form:smoothfunction f 1 -form:integrandinlineintegral fdx + gdy + hdz 2 -form:integrandinsurfaceintegral fdxdy + gdzdx + hdydz 3 -form:integrandinvolumeintegral fdxdydz Onan n -manifold,all k -formswith k>n arezero,duetothe antisymmetry . 2.1.2Exteriorcalculus. Asetofoperatorscanbede˝nedondi˙erentialformstoformadi˙erentialcalculusforintegrable quantitiesonmanifolds.Welisttheseoperators˝rstbeforeestablishingthecorrespondenceofthem withtheclassicalvector˝eldanalysisonsurfaces.Inthefollowing,wedenotethesetof p -forms as p . 15 exteriorderivative d : k ! k +1 ; contractionoperator i X : k ! k 1 ,where X isavector; Hodgestar ? : k ! n k ; wedgeproduct ^ : p ! q ! ! p + q . Onsurfaces(2-manifolds), 0 -formsand 2 -formshaveasinglecomponent,sotheycanberep- resentedbyscalar˝elds; 1 -formshavetwocomponents,sotheycanberepresentedbyvector˝elds (althoughtheyareinfactcovector˝elds).Insuchrepresentations, d appliedto 0 -formsproduces gradients, d appliedto 1 -formsproducescurl. i X witha 2 -formisjustascalingof X ,and i X witha 1 -formisthedotproductbetweenthetwovectors.TheHodgestar ? appliedto 0 -formas multiplicationbyareadensity,to 1 -formasarotationby ˇ= 2 ,andto 2 -formasdivisionbyarea density.Thewedgeproductbetween 0 -formanda p -formisjustascalingoftheotherform,the wedgeproductbetweentwo 1 -formsisthecrossproduct,whichproducesascalaronsurfaces. 2.2ConnectionsonSmoothManifolds Inordertotakederivativesofvector˝eldsonmanifolds,onemustaccountforthefactthatthevector ˝eldcomponentsarede˝nedondi˙erentbasisframesoverdi˙erenttangentspaces.Thus,one must˝rstde˝neawaytocomparevectorslivingonnearbytangentspacesinageometricmanner. A connection playssucharole,asitmapsatangentvector(seenasanin˝nitesimalmovement towardanearbypoint)toanin˝nitesimallineartransformationaligningthelocaltangentplaneto thetangentplaneatthatnearbypoint. 2.2.1De˝nition Aswewillreviewshortly,aconnectionisequivalenttoanotionofparalleltransport,i.e.,howto slidetangentvectorsalongcurveson M .A metricconnection hastheadditionalpropertythatthe 16 Figure2.1 Smoothconnection. Onasmoothmanifold,aconnectionindicateshowatangentvector atpoint p isparalleltransportedalongapath C toanearbypoint p 0 = p + w ,accountingforthe changeofframebetweenthetwotangentspaces.Fromaconnectionthenotionof(covariant) derivativeofvector˝eldsisderived,asnearbyvectorscannowbecompared. metricon M ispreservedbyparalleltransport.Givenaframe˝eld ( e 1 ( p ) ; e 2 ( p )) ,aconnectionis determinedbythe coe˚cients ! i jk de˝nedas r e k e j = X i ! i jk e i Eachcoe˚cient ! i jk thusdescribesthe i -thcomponentofthechangeofthebasisvector e j along e k .(Itcanalsobeinterpretedasthe k -thcomponentofamatrix-valued 1 -form =( ! i j ) aswewill seenext.) The Levi-Civitaconnection of M isaspecialmetricconnection:itistheonlyonethatsatis˝es ! i jk ! i kj =0 forframesformedbytangentvectorsofisocurvesofaparameterization.Noteherewe restrictthediscussionofconnectiontothemetricconnection.Forde˝nitionsofotherconnections de˝nedonvectororframebundles,wereferthereadersto[71]. 2.2.2Connection 1 -form Aconnectioncanberegardedasawayofdeterminingwhetheravector u inthetangentspaceof p isparalleltoavectorinthein˝nitesimallynearbytangentspaceof p 0 (seeFig.2.1).Inthelocal 17 frame ( e 1 ( p ) ; e 2 ( p )) at p , u ( p )= u 1 e 1 ( p )+ u 2 e 2 ( p )=( e 1 ( p ) ; e 2 ( p )) 0 B @ u 1 u 2 1 C A Theconnectionprovidesanexpressionforthevectorat p 0 thatisparallelto u ( p ) viaanin˝nitesimal perturbationoftheoriginalcoordinates: u 0 ( p 0 )=( e 1 ( p 0 ) ; e 2 ( p 0 ))( I w ) ) 0 B @ u 1 ( p ) u 2 ( p ) 1 C A ; whichcanthenbecomparedagainst u ( p 0 )=( e 1 ( p 0 ) ; e 2 ( p 0 )) 0 B @ u 1 ( p 0 ) u 2 ( p 0 ) 1 C A : Formally,theconnectionisthusde˝nedasamatrix-valued 1 -form ,whichencodesthattheframe ( e 1 ( p ) ; e 2 ( p )) isalignedtotheframe ( e 1 ( p 0 ) ; e 2 ( p 0 ))( I w ) ) whenmovingalong w . Forsimplicity,weassumethatthelocalframe˝eldisorthonormal,i.e. ( e 1 ; e 2 )=( e ; e ? ) ,where e isaunitvector,and e ? isits90 -rotationinagivenmetric g ofthesurface.Sinceweassumed thattheconnectionismetricpreserving( i.e. ,thatthebasisvectorsareparalleltotwomutually orthogonalunitvectorsinnearbyframes),theconnection simpli˝estoan antisymmetric matrix representinganin˝nitesimalrotationoftheform: = 0 B @ ! 1 1 ! 1 2 ! 2 1 ! 2 2 1 C A = 0 B @ 0 ! ! 0 1 C A = !J; where J isthe90 -rotationmatrix J = 0 B @ 0 1 10 1 C A : 18 Therefore,givenaframe˝eld,theconnectionisde˝nedbyarate-of-rotation-valued 1 -form ! describinghowfastthelocalframeshouldrotatetoaligntonearbyframeswhenmovingalonga certaindirection. Curvatureofconnection Theexteriorderivativeofthelocalrepresentationoftheconnection ! de˝nes,uptoasign,thecurvatureoftheconnection,andisdenotedas K = d! .Anyclosedpath @R aroundaregion R ofthemanifoldthereforeaccumulatesarotationofframe,anditisequal totheintegraloftheconnectioncurvatureover R .ForthecanonicalLevi-Civitaconnection,this curvaturecorrespondstotheconventionalnotionofGaussiancurvature. 2.2.3Covariantderivativeonsmoothmanifolds Geometricintuition Covariantderivativeofavector˝eld u atapoint p onasurface M isthat r u encodestherateofchangeof u around p (checkFig.2.1).Projectingthederivativeofavector ˝eld u alongavector w leadstoavector r w u ,whichindicatesthedi˙erencebetweenvectors u ( p ) at p and u ( p 0 ) atanearbypoint p 0 p + w ( p ) ,where 2 R isapproaching 0 .However,these vectorsliveindi˙erenttangentspaces,sothecomponent-wisedi˙erencesdependonthechoiceof localbasisframes,andtakingtheirdi˙erencesinamannerthatispurelygeometric(i.e.,coordinate frame-independent)requirestheadditionalinformationofconnection. 2.2.4Metric-preservingcovariantderivative Givenaframe˝eldandaconnection 1 -form,thecovariantderivative r u ofvector˝eld u = u 1 e 1 + u 2 e 2 canbeexpressedincoordinatesas r u =( e 1 ; e 2 ) 2 6 4 0 B @ du 1 du 2 1 C A + !J 0 B @ u 1 u 2 1 C A 3 7 5 ; (2.2) where d istheexteriorderivative[72]appliedtothecomponentsofthevector˝eld,andthecon- nectionisusedtolocallyaccountforthechangeofframes.Whileitisnowastand-aloneoperator 19 onvector˝eldsakintothegradientoperatorforfunctions,itcanalsobepairedwithanothervector ˝eld w tomeasurethedirectionalderivativeof u along w ,i.e., r w u =( e 1 ; e 2 ) 2 6 4 0 B @ du 1 ( w ) du 2 ( w ) 1 C A + ! ( w ) J 0 B @ u 1 u 2 1 C A 3 7 5 : Notethatevenif ! isdependentonthechoiceofthelocalframe˝eld, r u isapropertensor˝eld de˝nedonthetangentbundle. Geometricdecomposition Inanorthonormalframe˝eld,thecovariantderivativeofthevector ˝eld u canbeexpressedinamatrixform.Forclarity,weomitthebasis ( e 1 ; e 2 ) appearinginthe expressionof r u inEq.2.2inwhatfollows.Representingthere˛ectionmatrixby F = 0 B @ 10 0 1 1 C A ; andthe 2 2 identitymatrixby I; thismatrixrepresentationcanberearrangedintofourgeometrically relevantterms: r u = 1 2 [ I r u + J r u + F r ( F u )+ JF r ( F u )] ; (2.3) where J r u (measuringthecurlof u )istheonlyantisymmetricterm.Moreover,wecanrewrite thisdecompositionasafunctionoftwootherrelevantderivatives: r u = @ u + F @ u ; wheretheholomorphicderivative @ 1 2 ( I r + J r ) containsdivergenceandcurlofthevector ˝eld,neitherofwhichdependonthechoiceoflocalframe;whereastheCauchy-Riemannoperator (orcomplexconjugatederivative) @ 1 2 ( I r F + J r F ) dependsonthechoiceofframe.Due totheuseofre˛ection, @ u behavesasa 2 -vector( 2 -RoSy)˝eld(seeAppendixA). Paralleltransport Paralleltransportofavector˝eld u alongapath C ( s ) (where s isaparam- eterizationofthepath)betweentwonearbypointsofamanifold M inagivenmetricconnection 20 isde˝nedby r C 0 ( s ) u =0 ; where C 0 ( s ) denotestheunittangenttothepath C ( s ) .Thisimpliesby integrationthatavector,representedinthebasis ( e ; e ? ) ,evolvesin˝nitesimallyalongthepathvia theconnectionas u ( s )=exp J Z s 0 ! ( C 0 ( )) u (0) : (2.4) Consequently,avectorparallel-transportedalongthispathundergoesaseriesofin˝nitesimalro- tations,addinguptoa˝niterotation ˆ = R C ! ,since exp( J )=cos I +sin J .Thismatrix exponentialthusinducesalinearmapping(namely,arotationbecausewerestrictourdiscussionto metricconnections)betweenthetangentspacesofthetwopoints. 2.2.5Relevantenergies BasedonthedecompositionofthecovariantderivativeoperatorinEq.2.3,wecanalsoexpressthe Dirichletenergy E D ofvector˝eldasthesumoftwomeaningfulenergies: E D ( u )= 1 2 Z S jr u j 2 dA = 1 2 ( E A ( u )+ E H ( u )) : Theantiholomorphicenergy E A measureshowmuchthevector˝elddeviatesfrombeingharmonic, andtheholomorphicenergy E H measureshowmuchthe˝elddeviatesfromsatisfyingtheCauchy- Riemannequations: 8 > < > : E A ( u )= 1 2 R M [( r u ) 2 +( r u ) 2 ] dA; E H ( u )= R M ( @ u ) 2 dA: Whilecomplexnumbersareoftenusedtoexpresstheseenergies,westicktobasicvectorcalculus inourworkforsimplicity. Furthermore,thedi˙erencebetween E H and E A leadstoaboundarytermandatermrelated totheconnectioncurvature K = d! , E A ( u ) E H ( u )= Z @M u ( r u )+ Z M K j u j 2 : (2.5) InChapter4,alltheoperatorsandenergiespresentedwillbegivenadiscreteformulationfortheir evaluationontrianglemeshes. 21 2.3DecompositionofTensorFieldonSmoothManifolds Webeginwithabriefreviewofexistingdecompositionsofarbitraryrank- 2 tensorsonsmooth surfaces M withboundaries @ M .Notethatwewillrestrictourexpositiontotensorsoftype (0 ; 2) (i.e.,actingontangentvectors),butequivalentexpressionsfortensorsoftype (1 ; 1) or (2 ; 0) can bederivedusingproperraisingorloweringofindiceswiththe˛atandsharpoperatorsde˝nedby theRiemannianmetric g . 2.3.1Antisymmetricvs.symmetrictensors Justasamatrix A canbedecomposedintoasymmetric 1 2 ( A + A t ) andanantisymmetric 1 2 ( A A t ) part,arank- 2 tensor˝eld ˝ 2T canbedecomposedintoanantisymmetric(orskew-symmetric) tensor 2A andasymmetrictensor ˙ 2S with ˝ = + ˙ .Therefore, T = AS : (2.6) ThisdecompositionistriviallyanorthogonaldirectsumfortheFrobeniusinnerproduct h :;: i F due tothefactthattheproductofanantisymmetricmatrixandasymmetricmatrixistraceless,andthus theirinnerproductvanishes.Notethatantisymmetrictensorsarealsocalledormsandhavebeen extensivelyusedasthebasisofexteriorcalculus[72].Commongeometricnotionssuchasmetric, stress,andstrainare,instead,symmetrictensors. 2.3.2Decompositionofantisymmetric 2 -tensors Antisymmetricrank- 2 tensors 2A ,dubbed 2 -forms,areparticularlysimpleonsurfaces:theyare oftheform = s g where s isanarbitraryscalarfunction.Theycanbefurtherdecomposed,via Hodgedecomposition[72],astheorthogonaldirectsum = d! h ,where ! isanarbitrary 1 -form and h isaharmonic 2 -forhissimplyaconstant p times g if M hasasingleconnected component.Consequently,byapplyingtheHodgedecompositionon ! ,weseethat 2 -formscanbe writteninfullgeneralityas: = s g = q + p ) g ; (2.7) 22 where q istheLaplacianofascalarfunction q ,and p isascalarconstant(non-zeroconstant functionsare,indeed,notintheimageoftheLaplacianoperator). 2.3.3Decompositionofsymmetric 2 -tensors Symmetricrank- 2 tensorscanalsobedecomposedfurther.BergerandEbin[73]werethe˝rstto proposeanotionofdecompositionofsymmetrictensorson arbitrary manifoldsthatextendsthe well-knownHodgedecompositionofvector˝eldsandforms.Noticingtheroleofthekernelandim- ageofdivergenceandcurlintheHodgedecomposition,theyproposedtoorthogonallydecompose asymmetrictensorviatheimageofanoperator P (withinjectiveprincipalsymbol)andthekernel ofitsadjointoperator P (uniquelyde˝nedvia h P ; F = ;P uptoboundaryconditions): S =Im P Ker P : (2.8) Thisisthegeneralizationofthewell-knownfactthat,foranygivenmatrix,itsrangeandthekernel ofitstransposeformanorthogonaldecompositionoftheentirespace.Wereviewrelevantexamples ofthisversatileconstructionnext. Divergence-basedexpression. Oneofthemostcommondi˙erentialoperatorsonmanifoldsisthe covariantderivative[74],whichextendsthenotionofdirectionalderivativeforarbitrarymanifolds. Thecovariantderivative r ! ofa 1 -form ! returnsarank- 2 tensorwhosesymmetricpartisthe Killingoperatorof ! ,i.e., 1 2 r ! + r ! t . . = K ( ! ) . i TheKillingoperatoris,itself,remarkably relevantindi˙erentialgeometry:itskernelcorrespondstovector˝elds(knownasKillingvector ˝elds)thatde˝neisometric˛owsonthesurface[20].For P K inEq.(2.8),theadjointoperator P turnsouttobethenegateddivergenceoperator d iv ontensors[73],implicitlyde˝nedona closedsurfaceas: h ˙; K ( ! ) i F = d iv˙;! i 1 8 ˙ 2S : (2.9) i Notethatourde˝nitionoftheKillingoperatordi˙ersbyafactor 1 = 2 frommostauthors,inan e˙orttosimplifyfurtherexpressions. 23 Notethat,for˛atdomainswiththeEuclideanmetric I ,theKillingoperatorcanbeexpressedin localcoordinatesasasymmetricmatrixwithentry ( i;j ) oftheform 1 2 ( @ j + @ i ) ,whilethedivergence operatorreducestothedivergenceofeachcolumnofthematrixformofatensor.FromtheBerger- Ebindecomposition,weconcludethatanysymmetrictensor˝eldiscomposedofadivergence-free partplusanelementoftheimageoftheKillingoperator: S =Im K Kerd iv: (2.10) Curl-basedexpression. Wecanalsode˝neasimilardecompositionusingthistimethenotion ofcurlofatensor.Infact,therelationshipbetween d iv and c url for 2 -tensorsin M issimple: justlikethecurlofavector˝eldisminusthedivergenceofitsrotatedversion,fora 2 -tensor ˙ wehave c url˙ . . =d iv ( ?˙? - t ) ,where ?˙? - t isthe ? -conjugateof ˙ .WethusgetaBerger-Ebin decomposition S =Im K Kerc url; (2.11) wheretheoperator K indicatesthe ? -conjugateoftheKillingoperator,i.e., K ( ! ) . . = ? K ( ! ) ? - t . Trace-basedexpression. Anothercanonicaloperatorontensorsisthetrace tr .ItsBerger-Ebin baseddecompositionisrathertrivialsincetheadjointofthetraceissimply tr ( z )= z g forany scalarfunction z ,thusleadingto: S =Imtr Kertr : (2.12) 2.3.4Remarks Weconcludethissectionwithafewobservations. Boundaryconditions. Inordertouniquelyde˝netheadjointrelationinEq.(2.9),wemustpre- scribeboundaryconditionsfor 2 -tensor˝elds.Similartothecaseof 1 -forms,thiscanbeachieved byeitherprescribingboundarytensors(Dirichletboundarycondition)orspecifyingtheirnormal derivatives(Neumannboundarycondition). 24 PhysicalInterpretation. Tensordecompositionsareoftenusedtocharacterizedeformationsin mechanicalsystems.Theantisymmetricpartofasymmetrictensors(Eq.(2.6)),forinstance,re- vealsin˝nitesimalrotationsina˛uidmotion.Divergence-freetensorsandtheKillingoperator (Eq.(2.10))indicateforceequilibriumanddeviationfromisometriesinsolidmechanics.Simi- larly,thetrace-baseddecomposition(Eq.(2.12))identi˝eslocaldilationsandshearing,commonly controlledinelasticityviaLaméparameters. CovariantDerivative. Asmentionedinthecovariantderivativemapsa 1 -form ! toa 2 -tensor˝eld r ! whichisthesumofasymmetricandanantisymmetricpart: r ! = K ( ! ) 1 2 d!; (2.13) wheretheantisymmetricpartishalfthecurlofthevector˝eld ! ] associatedto ! .Therefore,the covariantderivative r ! identi˝esthescalarfunction q inEq.(2.7)withthe(negated)function g inducedbythecoclosedpart ?dg of ! . GeneralizedLaplacian. ThestandardLaplace-Beltramioperator onafunction z isde˝nedas d iv ( r z ) .Thisoperationgeneralizesforasymmetric 2 -tensor˝eld ˙ in M as ˙ z . . =d iv ( ˙ r z )= ? (d iv˙ ^ ?dz )+tr ˙ g 1 Hess( z ) ; (2.14) where Hess( z ) istheHessianof z .Thisoperatorisparticularlyrelevantinthecomputationofquasi- harmonic˝elds[68]andinelasticity[75].Graphicsapplicationshavealsousedthisgeneralized Laplaciantocomputeanisotropicparameterization[63,76]and˝ltering[77],andmorerecentlyto designsimplicialmasonrystructures[78,79].Notethat,when ˙ isadivergence-freetensor˝eld, thegeneralizedLaplaceoperatorbecomes linearaccurate ,i.e., ˙ z =0 foranylinearfunction z intheplane. 25 2.4DiscreteExteriorCalculus Acomputationaltoolusedthroughoutthisdissertationisthediscreteimplementationoftheafore- mentionedexteriorcalculus,whichpreservescrucialdi˙erentialidentitiesinvector˝eldanalysis. Asthe p di˙erentialformsareintegrandson p dimensionalshapesinthedomain,theyadmitnatural discretization,throughtheirintegralvalueson p dimensionalcellsintessellateddomains. Inparticular,forsurfacemesh,a primal 0 / 1 / 2 -formisstoredasonevalueintegratedperver- tex/edge/face,whilea dual 0 / 1 / 2 -formisstoredasonevalueintegratedperface/edge/vertex.The usualdi˙erentialoperatorsinvector˝eldanalysiscanbeimplementedthroughtwobasicoperators d and ? inDEC.The˝rstoperator di˙erential ,orexteriorderivative, d k maps k -formsto k +1 -forms byevaluatingthesumof k -formintegralsontheboundaryof k +1 -cells,andthesecondoperator Hodgestar k mapsprimal k -formstodual 2 k -formsin2Dbyrescalingthemusingthesize ratiobetween k -cellsanddual 2 k -cells.Wemayinterpret d 0 asgradient r , d 1 ascurl , 0 asmultiplicationbytheareaform, 1 asrotationby90 onthetangentplane,and 2 asdivision bytheareaform.Otherdi˙erentialoperatorscanbeassembledfrom d and ,e.g. co-di˙erential k = 1 k 1 d T k 1 k ,whichareadjointtodi˙erentials.Inparticular,divergence canbeimple- mentedby 1 .Onatrianglemesh,the d 'sareimplementedtransposesofthesignedincidence matrices,andthe 'sareimplementedasdiagonalmatriceswiththeratiosbetweenthesizesof dualmeshcellsandthecorrespondingprimalmeshcellsonthediagonal.Formoredetails,refer to[4]. 26 CHAPTER3 ORIENTATIONFIELDGUIDEDTEXTURESYNTHESIS 3.1Introduction Texturesynthesisisapopularmethodtoacquiretextures.Texturesoftencontainsalientfeature directions,whosealignmentisoftencontrolledbyauser-speci˝edguidancedirection˝eld.Such adirection˝eldisalsomandatoryformostmethodsonsurfacesevenwhentherearenofeatures. Fortextureswithtwowayrotationalsymmetry(2-RoSy),theguidance˝eldsdonothavebecon- tinuouseverywhere.Instead,nearbyvectorsshouldbeallowedtohavenearlyoppositedirectionsto havenaturalsingularities.Such˝eldsarecalled2-RoSy˝elds,ororientation˝elds.Forinstance, ˝ngerprintsareoblivioustowhetherthedirectionisforwardorbackwardalongtheridges.The principalcurvaturedirection˝eldsonsurfacesisanotherextremelyimportantexampleof2-RoSy. Inthischapter,wespeci˝callytargetatdevelopingamethodforhandlingsuch˝elds. Inthefollowing,we˝rstbrie˛ydiscussthemostrelevantrelatedworkonorientation˝elddesign andontexturesynthesis.Wethenpresentourvector˝elddesignalgorithmforthenatural/free boundaryconditioninSec.3.3.Thesingularitycontrolinorientation˝eldsispresentedinSec.3.4. Next,weelaborateonthenontrivialmodi˝cationstomakeparallelappearancetexturesynthesis applicabletoorientation˝eldsinSec.3.5.Examplesdemonstratingthecapabilityofoursystem areshowninSec.3.6.WeconcludethischapterinSec.3.7. 3.2RelatedWork Vector˝elddesign Ina˛exibleandintuitivetexturingsystem,usersshouldbeabletocontrolthe orientationandsizingoftexturesonsurface.Suchcontrolsareoftenachievedbydesigningavector ˝eldprescribingoneoftheaxesofthelocalcoordinateframes.Somevector˝elddesigntoolsused 27 interpolationfromscattereduser-speci˝eddirections[80,81],andothersalsoallowsingularity control[13,17].Zhangetal.[13]proposedtousegeodesicpolarmapsandparalleltransportto createradialbasisfunctionsgivenusers'requirements.Fisheretal.[17]employedthetoolsfrom discreteexteriorcalculus,byrepresentingthe˝eldasdiscrete1-formsandsolvinglinearequations withuser-de˝nedconstraints.Ourvector˝elddesignisbasedon[17],withonemaindi˙erence onthetreatmentofthefreeboundarycondition.Thechangeisnecessaryasthee˚cienttools fromdiscreteexteriorcalculuscannotexpressthevector˝eldDirichletenergyofvector˝eldsasa directcombinationofthebasicoperatorsinexteriorcalculusforsurfaceswithboundaries.More precisely,inthiscase,theDirichletenergyofatangentvector˝eldisdi˙erentfromthesumofthe squaredsumofthe L 2 -normsofitsdivergence˝eldanditscurl˝eld,asdetailedinSec3.3. Texturesynthesis Theliteratureongeneratinglargetexturepatchesautomaticallyfromgiven exemplarsisvast,assuchexample-basedtexturesynthesistechniques,amongthes arttextureacquisitionmethods,areeasytouseandcapableofproducingresultswithoutunnatural artifactsorperiodicity.Mostoftheexample-basedmethodsarebasedontheMarkovRandomField theory,assumingthatthecombinedprobabilitydistributionofpixelshasstationarityandlocality. Theactualimplementationcanbepixel-based,patch-based,ormoregenerally,optimization-based. Patch-basedalgorithms[82,83,84]extractconsistentpatchesfromtheexemplarandgluethem togethertocreatelargetextures.Theycanbehighlye˚cientwithneighborhoodsfaithfultothose intheexemplar.However,theydonotprovidelargevariationandcanbeine˚cientforruntime synthesisduetothesequentialnatureoftheprocess.Somepixel-basedalgorithms,ontheother hand,areabletogeneratehighqualityresultsinteractivelythroughmulti-scaleGaussianimage stacksandparalleltexturesynthesis[85,2].Extensionstoperformtexturesynthesisonsurfaces byformingseamlesstextureacrossatlaschartscanbefoundin,e.g.,[86,2].Refertothesurveys [87,88]formoreinformationontexturesynthesis. 28 Relationtoourwork Forourtaskoforientation˝eldguidedtexturesynthesis,weuseamod- i˝edversionofthetangent˝elddesignmethod[17].Thevector˝elddesignthroughaweighted leastsquaresmethodleadstoastraightforwardPoisson-equation-likelinearsystem.Whenthesin- gularitiesaremoved,thereisnoneedtorebuildspanningtreesasin[26],orrerundiscreteRicci ˛ows[25].Forindex-1singularities(poles),onlytherighthandsideofthelinearsystemismod- i˝ed;forindex- 1 singularities(saddles),ane˚cientincrementtotheCholeskyfactorizationof thelefthandsidecanbeperformed.Furthermore,whiletexturesynthesisdependsonlyontheunit directionofthe˝eldinmostcases,thetruevector˝elddesigninengineeringapplicationscould bene˝tfromamethodthatallowsdirectcontroloverdivergenceandcurlasin[17].Ourtexture synthesisstageisbasedon[85]and[2],whichmanipulatepixelcoordinatestoovercometheissue oflackofe˚ciencyinorder-independentneighborhoodmatching.However,fororientation˝eld guidedsynthesis,theupsamplingandcorrectionstepsinthetop-downmultiscaleapproachmust besubstantiallymodi˝ed. 3.3VectorFieldDesignwithNaturalBoundaryConditions Beforepresentingourmodi˝cationtothenaturalboundarycondition,webrie˛yrecapthemethod describedin[17].Wedemonstratethenecessityofourmodi˝cationthroughexamples. Thetangentvector˝elddesignproblemisformulatedasaweightedleastsquaresproblemin [17].Thedesignconstraintsarespeci˝edthroughuser-controlledcurlanddivergenceofthevector ˝eld,aswellasdirectconstraintsonthevectors,allatscatteredlocations.Thecurlisonlynon-zero atuser-speci˝edvortices,andthedivergenceisonlynon-zeroatuser-speci˝edsourcesorsinks.The directconstraintscanbeanyprescriptionofthevectoratselectedlocations,butareoftenspeci˝ed inbatchesthroughusersketchstrokes. Whentherelevant˝eldsareexpressedasdiscretedi˙erentialforms,theaboveweightedleast squaresproblemhasastraightforwardimplementationthroughdiscreteexteriorcalculus(DEC). TheresultinglinearsystemisessentiallyaPoissonequationcombinedwithtermsfromsoftcon- 29 straints. 3.3.1Setup Thecomputationiscarriedoutona2-manifoldwithboundary,representedbyatrianglemesh M , withvertexset V ,edgeset E ,andtriangleset T .Avector˝eld u canbestoredasa1-form,i.e.one scalarvalueperorientededge e i 2 E ,denotingthelineintegralalongtheedge c i = R e i u .Ascalar ˝eld s canbestoredasa0-form,onevaluepervertex v i 2 V , s i = s ( v i ) ,orasa2-form,onevalue pertriangle t j 2 T , s j = R t j s j .Inparticular,thedivergenceofavector˝eldcanberepresentedby a0-form,whileitscurlcanberepresentedbya2-form. Assumethat U representsthevector˝eld, S thedivergence˝eld, C thecurl˝eld, U Z the constraintsonselectededges,where Z isthematrixprojectinganarrayrepresentinga1-formonto anarrayassembledbyonevalueperuser-selectededge.Thedesiredvector˝eldcanbecomputed bytheweightedleastsquaressolutionofthefollowingequations, U = S;dU = C;ZU = U Z ; leadingto ( ( + d )+ Z T WZ ) U = dS + C + Z T WU Z ; where d the di˙erential , the co-di˙erential and the Hodgestar operatorinDEC.Hereweomit thesubscriptswhentheycanbedeterminedfromthecontext.Also W speci˝estheweightingof thedirectconstraints.Asidefromtheterminducedby Z ,theresultingsymmetriclinearsystemis simplythevector˝eldPoissonequation,wheretheLaplace-Beltramioperator + d isequivalent, uptoasign,towhatcanbeobtainedfromthevectorcalculusidentity r 2 = rrr : 3.3.2Naturalboundaryconditions In[17],thefreeboundarycondition,forthecasewhenthevector˝eldisnotrestrictedtobeatacer- tainanglewiththeboundary,isimplementedbyaddingatermtoproperlyincludetheintegralofdi- 30 vergenceforthepartialVoronoicellsattheboundary.However,thisstillleavesahigh-dimensional kernelfortheresultinglinearoperator.Numericallytheoperatorislikelytobepositivede˝nite duetothediscretization,butitleadstospurioussingularities,unlesssu˚cientdirectconstraints areincludedorwhenthemuchdenserbi-Laplacianisincluded. Ourremedytotheaboveproblemisbasedontheobservationthatthefreeboundarycondi- tionshouldbeobtainedthroughminimizingtheDirichletenergy R M jr u j 2 .Choosingalocal orthonormalframe f e 1 ; e 2 g ateachpoint,wedenotethepartialderivativesofthecomponentsof u by u = @u @x .Assumingtrivialconnection,weignorethecurvature-relatedterm(seethe Weitzenböckformulain,e.g.,[74]),andfocusonthein˛uenceoftheboundary Z M jr u j 2 = Z M u 2 1 ; 1 + u 2 1 ; 2 + u 2 2 ; 1 + u 2 2 ; 2 = Z M ( u 1 ; 1 + u 2 ; 2 ) 2 +( u 2 ; 1 u 1 ; 2 ) 2 2( u 1 ; 1 u 2 ; 2 u 1 ; 2 u 2 ; 1 ) = Z M ( r u ) 2 +( r u ) 2 Z @M u 1 du 2 u 2 du 1 (3.1) TheboundaryterminthelastrowisaresultofStokes'theorem.Instandardcalculus,wemay rewritethetermas Z @M ( u d u ) n ; where n isthesurfacenormal. Figure3.1 Twoconsecutiveedgesalongtheboundary. Inthediscretesetting,weexpresstheDirichletenergyas U T LU; where U isthediscrete1-form representationof u ,and L istheLaplacian-likematrixtobeconstructed.Weinitialize L tothesum 31 ofthedivergenceandcurlterms,andthenaddtheboundaryterm.Todiscretizetheboundaryterm, we˝rstturntheboundaryintegralintoasummationoverboundaryedges X e i 2 @M ( u i ( u i +1 u i )) n i = X e i 2 @M ( u i u i +1 ) n i ; whereweassumethat e i +1 istheedgefollowing e i alongtheboundary,and n i isthesurfacenormal attheirsharedvertex. Assumingthediscretecurlforboundarytrianglestobeclosetozeroasin[17],wehavea constantvectorwithineachtriangle,whichallowsustosimplychooseanypoint(inparticular,the barycenter)ofthetrianglefortheevaluationof u i .Adiscrete1-formisonevalueperedge,so U =( c 1 ;c 2 ;:::;c n ) ; where n isnumberofedges.Forthepairofboundarytrianglesshownin Figure3.1,wehave u i = c i ˚ i + c j ˚ j + c k ˚ k ; u i +1 = c i +1 ˚ i +1 + c l ˚ l + c m ˚ m ; where ˚ i = 1 3 ( r ˚ v 2 r ˚ v 1 ) isthebasisfunctionforedge i pointingfrom v 1 to v 2 evaluatedat thebarycenterofthecorrespondingtriangle,and ˚ v isthelinearbasisfunctionforvertex v .The updateto L involves18termsin9pairs,e.g. L jl +=( ˚ j ˚ l ) n i ;L lj +=( ˚ j ˚ l ) n i : Onacurvedpatch,wemayobtainthesurfacenormalatthevertexfromanyreasonableweighted averaging. AsshowninFigure3.2,anyharmonicvector˝eldcanbeaddedtoa˝eldwithoutchanging thetargetfunctionin[17],leadingtospurioussingularities,whileinourcase,theDirichletenergy minimizationproducestheexpectedresults. 32 Figure3.2 Comparisonofresults. Userinput:asinglesource(top);asinglevortex(bottom). Fisheretal.'sdesignmethodproducedmultiplespurioussingularities(left);ourmethodproduced theminimizeroftheDirichletenergy(right). 3.4OrientationFieldDesign Representationofthedirection˝eld Wefollowthepracticein[23],andrepresentthedirection ˝eldbytheangle denotingthedeviationfromthex-axisofalocalcoordinateframe.Wecan constructtheframe˝eldbyspecifyingthex-axisthroughthesolutionoftheabovenaturalboundary conditionvector˝elddesignobtainedby˝xingasinglevector,inthecaseoftrivialtopology. Otherwise,itcanbecomputedby˝rstspecifyingsomesingularitiesconsistentwiththePoincaré- Hopfindextheorem,andusetrivialconnection[26]ordiscreteRicci˛ow[25]toconstructthe frame˝eld. Theorientation˝eldcanthenberepresentedbyasmoothvector˝eldwiththeangle 2 ,since 2( + ˇ ) leadstothesameangle.Usingacomplexnumbertorepresentthevectorinthelocalframe, wecanusethesquareandsquarerootoperationsforcomplexnumberstoconverttheorientation ˝eldandvector˝eldfromeachother. Themajorfeaturesinanorientation˝eldaredeterminedbythesingularities.Twobasicsingu- larities,wedgeandtrisector(Figure3.3)withindex- 1 2 andindex- 1 2 ,respectively,canbeusedto producesingularitiesofarbitraryindicesintheorientation˝eld. 33 Figure3.3 Basicsingularitiesfororientation˝elds:wedge(left)andtrisector(right). Our systemalsoprovidescontrolovertheorientations.Top:original;Bottom:45 rotated. Wepresentasimplemethodofspecifyingnotonlythesingularitytypesandlocations,but alsotheirorientations.Wedgescorrespondtosources/sinksandvortices,forexample,asource correspondtowedgewithahorizontal˛owlineconnectedtothesingularity.Asdescribedin[13], wecanseethatthelocal˝eldinasmallneighborhoodaroundasourcevertex v havetheformof e ,where istheanglebetweenthedisplacementfrom v tothepointintheneighborhoodandthe localx-axisdirection.Thus,thecorrespondingorientation˝eldisoftheform e = 2 ,theexpected wedge.Foravortex,thevector˝eldisoftheform e i ( + ˇ= 2) .Combiningthetwowithweights cos2 and sin2 ,wehavetheorientation˝eldoftheform e i ( = 2+ ) ,i.e.arotatedwedge.The trisectorscorrespondtosaddlepoints,whichcanbeconstructedbycontrollingtheone-ringofa vertex v tohaveavectorof e i ( +2 ) ineachincidenttriangle.Seethe45 rotatedwedgeand trisectorinthebottomrowofFigure3.3. Withapropercombinationofsingularitiesofpositiveandnegativeindices,therewouldrarelybe anyuncontrolledsingularitieswithourproperboundarycondition.Thisbehaviorcanbeunderstood byfollowingthesameargumentasin[26,25]:additionalvector˝eldconstraintscanbeseenas justsmoothdeviationfromaninitialorientation˝eldsatisfyingthesingularityconstraints. 34 Figure3.4 Oneofthethreepredictedtexturelocationsfortheupper-rightcornerinthefour- cornerneighborhood. 3.5TextureSynthesisfor2-RoSyField Traditionalcontrollabletexturesynthesisoftenusesadesignedsmoothvector˝eldasuserinput. Thisisnotthesameasusinganorientation˝eld,sincethe˝eldofrepresentativevectorschosen fromoneofthetwodirectionisinevitablydiscontinuousinthepresenceofatleastonewedge ortrisector.Thusasweadaptthestrategyfrom[85,2],andperformthecoarse-to-˝netexture synthesis,wemustintroduceanwnmappingstyletoenforcethecontinuousappearance. Werestrictourdiscussiontotheplanarcase,asthecurvedpatchcaseistreatedbycombiningthe Jacobianoftheparameterizationasin[2] 3.5.1Anisotropictexturesynthesis We˝rstbrie˛ysummarizetheappearancespacesynthesisin[2]beforediscussingthemodi˝ca- tions.Inthepreparationstage,aPrincipalComponentAnalysis(PCA)isperformedonthesetof all 5 5 -neighborhoodsintheexemplarGaussianstackateachlevel,tocreatea8Dappearance vectorspace,turningtheexemplarintoa2Darrayofappearancevectors ~ E .Theparallelsynthesis thenrepeatsthreemainsteps,namely upsampling , jittering ,and correction ,untilthe˝nestlevel textureisgenerated. Theappearancevectorateachoutputpixelisrepresentedthroughamappingtoapointinthe exemplar ~ E .Denotingthetextureexemplarcoordinatesforapixel p intheoutputpyramidatlevel L by S L [ p ] ,theupsamplingpassforthelevel- L +1 pixelscorrespondingtolevel- L pixel p israther 35 straightforward,whenthereisaguidance˝eld: S L +1 [2 p + ~ 4 ]= S L ( p )+ J ( p ) 1 2 4 ; where 42f 0 B @ 1 1 1 C A ; 0 B @ 1 1 1 C A ; 0 B @ 1 1 1 C A ; 0 B @ 1 1 1 C A g ; ~ 4 = 1 2 ( 4 + 0 B @ 1 1 1 C A ) ; and J ( p ) istheJacobianmatrixforlocal S tofollowtheguidance˝eld,whichisessentiallya rotationmatrixaligningx-axistothegivenguidancedirectioncombinedwithapossiblescaling. Inthecorrectionstep,afour-cornerneighborhood N S ( p ; 4 ) issu˚cientduetotheuseofap- pearancevectors.Forbetterconvergenceintheparallelsynthesis,[2]suggestedtoaveragethe appearancevectorforeachcorner 4 fromthecornervaluespredictedfromthreeo˙setlocations ( 4 ;M )=^ ' ( 4 )+^ ' ( M 4 ) ;M 2M ,where M = f 0 B @ 00 00 1 C A ; 0 B @ 10 00 1 C A ; 0 B @ 00 01 1 C A g ; and ^ ' ( 4 )= j ' ( 4 ) = k ' ( 4 ) k +1 = 2 j isthenormalizedversionofwarpedo˙set ' ( 4 )= J 1 ( p ) 4 . Asthepredictedtexturelocationis P ( p; )= S [ p + ] J ( p ) ; showninFigure3.4,the˝nal formulais N S ( p ; 4 )= 1 3 X M 2M ~ E [ P ( p; ( 4 ;M ))+ 4 ] : Theneighborhoodisthencomparedwiththeprecomputedneighborhoodsintheexemplar.For fastcomparisononGPU,theneighborhoodcanbefurthercompressedthroughanotherPCA. Fore˚ciency,thesearchofbest-matchingexemplarpixelislimitedtothe k -coherentset C ( p )= f C ( p; 4 ;i ) j i =1 :::k; k4k < 2 g ; wherethecandidatesarepredictedfromnearbypoints p + 4 withtheprecomputed k -coherent o˙set C 0 i , C ( p; 4 ;i )= S [ p + 4 ]+ C 0 i ( S [ p + 4 ]) J ( p ) 4 : Wefollowtheirpracticeofchoosing k =2 . 36 &% '$ Figure3.5 Comparisonoftheresultsfromtheparallelanisometrictexturesynthesismethod without(left)andwith(right)ourmodi˝cations. Therepresentativevector˝eldhasdiscontinu- itywithintheredcircle. 3.5.2Handlingorientation Whentheanisotropicparallelsynthesisisappliedtoorientation˝elds,therearevisibleartifacts whentherepresentativevectorsarechangingtotheoppositedirections(Figure3.5).Increasingthe amountofjitteringorrearrangingthetextureexemplarinamoresymmetricwaywouldnotsolve theproblem.Cuttingtheoutputintochartsaccordingthe˝eldanduseindirectionmapwouldnot belesscostlyandlesse˙ectivethanoursolution. Ourmodi˝cationisbasedontheobservationthatthediscontinuityinthetextureismainlydue totheincorrectlypredictedtexturecoordinates P ( p; ) asshowninFigure3.6,whicha˙ectsboth theneighborhoodconstructionandthecandidatesets.Thisissuecanbe˝xedbymodifyingthe predictionto ^ P ( p; )= S [ p + ] J ( p + ) : Thefour-cornerneighborhoodisalsomodi˝edto ^ N S ( p ; 4 )= 1 3 X M 2M ~ E [ ^ P ( p; ( 4 ;M ))+( 1) c ( p + ;p ) 4 ] ; wheretheconsistency c ( p + ;p ) isde˝nedas u ( p + ) u ( p ) < 0 ,abinaryindicatorofthepresence ofa180 rotation. Ifweareusingcolorpixels,thiswouldhavesu˚ced.Howevertheappearancevectorsrepresent 5 5 -neighborhoods.Sotheywouldbecontainingthewrongappearanceifweusetheappearance vectoratthe˛ippedpredictedlocationdirectly.Tohandletheissuewithoutlosingmuche˚ciency, 37 Figure3.6 Reasonforthedisconituityofthesynthesizedimage. Followingthedasheddirection wouldhaveproducedawrongprediction,while ~ P properlytakesintoaccountthemutualorienta- tion. webuildthe8Dappearancespacefromthesetcontainingboththe 5 5 -neighborhoodsandtheir rotatedimages.Thenwestoretwoappearanceimagesfortheexemplar,onefortheoriginal ~ E 0 , theotherfortherotated ~ E 1 .Westoreonebooleanvariable I ( p ) foreachoutputpoint,indicating whethertherotatedappearanceisused. Puttingthesetogether,wehavethe˝nalformulafortheneighborhoodconstruction ~ N s ( p ; 4 )= 1 3 X M 2M ~ E ( ) [ ~ P ( p; ( 4 ;M ))+( 1) ( ) 4 ] ; (3.2) where ( p; )= I ( p + )+ c ( p + ;p ) combinesthee˙ectsoftheconsistencyandthecurrentindicator,and ~ P ( p; )= S [ p + ] ( 1) ( ) J ( p ) isthemodi˝edprediction. Amodi˝cationisalsoinplaceforthe k -coherentcandidates C ( p; 4 ;i )= S [ p + 4 ]+ C 0 i ( S [ p + 4 ]) ( 1) ( p; 4 ) J ( p ) 4 Whencomparingtheneighborhoodinformationconstructedwiththecandidates, ~ E ( p; 4 ) ( C ( p; 4 ;i )) shouldbeusedtoaccountforthepossiblerelativerotations. Whenthebestmatchisfoundatthecandidatepredictedbyo˙set 4 ,theindicator I isupdated aswellas S , I ( p )= ( p; 4 ) : 38 Finally,theupsamplingstepisalsoadaptedto S L +1 [2 p + ~ 4 ]= S L ( p )+( 1) I ( p ) J ( p ) 1 2 4 ; and I L +1 [2 p + ~ 4 ]= I L ( p )+ c L;L +1 ( p; 2 p + ~ 4 ) ; where c L;L +1 ( p;q ) isde˝nedtobe u L ( p ) u L +1 ( q ) < 0 ,abinaryvaluedfunctionforcheckingthe consistencyoftheorientation˝eldbetweendi˙erentscales,asthecoarseand˝nelevelsoftheout- putimagemaychoosedi˙erentrepresentativeswhendownsamplingfromtheoriginalorientation ˝elds. 3.6Results ThetestsofouralgorithmonexampleswereperformedonaregularlaptopwithIntelCore2Dual with4GBmemory.Inallofourtests,themethodtooknomorethanafractionofasecond,al- lowingforinteractivemanipulationofthesingularityanddirectionconstraints,eventhoughour implementationisnotoptimized.Intheory,wecanreachthesamee˚ciencyof[17]and[2]inthe respectivestages,asonlynegligibleoverheadisincurredbythemodi˝cationstothe1-form-based tangentdesignmethodandparallelcontroltexturesynthesis. InFigure3.7,weshowthatoursystemcaneasilycreate˝ngerprint-likeimagesimitatingthe ˝vemaincategoriesofsingularitylayoutsinhuman˝ngerprints.Weshowthemethodappliedto moreexemplarsforplanarregionswithorientation˝eldsinFigure3.8.Weusethesameprocedure in[2]forgeneratingthetextureintexturedomainwhiletakingintoaccounttheJacobianofthe parameterization,andsomeresultsareshowninFigure3.9. Limitations Thereisnostrictguaranteethatadditionalsaddlepointswouldnotemergeinour vector˝elddesign,if,e.g.,weplacetwosourcesclosetoeachother.Howeverthesamecould happenformethodssuchas[26,25]:ifonespeci˝essomevectordirectionconstraintsasinour 39 Arch Leftloop Rightloop Whorl Tentedarch Figure3.7 Examplesforthe˝vemajorcategoriesof˝ngerprintsgeneratedbyourtexture synthesis. saddlepointplacement,extrasingularitieswouldhavetobegeneratedinadditiontothoseused inconstructingthealmosteverywhere˛atmetricsorconnections.Ontheotherhand,inpractice, withapropermixtureofpositiveandnegativesingularities,whichdoesnotproduceexcessively largeindicesinlocalregions,itwouldtakesomestrongvectordirectionconstraintstoproduce additionalsingularitieswithanymethodwithproperfreeboundarycondition.Anotherissueisthat ourtexturesynthesisdoesnotprovidedirectcontroloverthebifurcationandendingofthefeatures containedtheexemplar(See,e.g.Figures3.7and3.8),butthisiscommontomanyanisometric texturesynthesismethods. 3.7Conclusion Wepresentedasimpleframeworkbasedontangentvector˝elddesign.Weeliminatedthespurious singularitiesproducedbythefreeboundaryconditionthroughincludingthemissingboundaryterm. Givenalocalframe˝eldwithtrivialconnection,wecovertthevector˝eldintoanorientation˝eld bytakingthesquarerootofthecomplexrepresentationofthevectorinthelocalframe,whichhalves theangletothex-axis.Wealsoprovidecontrolovertheorientationsofthewedgeandtrisector singularities.Thedesignedorientation˝eldcanthenbeusedinaparalleltexturesynthesis,adapted fororientation˝elds.Suchtexturesynthesisallowson-the-˛ysynthesisandisGPU-friendly,due toitsorder-independence. 40 Figure3.8 Resultswithvarioustexturesonplanarregions. 41 Figure3.9 Resultsfororientation˝eldsoncurvedpatches. 42 CHAPTER4 DISCRETECONNECTIONANDCOVARIANTDERIVATIVEFORVECTORFIELD ANALYSISANDDESIGN 4.1Introduction Covariantdi˙erentiationde˝nesanotionofderivativealongtangentvector˝eldsofacurvedman- ifold.EstablishedbyRicciandLevi-Civita,thecovariantderivativealsorelatestotheconcept ofconnection(andthus,paralleltransport)ofvector˝eldswidelyusedinphysics,particularlyin gaugetheoryandrelativity.Itisalsothebasictooltoformallymeasurehowavector˝eldchanges overacurvedsurface,asneededinawidevarietyofgeometryprocessingapplicationsranging fromtexturesynthesistoshapeanalysis. Unfortunately,anappropriatediscretecounterpartofsuchadi˙erentialoperatoractingonsim- plicialmanifoldsremainselusive.Inthischapter,weo˙erafulldiscretetreatmentofconnection throughWhitneybasisfunctionsthatleadstoanalyticalexpressionsofthecovariantderivativefor ˝nite-dimensional,vertex-basedtangentvector˝eldsonsimplicialmanifolds.Wedemonstratethe relevanceandnoveltyofourcontributionstovectorand n -direction˝eldediting,asito˙erscontrol inposition and orientationofbothpositiveandnegativesingularities. 4.1.1Relatedwork Whilemanygraphicsapplications(spanningtexturesynthesisand˛uidanimation)requirevector ˝eldsontrianglemeshes,weonlyreviewthekeycomputationalingredientsthathavebeenformu- latedtodealwiththeanalysisanddesignofvectorand n -direction˝eldsovertriangulatedsurfaces. 43 4.1.1.1Vector˝elds Computationaltoolsforvector˝eldsondiscretesurfacesarerequiredwhethertheuserisgivena tangentvector˝eldtoanalyzeor(s)heneedstodesignavector˝eldfromasparsesetofdesiredcon- straints.Forinstance,discretenotionsofdivergenceandcurl(vorticity)wereformulated[15,14]; topologicalanalysisalsoattractedinterest,inwhichpositionsofvector˝eldsingularitiesareiden- ti˝ed,merged,split,ormoved[89,13];quadraticenergiesmeasuringvector˝eldsmoothnesswere alsointroducedsincetheirminimizers(possiblywithaddeduserconstraints)limittheappearance ofsingularities[17]. 4.1.1.2Fromvector˝eldsto n -direction˝elds Themoregeneralcaseof n -direction˝elds(calledunit n rotationalsymmetry(RoSy)˝eldsin[24]) suchasdirection˝elds( n =1 )orcross˝elds( n =4 )werenumericallyhandledthroughenergymin- imizationaswell,buttheenergiesthatwereinitiallyproposedforthiscasewerehighlynon-linear orinvolvedintegervariables[90,24,27,91,92,93].Aquadraticenergywasrecentlyintroduced in[1]throughadiscretizedversionoftheDirichletenergy,extendingthequadraticenergyof[17] whichonlyaccountedforthesquaredsumofthedivergenceandofthecurlofvector˝eldsoverthe surface.Theextracurvatureandboundarytermsinvolvedinthisnewapproachwerealsoshownto o˙eradditionalusercontrol. 4.1.2Outlineandnotations Thecontinuousde˝nitionsandrelevantpropertiesofconnections,covariantderivatives,andasso- ciatedenergiesarealreadydiscussedinChapter2.Weproposeadiscretede˝nitionofconnection onasimplicialcomplexinSec.4.2,beforediscussinginSec.4.3howtocomputeagloballyoptimal discreteconnectioninthesensethatitisclosesttotheLevi-Civitaconnectionofthesurface.We thenprovideinSec.4.4closed-formexpressionsforbasisfunctionsofvector˝eldsandcovariant derivativesbasedonourdiscreteconnections,beforeexplaininginSec.4.5howthesenumerical 44 toolscanbeleveragedtoimprove( n -)vectorand n -direction˝eldeditingontrianglemeshes.We concludewithvisualresultsofvector˝eldeditingandnumericalcomparisonsofourvariousop- eratorsinSec.4.6. Throughoutourexposition,wedenoteby T atriangulated 2 -manifoldofarbitrarytopology, withasetofvertices V = f v i g i ,edges E = f e ij g i;j andtriangles T = f t ijk g i;j;k .Eachvertex v i isassignedaposition p i in R 3 .Eachedgefurthercarriesanarbitrarybut˝xedorientation,while verticesandtrianglesalwayshavecounterclockwiseorientationbyconvention.Indexorderindi- catesdirection,inthesensethatedge e ij isdirectedfromvertex v i to v j .Wealsoexploitthe containmentrelationofasimplicialcomplexbyde˝ning ˙ tobea face of ,and a coface of ˙ , i˙ ˙ ˆ with ˙; 2T .Wedenotetheangleinatriangle t ijk between jk and ji by ijk > 0 : TheGaussiancurvatureof T atavertex v i isthusexpressedas i =2 ˇ P t ijk kij .Finally,we denoteby ' i , ' ij ,and ' ijk theWhitneybasesof 0 -formsonvertices v i , 1 -formsonedges e ij ,and 2 -formsontriangles t ijk respectively; ' i isthepiecewiselinearfunctionwith ' i ( v j )= ij (where istheKroneckersymbol),whiletheotherformbasesarede˝nedas: ' ij = ' i d' j ' j d' i and ' ijk =2 d' i ^ d' j [18]. 4.2ConnectionsonSimplicialManifolds Wenowmovetothediscretesettinganddescribetheconstructionofadiscreteconnectionon simplicialmanifolds. 4.2.1Rationale Oftheseeminginadequacyoftrianglemeshes Thecontinuousnotionofconnectiondoesnot quiteapplyasisonanon-smoothmanifold.Inparticular,atriangulated 2 -manifold T hasapiece- wiselinearembeddingin3DEuclideanspacewithpiecewiseconstantnormals,concentratingGaus- siancurvaturesolelyatverticesandmakinglocaltangentspacesonlyunequivocallywell-de˝ned intheinterioroftriangles.Asaconsequence,avector˝eld'scovariantderivativeinducedbythe 45 Levi-Civitaconnectionofatrianglemeshmaynotbe pointwise ˝nite.However,sinceapairof trianglescanbeisometrically˛attened,thereisaclearwaytoparalleltransportavectorwithin apairofadjacenttrianglesusingtheLevi-CivitaconnectioninducedbytheEuclideanmetric.A purelydiscretenotionofarbitraryconnectionswasderivedfromthisideain[26],usingdiscrete dualconnection 1 -formsthatstoreadjustmentrotationsalongdualedges,representingan integral formofconnection.Unfortunately,dualdiscrete 1 -formshavenosimpleinterpolationbasisfunc- tionsotherthanpiecewiseconstantpertriangletode˝neaproperconnection 1 -formeverywhereon thepreventingtheevaluationofthe L 2 -basedenergyintegralsdescribedinSec.2.2.5. OftheimportanceoftheLevi-Civitaconnection Yet,theconventionalnotionsofdivergence orcurlofvector˝eldsonsmoothsurfaces derive fromtheLevi-Civitaconnectioninducedbythe embeddingin R 3 (seeEq.2.3).Wearethereforecaughtinadilemma:eitherwegiveuponusing piecewiselinearsurfacesandgoforhigherordersurfacedescriptionsforwhichsmoothnessis nolongeranissue,orwemodify,aslittleaspossible,thenotionofLevi-Civitaconnectionon thetrianglemesh(bytheGaussiancurvaturearoundvertices)sothatonecancreate smoothvector˝eldsthathavecontinuouscovariantderivatives.Weoptforthesecondoptionin thischaptertoretainthesimplicityoftrianglemeshes,whileo˙eringa˝nite-dimensionalspace ofsmoothvector˝eldsforwhichthepointwisederivativesde˝nedinSec.2.2.4andtheenergies de˝nedinSection2.2.5arewellinourcase,knowninclosedform.Notethatthe piecewiselinearnatureofsimplicialcomplexesimpliesthattherepresentationofaconnection acrosssimplices(equippedwiththeirownlocalbasisframe)mustbediscontinuousinorderfor paralleltransporttoproducecontinuoustangentvector˝elds:wewillthereforeformulateageneric notionofsimplicialconnectionwith˝niterotationsbetweenadjacentsimplices,butacontinuous closed-formexpressionwithinsimplices. Previousattempts Vertex-basedinterpolationofvector˝eldshasrecentlybeenshownuseful toeitherde˝nelocaldiscrete˝rst-orderderivatives[13],orevaluateglobal L 2 normofderiva- 46 Figure4.1 Simplicialconnection. (left)Eachvertex v i isgivenanimpulserotationangle ˆ v i ! e ij to edge e ij and ˆ v i ! t ijk totriangle t ijk .(right)Acontinuousconnectionwithinsimplicesisencoded throughedgerotation ij andhalf-edgerotation ˝ ij;k interpolatedviaWhitneybasisfunctions. tivessofarneverboth.Additionally,vector˝eldinterpolationisusuallymadewith speci˝cally-designedbasisfunctions,buttheconnectionimplicitlyde˝nedbythesebasisfunctions isnotknownanalytically.Therefore,noanalysisoftheresultingconnection(inparticular,com- paredtothecanonicalLevi-CivitaconnectionofthemetricinducedbytheEuclideanembedding ofthemesh)hasbeenproposedforthisvertex-basedvector˝eldsetup.Yet,thechoiceofconnec- tionsigni˝cantlyimpactstheaccuracyofdi˙erentialoperatorsandenergiesusedubiquitouslyin geometryprocessingsinceita˙ectstheevaluationofthecomponentsofthecovariantderivative. Approach Wecontributeade˝nitionofdiscreteconnection 1 -formsinwhichwefullyexploit thesimplicialstructureofmeshes.Byde˝ningalocalframeforeachsimplexofaninputmesh,we encodetheconnectionthrough˝niterotationanglesbetweenincidentsimplicesandviapiecewise linearWhitney 1 -formswithinsimplices.Ourconstructionanditsclosed-formexpressionswill allowustoevaluatebothlocalintegrationsand L 2 normsofderivatives,providingadiscretenotion ofcovariantderivativeforvertex-basedvector˝eldsovertrianglemeshes. 47 4.2.2Discreteconnection 1 -form WhilethecontinuousinterpretationofparalleltransportdescribedinEq.2.4appliesdirectlyin regionsofthesimplicialcomplex T thatarelocally˛at(suchasalonganedgeorwithinatriangle), aspecialtreatmentisneededforpathscrossinganedgeorgoingthroughavertexwheretangent spacediscontinuitieshappen.Wenowformulateagenericnotionofdiscreteconnection 1 -form onmanifoldtrianglemeshesthroughcontinuousWhitney 1 -formswithinsimplicesandimpulse (integrated)rotationanglesbetweenincidentsimplices. Simplicialframes We˝rstarbitrarilychooseaframeforeachvertex,orientededge,andtriangle of T .Selectingaunittangentdirection e ˙ perorientedsimplex ˙ 2T su˚ces,asaframecan beassembledbypickingthisreferencedirectionandits ˇ= 2 -rotateddirection e ? ˙ .Thisdirection canbeseenasindicatingthe x -directionofalocalparameterizationaroundthesimplex.Foran orientededge,astraightforwardchoiceisalongitself;asimplechoiceofframesforeachvertex v i isthedirectionofoneoftheorientededgesemanatingfromit;andforeachtriangleitcanbeoneof its(counterclockwiseoriented)edges.Thechoiceofframescanbearbitraryasitwillnotin˛uence theresultsinanyway;however,˝xingsimplicialframesisanecessarysteptobothrepresentand numericallymanipulateconnections(justlikeinthecontinuouscase):anassignmentofframes ( e ˙ ; e ? ˙ ) onallsimplices ˙ formallyde˝nesasectionoftheframebundleforeachone-ring,over whichanytangentvectorisexpressedbyitscoordinates(2scalarvalues)inthisframe overwhichtheconnection 1 -form ! lives.Notethattheseframesarepurelyintrinsictothesurface asin[13,1],anddo not de˝netangentplanesintheembeddingspace. Whitney-basedconnectionswithinsimplices Wecanstillusethecontinuousnotionofparallel transportwithineachsimplex:smoothpathsarewellde˝nedintheinteriorofbothedgesandtri- angles.Aparticularlyconvenient˝nite-dimensionalrepresentationofaconnection 1 -formwithin asimplexistousediscrete 1 -formsstoredasorientededgevaluesinterpolatedviaWhitney(piece- wiselinear)basisfunctions[18].Wethusrepresentacontinuousconnectionper(oriented)edge e ij 48 byprovidingthe(signed)rotationangles ij experiencedwhiletravelingalong e ij .Similarly,acon- tinuousconnectionover(oriented)trianglesisde˝nedbyprovidingthe(signed)rotationangles ˝ ij;k accumulatedwhiletravelinginsideeachtriangle t ijk alongitshalf-edge e ij (seeFig.4.1(right)). Notethat ˝ ji;k = ˝ ij;k sinceitdenotestherotationinducedalongthesamehalf-edgebutgoing from v j to v i insteadof v i to v j .However, ˝ ij;l denotestherotationanglesinducedalongitsopposite half-edge,i.e.,expressedintriangle t ilj ,and,ofcourse, ˝ ji;l = ˝ ij;l . Consequently,given 3 j F j values f ˝ ij;l g and j E j values f ij g ,wecanreconstructthetriangle- restrictedcontinuousconnection 1 -form ˝ withineachtriangle t ijk expressedas: ˝ = ˝ ij;k ' ij + ˝ jk;i ' jk + ˝ ki;j ' ki ; where ' ij istheWhitney 1 -formbasisfor e ij (seeSec.4.1.2);andtheedge-restrictedcontinuous connection 1 -form expressedas: = ij d' j ; where ' i isthepiecewise-linearWhitneybasisfunctionforvertex v i ,and d' j istherestrictionof ' ij totheedge e ij .Nowparalleltransportalonganypath C ( t ) withinatriangleengendersadiscrete rotationangle R C ( t ) ˝ ,whileparalleltransportalonganypath C ( t ) withinanedgeengendersa discreterotationangle R C ( t ) . Impulseconnectionsbetweenincidentsimplices Anin˝nitesimalparalleltransportofavector from asimplex to oneofitscofacesresultsinasuddenchangeofa˝niterotation ofthevectorcoordinateseveniftheconnectionissupposedtobe˛at.Forinstance,in˝nitesimally movingfromavertex v i tooneofitsemanatingedges e ij requiresa˝nitechangeofcoordinates fromframe e v i toframe e e ij .Thesameistrueforamotionfrom v i toacofacetriangle t ijk , andfromapointonanedge e ij tothesamepointconsideredaspartofacofacetriangle t ijk (see Fig.4.1(left)).Wethusproposetoencodeourdiscreteconnectionbetweeneachvertexandits cofacesusingrotationangles:theyrepresenttheintegralof impulse (Dirac)connection 1 -forms, sincetheyintegratetoa˝niterotationangleoverazero-lengthpath.Forthisreason,wereferto themasrotations 49 Wedenoteby ˆ v i ! e ij thevertex-to-edgeimpulserotationanglesuchthat exp( Jˆ v i ! e ij ) appliedtothecomponentsofavectorat v i expressedinframe e v i givestheexpressionofthe parallel-transportedvector,stillat v i butconsideredaspartof e ij ,hencewritteninframe e e ij . Similarly,theimpulseparalleltransportfromavertex v i tothecornerofanincidenttriangle t ijk isdenotedbytherotationangle ˆ v i ! t ijk ,andtheimpulserotationfromapoint p on e ij tothe samepointconsideredaspartof t ijk isdenotedas ˆ e ij ! t ijk ( p ) .Onehas ˆ v i ! ˙ = ˆ ˙ ! v i by de˝nition.Wealsoimposethat ˆ v i ! e ji =( ˆ v i ! e ij ˇ )+2 ˇn ij ; where n ij iseither 0 or 1 ,denotingapossiblefullrotationnecessarytoalignthetwooppositeedge- basedframes.Notethatasinglenon-zero n ij pervertex v i isneeded:essentially,this 2 ˇ o˙setis neededtoformalocallyconsistentframe˝eldin v i 'sone-ring;notealsothatthese n ij coe˚cients willhavenoe˙ectontheconnectioncurvatures:theyarepurelyforanglepurposes. Wewilldescribeasystematicwaytosettheimpulserotationsand 2 ˇ o˙setsforagivenconnection inSec4.3. NotethattheconnectioninducedbytheEuclideanembeddingofameshisencodedbyanedge- to-trianglerotation ˆ e ij ! t ijk ( p ) equaltoaconstantangle ˆ e ij ! t ijk ( p )= \ ( e e ij ; e t ijk ) 8 p 2 e ij ; where \ ismeasuredintheEuclideanmetric:inthislocally˛atmetric,avectoronlyundergoes achangeofframebetweentheedgeanditsincidenttriangleinthelocalhingemapoftheedge. Ourdiscretenotionofconnection,involvingmoreimpulserotations,isthusageneralizationof thecontinuousnotion.Whiletheimpulserotationsdependonthechoiceofsimplexframes,they aregeometric(intrinsic)entitiesthatde˝neparalleltransportfromverticestonearbysimplices.A changeofsimplexframeswouldthereforerequiredi˙erentimpulserotationstoencodethesame notionofparalleltransportlikeachangeofaframe˝eld(asectionoftheframebundle)in thecontinuouscasewouldgenerateadi˙erent 1 -formconnection. Curvatureofdiscreteconnection Adiscreteconnectionwitharbitraryassignmentofimpulse rotationsandWhitney-basededgerotationshasnon-zerocurvaturealmosteverywhere.Inparticu- 50 lar,apatharoundtheperimeterofatriangle t ijk createsarotationangle K ijk = ˝ ij;k + ˝ jk;i + ˝ ki;j : Theconnectionalsohascurvaturearoundhalf-edges:aclosedpathfromapoint p ,alongedge e ij , toanotherpoint q ontheedge,crossingtoface t ijk ,followingtheborderedgealong q ! p ,then backto p (Fig.4.2(left))accumulatesarotationangle K ij;k ( p ; q )= ˆ e ij ! t ijk ( p )+ ij [ ' j ( q ) ' j ( p )]+ ˆ e ij ! t ijk ( q )+ ˝ ij;k [ ' j ( p ) ' j ( q )] wheretheindexafterthecommaindicatesthehalf-edgearoundwhichtheclosedpathisconsidered. Wewilldenoteby K ij;k thetotalcurvatureengenderedbyapatharoundthewholehalf-edge(i.e., startingat v i ,goingthrough v j ,andcomingback),thatis: K ij;k = ˆ v i ! e ij + ij ˆ v j ! e ij + ˆ v j ! t ijk + ˝ ji;k ˆ v i ! t ijk Thecurvatureofadiscreteconnection,unlikethecurvatureofthetrianglemeshwhichwascon- centratedpurelyatvertices,isnowaround,withtrianglecurvatures K ijk andhalf-edge curvatures K ij;k .Thiswillactuallyrenderthenotionofcovariantderivative˝niteaswediscussin Sec.4.4.1. 4.2.3Reducedparametersfordiscreteconnections Whilethefulldescriptionofadiscreteconnection 1 -formrequiresalargeamountofimpulsero- tationsandedgerotations,weproposetofocusondiscreteconnectionswith ˝nitecurvature only. Thatis,wereducethepermissiblesetofconnectionsbyenforcingthattheircurvaturesoverloops withzeroareasareidenticallyzero,i.e., K ij;k =0 .Thisparticularchoiceismadetoenforcepoint- wise˝nitevaluesofthecovariantderivative,andthus,a˝nite L 2 norm.Wecannowparameterize thesetofallsuchdiscreteconnection 1 -formsthroughvertex-basedvaluesonly,indicatingthe 3 j F j +3 j E j rotationanglesfromeachvertextoincidentsimplices(seeFig.4.2(right)): 3 j F j vertex-to-triangleimpulserotations ˆ v i ! t ijk ; 51 Figure4.2 CurvatureandParameters. Left:Curvatureisaccumulatedalongaclosedpatharound theinteriorofatriangle( K ijk )oraclosedpatharoundasectionofahalf-edge( K ij;k ( p ; q ) ).Right: Adiscreteconnection ˆ with˝nitecurvature( K ij;k =0 )isencodedthroughonlyvertex-triangle, vertex-to-edge,andvertex-to-vertexrotationangles. 2 j E j vertex-to-edgeimpulserotations ˆ v i ! e ij ; and j E j vertex-to-vertexrotations ˆ ij ,representingtheconnectionintegralfrom v i ,along e ij , thento v j : Allotherimpulserotationsandedgerotationsaredirectlydeducedfromthesereducedparameters byenforcingthat K ij;k =0 .Inparticular,weget ij = ˆ v i ! e ij + ˆ ij + ˆ v j ! e ij ; ˝ ij;k = ˆ v i ! t ijk + ˆ ij + ˆ v j ! t ijk : (4.1) Noticethatadiscreteconnectioninthisreducedsethasalinearlyvaryingimpulserotationangle ˆ e ij ! t ijk atapoint p 2 e ij betweentheedge e ij andanincidenttriangle t ijk as: ˆ e ij ! t ijk ( p )= ˆ v i ! e ij + ij ' j ( p )+ ˆ v i ! t ijk + ˝ ij;k ' j ( p ) = ' i ( p )( ˆ v i ! e ij ˆ v i ! t ijk )+ ' j ( p )( ˆ v j ! e ij ˆ v j ! t ijk ) : (4.2) Also,theconnectioncurvatureinatriangle'sinteriorissolelydeterminedby ˆ ij : K ijk = ˆ ij + ˆ jk + ˆ ki : 52 Wewillnowdenoteby ˆ thediscreteconnectionde˝nedbythesereducedparameters,i.e., ˆ =( f ˆ ij g ; f ˆ v i ! e ij g ; f ˆ v i ! t ijk g ) .Asweareabouttosee,anysuchdiscreteconnectioncanbe usedtode˝nea˝nite-dimensionalspaceofvector˝eldsonthesurfaceanditsassociateddi˙erential operators.However,mostgeometryprocessingtoolsassumetheLevi-Civitaconnectioninduced bytheEuclideanembedding.Wethusdescribenexthowtode˝neadiscreteconnectionasclose aspossibletotheoriginalLevi-Civitaconnectionofthemesh,whilekeepingcovariantderivatives ˝nite. 4.3ComputingLevi-CivitaConnections Thereducedparametersofourformulationofconnectionsovertriangulatedmanifoldsneedtobe determinedtocreateaninstanceofdiscreteconnection.We˝rstprovidelocalchoicesofreduced parametersthatwereimplicitinpreviouswork,beforeintroducingaglobaloptimizationprocedure thatmimicstheworkof[26]butwithinour(primal)connectionsetup,inthesensethatitmakes thediscreteconnectionascloseaspossibletothecanonicalLevi-Civitaconnection ˆ e ij ! t ijk of theinputsurface. 4.3.1Connectionderivedfromgeodesicpolarmaps Onechoiceforevaluating ˆ ij basedonlocalmeasurementsfromtheinputmeshmakesuseofthe geodesicpolarmapasin[13]and[1].Thegeodesicpolarmapproportionallyrescalestipangles aroundeachvertexsuchthattheysumto 2 ˇ ,inducinga˛atteningoftheimmediatesurroundingof eachvertex v i throughascalingfactor s i =2 ˇ= X t ijk kij 2 ˇ= (2 ˇ i ) ; (4.3) where i istheGaussiancurvaturefor v i .Assumingforsimplicitythattheframebasisvector e v i atvertex v i waschosentobealignedtooneoftheadjacentedgeframes e e im ,itisnaturaltoselect ˆ v i ! e ij = s i \ ( e e ij ; e e im ) ,wherethepositiveangle \ ismeasuredbysummingtriangletipangles 53 counterclockwisearound v i betweenpossiblynon-consecutiveedges e ij and e im aroundvertex v i . Next,weselect ˆ v i ! e ji =( ˆ v i ! e ij ˇ )+2 ˇn ij ; where n im =1 and n ij =0 8 j 6 = m .Withthis choice,theGaussiancurvatureof v i isdistributedtoitsone-ring,sincetheintegralofGaussian curvaturearoundthetipoftriangle t kij isnow: ˆ v i ! e ij +( ˆ e ij ! t ijk ˆ e ki ! t ijk ) ˆ v i ! e ki = ˆ v i ! e ij +( ˇ kij )+( ˆ v i ! e ik ˇ )+2 ˇn ik =( s i 1) kij : Thevertex-to-vertexcoe˚cient ˆ ij ofthediscreteconnectionisthensettobe: ˆ ij = ˆ v i ! e ij ˆ v j ! e ij ; andthetrianglecurvature K ijk oftheconnectionbecomes: K ijk =( s i 1) kij +( s j 1) ijk +( s k 1) jki : Thisispreciselythechoicethattheauthorsof[1]made,exceptthattheirrestrictionontherange ofGaussiancurvatureisunnecessaryhere.Giventhatourcontinuousedge-andtriangle-wise connectionsareentirelydeterminedbythecoe˚cientsof ˆ ,ourapproachthusprovidea closed- formexpression ofthecontinuousconnectiontheyimplicitlyused. Thischoiceofvertex-to-vertexrotationanglesdoesnot,however,fullydetermineadiscrete itisenoughtoevaluatetheDirichletenergyofavector˝eldaswewillsee inSec.4.4.Indeed,impulserotationsfromvertextotrianglesarecrucialforthelocalevaluation ofthe˝rst-orderderivativesdivergence,curland @ .Anintuitivechoiceforthesevertex-to-triangle rotationsistousethevertex-to-edgeimpulserotationsinducedbythevertex-to-vertexcoe˚cients andthewell-de˝nedangles(measuredintheactualEuclideanmetric)fromtheedgeframetothe triangleframe,i.e., ˆ v i ! t ijk = ˆ v i ! e ij + ˆ e ij ! t ijk ; wheretheLevi-Civitaconnection ˆ e ij ! t ijk = \ ( e e ij ; e t ijk ) oftheinputmeshisused.However, thischoiceisbiasedsinceitonlyconsiderstheimpulserotationsof e ij andnotofitsneighboring 54 edges.Tobeconsistentwiththegeodesicpolarmap,therotationfromthevertexframebasis e v i toanydirectionbetween e ij and e ik shouldbedirectlycomputedbasedonthescalingfactor s i , andshouldresultinarotationangleinbetween ˆ v i ! e ij and ˆ v i ! e ik .Oneofthemanydi˙erent waystoenforcethispropertyisthustopickanarbitraryinteriorpoint c ijk (suchastheincenteror thebarycenter)ofeachtriangle t ijk ,tode˝ne ˆ v i ! c ijk =( ˆ v i ! e ij + ˆ v i ! e ik +2 ˇn ik ) = 2 ,andto de˝nethevertex-to-triangleimpulserotationsas ˆ v i ! t ijk = ˆ v i ! c ijk + \ ( c ijk p i ; e t ijk ) ; (4.4) where,again,theangles \ aremeasuredintheactualEuclideanmetricoftheinputmesh. 4.3.2Locallyoptimalconnection 1 -form Thechoiceofgeodesicpolarmapmay,however,resultinlargeconnectionvalues ˝ (asdeduced from ˆ throughEq.4.1),indicatingasigni˝cantmismatchbetweenthelocaloriginalLevi-Civita connection( 0 insideatriangle)anditsdiscretecounterpart.Asimpleimprovementcanbeachieved bychoosingthevertex-to-trianglerotationsthatminimizethe L 2 normofthisdeviationwithineach trianglewhilekeepingthevertex-to-vertexcoe˚cients ˆ ij unchanged.Asthe L 2 normof ˝ per triangleisaquadraticfunctionofitsedgevalues ˝ ij;k , ˝ jk;i ,and ˝ ki;j usingthemassmatrixof Whitney 1 -formbasisfunctions,thelocaloptimalvaluesarefoundinclosedformtobesimply ˝ ij;k = K ijk = 3 ; whichleadsto Z t ijk ˝ ^ ?˝ = 1 36 (cot( ijk )+cot( jki )+cot( kij )) K 2 ijk : Thereare,however,multiplechoicesofvertex-to-triangleimpulserotationsthatachievethislocally minimalconnection.Forinstance,wecouldpickonearbitraryimpulse ˆ v i ! t ijk pertriangle t ijk , then˝nd ˆ v j ! t ijk and ˆ v k ! t ijk sothat,for q 2f j;k g , ˆ v q ! t ijk = ˆ v i ! t ijk + ˆ qi + ˝ iq : (4.5) Onecan,instead,computethethreetripletsofvertex-to-triangleimpulserotationsinducedby˝xing eachoneofthecornerimpulserotationsindividuallyusingEq.4.5,andaveragetheirvaluestoavoid 55 bias.Thisaveragedchoiceleadstobetteraccuracyinsingularitydirectioncontrol(seeSec.4.5), andhasproventobe,inallourtests,the local de˝nitionofconnectionthatgeneratestheleast amountofnumericalerrors(seeTable4.1). 4.3.3As-Levi-Civita-as-possibleconnection 1 -form Derivingadiscreteconnectionthroughageodesicpolarmap[1]leadstoreasonableconnection 1-forms ˆ ij onprimaledges,andlocaloptimizationsofimpulserotationsfurtherminimizethe resultingtriangle-basedconnection 1 -form.Wecan,however,directlycomputeagloballyopti- maldiscreteconnectionbyselectingtheoneclosest(inapropersense)totheactualLevi-Civita connection ˆ derivedfromthepiecewise˛atmesh. Inordertode˝neameaningfulnotionofoptimalconnection,weproposethefollowingtwo measurementsofdeviation: D T ( ˆ )= X t ijk Z t ijk ˝ ^ ?˝; D E ( ˆ )= X e;t j e ˆ t w e;t Z e ( ˆ e ! t ( p ) ˆ e ! t ) 2 dl; where ˆ e ! t ( p ) isthelinear-varyingimpulserotationgiveninEq.4.2,and w e ij ;t ijk =tan jki istheinverseofthecotanweightfortheHodgestarof 1 -formswithinthetriangle(fortipangles greaterthanorequalto ˇ= 2 ; wecanusea˝xedlargevaluefor w e;t insteadwithoutsubstantial impactontheresultingcoe˚cients,asthee˙ectofthecotanweightsontheglobalresultisminor asnoticedin[26]forthedualversion). D T measuresthedeviationfromthe˛atconnectionwithin triangles,while D E measuresthedi˙erencebetweenthetrueLevi-Civitaconnectionmeasured bytheangles \ ontheinputmeshandtheimpulserotationinducedbythereducedparametersof ˆ .Minimizingthequadratictotaldeviation D T + D E (oranylinearcombinationthereof)isthus simple:theoptimizationprocedureamountstosolvingalinearsystemin ˆ afterwe˝xitskernelof 56 size j V j bysettingtozerooneofthevertex-to-faceimpulserotations ˆ v i ! t ijk pervertex v i (these j V j gaugevaluesdonota˙ecttheresult,astheyamounttoarotationangleofthearbitraryframe direction e v i ).Bothenergiesareexpressedasquadraticfunctionsof ˆ ,buttheintegrateddeviation D E doesnotdependon ˆ ij sincethecontributionsfrom and ˝ canceloutalongeachedge. 4.3.4Trivialconnections Wejustdescribedhowourde˝nitionofadiscreteconnectioncanbemadeascloseaspossible totheLevi-Civitaconnection ˆ throughalinearsolve.Infact,wecanalsocreateaconnection ascloseaspossibleto any metricconnectionwitharbitraryconesingularitiesatvertices,similar tothe trivialconnections of[26]:inourcontext,trivialconnectionsarecreatedbyusingangles ~ ˆ e ij ! t ijk = ˆ e ij ! t ijk + ij;k ,where ij;k isanadjustmentangle,andtheconesingularityat v i hasaconnectioncurvature K i = X t ijk ( ˆ v i ! e ij +~ ˆ e ij ! t ijk ~ ˆ e ki ! t ijk ˆ v i ! e ki ) : Iftheadjustmentangleshavebeenpickedsuchthat K i =0 formostvertices,andifwereplace ˆ e ! t inthedeviation D E by ~ ˆ e ! t ,ouroptimizationwillleadtotrivialconnections,thusextending themethodof[26]toourprimalsetup.AswewilldemonstrateinSec.4.6,ouroptimizationofthe discreteconnectionimprovestheaccuracyofallfurthernumericalevaluations.Moreimportantly, wecannowformulateinclosed-form(pointwiseorlocallyintegrated)derivatives and their L 2 normsasexplainednext. 4.4Connection-basedOperators Fromadiscreteconnection ˆ andavector u i = u 1 i e v i + u 2 i e ? v i ateachvertex,wecangiveanexact expressionofthevector˝eld u withineachtriangleof T .Consequently,any˝rst-orderoperator orenergywillbeeasytoevaluateusingtheresultingcontinuousvector˝eld.Thekeyobservation inconstructingbasisfunctionsofvector˝eldsisthatwhilethebasisexpressionscontainjumps 57 alongedges,thecovariantderivativeis˝niteeverywhereasthesejumpsarecompensatedforby thediscreteconnection. 4.4.1Basisfunctionsforvector˝elds Givenadiscreteconnection ˆ ,wede˝neabasisfunction i pervertex v i .Itsexpression i j t within eachincidenttriangle t isconstructedby˝rstusingtherotation ˆ v i ! t toparalleltransportthe vector u i storedinthelocalframe e v i of v i tothecorneroftriangle t ;wethenparalleltransport theresultingvectorexpressedintheframe e t alongastraightpathfrom v i toanarbitrarypoint p in t undertheconnection1-form ˝ ,whichde˝nesalocalframe˝eld i t ( p )=( e t ; e ? t )exp " ( ˆ v i ! t + Z v i ! p ˝ ) J # : Withtheselocalframe˝elds,wemakeuseofthescalarbasisfunctions ' i at p toblendtheparallel transportedvectorsfromeachcornerofthetriangle.Sinceourconnection ˝ islinearwithineach triangle,theresultingbasisfunctionforavertex v i iseasilyexpressedinclosedformas: i t ijk ( p )= ' i ( p i t ijk ( p ) = ' i ( p )( e t ijk ; e ? t ijk )exp h ( ˝ ij;k ' j ( p )+ ˝ ik;j ' k ( p )+ ˆ v i ! t ijk ) J i : Theinterpolatedvector˝eld u canthenbeevaluatedanywhereonthemeshvia u = X i i u 1 i u 2 i : Notethatthisinterpolationisvisuallyquitesimilartoalinearinterpolationforadiscreteas- Levi-Civita-as-possibleconnection,butcanbedramaticallydi˙erentforotherconnections.Fig.4.3 showsavector(ingreen)locallyinterpolatedbyabasis i overanon-˛atone-ringforanas-Levi- Civita-as-possibleconnection( left )vs.whenoneofthevertex-to-faceconnectionangleshasbeen doubled( right ). 58 Figure4.3 Locallyinterpolatedvectorbydi˙erentconnections. 4.4.2Discretecovariantderivative UsingthedecompositiongiveninEq.2.3anddroppingthebasis ( e t ; e ? t ) forclarity,thecovariant derivativeofourbasisfunctionswithintriangle t ijk isformallyderivedvia: r i = r ( ' = i d' i + ' i r i = i d' i J ( ˝ ij;k d' j + ˝ ik;j d' k )+ J ˝ = i d' i J ( ˝ ij;k ( ' jk + ' ij ) + ˝ ik;j ( ' jk ' ki ))+ J ˝ = i d' i K ijk J i ' jk : Notethatwhilethebasisfunctions i dependonthechoiceofvertex-to-triangleimpulserotations ˆ v ! t ,theirmassmatrix R T i j (resp.,sti˙nessmatrix R T r i : r j )doesnotdependonit, since,e.g., i ( p ) j ( p )= ' i ( p ) ' j ( p )exp[ J ( K ijk ' k ( p )+ ˆ ij )] : Consequently,theenergies E D , E H ,and E A donothavethisdependenceeither,andtheirex- pressionsaresimilartotheresultof[1]exceptthatweuseanoptimizedconnection ˆ insteadof thevertex-to-vertexcoe˚cientsderivedfromthegeodesicpolarmap(Sec.4.3.1).However,rota- tions ˆ v ! t arenecessaryfortheevaluationofpointwiseorintegrated˝rst-orderderivativessuch asdivergence,curl,andCauchy-Riemannoperators. 59 (a)coarsebunnymesh (b)vector˝eld (c)direction˝eld (d)cross˝eld Figure4.4 Fromvector˝eldto n -vector˝elds. Adiscretevector˝eld,evenonacoarsemesh,can bedirectlyconvertedintoan n -vectoror n -direction˝eldbyscalingtheconnectionangles.Here, abunnymesh(a)andavector˝eldwithasourceandasaddleononeside(b)isconvertedintoa 2 -RoSy(direction)˝eld(c)anda 4 -RoSy(cross)˝eld(d). 4.4.3Discreteoperatorsbasedoncovariantderivative Toderivetheintegralsof˝rst-orderoperatorspertriangle,itisconvenienttochooseabarycentric- coordinateparametrization ( x ( p ) ;y ( p ))=( ' j ( p ) ;' k ( p )) intriangle t ijk ,forwhichthemetric is g = 0 B @ e ij e ij e ij e ik e ij e ik e ik e ik 1 C A : Thecomponentsof r i cannowbestraightforwardlyevaluatedgivenanyconstantframe˝eld ( e 1 ; e 2 ) withinthetriangle.Forinstance,ifonepicks e 1 = 1 g 11 @ @x ; onegetsinsidetriangle t ijk : r e 1 i = i d' i ( e 1 ) K ijk ' i J i ( ' j d' k ' k d' j )( e 1 ) = 1 g 11 dx ( @ @x ) K ijk xJ ( yd ( x + y ))( @ @x ) i = 1 g 11 ( I + K ijk xyJ i : ThefouroperatorsinvolvedinEq.2.3arethenassembledvia d iv i = e 1 r e 1 i + e 2 r e 2 i ; c url i = e 1 r e 2 i e 2 r e 1 i ; div i = e 1 r e 1 i e 2 r e 2 i ; curl i = e 1 r e 2 i + e 2 r e 1 i : 60 Notethat,asexpected,arotationby inthetriangle'slocalframeproducesnochangein d iv or c url ,butitresultsinarotation exp( J 2 ) oftheCauchy-Riemannoperator @ =1 = 2( div;curl ) .If ontheotherhand,theconnectionfromavertex v toanincidenttriangle t ischangedbyanangle ,itresultsinaredistributionofthefourterms (d iv new ; c url new ) T =exp( J )(d iv; c url ) T and @ new =exp( J ) @; buttheircombined L 2 -norms( E A and E H )remainunchanged. Triangle-basedIntegrals Thediscreteversionsoftheseoperatorsarede˝nedastheircontinuous integralsovertrianglesasitprovidesnumericallyrobustlocalaverages: d iv t i = Z t d iv i ; c url t i = Z t c url i ; @ t i = Z t @ i : Theintegrationcanbedoneinclosedformsinceitessentiallyinvolvestermssuchas x exp( Jx ) : For numericalevaluation,Chebyshevexpansionisrecommended[1]tohandletheexpressionswhen theconnectioncurvatureiseithersmallorlarge.However,withouroptimizedconnection,itissafe toassumethatthecurvatureissmallenoughtouseasimplerTaylorexpansion,withessentiallythe sameaccuracy.Whiletheintegralofourdiscreteconnectionsonlocalhalf-edgecycles(Fig.4.2) iszerobydesign,thetotalintegralofthediscreteoperatorswejustformeddoesnotnecessarily vanishasitshould:thetriangleintegralofdivergencereducestotheboundaryintegralformedby half-edgesconsideredaspartofthetriangle,whichthereforedonotaccountfortheedgeintegrals. Thus,Stokes'theoremfordivergenceandcurlwillnotholdwhenwesumtriangleintegrals.In fact,thisdiscrepancybetweenintegralalongtheboundaryoftrianglesvsedgesisonlyoneofthe twosourcesofinaccuracy:theothersourceisthedeviationof ˝ fromthe(trivial)Levi-Civita connectionwithineachtriangle.ItbearsnoticingthatouroptimizationtargetfunctioninSec.4.3.3 ispreciselyameasureofthesetwodiscrepancies.Thus,ouroptimizeddiscreteconnectionsleadto higherquality˝rst-orderderivativeoperatorsthanthoseinducedbythegeodesicpolarmap.The ˝nalexpressionsofourdiscreteoperatorsareanalyticallyfoundthroughsymbolicintegration,see App.A.3. 61 (a)vector˝eldwithsaddle (b)direction˝eldfrom(a) (c) ˇ 4 -rotationof(a) (d)direction˝eldfrom(c) Figure4.5 Orientationcontrolfornegativeindexsingularities. Fromavector˝eld(a)onasphere withasaddlepointwithindex 1 (resp.,itscorresponding 2 -RoSy˝eld(b)formingatrisectorof index 1 = 2 ),theusercandirectlycontroltheorientation(c)ofthesaddle(resp.,theorientationof thetrisector(d))withouta˙ectingitspositiononthesurface. Edge-basedIntegrals IfapreciseenforcementofStokes'theoremisrequired,theper-triangle integralevaluationof˝rst-orderderivativescanbede˝nedviaboundaryintegralsinstead:usingour edge-basedconnection ,wecande˝neanothersetofdiscreteoperators,de˝nedoneachtriangle as d iv t i = Z @t i d l ; c url t i = Z @t i d l ; wherethebasisfunction isexpressedalongtheedgeas: i j e ij ( p )= ' i ( p )exp[ J ( ij ' j ( p )+ ˆ v i ! e )] : TheCauchy-Riemannoperatorisde˝nedinasimilarfashionvia: @ t i = 1 2 Z @t (( F i ) d l ; ( F i ) d l ) T ; wherethere˛ection F isdonew.r.t.theframe e t intriangle t: Theclosed-formexpressionsofthese discreteoperatorsaregiveninApp.A.2.Bothtriangle-basedandedge-baseddiscreteapproaches toevaluatinglocalintegralsof˝rst-orderderivativesexhibitsimilarnumericalaccuracy,aswewill discussinSec.4.6. 4.5Vectorand n -DirectionFieldDesign Theoperatorsandenergieswehavede˝nedbasedonourdiscreteconnectionarewellsuitedto thedesignofvisually-smoothvector˝eldsontrianglemeshesthroughbasiclinearalgebra,asone 62 hascontroloverthebehavioroftheirsingularities(bothposition and orientation)aswellastheir alignment.Inthissection,wepresenttwodi˙erentapproachestovector˝elddesignthatbuildupon andextendpreviousworkthroughtheuseofourdiscreteconnectionsandcovariantderivatives. Notethatcreatingasmooth n -vectoror n -direction˝eldisalsoatrivialmatter:theexactsame vector˝elddesignprocedurecanbeused˝rstinaconnectionwhereallangleshavebeenmultiplied by n ,andtheresultingvector˝eldisconvertedtoan n -vector˝eldbydividingtheanglethevector ˝eldmakeswitheachvertexreferencedirection e v i by n (seeFig.4.4).Wecanthennormalizethe resulting n -vector˝eldtomakeitan n -direction˝eldasproposedin[1]. Itshouldbenotedhere,asitwillbecomeimportantinthecourseofthissection,thatforan n -vector˝eld u with n 2 ,thenotionsofdivergenceandcurlbecomedependentonthechoice offrame:theynowrepresentthecomponentsofan ( n 1) -vector˝eld @ u aswedemonstratein App.A.Conversely,there˛ecteddivergenceandre˛ectedcurlrepresentan ( n +1) -vector˝eld @ u . 4.5.1Variationalapproach Theoverallprocedureofour˝rstapproachtodesignavector˝eldisbasedonaquadraticminimiza- tiondrivenbyuser-speci˝edconstraints,extendingtheapproachof[17].Fromaglobally-optimized discreteconnection,wede˝neapenaltyenergy P foravector˝eld u as: P ( u )= 1 2 Z T (d iv u d ) 2 +(c url u c ) 2 +( @ u s ) 2 + w ( u u 0 ) 2 ; where d prescribessources/sinks, c controlsvortices, s describesthedesiredsaddlepoints, u 0 isa guidancevector˝eld,and w isaweightusedforlocalorglobalalignmentconstraints.Theintegra- tionofthisquadraticenergycanbedoneonaper-trianglebasis,whichreducestoaPoisson-like linearsystem A U = b foramatrix A = ! + wI; where ! canbeseenasthediscretever- sionoftheconnectionLaplacian(whichhandlesboundaryconditionsnaturally,unlikethedeRham Laplacianusedin[17]).Thismatrix A hastheexactsamestructureastheonein[1],exceptthat weuseouroptimized ˆ ij insteadofvertex-to-vertexrotationsinducedbythegeodesicpolarmap. Therighthandsideterm b reliesonthediscretedivergence,curlandCauchy-Riemannoperators, 63 (a)Vector˝eldwithasource (b)Theedgefrom(a) (c)Avortexaddedto(a) (d)Wedgerotatedby ˇ 3 Figure4.6 Orientationcontrolofpositiveindexsingularities. Bysettingadivergence/curlpair (1 ; 0) onatriangle,asource(singularityofindex 1 )isformedinthevector˝eld(resp.,awedge singularityofindex 1 = 2 ontheassociated 2 -RoSy˝eld).Changingthispairto (cos( ˇ 3 ) ; sin( ˇ 3 )) , avortex(c)isaddedtothesource(creatinglog-spiralingstreamlines)whilethecorresponding orientation˝eld(d)hasitswedgerotatedby ˇ= 3 . whichuseouroptimizedvertex-to-trianglescoe˚cientsaswtermisanextensionofthe workof[29]fornon-˛atdomains.Whilewewillnotexplorethispossibilityhere,notethattheuser canalsostartfromachosentrivialconnection(seeSec.4.3.3)insteadoftheLevi-Civitaconnection foranevengreater˛exibilityinediting. Controllingsingularityorientation Usingourpenaltyenergy P ,wecancontroltheorientation ofpositiveindexsingularities,includingvortices,sources/sinks,andcombinationsthereof.This wasalreadypossibleinthedivergence-andcurl-basedapproachof[17].WithourdiscreteCauchy- Riemannoperator,wenowcanalsocontrolnegativeindexsingularities(i.e.,saddlepoints,see Fig.4.5)andtheirdirection,whichwasnotpossibleinpreviouswork. Positivelyindexedsingularitiescanbeconstructedbyassigningpairsofnon-zerovalues ( d ijk ;c ijk ) onselectedtriangles(andzeroforallothers)representingthelocaldivergenceand curlthattheuserdesires.Notethattheratio c=d controlsthedirectionofsingularitiesfor n -vector ˝elds:whiletheshapeofanindex- 1 singularityinavector˝eldisinvariantunderrotation,chang- ingapair ( d ijk ;c ijk ) to exp( J )( d ijk ;c ijk ) wheneditinganindex- 1 =n singularityinan n -vector ˝eldresultsinarotationof = ( n 1) ofthesingularity(seeFig.4.6). Whencontrollingasaddlepoint,theratiobetweenthetwocomponentsof s ijk onselected trianglesindicatesinsteadtheanglethatthesymmetryaxisofthesaddlepointmakeswiththe 64 simplicialframe˝eld e t ijk .Inthiscase, @ u is,itself,a 2 -vector˝eld,sorotatingthesaddlepoint by = 2 amountstousing exp( J ) s ijk : For 1 =n -singularitiesin n -direction˝elds,wewillget = ( n +1) rotationsinstead.Fig.4.5showsanexamplewhereasaddlepointisrotatedby ˇ= 3 by changingthecomponentsof s ijk onthetriangle t ijk containingthesaddle. Constrainingalignment Vectoror n -direction˝eldscanalsobemodi˝edviaalignmentcon- straints,eitherviaaninputdirection˝eldorviauser-drawnstrokes.Ifwearegivenatarget n - vectoror n -direction˝eldrepresentedby u 0 ,webalancethesmoothness(andsingularitycontrolif needed)andthealignmenttermviaauser-speci˝edweight w asindicatedinthelasttermofenergy P .Formorelocalediting,theusercandrawstrokesonthemeshasanintuitivewaytoprovide controloverthedesign.Weessentiallyfollowtheapproachof[17]tocreatealocallysupported vector˝eld u 0 ,andenforceitviathesamepenaltytermusedabove,withitsownweight w tolet theuserdecidehowcloselytheresultingvector˝eldshouldfollowthestroke(Fig.4.7). 4.5.2Eigendesign Whileourvariationalapproachtoeditingisfastandsimple,itsu˙ersfromtwoshortcomings:˝rst, oneneedstostartfromanexistingvector˝eldtobegintheeditingprocess;second,spurioussin- gularitiescanappearasmoreconstraintsareinputbytheuser.Boththeseissuescanbeaddressed (a)Originalvector˝eld (b)withauser-speci˝edstroke Figure4.7 Designbystroke. (a)Froman n -vectoror n -direction˝eldwitharbitrarysingularities, (b)theusercandrawastroke(blue)inordertoeasilyin˛uencethedirectionofthe˝eld.The resultisupdatedinteractivelybysolvingthelinearsystemresultingfromthevariationalapproach ofSec.4.5.1. 65 usingadi˙erentapproachtovector˝eldediting,whereavector˝eldisprovidedsuchthatitis thet˝eldsatisfyingtheconstraintsprescribedbytheuser.Indeed,theauthorsof[1] noticedthatthevector˝eldwiththelowestDirichletenergyfora˝xed L 2 normcanbefound throughageneralizedeigenvalueproblem(i.e.,aHelmholtzequation),whichmakesuseofboth theconnectionLaplacianmatrix(computingtheDirichletenergy E D )andthemassmatrix(com- putingthe L 2 norm).Wecanadopttheexactsamemethod,butnowusingourdiscreteoptimized inimprovedeigenvector˝eldswithsingularitiesappearingatmoresalient locations(seeFig.4.8). However,ourdiscreteoperatorsfor˝rst-orderderivativeso˙eramuchmoregeneralextension ofthisdesignapproach.Indeed,wecannowmodifytheconnectionLaplacianmatrixtoadda quadraticpenaltyonthevector˝eldcomponents across user-speci˝edstrokestodirectlyinclude directionconstraintsintheeigenvalueproblem.Similarly,themassmatrixcanbemodi˝edtocon- trolbothsingularityplacementandorientationusingthetermswepresentedinSec.4.5.1.Solving theresultinggeneralizedeigenvalueproblemprovidesthetvector˝eldthatsatis˝esuser constraints,wheresmoothestisde˝nedwithrespecttothenotionofconnectionusedtoderivethe covariantderivative.Iftheuseralsochangesthediscreteconnectiontobetrivialwithprescribed singularitiesasdescribedinSec.4.3.3,thevector˝eldwillbesmoothestforthisconnectionaswe demonstrateinFig.4.9.Fromthiseigendesign,variationalediting(Sec.4.5.1)canbeperformed iftheuserwishestofurthereditthevector˝eld. 4.6Results Wepresentnumericaltestsoftheaccuracyofouroperatorsderivedfromourdiscreteconnection aswellasafewvector˝elddesignresultsusingourtwoapproaches. 66 4.6.1Accuracyofdiscreteoperators Weevaluatetheaccuracyofthediscreteapproximationsof d iv , c url ,and @ pertriangle.Toallow forpropererrorevaluation,weuseasetoftrianglemeshesinterpolatingasphereatvariouslevels ofdiscretization,anduseasmoothvector˝eld(namely,alow-ordervectorsphericalharmonic) withaknownexpressionsothatwecanevaluateitsexactdivergenceandcurleverywhere.We thencomputethe L 2 errorbetweenourdiscretedivergence(resp.,curl)evaluationandthereal integralvaluepertriangle.TheresultsshowninTable4.1demonstratethatouroptimizationofthe connectionimpactstheaccuracyof˝rst-orderoperatorsquitesigni˝cantlycomparedtoageodesic polarmapbasedconnection.Thearea-basedvs.edge-basedevaluationsofthelocal˝rst-order derivativespresentedinSec.4.4.3are,however,minimallydi˙erent.WefoundthattheStokes approach(basedon )oftenleadstoabetteraccuracyespeciallyon˝nemeshes;yet,thearea-based operatorsareslightlymorerobusttonoiseastheyrelyonareavs.edgeintegrals.Weusedthe samesetuptoevaluatetheaccuracyofourvector˝eldenergiesbasedonourtriangle-based˝rst- orderderivatives,andonceagaintheoptimizedconnectionshowssuperiornumericalaccuracy exceptonverycoarsemeshes.OurDirichletenergyresultsarealsosystematicallybetterthan the L 2 evaluationprovidedby[1],evenifouroptimalvertex-to-vertexconnectionangles ˆ ij are usedtoimprovetheirresults.Thedi˙erenceoftheantiholomorphicandholomorphicenergiesfor direction˝eldsisalsoagoodmeasureofaccuracy,asweknowthatitshouldevaluatetotheEuler characteristicofthemeshtimes 2 ˇ ,andtheedge-basedevaluationsusingouroptimizedconnections exhibit,onceagain,signi˝cantlyimprovedaccuracyasshowninTable4.2.Ouroperatorsarethus wellsuitedtovector˝eldanalysisonmanifoldsimplicialcomplexes. 4.6.2Vectorand n -direction˝eldonmeshes Visualizationof˝eldswasdoneusingthecodefrom[24].Weexperimentedwithourvariational- basededitingapproachbasedonthequadraticenergy P .Asexpected,thissimplenumericalmethod (requiringonlyalinearsolveforeachnewconstraintaddedbytheuser)o˙erscontrolnotonlyover 67 positivesingularities,butalsooversaddlepointsinthevector˝eldandtheirprincipalaxes.For instance,asaddlepointhappeningonthesideofamesh(seeFig.4.5)canberotatedbyanyangle withoutchangingitsposition.Thesamecontrolappliesto n -direction˝eldswithoutanycode modi˝cation(Fig.4.4). Finally,wetriedoureigenapproachtovector˝elddesign.First,wefoundthatournotionof smoothestvector˝eldfortheLevi-Civitaconnectionisquiteclosetotheresultsof[1],although visualcomparisonsshowfrommarginaltomoderateimprovementsdependingonthecomplexityof themodel(seeFig.4.8).Whereourmethodreallydi˙ersisinourabilitytohandleuserconstraints intheexactsameframework,aswellasarbitraryconnectionsasdemonstratedinFig.4.9. 4.7Conclusion Wehaveproposedtheconstructionofadiscretenotionofconnectionanditscovariantderivative byexploitingthesimplicialnatureoftriangulated 2 -manifoldsandpickingthelowest-order˝nite elementbasisfunctionswecould(tosimplifytheresultingexpressionsandmakevector˝elddesign ase˚cientaspossible)suchthatderivativesandtheir L 2 normsarewellde˝nedand˝nite.The resultingdiscretecovariantderivativeislinearandmetricpreservingbyde˝nition,althoughitfails toexactlysatis˝esLeibniz'sruleasmostWhitney-baseddiscreteoperators.Ournotionofdiscrete connectionwasshowntobenumericalsuperiortopreviousapproaches,andapplicationstovector anddirection˝elddesignweredemonstrated. 68 (a)[1]'s... (b)...vs.ourresult (c)[1]'s... (d)...vs.ourresult (e)[1]'s... (f)...vs.ourresult Figure4.8 Comparisons. Whilethemethodof[1]˝ndssimilarsingularities,ourapproachleads totraightervector˝elds(seeneckofbunny(a)&(b);noseoflion(e)&(f)),andthepositions ofoursingularitiesarefoundclosertocorners(seeinsetsoffandisk,(c)&(d)).Yellowandblue markersindicatethepresenceofsingularitiesinthevector˝elds. (a)Smoothestvector ˝eldfortheLevi-Civita connection,withno constraintsadded (b)Smoothestvector ˝eld(Levi-Civitacon- nection)thatmatchesa user-speci˝edstroke (c)Smoothestvec- tor˝eldforatrivial connection(with prescribedsingular- ities)withnoadded constraints (d)Smoothestvector ˝eld(forthesametriv- ialconnectionof(c)) thatmatchesauser- speci˝edstroke Figure4.9 Eigendesign. Whileanunconstrainedgeneralizedeigenvalueproblem(a)willresult inthesmoothestvector˝eld(i.e.,withthelowestDirichletenergyfora˝xed L 2 norm)forthe as-Levi-Civita-as-possibleconnection,wecanalso˝ndthesmoothestvector˝eldthatmatches user-speci˝edstrokes(b).Moreover,theusercanprescribeatrivialconnection(c)withgiven singularities(bothpositiveandnegativeones,placedonthevector˝eldsingularitiesof(a)inthis example),andthetreatmentofstrokeconstraintsremainsthesame(d). 69 L 2 errorfordiv polarmap localoptimal globaloptimal sphere 0.2447 0.2239 0.1809 sphereLoop1 0.1586 0.1054 0.0361 sphereLoop2 0.2742 0.1297 0.0084 sphereLoop3 0.7746 0.2749 0.0020 L 2 errorforcurl polarmap localoptimal globaloptimal sphere 0.2453 0.2251 0.1823 sphereLoop1 0.1563 0.1039 0.0361 sphereLoop2 0.2760 0.1300 0.0083 sphereLoop3 0.7765 0.2752 0.0020 L 2 errorfor E D polarmap localoptimal globaloptimal sphere 2.1906 2.2470 2.4016 sphereLoop1 0.2306 0.3613 0.6258 sphereLoop2 0.8679 0.3259 0.1581 sphereLoop3 3.0080 1.0464 0.0396 [1] [1]w/optimal ˆ ij 2.4161 2.4153 0.6300 0.6298 0.1592 0.1591 0.0399 0.0398 Table4.1 Approximationerrors. Usingmeshesofincreasingresolutionsthatallinterpolatea sphere,weevaluatethe L 2 errorsforthedivergence(topleft),curl(topright),andDirichletenergy operators(bottom)evaluatedpertriangleusingouredge-basedapproach(viaStokes).Thesphere meshhasonly162vertices,andwere˝neitsconnectivityviaLoopsubdivisions,leadingtomeshes of642,2562,and10242vertices.Weaveragedtheerrorsincurredfor100randomvector˝elds thatarelinearcombinationsofthe˝rst 40 vectorsphericalharmonics,normalizedtohaveunit L 2 norm.Theoptimal(as-Levi-Civita-as-possible)connectionsystematicallyproducesthesmallest errorexceptforextremelycoarseresolutions.Wealsoimproveonthe L 2 normproducedby[1], evenifouroptimalvertex-to-vertexangles ˆ ij areusedintheirformulae. R T K (mean/std) polarmap localoptimal globaloptimal [1] sphere 3.9730/0.923 e 3 3.9756/0.623 e 3 3.9756/0.619 e 3 3.9756/0.620 e 3 sphereLoop1 3.9878/0.341 e 3 3.9897/0.102 e 3 3.9898/0.103 e 3 3.9898/0.103 e 3 sphereLoop2 3.9948/0.455 e 3 3.9970/0.057 e 3 3.9970/0.057 e 3 3.9970/0.057 e 3 bunny 3.8857/0.850 e 2 3.9082/0.706 e 2 3.9192/0.741 e 2 3.9193/0.742 e 2 bunnyLoop 3.9610/1.199 e 2 3.9860/0.696 e 2 3.9880/0.725 e 2 3.9875/0.725 e 2 torus 0.0234/0.913 e 2 0.0216/0.371 e 2 0.0207/0.381 e 2 0.0207/0.381 e 2 torusLoop -0.0025/0.328 e 2 -0.0022/0.059 e 2 -0.0013/0.065 e 2 -0.0016/0.065 e 2 globaloptimalw/Stokes 4.0000 /0.000 e 3 4.0000 /0.000 e 3 4.0000 /0.000 e 3 3.9995 /0.000 e 2 4.0003 /0.000 e 2 -0.0003 /0.000 e 2 0.0000 /0.000 e 2 Table4.2 ApproximationsofEulercharacteristic. Forapointwiseunitvector˝eld u ,thedi˙er- enceofantiholomorphicandholomorphicenergiesis E A ( u ) E H ( u )= R T K (Eq.2.5).Using randomlinearcombinationsofthe30lowestvectorsphericalharmonics,weevaluatethedi˙erence ofourdiscreteenergies E A and E H for 100 vector˝elds(withnormalizedcoordinatesateachver- tex),dividedby ˇ ;weindicateboththemeanandthestandarddeviationofthese 100 integrations. Onvariousmeshes(ofgenus 0 and 2 ),ouredge-basedevaluationsexhibitsigni˝cantlylowererrors thanallotherarea-basedestimations,includingresultsfrom[1]. 70 CHAPTER5 DISCRETE2-TENSORFIELDSONTRIANGULATIONS 5.1Introductionandrelatedwork Whilescalar(rank- 0 tensor)andvector(rank- 1 tensor)˝eldshavebeenstaplesofgeometryprocess- ing,theuseofrank- 2 tensor˝eldshassteadilygrownoverthelastdecadeinapplicationsranging fromnon-photorealisticrenderingtoanisotropicmeshing.Unliketheirlowerrankcounterparts, thereiscurrentlynoconvenientwaytoperformcomputationswitharbitrary 2 -tensor˝eldsontri- angulations.Inthischapter,wepresentacoordinate-freerepresentationofrank- 2 tensorssuitable fortensorcalculusontrianglemeshes.Derivedfromanorthogonaldecompositionofplanar 2 - tensor˝elds,ourresultingdiscretetensorsextendthenotionofdiscretedi˙erentialforms,andare thuscompatiblewithdiscreteor˝nite-elementexteriorcalculusinthattheyde˝nepairingandinner productsofarbitraryforms.Additionally,pervasivediscretegeometryprocessingtoolssuchasthe weightedLaplace-Beltramioperatorareshowntobespecialcasesofourconstruction,whilenew operatorssuchasthecovariantderivativeofdiscrete 1 -formsemerge. Analysisandvisualization. Visualizationof˛uidmotionisoftenachievedbyanalyzingthegra- dientofthevelocity˝eld[94].This 2 -tensor˝eldisoftensplitintoanantisymmetricpartcon- veyingvorticity,andasymmetricpartthatcanbedepictedviastreamlinestangenttotensoreigen- vectors[95].Auni˝edanalysisofarbitrary 2 -tensorswasproposedin[96]basedoncomplex eigenvaluesandeigenvectors.Zhangetal.[97]used,instead,ageometricdecompositionof 2 - tensorsleveragingthetraceoperator,whichwaslaterillustratedasacombinationofstreamlines andglyphs[98].Incontrast,ourworkintroducesaneworthogonaldecompositionofplanar 2 - tensor˝eldscompatiblewithdiscreteexteriorcalculus. 71 Metrics. ThemetrictensorofaRiemanniansurfaceis,itself,asymmetrictensorthatde˝nes thelengthof,andanglebetween,tangentvectors.Whilemostgeometryprocessingmethodsuse thecanonicalmetricofameshinducedbyitsEuclideanembedding,onecanuseasetofedge lengthstoencodepiecewise-Euclideanmetrics[99,100,101].However,highdegreesofanisotropy mightnotberepresentablewithpureedgelengthsastheymightnotful˝llthetriangleinequality everywhere[76,102].Recently,anotionofdiscretedivergence-freemetrictensorintheplanewas introducedin[78](representingstresstensorswithinmasonrystructures)throughnotonlyedge lengthsbutalsoadditiveweightsperverteha˙ectboththediscreteHodgestarandthe Laplacianoperator.Thisaugmentedmetricwasfurtherextendedtosurfacemeshesin[103].Our approacho˙ersageneralizationofthisdivergence-freecasetoarbitraryrank- 2 tensors. Elasticity. Decompositionsofdi˙erential 2 -tensorssuchasstressandstrainareparticularlyrel- evantinelasticity[75].Arnoldetal.[104]proposedtensorsubspaces(includingdivergence-free tensors)thatformanexactchaindubbedthe elasticitycomplex .Thissequencefurtherservedasthe basisfordiscretizingplanarsymmetric 2 -tensor(stress)˝eldsthroughmixed˝niteelements[105] ornon-conformingelements[106].Extensionstotetrahedralmesheswereproposedin[107,108]. Alsointheelasticitycontext,Kansoetal.[109]expressed 2 -tensor˝eldsasquadratictensorprod- uctsofWhitney 1 -forms.Whilepreviousmethodsrequirehighorder˝nite-elementspaces,we discretizearbitrary 2 -tensor˝eldsthroughdirectdi˙erentiationofpiecewise-linearWhitneybasis functions,whichleadstoclosed-formexpressionsfordiscretetensorcalculusontriangulations. 5.1.1Notations Wewillmakeuseofafewspeci˝cnotationsinthischapter. Continuoussetup. Wedenoteby M asmoothandcompactRiemannian 2 -manifold,possibly withboundaries @ M ,andendowedwithametric g thatprovidesaninnerproducton(tangent) vector˝elds.Wealsousethenotionof k -forms( k =0 ; 1 ; 2 ),alongwiththeirrespectiveinner 72 products h :;: i k ,andtheoperators d and ? ontheseforms[72].Wedenoteby theLaplace-Beltrami operatoronfunctions.Fromthemetric,onecanconvertavector˝eld v intoanequivalent 1 -form ! usingthe˛at( [ )operator,i.e., v [ = ! ;similarly,a 1 -formisconvertedintoitsequivalentvector ˝eldbythesharp( ] )operator,i.e., ! ] = v .Wecall T thespaceoftensor˝eldsofrank (0 ; 2) on M , i.e., 2 -tensorsactingonvector˝elds.Wealsode˝nealocalbasisoftensorsinagivencoordinate frameas: I = 10 01 ;J = 0 - 1 10 ;B = 01 10 ;C = 10 0 - 1 : Wewritetheareaformof g as g = p det g J t ,andtheHodgestaron 1 -formsas ? = p det g J g - 1 , indicatingarotationby ˇ= 2 inthetangentplanewhenappliedtoacovector.Finally,the(Frobenius) innerproducton 2 -tensor˝eldsis: 8 ˝ 1 ;˝ 2 2T ; h ˝ 1 ;˝ 2 i F = Z M tr( ˝ t 1 g 1 ˝ 2 ) g ; (5.1) where tr( ˝ )= ˝ ij g ij indicatesthetraceoperatoron 2 -tensors. Figure5.1 Notationsfordiscretesetup. Discretesetup. Whendealingwithadiscretesurface,weuseanorientable,compact,and2- manifoldsimplicialcomplex M in R 3 ,ofarbitrarytopology(possiblywithboundary @M ).We call V thesetofallitsvertices,whilethecorrespondingedgeandfacesetsaredenotedby E and F .Eachedgeandtrianglecarriesanarbitrarybut˝xedorientation(indexordermatters;e.g., ij hastheoppositeorientationas ji ),whileverticeshavepositiveorientationbyconvention.Vertices aregivenpositions P = f p i 2 R 3 g ,whichde˝nethesurfacethroughlinearinterpolationovereach simplex.TheresultingEuclideanmeasuresofedgesandtrianglesaredenotedby l ij (length)and 73 a ijk (area),wheretheindicesrefertothevertexindices,andweassumethesetobeallnonzero.We denoteby ijk theanglebetweenedges ij and jk ofatriangle ijk (seeFig.5.1).Discrete k -forms aregivenasscalarson k -cells[4].Moreover,weindicateas d 0 thetransposeoftheincidence matrixofverticesandedges( jEj rows, jVj columns),inwhicheachrowcontainsasingle +1 and 1 fortheendpointsofagivenedge(thesignbeingdeterminedfromthechosenedgeorientation), andzerootherwise;andby d 1 thetransposeoftheincidencematrixofedgesandfaces( jFj rows, jEj columns),with +1 or 1 entriesaccordingtotheorientationofedgesasonemovescounter- clockwisearoundaface.WealsouseWhitneybasisfunctionsfordiscreteforms[18],indicated as ˚ i (theusualpiecewiselinear˝nite-elementfunctionwith ˚ i ( p i )=1 , ˚ i ( p j )=0 )for 0 -forms, ˚ ij = ˚ i d˚ j ˚ j d˚ i for 1 -forms,and ˚ ijk =2 d˚ i ^ d˚ j for 2 -forms.Bysharpening 1 -formbasis functionswiththepiecewiseEuclideanmetric,wegetthecorrespondingbasisfunctionsforvector ˝elds ˚ ˚ ˚ ij = ˚ ] ij = ˚ i r ˚ j ˚ j r ˚ i .Hence,ourdiscretetreatmentwillrepresentavector˝eld u and itsassociated 1 -form = u [ throughthesameedgevalues ij ,i.e.,through u = P ij ij ˚ ˚ ˚ ij and = P ij ij ˚ ij . 5.2TensorFieldsover 2 D EuclideanSpace WenowcombinethethreeBerger-Ebindecompositionsdescribedinandderiveanew coordinate-freedecompositionof 2 -tensor˝eldsforthecaseofacompactregion M in R 2 with boundaries @ M andEuclideanmetric( g I ).Thecontinuouspicturewepresentherewillbeat thecoreofourdiscreteapproachtodealwith 2 -tensor˝eldsonarbitrarytriangulations.Noticethat di˙erentialoperatorssimplifyconsiderablyfortheEuclideantheHodge-starandthe areaformreduceto ? J and g J t ,respectively.Yetwekeepouroriginalnotationinorderto discussextensionsandlimitationsofourresultsforcurvedsurfaces. Killingdecomposition. Supposethata 1 -form ! isexpressed,viaHodgedecomposition,as ! = df ?dg h ,where f and g arescalarfunctions( df and ?dg represent,respectively,the 1 - formsassociatedto r f and J r g ),and h isaharmonic 1 -form.ItsKillingoperator K ( ! ) canbe 74 decomposedbylinearityintotermsthataremutuallyorthogonalwithrespecttotheFrobeniusinner onlyintheplane,butalsoforsurfacesofconstantGaussiancurvatureasshownin App.B.1: K ( ! )= K ( df ) K ( ?dg ) K ( h )=Hess( f ) Tr 0 ( g ) r h: (5.2) Onecancheckthat K ( df ) reducestotheHessian Hess( f ) . . = r df ofthefunction f ,whiletheterm K ( ?dg ) isalwaysethusdenoteitas Tr 0 ( g ) .Theterm K ( h ) issimplythecovariant derivative r h duetotheharmonicityof h . ConjugateKillingdecomposition. Inasimilarfashion,the ? -conjugateversionoftheKilling operator K ( ! ) can,itself,bedecomposedas: K ( ! )= ? Hess( f ) ? - t ? Tr 0 ( g ) ? - t ? r h? - t : (5.3) Wenoteherethatthetracelessandharmonictermsintheplaneareinvariantby ? -conjugation;i.e., Tr 0 ( g )= ? Tr 0 ( g ) ? - t and r h = ? r h? - t . Completedecomposition. UsingEqs.(2.7),(5.2)and(5.3),andrecallingthatdivergence-free tensorscanbeexpressedas ? -conjugatedHessians[110],weconcludethatanarbitrary 2 -tensor˝eld ˝ intheplaneisorthogonallydecomposedintoantisymmetric,divergence-free,curl-free,traceless, andharmonicparts: ˝ = 2A z }| { s g |{z} 2 -form 2S z }| { Hess ( f ) | {z } curlfree ? Hess ( w ) ? - t | {z } divfree Tr 0 ( g ) | {z } traceless ? r h? - t | {z } harmonic ; (5.4) wherethescalarfunction s describestheantisymmetricpartofthetensor˝eld,andthethreescalar functions( f , g and w )plusaharmonic 1 -form h encodethespaceofsymmetrictensors.Thereby, weobtaina completecharacterizationofplanar 2 -tensor˝elds ,whichonlyrequirescoordinate-free scalarfunctions f , g , w ,and s . Wefurthernoticethatanyconstanttensoroftheform aI + bB + cC canbeexpressedasthe Hessianofaquadraticfunction f or w .Similarly,aconstanttensor pJ + bB + cC canbeassociated 75 tothecovariantderivativeoftherotatedgradientofaquadraticfunction g .Wecanthususethethree constantscaling a , b ,and c toencodeasymmetrictensor˝eld,andthenrewriteEq.(5.4) inamoreconciseform: ˝ = sJ + aI + bB + cC + K ( df + ?dg )+ K ( dw + h ) : (5.5) Separatingtheseconstanttermswillbeshownusefulinourtreatmentof2-tensorsondiscretenon- ˛atsurfacesin Finally,itbearsrepeatingthatEq.(5.4)isonlyvalidfortheEuclideanmetric( g I ).Moreover, whiletheBerger-Ebindecompositionspresentedinarevalidforanysmoothmanifold,we showinApp.B.1thatthevariouspartsoftheKillingoperatorinEq.(5.2)aremutuallyorthogonal onlyonsurfacesofconstantGaussiancurvature.Toourknowledge,thereisnoknowngeneral coordinate-freedecompositionof 2 -tensorsonarbitrarysurfaces. 5.3TensorFieldsoverTriangulations Wenowleverageourcontinuousdecompositionof2-tensor˝eldsintheplanetorepresentdiscrete 2 -tensor˝eldsonarbitrarytrianglemeshesvia local,discrete 0 - and 1 -forms . 5.3.1Discreteantisymmetric 2 -tensors Di˙erentialformsareknowntobeconvenientlydiscretizedusingtheconceptof cochains de˝nedin AlgebraicTopology[111],andcanbeinterpolatedthroughWhitneyformbases[18].Theresulting discretedi˙erentialforms[4]andtheirmostrelevantoperators[65]arewelldocumentedbynow. Inparticular,Hodgedecompositionofarbitraryformscarriesveryneatlyintothediscreterealm inacoordinate-freefashion.Thecaseofdiscrete 2 -formsisaparticularlysimplesubsetofthis discretetheory:a 2 -form asusedinEq.(2.7)issimplyencodedasitsintegrationovereachface ijk ijk = Z ijk (5.6) 76 Thisisequivalenttostoringascalar s ijk perfaceasadiscretizationoftheantisymmetricpartin Eq.(5.5),with s ijk = ijk =a ijk .NotethatthisvaluecanbefurtherdecomposedusingtheLaplacian ofadual 0 -form q andaconstant 2 -form p asindicatedinFromthissetofscalar-per-face ijk ,adiscretedi˙erential 2 -formcanbeinterpolatedthroughface-basedWhitneybasisfunctions as P ijk ijk ˚ ijk : 5.3.2Discretesymmetric 2 -tensors Unliketheantisymmetriccase,symmetrictensorsarenotentitiesthataredirectlyrablethus adi˙erentdiscretizationapproachmustbeadopted.Weintroducea˝nite-dimensionalrepresenta- tionofsymmetrictensorsviaadiscreteversionofEq.(5.5). Figure5.2 Encodingunitfordiscretetensorrepresentation. Weuse onepatchperedge ij de˝ned asthetter˛yscontainingthetwotrianglesadjacentto ij andtheirimmediateneighbors (top),aswellas onepatchperface ijk de˝nedasthefaceanditsimmediate˛aps(bottom). Encoding. Weproposetorepresentdiscretesymmetric 2 -tensor˝eldsonarbitrarytriangle meshesbyencodingtheformsinvolvedinthedecompositionofEq.(5.5)oversmall,developable patches(seeFig.5.2).Foreachedge-centeredandface-centeredpatch,westorealocalapprox- imationofacontinuoustensor˝eldasvaluesperorientedsimplex( w i and f i atnodes,values 77 g ijk attriangles,andharmonic 1 -formvalues h ij atorientededges)fromwhichwewillbeableto derivethesymmetrictermsofEq.(5.5).Thisform-baseddiscretizationchoiceisguidedbythe usualalgebraictopologytoolsofDEC/FEECandtheresultingdiscreteHodgedecomposition[4]: inparticular,itfaithfullydiscretizesthecontinuous 1 -forms df + ?dg and dw + h as d 0 f + F - 1 d t 1 g and d 0 w + h ,where F isadiscreteHodgestar.Notethatwedonotneedtoexplicitlyencodethe constants a;b; and c since,aswediscussedintheycanbeincorporatedinthescalar˝elds f;g;w ,and s . Interpolation. Aswewishtoprovideadiscretetreatmentof 2 -tensorsthatisfullycompatible withDEC,theuseofWhitneyformbasisfunctions[18]ismostappropriate:theyprovidelow order,intrinsicinterpolationofourdiscreteformsthrough f = P i f i ˚ i , g = P i g ijk ˚ ijk ,and h = P ij h ij ˚ ij .Withthispiecewisecontinuousreconstructionofformsovereachpatch,wecan formallyevaluatethelocaltensor˝eldapproximationforallpatchesaswedescribebelow.However, ouruseofpiecewiselinearbasisfunctionsisnotamenabletoproperlycapturelocallyconstant2- tensors:whileaquadraticfunction f hasaconstantHessian,apiecewise-linearapproximationof f failstoful˝llthisproperty.Wethusbeginourtensorreconstructionbyextractingalocalmean tensorperpatch,denoted ˙ ,tofullyremedythislimitationoflow-orderforminterpolation. Extractinglocalmeantensor ˙ . From f , g , w , h we˝rstevaluatealocalconstanttensor ˙ throughlocal˝tting.Foreachofthe 1 -forms d 0 f , F - 1 d t 1 g , h ,and d 0 w onanedge-basedorface- basedpatch,we˝ndtheleast-squares˝ttinglinear 1 -formoverthepatch:usingalocalcoordinate systemwhere x isalongtheorientededge,wecomputetheoptimalcoe˚cients f i g i =1 :: 6 ofthe 1 -form 1 dx + 2 dy + 3 ( xdx + ydy )+ 4 ( ydx + xdy )+ 5 ( xdx ydy )+ 6 ( ydx xdy ) .Themeantensor ˙ = aI + bB + cC isthenexpressedinlocalcoordinatesasasumofcontributions 3 I + 4 B + 5 C obtainedfromeach 1 -form d 0 f , F - 1 d t 1 g , h ,and d 0 w .Thisprocedurerequiresalinearleast-squares solveofsize 6 x 6 forbothedge-andface-basedpatches,andisperformedonthe˛ywhenneeded. 78 Residualedge-basedDiractensors. Thedi˙erentialtermsofEq.(5.5),representingspatially varyingtermsaroundthemeantensor ˙ ,cannowbecapturedwithineachpatchaswell.Oncewe removefromthevaluesof d 0 f , F - 1 d t 1 g , d 0 w ,and h thelinear 1 -formsfoundintheleast-squares solution,theresidualdiscreteformscanbeformallydi˙erentiatedto˝ndthecorrespondingtensor ˝eldtheyencodeovereachpatch.BecauseofourchoiceofWhitneybasisfunctions,theresulting residual 2 -tensor˝eldturnsouttoonlyincludeedgediscontinuitiesinducedbythederivativesof thepiecewiselinearbases ˚ i and ˚ ij .TheHessianof f ,forinstance,istriviallyzeroeverywhere except across edges,sincethevertex-basedbasisfunctionsarepiecewiselinearinsideeachtrian- gles,andtheirgradientsarediscontinuousacrossanedge.Similarly,thetracelessterm Tr 0 ( g ) leads todiscontinuitiesinthepiecewiselinear 1 -form F - 1 d t 1 g acrossedges.Incontrast,the ? -conjugate Hessianof w iszeroeverywhereexcept along edges.Wecanfurthercomputethetensortermcom- ingfromtheharmonic 1 -form h asadiscontinuityalongeveryedge.(Notethattheharmonicterm couldbelocallyabsorbedinthefunction w duetoPoincarélemma,therebyreducingmemoryusage ifneeded;wekeepitinourexpositionforclarity.)Therefore,ourdiscretesymmetric 2 -tensorper patchboilsdowntoaconstanttensor ˙ plusasumofimpulsetensorsonedgesexpressedas ˙ + X ij ij h t ij ( d 0 f + F - 1 d t 1 g ) e ? ij e ? ij + t ij ( d 0 w + h ) e ij e ij i ; (5.7) where e ij isthenormalizedvectorforedge ij , ij isthelineDiracfunctionalong ij (i.e., ij ( x;y )= ( y ) with beingthe1DDiracfunctionandthe x -axisbeingalong ij ),and t ij isafunctionlinear inits 1 -formargumentsuchthat,foredge ij betweentriangles ijk and ilj , t ij = t k ij + t l ji with t k ij ( )= ij ˚ j cot ijk ˚ i cot kij =l ij + jk ˚ j ki ˚ i cot kij +cot ijk =l ij : (5.8) Theseimpulsetensorsareonlywellde˝nedinadistributionalsense,buttheywillbesystematically integratedagainstbasisfunctionsintoobtainweakformsofdi˙erentialoperators. 79 5.3.3Discussion Ourproposeddiscreteencodingcanbeseenasageneralizationofanumberofpreviousapproaches. First,ourconstantterm ˙ peredgeandperfaceisakintotheconventionalpiecewise-constant discretizationoftensors,typicallydoneperfaceorvertethemajordi˙erencethatwedo notneedtode˝nelocalframesinwhichcomponentsarestored:theyarederivedfromourlocal, coordinate-free 0 -and 1 -formsinstead.Second,edge-basedDiractensorswerealreadyidenti˝edas relevantfortriangulatedsurfaces(see,e.g.,[112,113]);however,theyweredirectlyaveragedper localneighborhoodbeforebeingusedfordi˙erentialtead,wekeeptheDirac natureofourreconstructedtensorsandformallyintegratethemtoderivedi˙erentialoperatorson scalarsandvector˝elds.Lastly,havingbothconstanttensorsandDiracedgetensorscaptures continuoustensor˝eldsbetterthanlimitingthe˝nite-dimensionalrepresentationtoonlyoneof thesetwoparts. We˝nallynotethatourrepresentationisageneralizationofthetypicalencodingofastress tensor˝eldinplanarelastostaticsviatheAiryfunction[78],whichisthesumofaparaboloidand afunction w respondingtoaconstanttensor˝eldplustherotatedHessianof w torepresent aspatially-varyingtensor˝eld.Thisaddednon-constanttermbecomesasumofDiracimpulses forlinearbasisfunctions;higherorderWhitneyelements(see,e.g.,[65,114])wouldremoveDirac distrthecostofrequiringlargerpatches. 5.4DiscreteDi˙erentialTensor-basedOperators Ourdiscrete 2 -tensoredge-basedrepresentationcannowbeharnessedtode˝nevariousoperators onvector˝eldsand/or 1 -forms.Foreachtensor-basedoperator,wepresentitsdiscreteexpression foreachofthetermsinEq.(5.5).Weintroducetheedgeintegration T k ij ofthelineDiracfunction 80 t k ij (Eq.(5.8))asthistermwillappearinmostexpressions: T k ij ( )= Z ijk ij t k ij ( ) = jk cot kij ki cot ijk + 1 2 ( d 1 ) ijk cot ijk cot kij ; (5.9) where denotesadiscrete 1 -form.Followingtheconventionfor t ij ,weuse T ij ( ) . . = T k ij ( )+ T l ij ( ) . Observethat,inthecaseofexact 1 -forms = d 0 f ,Eq.(5.9)simpli˝estothenon-conforming Laplacian[15]of f restrictedto ijk .Consequently,theterms T ij returnzeroforanylinearfunction f .Foraboundaryedge ij ,weset T ij tozeroinordertoimplementNeumannboundarycondition. 5.4.1DiscretegeneralizedLaplacian r ( ˙ r ) AsmentionedintheLaplacianoperatoroffunctions,commonlyusedingeometryprocess- ing,isaparticularcaseofageneralfamilyofdi˙erentialoperatorsonfunctions ˙ ( z )=d iv ( ˙ r z ) where ˙ isasymmetric 2 -tensor˝eld[68].Wecande˝neitsweak(integrated)formonadiscrete scalarfunction z = P j z j ˚ j as h ˙ ( z ) ;˚ i i 0 = X ij ( z j z i ) Z M ˙ ( r ˚ i ; r ˚ j ) . . = X ij ( z i z j ) H ˙ ij : (5.10) ThisgeneralizedLaplacianoperatorondiscrete 0 -formscanthusbeexpressedasa jVjjVj matrix oftheform ˙ = d t 0 H ˙ d 0 ; (5.11) where H ˙ isadiagonal jEjjEj matrix.Itscoe˚cients H ˙ ij canbeevaluated inclosedform forthe varioustypesof ˙ presentedinEq.(5.5)asspelledoutinApp.B.3. Wepointoutthat H Id matchesthediagonalHodgestar F D [115]traditionallyusedinmeshpro- cessing(wewilldiscussdiscreteHodgestarapproximationsfurtherinAlso,theresulting ellipticoperator Id reducestotheusualcotan-Laplacianoperator[116].Moreover,forthecase of ˙ = ? Hess( w ) ? - t ,thematrix H ˙ correspondstotheextratermsusedinthe weightedLaplacian operator [117,118].Ourformulationthusextendsthisoperatortoarbitrary 2 -tensors,anddueto 81 ourdeliberatechoicetousetheconjugatedformoftheharmonicpartinEq.(5.4),ourgeneralized Laplacianfor ˙ = r h veri˝esthelinearprecisionofitscorrespondingcontinuousoperator[78]. Ellipticity. Inthecontinuoussetting,thegeneralizedLaplacianis(semi-)elliptici˙thesymmetric 2 -tensor ˙ ispositive(semi-)de˝nite(PSD).Afullcharacterizationofellipticityofourresulting discretegeneralizedLaplacianiscurrentlyunknown,butmanysu˚cientconditionscanbe(and havebeen)formulated.First,noticethatatraceless 2 -tensorcannotbePSDsincethesumofits eigenvaluesiszero.Forthecase ˙ =Hess( w ) ,asimplesu˚cientconditionontheweightswas o˙eredin[117],anditremainsvalidinoursetup.Forallothercases,onecandirectlycheckwhether thediscreteoperator H ˙ ispositivede˝nitebytestingdiagonaldominanceandnon-negativity. 5.4.2Pairingthroughdiscretetensors Discretesymmetrictensorscanalsobeusedtopairwithvector˝elds.Theintegralofthispairing, calledtotalpairing,becomesan jEjjEj operatoronedgevaluessince: h ;˙ ] i 1 = Z M ˙ ( # ; # )= X ij;kl ij kl Z M ˙ ( ˚ ˚ ˚ ij ;˚ ˚ ˚ kl )= t M ˙ ; where ; arediscrete 1 -formscorrespondingtothevector˝elds # ; # : Thematrix M ˙ istypi- callyreferredtoasthe(generalized) massmatrix .App.B.4listsalltheclosed-formexpressionsof thepairingmatrix M ˙ forthetermsofourdecompositioninEq.(5.5). Innerproductswithsymmetrictensors. Aparticularlyimportantcaseofpairingthroughasym- metric 2 -tensor ˙ isthenotionofinnerproduct,when ˙ ispositivede˝nite.Asinthegeneralized Laplaciancase,necessaryandsu˚cientconditionsonthescalarfunctions f and w toinducea positivede˝nitematrix M ˙ arenottrivialtoformulate.However,asimplecheckofthediagonal dominanceandnon-negativenessof M K and M K provideastraightforwardnumericalcharacter- izationofinnerproducts.Notethatthemassmatrixfor ˙ Id istheinnerproductofWhitney 1 -formbasisfunctions,dubbedtheGalerkinHodgestar F G [115]. 82 Crossproductswithantisymmetrictensors. We˝nallypointoutthatwhen ˙ ispurelyanti- symmetric(correspondingtothecase ˙ = inEq.(B.4)),thetotalpairingbecomesanintegrated crossproductbetweenthetwovector˝eldsweightedbythefacevalues ijk . 5.4.3Trace Thediscretetracecanalsobede˝nedthroughaweakformbasedonourdiscretetensors,resulting inavaluepervertex: [ tr ˙ ] i = h ˚ i ; tr( ˙ ) i 0 : Discreteantisymmetrictensorsthushavezerodiscretetrace,asinthecontinuousworld.Fora discretesymmetrictensor ˙ equaltothesuminEq.(5.7),andusing R ijk ˚ i ˚ j g = a ijk = 12 and R ijk ˚ 2 i g = a ijk = 6 ,we˝nd: tr ˙ = d t 0 H Id d 0 w + d t 0 M Id !: The˝rsttermisthe(primal)cotan-Laplacianof w atvertex i .Theremainderiselucidatedbynoting thatadiscrete 1 -form ! isnaturallysplitbasedonthediscreteHodgedecompositioninducedby theGalerkinHodgestar( M Id = F G de˝nedinEq.(B.4))as: ! = d 0 f + M Id 1 d t 1 g + h; where h isclosedandcoclosed,i.e., d 1 h =0 and d t 0 M Id h =0 .Sinceweknowthat d t 0 d t 1 isnull, thesecondtermsimpli˝estothecotan-Laplacianof f ,whilethediscreteversionsofthetraceless termsofthecontinuousdecomposition(Eq.(5.4))arezerowiththisdiscretetraceoperator.Thus, thediscretetracerecoverstheexactsametwonon-zerotermsasitscontinuouscounterpart. 5.4.4ChoiceofdiscreteHodgestars ThecontinuousHodgestarcanbeapproximatedinthediscretesettinginvariousways.Inour setupwherediscretevector˝eldsand 1 -formsareexpressedusingedgevaluesandWhitneybasis functions,themostnaturaldiscreteHodgestarisarguablytheGalerkinHodgestar F G M Id (Eq.(B.4)).However,thediagonalHodge F D H Id (Eq.(B.2))isasparseralternativeoften 83 preferredingraphicsasito˙ersalesscomputationallyintensiveapproparticular,the discreteHodgedecompositionforthissparsestarnowonlyinvolvesdiagonalmatrices.Infact, thesetwoHodgestarsarewell-knowntoberelatedinthesensethattheprimalLaplacianisthe samewhetherGalerkinordiagonalapproximationisused[115],i.e., d t 0 F D d 0 = d t 0 F G d 0 .Our extensionsof F D and F G toarbitrarysymmetric 2 -tensors(resp., H ˙ and M ˙ )preciselymaintain thispropertyasweproveinApp.B.2.Wethusnotethatonecanoptforeitherone,buttheuseof thecomputationally-attractivediagonalapproximationlosesthetracelesspropertyofthetermsin g and h describedinsince HM - 1 nolongersimpli˝es. 5.5Applications Wenowemployourdiscretedi˙erentialtensor-basedoperatorstoderivecomputationaltoolsfor covariantderivative,Liebracket,andanisotropicgeodesicsontrianglemeshes. 5.5.1Discretecovariantderivative Thecovariantderivativeprovidesageneralizationofdirectionalderivativesonarbitrarysurfaces. Withthisconcept,onecanmeasuretherateofchangeofa 1 -form alongavector˝eld ] (asso- Figure5.3 Discretecovariantderivativeforplanarmeshes. Covariantderivativeofa 1 -form = 2 xydx x 2 dy (top-left)along = dx (bottom-left)foraplanarmeshwithconcaveboundary. Resulting 1 -form ! hasanumericalresidualw.r.t.theanalyticalsolutionof 0 : 7% (center, jVj =173 ) and 0 : 1% (right, jVj =609 ),respectively.Vector˝eldsaredisplayedbyinterpolating 1 -formsat trianglebarycenters. 84 ciatedtoa 1 -form )asthecontractionof ] withthe 2 -tensor r : r ] . . =( r ) ] = !; where ! istheresulting 1 -form.Inthediscreterealm,wemakeuseofthepiecewiselinearbasis function ˚ ij toevaluatethedirectionalderivativeinaweakformas: 8 ij; h ˚ ij ;! i 1 = h ˚ ij ; ( r ) ] i 1 : ByleveragingEq.(2.13)andthemassmatricesderivedinweconvertthisweakformulation intoasparselinearsystem: M Id ! = M K ( ) 1 2 M d 1 ; (5.12) Therefore,wede˝nethediscretecovariantderivativeofthe 1 -form asthematrix: r = M Id 1 M K ( ) 1 2 M d 1 : Notethatthemassmatricesarecomputedbycombiningthemeantensor ˙ extractedfrom ineach patch,theedge-basedresidualtensorde˝nedby ,andtheantisymmetrictensor d 1 .Matrix M Id issparse,positive-de˝nite,anddependsonlyonthetrianglemesh,itcanthusbee˚cientlypre- factorized(ourimplementationuses eigen [119]).Onecanthencomputedirectionalderivatives fordi˙erent 1 -forms throughsimplesparsematrix-vectormultiplicationandbacksubstitution. Fig.5.3illustratesadirectionalderivativeonaplanarmeshwithconcaveboundariesforthecase = 2 xydx x 2 dy and = dx .Theresultingdiscrete 1 -form ! providesanapproximationofthe analyticalsolutionwitharelativeerrorof 0 : 7% foracoarsemeshand 0 : 1% fora 4 x˝nermesh. Fig.5.4exempli˝estherobustnessofthediscretecovariantderivativetomesheswithvariableres- olution(eveninthepresenceofobtuseangles),whileFig.5.5showsdirectionalderivativeson surfacesofcomplexshapeandnon-trivialtopology.Finally,Fig.5.9presentsconvergencetests ofourresultswithsymmetricandasymmetrictensor˝elds;werestrictedouranalysistoadisk,a planarconcavemeshandasphere,sincetheirdirectionalderivativeshaveknownanalyticalexpres- sions.WealsotestedthecontributionoftheimpulsetensorsinEq.(5.7)versususingsimplythe meantensor ˙ perpatchinourcomputations,andobservedasystematicdecreaseintherelative residualfrom 2% to 27% dependingonthetensor˝elds. 85 Figure5.4 Discretecovariantderivativeforspheremeshes. For 1 -forms =sin( ) (topleft) and =sin( ) d˚ (bottomleft)(expressedinsphericalcoordinates),ourdiscretecovariantderiva- tive ! = r ] onanirregularmesh(center)isconsistentwiththeresultonauniformmesh(right) (meshesshownasinsets).Vector˝eldsdisplayedbyinterpolating 1 -formsatbarycentersofasubset oftriangles. Figure5.5 Discretecovariantderivativeonmeshesofarbitraryshapeandtopology. Wechose (top)and (bottom)asthesmoothest 1 -formsfromthe 1 -formLaplacian[4].Centralimages showtheresulting 1 -form r ] ,visualizedwithsampledintegralcurves(bunny)andlineintegral convolution[5](twistedtorus). 5.5.2DiscreteLiebracket OurdiscretetreatmentofthecovariantderivativealsoleadstoaLiebracket(alsoknownasthe commutator)ofvector-˝elds.By˛atteningvector˝eldsto 1 -forms,theLiebracketoftwo 1 -forms 86 Figure5.6 Anisotropicgeodesicsonplanarmeshes. Ourtensor-baseddiscretedi˙erentialoper- atorscanbeusedtocomputeanisotropicgeodesics.Wetestedourmethodonadiskwithconstant tensorsofvariousanisotropyratio(fromlefttoright: 1 , 0 : 5 , 0 : 3 , 0 : 2 ,and 0 : 1 ),withthelarger magnitudealongthe x -axis.Noticethattheiso-levelsstretchtoellipseswiththeanisotropyas expected. and returnsa 1 -form evaluatedas: [ ; ] . . = r ] r ] = : Fromthisde˝nition,wedirectlyreuseEq.(5.12)andcomputethediscreteLiebracket 1 -form throughasimilarsparselinearsystem.Fig.5.7validatesourdiscreteLiebracketontheus exampleproposedin[6]. 5.5.3Anisotropicheatmethod Discrete 2 -tensorsarealsosuitabletocomputeanisotropicgeodesicdistancesbasedonasimple extensionoftheheatmethod[3].ForgeodesicsinducedbytheEuclideanembeddingspace,the heatmethodrequirestwolinearsystemsolvesinvolvingthecotan-Laplaceoperator:the˝rststep di˙usesanimpulseheatfunction z 0 isotropicallyforashorttimeinterval intoafunction z ,while thesecondstep˝ndsthepotential whosegradientbestapproximatesthenormalizedgradientof z underthesurfacemetric.Weinsteadproposetoreplacetheisotropicdi˙usioninthe˝rststepby ananisotropicdi˙usion[77]inducedbyaPSDsymmetric 2 -tensor˝eld ˙ .Wethuscomputethe function z usingthegeneralizedLaplacianoperator H ˙ (see F 0 + d t 0 H ˙ d 0 z = F 0 z 0 ; where F 0 isthediagonalHodge-starfor 0 -formsusingvertexareas[4].Wefurthersetthetime step tothesquareoftheaveragededgelengthmeasuredwithrespecttothetensor ˙ .Thesecond 87 stepremainsunchanged,solvingforthepotential basedonthecotan-Laplacianmatrix d t 0 H Id d 0 . Forboundaryconditions,weusedRobinboundaryconditionsasadvocatedin[3]. InFig.5.6,wedemonstratetheaccuracyofourmethodbyillustratingisodistancesforvarious anisotropyratiosonaunitdiskmesh.Wealsocomputeanisotropicdistancesdrivenbycurvaturein Fig.5.8:we˝rstcomputeanaverageshapeoperator peredgeasin[112],andsetthemeantensor ˙ to ( I +0 : 2 ) - 1 ,suchthatdistancesevolvemoreslowlyinregionsoflargecurvaturemagnitudes. 5.6FutureWork Ourdiscretesymmetric 2 -tensorsandtheirassociatedoperatorsonvector˝eldsrequirefurther numericalanalysis,justlikeusualoperatorsingeometryprocessing[120].Wearealsoinvestigating adiscretenotionofFrobeniusinnerproductconsistenttoourdiscrete 2 -tensors,withwhichone cancomputeKillingvector˝elds[20]andsmoothnessenergies[1].Finally,extendingourdiscrete treatmentof 2 -tensorstotetmeshesisanothertopicleftforfuturework. Figure5.7 DiscreteLiebracketoperator. OurdiscretenotionofLiebracketreproducesthetorus examplepresentedin[6]bothqualitativelyandquantitatively.Fortwo 1 -forms (left)and z (middle),where z isascalingfunction,theresultingLiebracket =[ ; ] (right)isparallelto , asexpectedinthesmoothcase.Pseudo-colorsindicatethenormof z and ,respectively. 88 Figure5.8 Anisotropicgeodesicsonsurfacemeshes. Anisotropicgeodesicscanbecomputed guidedbythecurvaturetensorofasurface.Left:isotropicgeodesicdistancegeneratedbytheheat method[3].Right:anisotropic(curvature-aware)geodesicdistancecomputedwithourgeneralized Laplacianoperator(see Figure5.9 Convergenceoftheerrorplot. Errorplotinlog-logscaleoftheresidualofthediscrete covariantderivativew.r.t.itsanalyticalsolution,indicatinglinearconvergenceondi˙erentmeshes. Foradiskmesh(left)andaconcaveshape(middle),weanalyzedfourscenarios:[inblue] = ( x y ) dx +( x + y ) dy , = xdx + ydy , r ] =( x y ) dx +( x + y ) dy ;[inpink] = 2 xydx x 2 dy , = dx , r ] = 2( ydx + xdy ) ;[inyellow] = sin (2 x ) dx + cos (2 y ) dy , = cos (2 x ) dx , r ] = 2 cos (2 x ) 2 dx ;[ingreen] = x 2 dx 2 xydy , = dx , r ] =2( xdx ydy ) .Forthesphere(right),we evaluatedthreecaseswhichare,insphericalcoordinates,[inblue] = sin (2 ) , = cos (2 ) , r ] =2 cos 2 (2 ) ;[inpink] = sin (2 ) d˚ , = cos (2 ) , r ] =2 cos 2 (2 ) d˚ ;[inyellow] = sin (2 ) + sin (2 ) d˚ , = cos (2 ) , r ] =2 cos 2 (2 ) +2 cos 2 (2 ) d˚ .Errorsmeasured usingonlythemeantensor ˙ (withnoedge-basedresidualtensors)canbeupto 27% larger. 89 CHAPTER6 SPECTRALVECTORCALCULUSFORVARIATIONALFLUIDSIMULATION 6.1Introduction Inthepreviouschapters,wediscussedspatialrepresentationsofvector˝eldsandtensor˝elds.Such representationsmayleadtocostlyprocessingproceduresforvector˝eldsthataretime-dependent, e.g.,in˛uidsimulation.Thus,inthischapter,wefocusinsteadonadrasticallydi˙erentspectral representationofvector˝elds,theassociatedoperatorsonsuchrepresentations,andtheresulting e˚cientupdaterulesin˛uidsimulation. Whilecurrentresearchofincompressible˛uidsimulationmainlyfocusesonachievingrealistic visuale˙ectswithminimumcomputationcost,thisrelentlessquestfore˚ciencyhasoftenresulted intimeintegratorsthatexhibitlargenumericalviscosity[36],astheyproceedviaoperatorsplitting throughadvectionfollowedbydivergence-freeprojection.Theincurrednumericaldissipationhas also,besidesitsobviousvisualartifacts,theunintendedconsequencethatpreviewsoncoarsespatial andtemporalresolutionsarefarfrompredictiveofthe˝nal,high-resolutionrun.Non-dissipative methodshavebeenproposedmorerecently[40];however,theyrequirelarge,non-linearsolves, hamperinge˚ciency.Ontheotherhand,model-reducedintegrators[121]manipulateasmaller setofdegreesoffreedomfoundviaGalerkindimensionreductiontocapturethemaincomponents ofthe˛owe˚ciently,atthecostofexcessivevorticitysmearing.Similarly,regularspatialgrids areoftenpreferredduetotheirsigni˝cantlylighterdatastructuresandsparserset,their usecon˛ictswiththepropertreatmentofboundaryconditionsovercomplex,non-grid-aligneddo- mains.WhilepressureprojectionwithsubgridaccuracyhavebeenrecentlyproposedonCartesian grids[44,7],non-dissipativemethodsstillrequireboundary-conformingmeshes. Inthischapter,leveraginganovelspectralanalysisoftheDECstylevector˝eldrepresenta- tion,weintroduceavariationalmodel-reducedEulerian˛uidsolverwithsub-gridaccuracywhich 90 Figure6.1 3Dbunnybuoyancytest :Ahotcubeofairinitiallylocatedatthecenterofa3Dbunny- shapeddomainisadvectedthroughbuoyancy.Computationswereperformedusingamodi˝ed Hodgestarona 42 42 32 grid,withonly 100 modes. bypassesthetraditionalnumericalcursesofGalerkinprojecteddynamics,whilekeepingthee˚- ciencyofCartesiangrid-basedsimulation.Ourcontributionsarenumericalinnature.Theydonot targetimprovementsinvisualcomplexity,butine˚ciency(throughembeddingofarbitrarybound- ariesonCartesiangrids,generality(arbitraryreducedbasescanbeemployed,and controllability(energycascadingandviscosityareconsistentacrosstemporalandspatialscales, 6.1.1Relatedworkformodel-reductionmethods WhilemostEulerianmethodsusea˝nite-dimensionaldescriptionofthe˛uidusingDOFsoncell facesorcenters,modelreductionwasintroducedinane˙orttoapproximatethe˛uidmotionus- ingonlyasmallnumberofbasisfunctions.Theearlydaysofcomputational˛uiddynamicsfor atmosphericsimulationproposedtoreducecomplexitybydiscardinghighfrequenciesthroughthe useofalownumberofmodes(typically,harmonicsorsphericalharmonics)todescribethevector 91 ˝eld[122,123],whilepseudo-spectralmethodsleveragedfastconversionbetweenmodalcoe˚- cientsandspatialrepresentationviatheFastFourierTransformforhighlysymmetricdomains[124]. Dimensionalityreductionwas˝rstintroducedfor˛uidanimationbyTreuilleetal.[121]through Galerkinprojectionontoareducedsetofbasisfunctionscomputedthroughprincipalcomponent analysisofatrainingsetof˛uidmotions.Theirmethodwasdemonstratedonregulargrids,butis generalizabletotetrahedralmeshes.Anumberofworksfollowed,proposingtheuseofdi˙erent basessuchasLegendrepolynomials[125],trigonometricfunctions[126],orevennon-polynomial Galerkinprojection[127];eventually,Laplacianeigenvectorswerepointedoutby[9]tobepartic- ularlyappropriateharmonicsastheyguaranteedivergencefree˛owsandfacilitatetheconversion betweenvorticityandvelocity,whileo˙eringasparseadvectionoperatorforsymmetricdomains. Theseeigenfunctionsalsoalloweasyimplementationofviscosity,andeliminatetheneedfortrain- ingsetsofvelocity˝elds.Forsimulationsinvolvingmovingsolids,modelreductioncanalsobe conductedonamovinggrid[128].Theuseofcubature,initiallyproposedtoachievemodel-reduced simulationofelasticmodels[129,130,131],canspeedupre-simulationof˛uidsinareducedsub- spaceaswell[132].However,thegainine˚ciencyofallsuchmodel-reducedsimulationsisoften counterbalancedby(attimessevere)energyorvorticitydissipationandtheneedforunstructured meshestocapturecomplexboundaries. 6.2RecapofVariationalEulerianIntegration Inordertoprovide˛uidsimulationswithstablelong-termbehavioracrossdi˙erentspaceortime resolutions,Pavlovetal.[50]introducedavariationalintegratorfor˛uidsinEulerianrepresentation bydiscretizingthe˛uidmotionasaLiegroupactingonthespaceoffunctions,andformulating thekineticenergyonitsLiealgebra.Themotionofanincompressible,inviscid˛uidisdescribed inthecontinuoussettingbyavolume-preserving˛ow ˚ t ,i.e.,aparticlewhichisatapoint p at time t =0 willbefoundat ˚ t ( p ) afterbeingadvectedbythe˛ow.Thesetofallsuchpossible ˛owsisgivenbythesetofvolume-preservingmaps ˚ t fromthedomaintoitself.Thissethaving 92 thestructureofanin˝nite-dimensionalLiegroup,itwasdiscretizedintoa˝nite-dimensionalLie groupforcomputationalpurposes.MovingfromaLiegrouptotheassociatedLiealgebraconnects theLiegroupviewpointof˛owsandmaps[47]totheLiealgebraviewpointofvector ˝elds,aswenowbrie˛yreview. Figure6.2 Functionalmaprepresentationofthe˛uid˛ow. Wediscretizeacontinuousfunction f ( x ) onourspacebytakinganaverage(integrated)value f i pergridcell i ofthemesh,whichwe arrangeinavector f .Thisde˝nitionofdiscretefunctionsallowsustodiscretizethesetofpossible ˛ows ˚ t usinga functionalmap (orKoopmanoperator) ( f ˚ 1 t )( x )= f ( ˚ 1 t ( x )) . 6.2.1Discretizationprocess Weassumethatthe˛uiddomainisdiscretizedasamesh.Withoutlossofgenerality,werestrict ourdiscussiontoregulargridsforsimplicity,aswewillshowinSec6.3.4howtoembedarbitrary domainsintoaCartesiangrid.InFig.6.2thefunctionalmapcanbeencodedasamatrix q ofsize thesquareofthenumberofcells,representingtheactionof ˚ t onanydiscretefunction;thatis,the integratedvalues f of f percellbecome q f once f isadvectedbythe˛ow ˚ .Becausethediscrete ˛owactsasafunctionalmap,itshouldalwaystaketheconstantfunctiontoitself.Thatis,forall q ,werequirethat q 1 = 1 ; where 1 isavectorofones(see[50]fortheequivalentconditiononan arbitrarymesh).Thisisthesameassayingthattherowsumsof q areequalto 1 ,i.e., q is signed stochastic .Sincewearesimulatinganincompressible˛uid,wealsorequirethatthediscrete˛ow bevolume-preserving.Thisconditionisachievedbyaskingthatthediscrete˛owpreservesthe 93 innerproductofvectors,thatis, q is orthogonal ,i.e., q t = q 1 .Thus,we˝ndthatweneedtotake q tobeanelementoftheLiegroup G oforthogonal,signedstochasticmatrices.Thismatrixgroup representsourdiscrete˛uidcon˝guration,aswedescribenext. 6.2.2TheEulerianLiealgebraviewpoint Wecanviewthe˝nite-dimensionalLiegroup G asacon˝gurationspace:itencodesthespace ofpossibleforthediscrete˛uid,inthateachelementoftheLiegrouprepresentsa possiblewaythatthe˛uidcouldhaveevolvedfromitsinitialposition.ThisLiegrouprepresentsa Lagrangianperspectiveasitidenti˝esthe˛uidparticlesinagivencellbyrecordingwhichcellsthey originallycamefrom.TheassociatedEulerianperspectiveisgivenbytheLiealgebra g ofmatrices oftheform _ q q 1 for q 2 G .Itwasshownin[50]thatanymatrix A 2 g ofthisLiealgebraisboth antisymmetric ( A t = A )and row-null ( A 1 = 0 ),andcorrespondstoadiscretecounterpartofthe Liederivative L v withrespecttothecontinuousvelocity˝eld v = _ ˚ ˚ 1 .Thus,theproduct A f ofsuchamatrixwithadiscretefunction f approximatesthecontinuousterm v r f .Furthermore, ifcells i and j arenearestneighbors,thenthematrixelement A ij representsthe˛uxofthe˛uid throughthefacesharedbycells i and j .Thus,anelementoftheLiealgebra g of G isdirectlylinked totheusual˛ux-based(MarkerAndCell)discretizationofvector˝eldin˛uidsimulators[133]. 6.2.3Non-holonomicconstraint Whilsttheelements A ij for A 2 g haveaclearphysicalinterpretationinthecasewhere i and j are nearestneighbors,thisisnotthecaseforelementsrepresentinginteractionsbetweencellsthatare notimmediateneighbors.SimilarlytoaCFLcondition,weprohibit˛uidparticlesfromskipping tonon-neighboringcells,byrestrictingtheLiealgebratotheconstrainedset S ,thesetofmatrices A suchthat A ij =0 unlesscells i and j shareaface(oranedgein2D).Werequiretheelements of g thatweusetorepresentthe˛uidvelocity˝eldstofallintothisconstrainedset.Thishasthe additionaladvantageofmakingthematricessparse,dramaticallydecreasingtheamountofmemory 94 requiredandthecomputationaltime,asmuchfewerdegreesoffreedomneedtobe now,thetraditionalMACdiscretizationwith˛uxescorrespondsexactlytoaLiealgebraelementin thisconstrainedset. Constrainingthematricesinthiswayrequiresanon-holonomicconstraint,becausetheset S is notclosedundertheLiebracket.Thatis,interactionsbetweennearestneighborsfollowedbyfurther interactionsbetweennearestneighborsproduceinteractionsbetweencellsthataretwo-awayfrom eachother,whicharethereforenotinsidetheconstrainedset S . 6.2.4Creatingavariationalnumericalmethod Usingthisdiscretization,onecancreateavariationalnumericalmethodforideal,incompressible ˛uidsthroughtheEuler-Poincaréequations[10]fortheLagrangiangivenby L Euler = 1 2 h A;A iˇ 1 2 Z v 2 d x; (6.1) andsubjecttothenon-holonomicconstraint A 2S .Theresultingnumericalmethodexhibitsno numericaldissipation,andproducesgoodqualitativebehavioroverlongtimescales.Changingthe timeintegrationschemetobetimereversibleleadstoexactenergypreservation[40].Withcontrol overdissipationandrobustnesstotimestepandgridsize,thiscomputationaltoolgreatlyfacilitates thedesignof˛uidanimation.Notethatthisvariationalintegratoralsoguaranteesthattherelabeling symmetryimpliesadiscreteversionofKelvin'scirculationtheorem,i.e.,circulationofvelocity˝eld (representedasaLiealgebraelement)alongaclosedloop(representedasa 1 -cycle[50])transported alongthe˛uid˛owisinvariant,whichhelpskeepthevividdetailsofvorticityinthe˛uidsimulation withoutresortingtoadditionalenergy-injectingmeasuressuchasvorticitycon˝nement,asshown in[19,40].However,thetimeintegrationrequiresaquadraticsolvebasedon all the˛uxesinthe domain,makingitinappropriateforrealtimesimulation. 95 6.3Model-reducedVariationalIntegrator Wepresentanintegratorwhichextendstheapproachof[50],usingadi˙erentfunctional-mapLie group,similarlyinterlinkedwithanEulerianvelocity-basedLiealgebrapicture.Ourmethodo˙ers theadditionaladvantageoffastcomputationsonarbitrarydomains:weuse reducedcoordinates to encodethemostsigni˝cantcomponentsofthespatialscalarandvector˝elds,andperformsubgrid accurateprecomputationsonsimple regulargrids .WewillfocusonEulerequations˝rst,before discussingvariantssuchasNavier-Stokesandmagnetohydrodynamics(MHD). 6.3.1Spectralbases We˝rstde˝nethediscrete, reduced scalarandvelocity˝eldsonwhichourfunctionalmapLie groupwillact.Extendingwhatwasadvocatedin[9],weusetheorthonormalbasesfor 2 -formsand 3 -formsgivenbytheeigenfunctionsofthedeRham-Laplacianoperatorsonanarbitrarydiscrete mesh M .ThesearecalculatedusingthediscreteoperatorsofDiscreteExteriorCalculus[134,65], allowingustoleveragethelargeliteratureontheirimplementationandstructure-preservingprop- erties.Fromthissmallsetofbasisfunctions,wee˚cientlyencodethroughreducedcoordinates thefull-space˝eldstypicallyusedintheMACscheme,i.e.,˛uxesthroughcellboundaries(dis- crete2-forms)torepresentvelocity˝elds,anddensitiesintegratedineachcell(discrete3-forms) torepresentscalar˝elds(suchassmokedensityorgeostrophicmomentuminrotatingstrati˝ed ˛ow[135]). Choiceofbases. Wedenotethe i -theigenfunctionofthe3-formLaplacian 3 as i ; withasso- ciatedeigenvalue 2 i , 3 i = 2 i i : Theeigenfunctionscorrespondingtothe M 3 +1 smallest i canbeassembledintoalow-frequency basis f 0 ;:::; M 3 g : 96 Notethatdependingontheboundarycondition, 0 =0 maycorrespondtomorethanoneharmonic function;buttheseremainstationarywhenadvectedbydivergence-freevelocity˝eldswithzero ˛uxacrosstheboundary,andarethusomittedinourdiscussion. Similarly,wedenotethe i -theigenfunctionofthe2-formLaplacian 2 as i ,withitsassociated eigenvalue 2 i : 2 i = 2 i i : Wealsoassemblethe˝rst M 2 eigenvector˝elds(correspondingtothe M 2 smallest i )intoa˝nite dimensionallow-frequencybasis, f 1 ;::: M 2 g : Someofthe2-formeigenfunctionsarenotdivergence-free,andtheseeigenfunctionscanbeiden- ti˝edasgradient˝elds, r i i (seeThus,wecanreordertheeigenfunctionsof 2 into f h 1 ;:::;h 1 ; r 1 1 ;:::; r M 3 M 3 ; 1 ;::: M C g ; where h i areharmonic 2 -forms(correspondingtofrequency i =0 )with 1 beingthe˝rstBetti numberdeterminedbythetopologyofthedomain(basically,thenumberoftunnelsplusthenumber ofconnectedcomponentsoftheboundaryminusone),and M C = M 2 M 3 1 denotingthenumber ofnon-harmonicbutdivergence-freebasisfunctions. Discretization. ComputingourspectralbasesrequiresaproperdiscretizationoftheLaplacian operatorsandofboundaryconditions.Bothtopicsarewellstudied,andmanyimplementations canbeleveraged[57,136].Inparticular,wenotethatdiscreteLaplaciansaretypically integrated Laplacians,meaningthatthetwoeigenvalueproblemsmentionedabovearediscretizedastwogen- eralizedeigenvalueproblems ( ? 3 3 i = 2 i ? 3 i and ( ? 2 2 i = 2 i ? 2 i respectively,tomakethediscreteoperatorssymmetricandthusallowfore˚cientnumericalsolvers. Weprovideadetailedguidetodiscretizationon arbitraryunstructuredmeshes intoexplicate 97 howtoenforceno-transferandfree-slipconditions(corresponding,respectively,to v n j @ M =0 and @v t =@n j @ M =0 ifthecontinuousvelocity˝eldisdecomposedattheboundaryintoitsnormal andtangentialcomponents, v = v n + v t ).Notethatonlytwooperatorsarerequired:theexterior derivative d andtheHodgestar ? .The˝rstoperatorispurelytopological,whilethesecondisjust ascalingoperationperedge,face,andcell.Moreover,wewillseeinthatthislatteroperator canbetriviallymodi˝edtohandlearbitrary˛uiddomainswithouthavingtouseanythingelsebut aregulargrid.Fromthesetwooperators,bothLaplaciansareeasilyassembled,andlow-frequency eigen˝eldsarefoundviaLanczositerations. 6.3.2SpectralLiegroup Whileearliermethods[50,10]havede˝nedscalar˝eldsusingaspatialrepresentationthrough linearcombinationsoflocally-supportedpiecewise-constantbasisfunctions,weuseaspectralrep- resentationthroughlinearcombinationsoftheaforementionedspectralbasisfunctions i ,allowing ustodrasticallyreducethenumberofdegreesoffreedomtheintegratorwillhavetoupdate,while stillconformingtotheshapeofthedomain(seeFig.6.3). Liegroup. Weencodethe˛uidmotionthroughatime-varyingLiegroupelement q ( t ) thatrep- resentsafunctionalmapinducedbythe˛uid˛ow ˚ t ,mappingafunction f ( x )= P i f i i ( x ) linearlytoanotherfunction g ( x )= P i g i i ( x ) suchthat g ( x )= f ˚ 1 ( x ) : Asthefunctionspace isapproximatedbya˝nitedimensionalspacespannedbylow-frequencybasisfunctions, q canbe encodedbya ( M 3 +1) ( M 3 +1) matrix.Thevolume-preservingpropertyofthe˛owstillimplies theorthogonalityofthematrix,i.e, q t q =Id .Sowearelookingforasubgroupof O ( M 3 +1) ,or, moreaccurately,of SO ( M 3 +1) ,sincewewishtodescribegradualchangesfromtheidentity.The conditionthatconstantfunctionsaremappedtothemselvesinthislow-frequencyLiegroupbe- comes q 0 i = 0 i and q i 0 = i 0 ,where ij istheKroneckersymbol,since 0 -thfrequencyrepresents theconstantfunction.Thise˙ectivelyremovesonedimension,andtheLiegroupthatweareusing isthusisomorphicto SO ( M 3 ) .ThisismuchsmallerthanthefullLiegroupusedforthespatial 98 Figure6.3 E˙ectofshapeonspectralbases :TheLaplacianeigenvectorsdependsheavilyonthe domain .Here,rectangle(top)vs.ellipse(bottom)domains(bothcomputedon2Drectangular gridofsize 60 2 )exhibitverydi˙erenteigenvectors 10 and 10 . representation[50]whichhadadimensionproportionaltothesquareofthenumberofcellsofthe potentialreductionofseveralordersofmagnitude. Liealgebra. Weidentifyeachvelocityeigenfunction m withanelementoftheLiealgebraof theaboveLiegroupasfollows.WetaketheLiederivativealongthevelocity˝eld m ofascalar eigenfunction j ,thenweprojecttheresultingscalar˝eldontoanotherscalareigenfunction j , producingamatrix A m foreachvelocityeigenfunction m ,withentries A m;ij = Z M i m r j ) : (6.2) Computing A m amountstoturninga3-formintoadual0-form˝rstwith ? 3 ,andthencarrying outtheintegralinthe(diamond)volumespannedbyeachfaceanditsdualedge:thisway,the di˙erentialofthedual0-formfrom j ismultipliedbythe2-form m onthefaceandtheaverage dual0-formfrom i ontheface.Noticethatwehave h A m ;A n i = mn byconstructionthanksto thebasisof beingorthonormal.Asinthenon-spectralcase,thedivergence-freeconditionleads 99 totheantisymmetryofthesematricessince A m;ij + A m;ji = Z M m r i j )= Z M i j r m =0 : Thisisexpected,sincetheLiealgebra so ( M 3 ) of SO ( M 3 ) containsonlyantisymmetricmatri- ces.TheLiealgebrahasaLiebracketoperator,whichisgivenbytheusualmatrixcommutator [ A m ;A n ]= A m A n A n A m . Non-holonomicconstraint. Justlikein[50],noteveryelementoftheLiealgebra so ( M 3 ) will correspondtoa˛uidvelocityspannedbytheeigenfunctions m .Weforcethedynamicsonthe Liealgebratoremainwithinthedomainofphysically-sensibleelementsusingthefollowingnon- holonomicconstraint,whichkeepsthevelocitywithinthespacespannedbythelowestfrequency M C + 1 divergence-free2-formbasis˝elds: A = M C + 1 X i =1 v i A i (6.3) where v i isacoe˚cientfor A i representingthemodalamplitudeoffrequency i .Thislinear conditioncanthusbeseenasanintuitiveextensionoftheone-awayspatialconstraintonLiealgebra elementsusedin[50]thatwementionedin 6.3.3Spectralvariationalintegrator TheLagrangianofthe˛uidmotion(i.e.,itskineticenergyinthecaseofEuler˛uids)canbewritten as L Euler = 1 2 h A ( t ) ;A ( t ) i aswereviewedinThus,theequationofmotioncanbederived fromHamilton's(leastaction)principle Z h A ( t ) ;A i dt =0 ; (6.4) where A = (_ qq 1 ) isthevariationof A inducedbyvariationof q .Ifwedenote B qq 1 , onehas A = _ qq 1 _ qq 1 qq 1 .Since _ B = _ qq 1 qq 1 _ qq 1 ,we˝ndthat A isinducedby variationsof q onlyifitsatis˝esLin'sconstraints[10]: A = _ B +[ B;A ] ; (6.5) 100 where B = P i b i A i isanarbitraryelementoftheLiealgebrawithcoordinates f b i g i inthe 2 -form basis.SubstitutingEq.(6.5)intoEq.(6.4),wethenhave 0= Z h A;A i dt = Z X i;k v i _ b k h A i ;A k i + X i;j;k v i v j b k A i ; [ A k ;A j ] dt = Z X k X i _ v i h A i ;A k i + X i;j v i v j A i ; [ A k ;A j ] b k dt: Sincethislastequationmustbevalidforany b k ,theupdateruleforthevelocity˝eldhastobe: _ v k = X i _ v i h A i ;A k i = X i;j v i v j A i ; [ A k ;A j ] v t C k v ; (6.6) where v isthecolumnvectorstoringthecoe˚cients v i ofthediscretevelocity A (Eq.(6.3)),and C k isthesquarematrixwith C k;ij = A i ; [ A k ;A j ] = Z M ( r i ) k j ) : (6.7) Notethatthisvelocityupdatedonotevenrequirethescalar( 3 -form)basesusedinthede˝nition oftheLiegroup;however,thesebasesbecomeimportantinmoregeneralsimulations,including magnetohydrodynamicsandrotatingstrati˝ed˛ows. Timeintegrator. Thecontinuous-timeupdateinEq.(6.6)isthendiscretizedviaeitheramidpoint rule(whichwillleadtoan energy-preserving model-reducedvariantof[40])oratrapezoidalrule (whichcorrespondstoamodel-reducedvariantofthevariationalmethodof[50]).Speci˝cally,the midpointruleisimplementedas v t + h k v t k = h X i;j C k;ij v t i + v t + h i 2 v t j + v t + h j 2 ; (6.8) Theenergypreservationcanbeeasilyveri˝edbymultiplying v t k + v t + h k onbothsidesoftheabove equation,summingover k ,andinvokingthepropertyofcoe˚cients C k;ij = C j;ik .Thetrape- zoidalrulecan,instead,beimplementedas v t + h k v t k = h 2 X i;j C k;ij ( v t i v t j + v t + h i v t + h j ) ; (6.9) 101 whichisderivedfromatemporaldiscretizationoftheactionwithvariationof ( q ) q 1 for q along thepathtobeintherestrictedLiealgebraset(toenforceLinconstraints),seeApp.C.4.Both theenergy-preservingandtrapezoidalvariationalrulesaretime-reversibleimplicitmethodssolved throughasimplequadraticsetofequationswithasmallnumberofvariables.Anexplicitforward Eulerintegrationcanalsobeusedforsmalltimestepsinordertofurtherreducecomputational complexity;noguaranteeofgoodbehavioroverlongperiodsoftimeisavailableinthiscase. Discussion. Ourstructuralcoe˚cients C k (whichcanbeprecomputedoncethespectralbases arefound)aresimilartotheadvectiontermsmentionedin[9].However,therearesomeimpor- tantdi˙erences.Althoughbothexpressionsconvergetothesamecontinuouslimit,ourvariational approachproducescoe˚cientsthatareexactlyantisymmetricin j and k astheLiebracketisanti- symmetric,makingourmethodenergy-preserving without theartifact-proneenergyrenormaliza- tionstepadvocatedintheirwork.Wealsonotethatthesymmetrymentionedintheirdiscretization (speci˝cally, 2 j C k;ij = 2 i C k;ji )is,infact, only validin2DasweexplaininMoreover, ourvariationalintegratoralsoadmitsaspectralversionofKelvin'stheoremasdetailedinFi- nally,ourapproachisquitedi˙erentfromAzencotetal.[47]eventhoughthey,too,useanoperator representationofvector˝elds.Becausetheyexplicitlyleveragethescalarnatureofvorticityin2D, theirworkcannotbegeneralizedto3D.Additionally,theirrepresentationofvector(resp.,vorticity) ˝eldsreliesonspatial,piecewise-linear(resp.,piecewiseconstant)basisfunctionsinsteadofusing areducedsetofbasisfunctions. 6.3.4EmbeddingcomplexdomainsonCartesiangrids Unstructuredmeshescanbemadetoconformtoarbitrarydomains,andtheconstructionofLapla- ciansonsimplicialmeshesiswelldocumented(seeTherefore,onecoulduseourapproach onsimplicialmeshesdirectly(seeFig.6.4foranexampleonanon-˛attrianglemesh).However, Cartesian(regular)gridsalwaysgenerate muchsimpler datastructuresand sparserstencils forthe structuralcoe˚cients,sostickingtoCartesiangridsiskeywhene˚ciencyisparamount.Yet, 102 Figure6.4 Curveddomain :Whileallother˝gureswereachievedonaregulargrid,ourapproach appliestoarbitrarydomains,hereonthe surface ofatriangulateddomain;asimplelaminar˛ow withinitialhorizontalvelocitysmoothlyvaryingalongtheverticaldirectionquicklydevelopsvor- ticalstructuresonthiscomplexsurface. model-reduced˛uidmethodscannoteasilydealwithcomplexdomainsusingonlyaregulargridto embeditin. Weproposeasimpleextensionof[7]tocompute k -formLaplaciansofanarbitrarydomain, still usingaregulargrid .ThisrenderstheimplementationofLaplaciansandtheirboundaryconditions quitetrivial,andremovesthearduoustaskoftetrahedralizingarbitrarydomains.Thisideawas introducedin[44]fortheirpressure-basedprojection,andasimplealterationproposedby[7]made theapproachrobustandconvergent.Weleveragethislatterworkbynoticingthatthemodi˝cation oftheLaplacian 3 thattheyproposedamountstoalocalchangetotheHodgestaroperator ? 2 . Figure6.5 Hodgestarsadjustedtotheboundary. Thedomain isde˝nedimplicitlybyafunc- tion ˜ via = f x j ˜ ( x ) 0 g . RecallthatthediagonalHodgestarsonamesh M areallexpressedusinglocalratiosofmea- surements(edgelengths,faceareas,cellvolumes)onboththeprimalelementsof M anditsdual elements[134].ThechangestotheLaplacianoperator 3 thatNgetal.[7]introducedcanbe 103 reexpressedbyanalterationoftheHodgestar ? 2 where eachprimalareameasurementonlycounts thepartoftheprimalfacethatisinside ,butdualedgelengthsarekeptunchanged.Weextend thissimpleobservation(whichamountstoalocal,numericalhomogenizationtocapturesub-grid resolution)bycomputingmodi˝edHodgestars ^ ? 1 ; ^ ? 2 ; and ^ ? 3 whereonlythepartsoftheprimal elements(partiallengths,areas,orvolumes)thatarewithinthedomain arecounted(seeFig.6.5). NotethatchangingdirectlytheHodgestarsdoesnota˙ectthesymmetryandpositive-de˝niteness oftheLaplacians,andthusincursnoadditionalcostforourmethod. Figure6.6 Comparisionofthegeneratedeigenvector˝eldsonacoarsegrid. Theleft˝gureis generatedthroughavoxelizedapproximationoftheboundary(red)whiletheright˝gureisbyour Hodgemodi˝cation(blue). Thisstraightforwardextensionallowsustocomputeourspectralbasesonregulargridforar- bitrarydomains asillustratedintheFig.6.6andinFig.6.7forabasiselementofvector˝elds. WealsoshowthebehaviorofthisHodgestarmodi˝cationunderre˝nementoftheregulargridfor agivencontinuousellipticdomain ,resultinginverygoodapproximationsoftheeigenvectors. NotethattheHodgestaroperatorsmayinvolvedivisionbysmalldenominators.Asimpleandtyp- icalthresholdingofnumbersbelowtheaverageprecisionofthe˛oatingpointrepresentation(i.e., 1e-8)toavoiddivisionbyzeroisenough,andtheeigenfunctionswithourspeci˝ctangentialand normalboundaryconditionsarecomputedwithoutanyextrapreprocessing.Infact,largevalues oftheHodgestarsactaspenalty:ifasmallfractionofthefaceisinsidethedomain,thenonlyan accordingly-small˛uxisallowed. 104 6.3.5Variantsandextensions OurapproachhasbeenlimitedtoEulerequationssofar.However,theuseofspectralbasisfunc- tions,theabilitytodealwitharbitrarydomainsonaregulargrid,andthefunctional-mapnature ofthediscretizationmakesforaveryversatileframeworkinwhichextensionstotheEuler˛uid modelcanbeeasilyincorporated.Inallcases,thepseudocoderemainsidentical,asoutlinedin Algorithm1. Algorithm1 Model-reducedvariationalintegrator 1: Construct2-formspectralbasiswithselectedfrequencies 2: if scalar˝eldsneeded then 3: Construct3-formbasiswithsameselectedfrequencies 4: endif 5: Constructstructuralcoe˚cients C k;ij withEq.(6.7) 6: Initializesimulation 7: for eachtimestep do 8: TimeintegrationthroughexplicitupdateorEq.(6.8)/Eq.(6.9) 9: Ifneeded,performscalaradvectionincurrentvelocity˝eld 10: endfor Viscosity. Whiletheabilitytoremovespuriousenergydissipationisimportantfortheconsistency ofanumericalintegratorwithrespecttotimestepsize,real˛uidsexhibitviscosity.Addingviscosity iseasilyachieved:itcorrespondstoadissipationofmodalamplitudesbyafactorof 2 i since thevector-valuedLaplacianisadiagonalmatrixinthespectraldomainasalreadyleveragedin, e.g.,[137].Thuseachmodalmagnitude v i evolvesas _ v i = 2 i v i 105 Figure6.7 Domain-alteredHodgestars :Ourframeworkcangeneratevectorbasessatisfyingpre- scribedboundaryconditionforarbitrarydomainsembeddedinaCartesiangrid.Hedge-hogvi- sualizationof 5 ona 256 2 gridforthreedi˙erent2Ddomainshapes,obtainedthroughasimple alterationoftheHodgestar ? operator. foraviscositycoe˚cientof .Consequently,Navier-Stokesequationscanbehandledthroughan operator-splittingapproachbyupdatingthemodalmagnitudesovereachtimeinterval h through v t + h i e 2 i h v t i : Figure6.8 ConvergenceofLaplacians :OurdiscretizationofthetwoLaplacianscreates(vector andscalar)eigen˝eldsthatconvergeunderre˝nementoftheregulargridusedtocomputethem, extendingthelinearconvergenceprovedin[7].Here,particle-tracingvisualizationofthe 15 th eigenbasisforvector˝eldsontheellipse(top)atresolution 30 2 , 60 2 , 120 2 ,and 240 2 ,and 15 th eigenfunction(bottom)atthesameresolutions. 106 Magnetohydrodynamics(MHD). Theequationsforideal,incompressibleMHDareeasilyex- pressedasamodi˝cationoftheEulerequations.TheLagrangianofMHDis L MHD = 1 2 h v ; v i 1 2 h F ; F i inappropriateunits[10],where F isthemagnetic˝eldwhichisadvectedbythevelocity˝eld v .Asboth v and F aredivergence-free,theycanbediscretizedwithourdivergence-freespectral bases.Withsuchdiscretevelocityandmagnetic˝elds,theupdateruleintimetosimulatetheMHD equationscloselyresemblestheEuler˛uidcase: _ v k = v t C k v F t C k F ; _ F k = X ij F i v j C j;ki ; wherethesecondequationperformstheadvectionof F (encodedinourspectral 2 -formbasis)inthe currentvelocity v .Itiseasytoverifythatthecrosshelicity R M v F = P i v i F i isexactlypreserved inourintegratorasitisinthecontinuouswornumericalpropertyrarelysatis˝edinexisting integrators[10].Thecrosshelicityisrelatedtothetopologicallinkingofthemagnetic˝eldand the˛uidvorticity.Thus,itspreservationpreventsspuriouschangesinthetopologyofthemagnetic ˝eldlinesoverthecourseofasimulation.ThisextensiontoMHDcanalsobeappliedtoaseries ofotherEuler-Poincaréequationswithadvectedparameters,modelingnematicliquidcrystal˛ows andmicrostretchcontinuaamongothers[10].Notethatbuoyancyanddensity˝eldscanbehandled inasimilarfashion,whethertheyarecoupledwiththedynamicsorpassivelyadvected;theyjust needtobesmoothenoughtobecapturedbylowfrequencies.Ourframeworkcanthereforebeused for,e.g.,atmosphericsimulationsaswell[135]. Subgridscalemodeling. DirectnumericalsolversusingNavierStokesequationrequirehigh resolutionstoresolvethecorrectcouplingoflargeandsmallscalestructures.Instead,subgrid scalemodelingrequiresmuchfewerdegreesoffreedomtocapturethecorrectlarge-scalestruc- turesbysimulatingthemaine˙ectsofthesmallsubgridscalestructureswithoutactuallyresolving 107 them.Amongthemanymodelsthatmatchempiricaldatawell,theLANS- model(Lagrangian- Averaged-Navier-Stokes,see[8])advectsthevelocityina˝lteredvelocitytobettercapturethe correctenergycascading.Since˝lteringisachievedthroughaLaplacian-basedHelmholtzoper- ator,wecanalsouseourspectralapproachtosimulatethismodelwithease.Thekineticenergy (i.e.,Lagrangian)isnowde˝nedas L -Euler = Z M 1 2 v 2 + 2 2 jr v j 2 : Inourspectralbases,the -modelamountstoaddingkineticenergytermsscaledby 2 i forthe modalamplitudes v i .Hamilton'sprincipleforthemodi˝edLagrangianleadstoessentiallythesame updateruleasNavier-Stokes',exceptthatthestructuralcoe˚cientsarereplacedby (1+ 2 2 i ) C k;ij : Notethatthismodi˝cationkeepstheantisymmetryin j and k intact,andisthereforeatrivial alterationofthebasicscheme. Figure6.9 Spectralenergydistribution :Withforcingtermskeepingthelowwavenumberam- plitudes˝xed[8],our3DreducedmodelappliedtotheLANS- modelofturbulenceproducesan averagespectralenergydistribution(blue)muchclosertotheexpectedKolmogorovdistribution (black)thanwiththeusualNavier-Stokesequations(red). Movingobstaclesandexternalforces. Formovingobstacles,insteadofcalculatingadditional boundarybasesasin[121],weinsteadfollowthesimplersolutionproposedin[9]:thedi˙erence inthenormalcomponentofthevelocityontheboundaryisprojectedontothevelocitybasisand 108 Figure6.10 Smokerising. Usingonly230modes(about0.003%ofthefullspectrumsimulation), both[9]'s(left)andourapproachalreadyexhibittheexpectedvolutesforabuoyancy-driven˛ow overasphere. subtractedfrom v ,resultinginalow-frequency˝eldroughlysatisfyingtheboundarycondition. Foranyexternalforces,e.g.,buoyancyforces,theire˙ectsonthetimederivativeofthemodal amplitude v i ofthe i -thfrequencyaresimplycalculatedbytheirprojectiononto i .Theresultsare visuallycorrectevenoncomplexshapes,andwithminimalcomputationaloverhead(seeFig.6.14). 6.3.6Generalizationtootherbases Whileweprovideddetailontheconstructionofavariationalmodel-reducedintegratorfor˛uid simulationusingLaplaceeigenvectors,onecaneasilyadaptourapproachtoarbitrarybasisfunc- tions,eventhoseextractedfromatrainingsetof˛uidmotions.Supposethatwearegivenaset ofscalarbasiselements i (orthonormalizedthroughtheGram-Schmidtprocedure)andasetof velocitybasiselements i .TheLiederivativematrix A willstillbeantisymmetricaslongas i 's aredivergence-free.Thismeansthatonecanuseexisting˝niteelementbasisfunctionsinsteadof ourLaplaceeigenvevenwaveletbasesof H (div ; (see,e.g.,[138])ifspatiallylocal- izedbasisfunctionsaresoughtaftertogetasparseradvection.Thekeytothenumericalbene˝ts ofourvariationalapproachistoensuretheanti-commutativityoftheLiebracketintheevaluation of h A i ; [ A j ;A k ] i (Eq.(6.7))andtheadvectionofother˝eldsbytheexponentialmap(orapproxi- 109 Figure6.11 Robustnesstoresolution :Withthehomogenizedboundaryconditionongridsofreso- lution 40 2 (blue), 80 2 (green),and 160 2 (red),nostaircaseartifactsareobserved,andthesimulation resultsareconsistentacrossresolutions. mationsthereof,seeApp.C.4)ofthematrixrepresentingtheLiederivativeasdoneinMHDand complex˛uids[10].Inaway,theoriginalnon-spectralvariationalintegratorscanbeseenasa specialcaseofourframeworkwhereWhitneybasisfunctionsareused.However,viscositycanno longerbehandledaseasilyinthiscaseastheLaplacianisnotdiagonalingeneralbases.Moreover, therequirednumberofdegreesoffreedomtoproducesmooth˛owsmayendupbeinghighifthe basesarearbitrary. 6.4Results OurresultsweregeneratedonanInteli7laptopwith12GBRAM,andvisualizedusingourown particle-tracingandrenderingtools. Reducedvs.fullsimulation. Inordertocheckthevalidityofourreducedapproach,weperformed astresstestinaperiodic2Ddomaintovisualizehowtheincreaseinthenumberofbasesusedin ourspectralintegratorimpactsthesimulationovertime.Weselectedaband-limitedinitialvelocity ˝eldattime t =0 thatonlycontainsnon-zerocomponentsforthe˝rst 120 frequencies.Wethen advectedthe˛uidusingourintegrator,with˛uidmarkersinitiallysetastwocoloreddisksnearthe center.Becauseofthepropensityofvorticitytogotohigherscales,ourreducedapproachdoes 110 notleadtotheexactsamepositionofthe˛uidmarkersafter 12 sofsimulationifoneusesonly 120 bases.However,asthenumberofbasesincreasesto300or500,thesimulationquicklycaptures thesamedynamicalbehaviorasafullvariationalintegratorwith 256 2 degreesoffreedom,see Fig.6.12.Wedemonstrateintheaccompanyingvideothatourvariationalintegratoralsocaptures theproperqualitativebehavioroftwomergingvorticesincontrasttotheresultusing[9]which, instead,generatesseveralvortices(seesupplementaryvideo). Figure6.12 Convergenceofsimulation :A˛owinaperiodicdomainisinitializedwithaband- limitedvelocity˝eldswith120wavenumbervectors.Fluidmarkers(formingablueandredcircle) areaddedforvisualization.After 12 sofsimulation,theresultsofourreducedapproach(left: 120 ; middle: 300 modes)vs.thefull 256 2 dynamics(right)arequalitativelysimilar. Arbitrarydomains. WealsoshowinFigs.6.3,6.7,and6.11(2D)andFigs.1.6,6.1,6.10,6.17, and6.14(3D)thattheuseofboundaryconditionsembeddedonregulargridsleadstotheexpected visualbehaviorneardomainboundaries,eliminatingthestaircaseartifactsoftraditionalimmersed- gridmethods.Ourhomogenizedboundarytreatmentobtainsresultssimilartothoseofunstructured mesheswhileusingonlycalculationsthataredirectlyperformedonregulargrrequiring signi˝cantlysimpler,smaller,andmoree˚cientdatastructures.AsshowninFig.6.13,ourbasis ˝eldsconvergewithsecondorderaccuracy,muchfasterthantheboundaryconditionin[44](the lattermay,infact,notevenconvergeinsomecasesasdiscussedin[7]).Moreover,wealsoextended thisapproachnotjusttoscalar˝eld,butvector˝elds.Our˛uiddynamicsisalsoconsistentacross awiderangeoftemporalandspatialdiscretizations,seeFig.6.11.Inaddition,theregulargrid structurealsosimpli˝estheinteractionwithimmersedsolidobjectsasdemonstratedinFig.6.17 111 Figure6.13 Log(error)-log(resolution)plotforeigenvectorstestedonaunitdisk. througha˛owinducedbyascriptedcarturningaroundacorner;interactive˛uidstirringbya paddlemanipulatedbytheuserisalsoeasilyachievedasshowninFig.6.14.Wealsoshowin Fig.6.10thatourmethodcanhandlethetypicaltestcaseofsmokeplumepastasphereevenat lowresolution,andwecanincorporatebothfree-sliporno-slipboundaryconditions.Finally,our spectralintegratorcanbecarriedoutinthesamefashiononcurveddomainsaswell,sincethe eigenvectorsoftheLaplace(-Beltrami)operatorarenomoredi˚culttocomputeonatriangulated surface;Fig.6.4showsasimplelaminar˛owonthe surface ofthebunnymodel. Advanced˛uidmodels. WealsoextendedourmethodtotheLANS- turbulencemodeltobetter capturethespectralenergydistributionwithasmallnumberofmodes.Ona3Dregulargrid,we performedasimulationasdescribedin[8]byholdingthelowwavenumbercomponents v i ˝xed for j i j < 2 toactasaforcingterm,andrunningthesimulationuntil t =100 .Wethenextracted 112 theaveragespectralenergydistributionpresentbetween t =33 to t =100 .WeshowinFig.6.9 thattheKolmogorov 5 = 3 laismuchbettercapturedthanwiththeusualNavier-Stokesmodel, evenforthelownumberofmodesusedinourspectralcontext:the -modelproducesadecay rateathighwavenumbersmuchsteeperthanaNavier-Stokessimulation,allowingustocuto˙the higherfrequenciesatalowerthresholdwithoutsigni˝cantdeviationfromthespectraldistribution. Thisindicatesthatourapproachconsistinginasimplescalingofthestructuralcoe˚cientshelps improving˛uidsimulationoncoarsegrids. WealsoimplementedourextensiontoMHD,andfoundtheexpectedpreservationofcross- helicityandenergy.Forcomparisonpurposes(see,e.g.,[10]),wevisualizeourresultsofthetypical rotortestwith100modesinFig.6.18.We˝nallyshowinFigs.6.1and6.10thatbuoyancyforcesare alsoeasytoincorporatebyaddinganupwardsforceproportionaltothelocalsmoketemperature; thecurlofthisexternalforceisprojectedontothe 1 -formbasisfunctions,andusedtoupdatethe vorticity. Computationale˚ciency. OuruseofmodelreductionviaLaplacianeigenbasesprovidesasig- ni˝cantlymoree˚cientalternativetofullsimulators,obviously.Duetoourvariationaltreatment oftimeintegration,wealsopreventmanyshortcomingsofthepreviousreducedmodelsasween- sureconsistencyoftheresultsoveralargespectrumofspatialandtemporaldiscretizationrates, andmaintainaqualitativelycorrectbehaviorevenoncoarsegrids.Thee˚ciencygaincomparedto thefullvariationalsimulationisapparent,beitin2D,curved2D,or3D.Forinstance,afull-blown 128 2 gridtakesaround 50 sforthevariationalintegratortoupdateonestep(throughaNewton solver)inatypicalsimulationusingthetrapezoidalruleupdate,whilea 50 -mode(resp., 100 -mode and 200 -mode)simulationwithourintegratortakesonly 0 : 098 s(resp., 0 : 65 sand 2 : 0 s)forcomplex boundaries(i.e.,withdensestructuralcoe˚cients),and 0 : 026 s(resp., 0 : 070 s, 0 : 28 s)forsimplebox domains(withsparsecoe˚cients).OurNewtonsolvernormallyconvergesinacoupleofiterations dependingonthetimestepsize(whichdeterminesthequalityoftheinitialguess);forinstance,the averageinour3DbunnybuoyancytestinFig.6.1isbelow 3 iterations. 113 Figure6.14 Interactivity :Wecanalsousetheanalyticexpressionsfor k and C k;ij inaperiodic 3Ddomaintohandlealargenumberofmodesdirectly.Theexplicitupdateruleexhibitsnoarti˝cial dampingoftheenergyasexpected,buto˙ersrealtime˛ows. Selectionoffrequencies. Dependingonhowmanymodestheuseriswillingtodiscard(andre- placebywaveletnoiseordynamicaltexturefore˚ciency),thecomputationalgainscanbeinthe orderofseveralordersofmagnitude,andthisallowsustosimulate˛owsatinteractiveorrealtime rates(seeFig.6.17,orFig.6.14foranexamplewithaperiodic3Ddomainwherewecancompute theeigenbasesinclosedform).Notehoweverthatourmodel-reducedintegratorsu˙ersfromthe usuallimitationofmodelreduction:thecomplexityisactuallygrowingquadratically(resp.,cubi- cally)withthenumberofmodesforsparse(resp.,dense)structuralcoe˚cients.Soourintegrator isnumericallye˚cientonlyforrelativelylowmodecounts.However,thisisexactlytheregimefor whichonecanachievesigni˝cantcomputationalsavingsforverylittlevisualdegradation.Similar to[9],wealsofoundthat,whenusingveryfewlowfrequenciesleadstounappealingsimulations, addingafewhighfrequencies(andthus,skippingalargeamountofmediumfrequencies)isenough torenderananimationrealistic:ourintegratorcanusesuchatailoredfrequencyrangeseamlessly, andthenon-linearexchangebetweenlowandhighfrequenciesisenoughtocreatemuchmorecom- plexpatternsthatrespecttheexpectedmotionofthe˛ow,seeFig.6.15.Fig6.10wasalsodonein thismanner:the˝rst 115 modeswereused,thenext 400 modeswereskipped,andweaddedthe next 115 modestoaddsmallscalee˙ects.Theuseofsubgridscalemodelingexplainedin isyetanotherwaytomakesurethatthehigherfrequenciesareproperlydealtwithandprovidea good,visuallycorrectapproximationtothe˛uidequations. 114 Figure6.15 Frequencyshaping :ForthesamesetupasFig.6.1,usingonlythelowest10eigen- basisfunctionsforvector˝eldsleadstoaverylimitedmotion.However,addinganother10basis functionsofhighfrequenciescreatesamuchmoredetailedanimationatverylittlecost,insteadof usingallthefrequenciesfromlowtohigh. Timestepping. Finally,animportantfeatureofourmodel-reducedapproachisitsabilitytohan- dlebothexplicitandimplicitintegration.Implicitintegration,usingthemidpointrule(Eq.(6.8))or thetrapezoidalrule(Eq.(6.9)),comewithgoodnumericalguaranteesduetothetimereversibility. However,explicitintegrationisalsoveryconvenientasitfurtherreducesthetimecomplexityofthe simulation.Nevertheless,anexplicitintegrationhasverylittletheoreticalguarantees,andshould onlybeusedwithcare. Quantitativeexperiments. Onewaytoevaluateareducedmodelof˛uidsistomeasurethe evolutionintimeoftheerrorofthevelocity˝eldcomparedtoafull-spectrum(spatial)simulation. UsingtheexactsameLaplacianeigenvectorsrepresentingonly 0 : 003% ofthemodesforthe3D simulationoftherisingsmokeinFig.6.10,bothourstructuralcoe˚cientsand[9]'sprovidea slowlyincreasingerrorasshowninFig.6.16(top),withoursshowinganimprovementofaround 20% ;the L 1 showsamorepronouncedimprovementaswell.Thesameexperimentin2Dfor 2vorticesexhibitsthesametrend(Fig.6.16,bottom),withamorepronounceddi˙erencegiven 115 thatourapproachleadstothetwovorticesmergingasinthegroundtruthsimulation,while[9]'s generatesmultiplevortices(seesupplementaryvideo). Figure6.16 Relativeerrors. Relative L 2 (left)and L 1 errorsmeasuredwithrespecttoafull- spectrum(spatial)simulationaresystematicallyimprovedwithourstructuralcoe˚cientscompared to[9],evenifthesametimeintegrationisusedtoallowforafaircomparison.Top:errorsforthe risingsmokeexampleofFig.6.10;bottom:errorsfortwomergingvortices(seevideo). 6.5Conclusion Wehaveintroducedspectralbasesforscalarandvector˝eldsonirregularshapesembeddedinregu- largrids,togetherwiththeoperatorsobtainedthroughasimpleandnovelalterationtoo˙ersub-grid accuracyatnoextracost.Basedonthespectralanalysis,weintroduceavariationalintegratorfor ˛uidsimulationinreducedcoordinates.ByrestrictingthevariationsinHamilton'sprincipletoa low-dimensionalspacespannedbylow-frequencydivergence-freevelocity˝elds,ourmethodex- hibitsthepropertiesofvariationalintegratorsincapturingthequalitativelycorrectbehaviorofideal 116 Figure6.17 Immersedmovingobjects. Asthecarmakesarightturn,thelowfrequencymotion oftheairdisplacedarounditliftsthedeadleaves.Thevelocity˝eldaboveisvisualizedthrough arrows. incompressible˛uids(suchasKelvin'scirculationandenergypreservation)whilegreatlyreducing thecomputationalcost.Finally,wedemonstratedtheversatilityofourintegratorbystraightforward extensionstomovingboundary,magnetohydrodynamics,andturbulencemodels. Discussion. Algorithmically,ourmethodresemblesallothermodel-reduced˛uidmethods.How- ever,ito˙ersa uni˝ed formulationofmodel-reduced˛uid˛owsforarbitrarybasisfunctions,and providesstructuralcoe˚cientswithouttheartifactsof[9].Itonlyrequiresaregulargridtoencode arbitrarydomainswiththesameconvergencerateas[7],butalsoallowsforthecomputationof vorticitybases.DECoperatorsforthecomputationofLaplaciansallowfullcontroloverboundary conditions,forarbitrarytopology;butanyotherdiscreteoperatorscaneasilybeusedinstead.Our nonlinearupdaterulesenforceadiscreteformofKelvin'stheoremandtimereversibilitythus energypreservation.Theyalsoo˙errobustnesstotimeandspacediscretizationrates,animpor- tantfeaturewhenpreviewingresults.Onecanalsoemployexplicitintegrationtofurtherreduce computationalcomplexity.Anyapplicationseekinglowtimecomplexityof˛uidsimulationwill bene˝tfromourreducedspaceapproach,inparticular,real-timeinteractivesimulationortoolsfor 117 Figure6.18 MHDrotortest :Therotortestformagnetohydrodynamicsconsistsofadense rotatingdiskof˛uidinaninitiallyuniformmagnetic˝eld(left-right,top-middle: t = 0 : 042 ; 0 : 126 ; 0 : 210 ; 0 : 336 ).Ourspectralintegratorcapturesthecorrectbehavior(seefulldynamics in[10])evenwithonly 100 modes.Discreteenergy(blue)andcross-helicity(red)are,aspredicted, preservedovertime(bottom). designingartist-drivencoarsesimulation.Evenproduction-qualitysmokeor˛uidanimationmay beachievedwithouthavingrecoursetoafullresolutionsimulationthroughexistingpost-process curlnoisetechniques.Moreover,ourmodi˝edHodgestarcanbeusedinavarietyofgeometry processingapplicationswheresubgridaccuracyoncoarsegridsisdesirable. 118 CHAPTER7 SUMMARYANDFUTUREWORK Inthisthesis,wepresentinnovativecomputationaltoolsforvector˝eldsand 2 -tensor˝eldsanalyses andtheirapplications.Ourmaincontributionsaresummarizedasfollows: Wecontributedatheoreticaldiscreteframeworkforperformingcovariantderivative(Chap- ter4),whichisessentialtodi˙erentialcalculusonvector˝eldsontrianglemeshesandex- tendingthetheoryofdiscreteexteriorcalculustotruevector˝eldanalysis.Ournotionof discreteconnectionalsoleadstoacompatiblediscretizationofother˝rst-orderderivative operatorsofvector˝elds.Theresultingcomputationalframeworkcanbeappliedto n -vector ˝elddesign,aswellasprovidingthediscreteoperatorsnumericallysuperiortopreviousdis- cretization. Ourvector˝eldanalysistoolisalsousedinaconcreteapplication,example-basedtexture synthesiswithfeaturedirectionsalignedtoorientation˝elds(Chapter3).Ourframework providesanintuitiveandnaturalcontrolofthesingularitieswithouttheneedforextracon- straints.Spurioussingularitiesareeliminatedbyincorporatingthemissingboundaryterms intothevariationalformulation,i.e,byminimizingtheDirichletenergy.Furthermore,we proposedaGPU-friendlyseamlesssynthesiscompatiblewiththeorientation˝eldwhichmay containdiscontinuitywhentreatedasavector˝eld.Anovel upsidedown mappingstyleis introducedtoenforcetheseamlessappearanceoncethediscontinuityoftherepresentative vector˝eldisdetected. Extendingcoordinate-freerepresentationtorank-2tensorsisachievedbytheuseofBerger- Ebindecomposition(Chapter5).Weshowthatanarbitrary2-tensor(symmetricornon- symmetric)inaplane(oraconstantcurvature2-manifold)canbeorthogonallydecom- posedintoantisymmetric,divergence-free,curl-free,trace-less,andharmonicparts,eachof 119 whichadmitscoordinate-freerepresentation.Thisrepresentationfacilitatesanumberofcom- putationaltools,including2-tensorinducedcovariantderivatives,Liebracket,anisotropic geodesiccalculation.Inadditiontothepracticalcomputation,webelieveourrepresentation andoperatorsalsoprovidesteppingstonestowardsafull-blowntensoranalysisonsimplicial meshes. BasedonanovelspectralanalysisforirregulardomainsembeddedinaCartesiangrid,our computationaltoolcanalsobeusedforincompressible˛uidsimulationthroughaninnova- tivemodel-reducedvariationalEulerianintegrator(Chapter6).Ourhomogenizedboundary treatmentobtainsresultssimilartothoseofunstructuredmeshesandthestaircaseartifacts oftraditionalimmersed-gridmethodsareeliminated.Basedonsuchtreatment,thescalar andvectorvaluedeigenfunctionsoftheLaplacianoperatorcancapturethedetailedshape withoutcompromisinge˚ciency.Theeigenfunctionsassociatedwithlowfrequencieslead toourmodel-reduced˛uidsimulator,whichachievesrealisticanimationsinsigni˝cantlyless computationaltimewithoutthenumericalviscosity.Consequently,ourintegratorisrobust tocoarsespatialandtemporalresolutions,providingpredictivepreviewforthe˝nal,high- resolutionrun. Ourresearchonthevectorand 2 -tensoranalysesandapplicationso˙ersseveraldirectionsfor futureresearch: Wehaveproposedaseamlessmethodforexample-basedtexturesynthesiswithfeaturedi- rectionsadaptedfororientation˝elds.Duetoitsorder-independence,suchtexturesynthesis canbeparallelizedandthusfurtheracceleratethee˚ciency.Itwillbealsointerestingtoex- plorethee˙ectsofcombiningtrivialconnectionormetric-drivenN-RoSyonsurfaceswith arbitrarytopology,generalizetheparalleltexturesynthesistoN-RoSy˝elds,andimplement applicationsofthemethodtolatent˝ngerprintenhancement. OurconstructedsmoothdiscreteconnectionisinterpolatedbylinearWhitneyforms.While 120 webelievethatvariousapplicationsingeometryprocessingandevensimulationwouldbene- ˝tfromasmootherapproximation,higher-orderconnectionsthatstill˝tourframeworkcould bederivedfromsubdivision-basedWhitneyformsde˝nedin[114]orfromotherhigher-order Whitneyforlongastheirintegralscanbeeitherevaluatedinclosedformorthrough quadrature.Similarly,ahighorderconstructionforourintrinsicrepresentationof 2 -tensor throughthesubdivision1-formbasisfunctionswouldalsobeinteresting.Moreover,ouren- codingofarbitrary 2 -tensorsmayalso˝ndotherapplicationsinthecontextofsimulation: thestressandstraintensorsusedinelasticitycouldbeencodedwithintrinsicvtead ofusingapiecewise-constantrepresentationinducedbytheembeddingofthetrianglemesh astypicallydonein˝nite-elementmethods. Oneintriguingextensionforourmodel-reduced˛uidintegratoristheuseofreducedbases withspatiallocality,asourintegratorisnotrestrictedtoanyparticularsetofbasesfunctions. Forinstance,usingwaveletsforvorticitymayo˙er optimalsparsityinthestructuralcoe˚- cients ifwecanaddressthechallengeofadaptingthefrequencytothelocalfeaturesizeofthe domain.Improvingscalability(throughsparsityinstructuralcoe˚cientsorpseudo-spectral methods)andbetteradaptivitytomoving/deformingsolidboundaries(throughspatiallo- cality)maytheno˙erawiderapplicabilityformodelreducedmethods.Anotherpossible extensionistoincorporatefreesurfaceboundaryconditionsthroughourmodi˝edHodge star,combinedwithwaveletrepresentationsforthevolumeof˛uidpercell. 121 APPENDICES 122 APPENDIXA EXPLICITEVALUATIONOFOPERATORSBASEDONCOVARIANTDERIVATIVE Inthisappendix,wedescribehowoneencodesourdiscreteoperatorsforavector˝eld u asmatrices actingonthevectorcoordinates ( u 1 i ;u 2 i ) T ateachvertex v i .Inthisappendix,weadoptthefollowing shorthandnotationforclarity: ˆ ˆ v i ! e ij , ij ,and \ ( e e ij ; e t ijk ) . A.1Divergence/curlfor n VectorFields Whenallthelocalframesintheneighborhoodrotateby ,therepresentationvector˝eld v of an n -vector˝eldcanbeexpressedinthenewframeas v 0 =exp( J ) v .Thecovariantderivative withrespecttoanarbitraryvector˝eld w r w v =( r v ) w alsochangesexpressionasan n -vector ˝eld,yielding: exp( J )( r v ) w =( r v 0 ) w 0 =( r v 0 )exp( J ) w : ApplyingEq.2.3andnoting F exp( J )=exp( J ) F; r v 0 =exp( J )( r v )exp( J ) = 1 2 exp( J )( @ v + F @ v )exp( J ) = 1 2 exp( J ( n 1) ) @ v + 1 2 exp( J ( n +1) ) F @ v : Thus @ v transformsasan ( n 1) -vector˝eld,while @ v transformsasan ( n +1) -vector˝eld. A.2Edge-basedOperators Ourdiscreteoperatorsareeachrepresentedasa j F j 2 j V j matrix,assembledbasedonthecon- tributionofthevectorcoordinatesateachvertex v i totheintegralvalueoftheoperatoroneach 123 adjacenttriangle t ijk .Throughintegrationbyparts,we˝nd Z e ij i dl = j e ij j Z 1 0 (1 x )exp( J ( + ˆ )) dx = j e ij j 2 exp( Jˆ )[ I J exp( J )] : Wecannowevaluatethefourdiscreteoperatorsthroughthefollowingfunction: I ( ˆ; )= j e ij j 2 j t ijk j [cos( ˆ ) cos( ˆ + ) sin( ˆ ) ] : Ifwedenoteby op u m i t ijk thecontributionofthe m -thcomponentof u i totheintegralof op in t ijk , wehave(recallthatforan n -vector˝eld,divergenceandcurloperatorsproducean ( n 1) -vector ˝eld,whilethere˛ectedonesproducean ( n +1) -vector˝eld): c url u 1 i t ijk = I ( nˆ +( n 1) ; ) ; c url u 2 i t ijk = I ( nˆ +( n 1) j + ˇ= 2 ; ) ; d iv u 1 i t ijk = I ( nˆ + ˇ= 2+( n 1) ; ) ; d iv u 2 i t ijk = I ( nˆ + ˇ= 2+( n 1) ; ) ; curl u 1 i t ijk = I ( nˆ +( n +1) ; ) ; curl u 2 i t ijk = I ( nˆ +( n +1) + ˇ= 2 ; ) ; div u 1 i t ijk = I ( nˆ +( n +1) + ˇ= 2 ; ) ; div u 2 i t ijk = I ( nˆ +( n +1) + ˇ; ) : A.3Triangle-basedOperators Weevaluatedtheper-triangleintegralexpressionsofouroperatorsthroughsymbolicintegration. Notethatitleadstoexpressionswith ˝ ij;k , ˝ jk;i ,and ˝ ki;j appearinginthedenominator.Asthese 124 valuesaretypicallyclosetodegenerate,Chebyshev[1]orTaylorexpansionisnecessarytoprovide robustnessinevaluation. 125 APPENDIXB DETAILSFOR 2 -TENSORRELATEDOPERATORS B.1DecompositionofKillingOperator WenowdetailthedecompositionoftheKillingoperator K forsmoothsurfaceswithGaussian curvature .We˝rstmakeuseoftheBochnertechnique(see,e.g.,[74,20]),andexpandthe divergenceoftheKillingoperatoras: d iv ( K ( ! ))=(2 + d 2 ) !; (B.1) where . . = ?d? isashorthandfortheco-di˙erentialoperator.(Notethatweassumeda 1 -form ! withzeroDirichletorNeumannboundaryconditionforsimplicity.)BycombiningEqs.(2.9) and(B.1),wenowcomputetheinnerproductofsymmetric 2 -tensor˝eldsgeneratedbytheKilling operatorofexact 1 -forms df ,co-exact 1 -forms ?dg ,andharmonic 1 -forms h : 8 > > > > > < > > > > > : hK ( df ) ; K ( ?dg ) i F =2 h f;? ( ^ dg ) i 0 ; hK ( df ) ; K ( h ) i F =2 h f;? ( ^ ?h ) i 0 ; hK ( ?dg ) ; K ( h ) i F =2 h g;? ( ^ h ) i 0 : Theseexpressionsreturnzeroforarbitrary f , g and h i˙ theGaussiancurvature isconstant. Therefore,wecandecomposetheKillingoperator K intoanorthogonaldirectsumasstatedin Eq.(5.2)inthecaseofplanardomains. B.2LumpingofPairing Theprooffoundin[115]thatthediagonalHodgestarisalumpingoftheGalerkinHodgestarin theLaplacianoperatorextendsdirectlytoourdiscretepairingoperatorsforarbitrarysymmetric 126 tensorssince: d t 0 M ˙ d 0 ij = X kl;mn ( d t 0 ) i;kl Z M ˙ ( ˚ ˚ ˚ kl ;˚ ˚ ˚ mn ) d mn;j 0 = Z M ˙ X kl d kl;i 0 ˚ ˚ ˚ kl ; X mn d mn;j 0 ˚ ˚ ˚ mn ! = Z M ˙ r ˚ i ; r ˚ j = d t 0 H ˙ d 0 ij : B.3DiscreteGeneralizedLaplacian ˝ Thematrix H ˝ isprovidedinclosedformforthevarioustermsofthedecompositioninEq.(5.5). Notethattheevaluationstencilforeachelementrequiresthepatchofedge ij (orpart thereof),andweusethenamingconventiondescribedintheinsetof Case ˝ = I . Thiscasecorrespondstothewell-knowncotanformula[116]: H Id ij = 1 2 cot jki +cot ilj (B.2) Case ˝ = . H ij = 1 2 a jil jil 1 2 a ijk ijk : (B.3) Case ˝ = K ( d 0 f + F - 1 d t 1 g ) . Using ! d 0 f + F - 1 d t 1 g forconciseness,wehave: H K ij = 1 2 l 2 ij cot kij cot ijk +cot jil cot lji T ij ( ! ) + 1 4 a ijk cot jki T ik ( ! )+ T kj ( ! ) + 1 4 a jil cot ilj T li ( ! )+ T jl ( ! ) Case ˝ = K ( d 0 w + h ) . H K ij = 1 l 2 ij T ij ( d 0 w + h ) Case ˝ = B . H B ij = kij ijk 2( kij + ijk ) + lji jik 2( jil + lji ) 127 Case ˝ = C . H C ij = 1+ kij ijk 2( kij + ijk ) 1+ jik lji 2( jil + lji ) B.4PairingthroughDiscreteTensors Thematrix M ˝ isprovidedinclosedformforthevarioustermsofthedecompositioninEq.(5.5). Notethattheevaluationstencilforeachelementrequires either thepatchofedge ij or thepatchofaface ijk ,andwestillusethenamingconventiondescribedintheinsetof Case ˝ = I . M Id ij;ij = 1 4 cot jki +cot ilj + 1 12 cot kij + ijk + 1 12 cot jil +cot lji M Id ij;jk = 1 12 cot ijk cot kij cot jki : Thisresultingmatrix M Id correspondstotheGalerkinHodgestar F G [115],asfurtherdiscussed in Case ˝ = . M ij;jk = M jk;ij = ijk 6 a ijk ; M ij;ij =0 : (B.4) Case ˝ = B . Weneedtode˝nealocalcoordinateframetocomputethispairing.Fordiagonal terms M B ij;ij ,weusethecoordinateframeinducedbytheedge ij ofthebutter˛ypatch;fortheother terms M B ij;jk ,wepickarandom,but˝xedframe F ijk perface,anddenoteby theanglethatrotates the x directionofthelocalframe F ijk tothedirectionofedge ki .Withthisconvention,onegets: M B ij;ij = ijk kij 4( ijk + kij ) + jil lji 4( jil + lji ) M B ij;jk = sin (2 ) 1+ jki kij +( jki + kij ) 2 12( jki + kij ) + cos (2 ) kij jki 12( jki + kij ) 128 Case ˝ = C . Usingthesameconventionasabove: M C ij;ij = 3+ ijk kij cot 2 ijk cot 2 kij 12( ijk + kij ) + 3+ lji jil cot 2 lji cot 2 jil 12( jil + lji ) M C ij;jk = cos (2 ) 1+ jki kij +( jki + kij ) 2 12( jki + kij ) sin (2 ) kij jki 12( jki + kij ) Case ˝ = K ( d 0 f + F - 1 d t 1 g ) . Using ! d 0 f + F - 1 d t 1 g forconciseness,theclosedform expressionis: M K ij;jk = 1 24 a ijk h T ij ( ! ) 2cot ijk cot kij + T jk ( ! ) 2cot ijk cot jki T ki ( ! ) cot jki +cot kij + 1 2 cot ijk cot kij cot jki ( d 1 ! ) ijk 1 2 cot ijk cot jil +cot lji ( d 1 ! ) jil + 1 2 cot ijk cot kjm +cot mkj ( d 1 ! ) kjm i M K ij;ij = T ij ( ! ) 6 l 2 ij h cot 2 kij +cot 2 ijk cot kij cot ijk +cot 2 jil +cot 2 lji cot jil cot lji i + 1 12 a ijk h T jk ( ! ) cot ijk +cot jki + T ki ( ! ) cot jki +cot kij i + 1 12 a jil h T il ( ! ) cot jil +cot ilj + T lj ( ! ) cot ilj +cot lji i + ( d 1 ! ) ijk 48 a ijk h 2cot jki (cot kij cot ijk )+cot 2 lji cot 2 jil i + ( d 1 ! ) jil 48 a jil h 2cot ilj (cot lji cot jil )+cot 2 kij cot 2 ijk i + 1 48 a ijk h ( d 1 ! ) kjm (cot kjm +cot mkj )(cot ijk +cot jki ) ( d 1 ! ) ikn (cot nik +cot ikn )(cot kij +cot jki ) i + 1 48 a jil h ( d 1 ! ) liu (cot liu +cot uil )(cot ilj +cot jil ) ( d 1 ! ) jlv (cot vjl +cot jlv )(cot ilj +cot lji ) i Case ˝ = K ( d 0 w + h ) . M K ij;jk =0 ; M K ij;ij = 1 l 2 ij T ij ( d 0 w + h ) Thesimilarityofthislastdiagonaltermwith H K isexplainedinwhereHodgestarapproxi- mationsarediscussed. 129 APPENDIXC DETAILSFORFLUIDSIMULATIONCOMPUTATION C.1ComputingSpectralBases Inthisappendix,wedescribehowtocomputethespectralbasesforbothvector˝eldsanddensity ˝eldsonamesh M . DiscreteLaplacians. Findingourspectralbases˝rstrequiresdiscretizingboththescalarLapla- cian rr andthevectorLaplacian rr + rr onthedomain M .Discretizationoftheseoperators onarbitrarysimplicialcomplexesiswelldocumented[134,57],andonlyinvolvestopologicalop- erators d 1 and d 2 derivingfromthemeshconnectivity,anddiagonalestaroperators ? 1 ;? 2 ; and ? 3 basedonlocalmeasuresof M anditscircumcentricdual,resultinginthefollowingsym- metricsecond-orderoperators: ? 3 3 ? 3 d 2 ? 1 2 d t 2 ? 3 ;? 2 2 d t 2 ? 3 d 2 + ? 2 d 1 ? 1 1 d t 1 ? 2 : Notethat d and ? areevensimpleronregulargrids,evenwiththealterationweintroducedin6.3.4. Boundaryconditions. Thecanonicalboundaryconditionsofvelocity˝eldsin˛uidsimulation forgraphicspurposesareno-transfer(i.e.,thenormalcomponent v n ofthevelocityalong @ M mustbezero)andfree-slip(i.e.,thederivativeofthetangentialvelocity˝eldalongtheboundary normal @v t =@n mustbezeroaswell).Toenforcetheseconditions,wethusaddtheconditionsthat the˛uxof i on everyboundaryface iszero,andthatthecirculationsalongthe(interiorhalf) boundaryoftheVoronoifaceassociatedwith eachboundaryedge isalsozero(i.e,wesimplyset thevaluesof ? 1 1 aszerosforalltheedgesadjacenttotheboundaryfacestocompute 2 ).Asfor theeigenfunctions i of 3 ,weuseeitherDirichletboundaryconditions f j @M =0 orNeumann boundaryconditions @f @n j @M =0 ; byconsideringboundarycellvaluesorboundarygradientsas 130 null.Ifother,non-homogeneousboundaryconditions(suchasin˛uxorout˛uxconditions)are required,thenonemustaddanadditionalharmonic(zerothfrequency)componentthatsatis˝esthe givenboundaryconditions. Eigencomputations. OncetheLaplacianswithproperboundaryconditionsareassembled,we cancomputetheirlow-frequencyeigen˝eldsusingasimpleLanczosalgorithmsincetheseoperators aresymmetric.Theconstanteigenbasesfromthekernelof 3 canbesafelyomittedbysettingzero valuesonboundaries,sinceaconstantscalarfunctionisunchangedwhenadvectedbyadivergence- freevelocity˝eld.Notethat,asmentionedinsomeoftheeigen˝elds i willbeoftheform 1 j j :indeed, i for i 6 =0 isaneigenfunctionof 2 since 2 j = 3 j = ( 2 j j )= 2 j j : Thesegradient˝eldsareeasilyidenti˝ablebycheckingtheirdivergence.Note˝nallythatintheory, therecouldbecaseswhere 2 i = 2 j formultiplepairsofindices i and j .Whileinpracticethisisvery unlikelytohappen,onecanprotectagainstthisrareeventbyreplacingoneofthecorresponding i by j j ,andreplacingtheothereigenvectorsofthiseigenvaluethroughaGram-Schmidt processtoformanorthonormalbasisagain. Comments. Wenotethattheapproachwedescribedabovetocomputetheeigenbasesforour ˛uidintegratorisfarfromunique.Forexample,the 1 harmonicvector˝eldsareobtainedas theeigenvectorsassociatedwiththeeigenvalue0,butwecouldhavealsocomputedtheharmonic functiondualtoeachhomologygeneratorviasimplesparselinearsystemsinstead[139].Addition- ally,thevector˝eldbasis i couldbecomputedthroughitsvectorpotential i instead:indeed, thesevectorpotential 1 -formsareeigenvectorsofthe 1 -formLaplacian 1 ,andboundaryedge circulationsaswellasdivergenceonboundarydualcelldivergenceareassumednulltoguarantee no-transferandfree-slipconditions.Thecurlofthese 1 -formbasisfunctionsarethen,bycon- struction,the˛ux-based i basisfunctions.Finally,wepointoutthatourapproachispurposely di˙erentfromwhatisproposedin[9],astheyuseaneigendecompositionof instead(leveraging 131 thedivergence-freenessofthevector˝elds).However,thissimpli˝edoperatorhasamuchlarger nullspacethatincludesalsocurl-free˝elds,requiringmanymoreeigenvectorstobecomputedvia Lanczositerationstogeneratedivergence-free˝elds. C.2AnalysisofStructuralCoe˚cients C k Forsimplicity,weusetheperiodicdomain [0 ; 1] 3 ,i.e.,the˛at3Dtorus.Theeigen˝eldscanbe expressedusingcomplexnumbersas i ( x )= w i e | k i x ; where | istheunitimaginarynumber, x isthe3Dcoordinates, w i isaunitvector,and k i isthe wavenumbervector(i.e.,with j k i j = i ).Thedivergenceofthebasisfunctionisthus div i ( x )= | k i w i e | k i x ; whilethecurlisexpressedas curl i ( x )= | k i w i e | k i x : Since div i =0 meansthat k i w i =0 ,therearetwoindependent w 'sforeach k inthebasis.We canthuscomputethestructuralcoe˚cients C c;ab fromEq.(6.7)inclosedform,bytheintegralof ( r a ) c b )= | ( k a w a ) ( w c w b ) e | ( k a + k b k c ) x ; wheresuperscript denotescomplexconjugation.Notethatnonzerocoe˚cients | ( k a w a ) ( w c w b ) onlyexistwhen k c = k a + k b ,andtheyadvectreal˝eldstoreal˝elds(whosecoe˚cientssatisfy v k ; w = v k ; w ).Itindicatesthat j k b j 2 C c;ab = j k a j 2 C c;ba isnottrueingeneralin3D,contraryto theclaimin[9];asimplecounterexampleis k a =2 ˇ (0 ; 2 ; 3) , w a =(1 ; 0 ; 0) , k b =2 ˇ (1 ; 1 ; 0) , and w b =(0 ; 0 ; 1) .Moreover,while C c;aa =0 indeedforthisdomainsince w c (2 k a )=0 ,this propertywillnolongerholdforanarbitrarydomain.Thankfully,ourvariationalintegratordoes notdependontheeigenmodesbeingsteady˛ows,sothesesymmetries(orrather,lackthereof)are inconsequential. 132 C.3Kelvin'sCirculationTheorem Ideal,incompressible˛uidshaveaconservedmomentum[140]givenbytheintegratedcirculation ofthe˛uidaroundaclosedcurvewhichisadvectedbythe˛ow.ThisfactisknownasKelvin's circulationtheorem.Methodssuchas[19]and[50]areconstructedsoastoconserveadiscretized formofthisconservedmomentum.OurspectralmethodalsoobeysaformofKelvin'stheorem asfollows.Wecande˝negeneralizedcurvesasspectraldual 1 -chains(alsocalled 1 - currents[134])oftheform: = X i i ? 2 A i : (C.1) Theabovedual 1 -chainexpressionalwaysrepresentsaclosedcurve,becauseeach A i corresponds toaclosed(divergence-free) 2 -form,whichmeansthedual1-chainisboundaryless.Apairing betweena 2 -formandageneralizedloopisde˝nedasexpected: h A; i = * X i v i A i ; X j j ? 2 A j + = X i v i i : (C.2) TheLieadvectionofthegeneralizedcurvealongthevelocity˝eld _ = [ A; (C.3) indicatesthatthecoe˚cients f i g i mustevolvesuchthat _ k = X i;j i v j Z M k ( r i j )) = X i;j i v j Z M ( r k ) j i )= X i;j i v j C j;ki : Thus,thespectralversionofKelvin'stheoremholdssince d dt h A; i = X i (_ v i i + v i _ i ) = X i v t C i v i + X i v i X j;k v k j C k;ij = X i;j;k v j C i;jk v k i X i;j;k v j v k i C i;jk =0 : 133 Intheabovederivation,dummyindexvariablesareswappedandtheidentity C k;ij = C j;ik is used. C.4TemporalDiscretization Afullydiscrete(inspaceandtime)treatmentofourvariationalintegratoriseasilyachievedusing theHamilton-Pontryaginprinciple[49],whereLagrangemultipliers k enforcethat A isindeed theEulerianvelocityofstate q .Ifonedenotesby h isthetimestep, A k thevelocity˝eldbetween time k &state q k andtime k +1 &state q k +1 ,thediscreteHamilton-Pontryaginactionbetween t =0 and t = Nh isexpressedas S d = N 1 X k =0 1 2 h A k ;A k i h + h k ;˝ 1 ( q k +1 ( q k ) 1 ) hA k i : Themap ˝ mustconvertanelementoftheLiealgebratoaLiegroupelement,thusmaking A k theEulerianvelocitybetweentime t k and t k +1 ;insteadoftheusualexponentialmapwhichis computationallydi˚culttohandle,weapproximateittobetheCayleytransform ˝ ( A )=( I A= 2) 1 ( I + A= 2) ,asite˚cientlymapsantisymmetricmatricestoorthogonalmatrices.Taking variationswithrespectto k ,werecovertheexpectedgroupelementupdaterule q k +1 = ˝ ( hA k ) q k : Variationswithrespectto A k showthatthemultiplierisactuallythemomentum: k = A k .Finally variationswithrespectto q k restrictedto q k = B k q k with B k intheLiealgebra(toenforceLin constraints)yield h k 1 ; ( I hA k 1 = 2) B k ( I + hA k 1 = 2) i = h k ; ( I + hA k = 2) B k ( I hA k = 2) i : Omittingthecubictermsin O ( h 2 ) stillpreservesadiscreteKelvin'stheorem,sowefollowthe suggestionin[10]andsimplifytheupdateruleto 8 B k ; h A k 1 ;B k + h 2 [ B k ;A k 1 ] i = h A k ;B k + h 2 [ B k ; A k ] i ; 134 whichreducestothetrapezoidalrulewith A k = P i v k i A i andanarbitrary B k = P i b k i A i . 135 BIBLIOGRAPHY 136 BIBLIOGRAPHY [1] F.Knöppel,K.Crane,U.Pinkall,andP.Schröder,yoptimaldirection˝elds, ACM Trans.Graph. ,vol.32,pp.July2013. [2] S.LefebvreandH.Hoppe,Appearance-spacetexturesynthesis, ACMTrans.Graphics , vol.25,no.3,pp.2006. [3] K.Crane,C.Weischedel,andM.Wardetzky,inheat:Anewapproachtocom- putingdistancebasedonheat˛ow, ACMTrans.Graph. ,vol.32,no.5,2013. [4] M.Desbrun,E.Kanso,andY.Tong,di˙erentialformsforcomputationalmodel- ing,in DiscreteDi˙erentialGeometry, A.I.Bobenko etal. (Eds),vol.38of Oberwolfach Seminars ,pp.BirkhäuserBasel,2008. [5] J.PalaciosandE.Zhang,evisualizationofrotationalsymmetry˝eldsonsur- faces,vol.17,no.7,pp.2011. [6] O.Azencot,M.Ben-Chen,F.Chazal,andM.Ovsjanikov,Anoperatorapproachtotangent vector˝eldprocessing, ComputerGraphicsForum ,vol.32,no.5,pp.2013. [7] Y.T.Ng,C.Min,andF.Gibou,Ane˚cient˛uid-solidcouplingalgorithmforsingle-phase ˛ows, J.Comput.Phys. ,vol.228,pp.Dec.2009. [8] C.Foias,D.Holm,andE.Titi,Thethreedimensionalviscousequations, andtheirrelationtotheNavieresequationsandturbulencetheory, JournalofDynam- icsandDi˙erentialEquations ,vol.14,no.1,pp.2002. [9] T.DeWitt,C.Lessig,andE.Fiume,simulationusingLaplacianeigenfunctions, ACMTrans.Graph. ,vol.31,pp.Feb.2012. [10] E.Gawlik,P.Mullen,D.Pavlov,J.Marsden,andM.Desbrun,ic,variationaldis- cretizationofcontinuumtheories, PhysicaD:NonlinearPhenomena ,vol.240,no.21, pp.2011. [11] M.D.P.S.KeenanCrane,FernandodeGoes,geometryprocessingwithdiscrete exteriorcalculus,in ACMSIGGRAPH2013courses ,SIGGRAPH'13,(NewYork,NY, USA),ACM,2013. [12] K.PolthierandE.Preuÿ,ariationalapproachtovector˝elddecomposition,in DataVi- sualization2000 (W.deLeeuwandR.vanLiere,eds.),Eurographics,pp.1Springer Vienna,2000. [13] E.Zhang,K.Mischaikow,andG.Turk,ector˝elddesignonsurfaces, ACMTrans.Graph- ics ,vol.25,no.4,pp.2006. 137 [14] Y.Tong,S.Lombeyda,A.N.Hirani,andM.Desbrun,multiscalevector˝eld decomposition, ACMTrans.Graphics ,vol.22,no.3,pp.2003. [15] K.PolthierandE.Preuÿ,vector˝eldsingularitiesusingadiscretehodgede- composition,pp.SpringerVerlag,2003. [16] D.Pavlov,P.Mullen,Y.Tong,E.Kanso,J.Marsden,andM.Desbrun,tructure-preserving discretizationofincompressible˛uids, PhysicaD:NonlinearPhenomena ,vol.240,no.6, pp.2011. [17] M.Fisher,P.Schröder,M.Desbrun,andH.Hoppe,oftangentvector˝elds, ACM Trans.Graph. ,vol.26,July2007. [18] H.Whitney, GeometricIntegrationTheory .PrincetonUniversityPress,1957. [19] S.Elcott,Y.Tong,E.Kanso,P.Schröder,andM.Desbrun,table,circulation-preserving, simplicial˛uids, ACMTrans.Graph. ,vol.26,Jan.2007. [20] M.Ben-Chen,A.Butscher,J.Solomon,andL.Guibas,discretekillingvector˝eldsand patternsonsurfaces, ComputerGraphicsForum ,vol.29,no.5,pp.2010. [21] B.SherlockandD.Monro,Amodelforinterpreting˝ngerprinttopology, PatternRecog- nition ,vol.26,no.7,pp.10471055,1993. [22] J.Feng,J.Zhou,andA.Jain,ientation˝eldestimationforlatent˝ngerprintenhance- ment,2013. [23] E.Zhang,J.Hays,andG.Turk,etensor˝elddesignandvisualizationonsurfaces, VisualizationandComputerGraphics,IEEETransactionson ,vol.13,no.1,pp. 2007. [24] J.PalaciosandE.Zhang,otationalsymmetry˝elddesignonsurfaces, ACMTrans. Graph. ,vol.26,July2007. [25] Y.-K.Lai,M.Jin,X.Xie,Y.He,J.Palacios,E.Zhang,S.-M.Hu,andX.Gu,ic-driven rosy˝elddesignandremeshing, VisualizationandComputerGraphics,IEEETransactions on ,vol.16,no.1,pp.2010. [26] K.Crane,M.Desbrun,andP.Schröder,Trivialconnectionsondiscretesurfaces, Computer GraphicsForum ,vol.29,no.5,pp.2010. [27] N.Ray,B.Vallet,W.C.Li,andB.Lévy,ydirection˝elddesign, ACMTrans. Graph. ,vol.27,pp.May2008. [28] C.Eisenacher,C.Tappan,B.Burley,D.Teece,andA.Shek,ample-basedtexturesyn- thesisondisney'stangled,in ACMSIGGRAPH2010Talks ,SIGGRAPH'10,(NewYork, NY,USA),pp.ACM,2010. [29] B.Liu,Y.Weng,J.Wang,andY.Tong,ientation˝eldguidedtexturesynthesis, Journal ofComputerScienceandTechnology(CVM) ,vol.28,no.5,pp.2013. 138 [30] Y.Lipman,O.Sorkine,D.Levin,andD.Cohen-Or,rotation-invariantcoordinates formeshes, ACMTrans.Graph. ,vol.24,pp.July2005. [31] S.KircherandM.Garland,ormmotionprocessing, ACMTrans.Graph. ,vol.27, pp.May2008. [32] Y.Wang,B.Liu,andY.Tong,surfacereconstructionfromdiscretefundamental formsontrianglemeshes, ComputerGraphicsForum ,vol.31,no.8,pp.2012. [33] A.MylesandD.Zorin,tortionconstrainedglobalparametrization, ACM Trans.Graph. ,vol.32,pp.July2013. [34] F.deGoes,B.Liu,M.Budninskiy,Y.Tong,andM.Desbrun,2-tensor˝eldson triangulations,vol.(SymposiumonGeometryProcessing),2014. [35] N.FosterandD.Metaxas,themotionofahot,turbulentgas,in Proc.ACM SIGGRAPH ,pp.Aug.1997. [36] J.Stam,table˛uids,in ProceedingsofACMSIGGRAPH ,pp.Aug.1999. [37] J.Steinho˙andD.Underhill,oftheEulerequationsforVorticityCon˝ne- ment, PhysicsofFluids ,vol.6,pp.Aug.1994. [38] A.Selle,N.Rasmussen,andR.Fedkiw,Avortexparticlemethodforsmoke,waterand explosions, ACMTrans.Graph. ,vol.24,pp.July2005. [39] X.Zhang,R.Bridson,andC.Greif,estoringthemissingvorticityinadvection-projection ˛uidsolvers, ACMTrans.Graph. ,vol.34,no.4,p.Art.52,2015. [40] P.Mullen,K.Crane,D.Pavlov,Y.Tong,andM.Desbrun,gy-preservingintegrators for˛uidanimation, ACMTrans.Graph. ,vol.28,pp.July2009. [41] F.Losasso,J.Talton,N.Kwatra,andR.Fedkiw,Two-waycoupledSPHandParticleLevel Set˛uidsimulation, IEEETrans.onVis.andComp.Graph. ,vol.14,no.4,pp. 2008. [42] A.Golas,R.Narain,J.Sewall,P.Krajcevski,P.Dubey,andM.Lin,ge-scale˛uidsimula- tionusingvelocity-vorticitydomaindecomposition, ACMTrans.Graph. ,vol.31,pp. 148:9,Nov.2012. [43] B.E.Feldman,J.F.O'Brien,andB.M.Klingner,Animatinggaseswithhybridmeshes, ACMTrans.Graph. ,vol.24,pp.July2005. [44] C.Batty,F.Bertails,andR.Bridson,Afastvariationalframeworkforaccuratesolid-˛uid coupling, ACMTrans.Graph. ,vol.26,pp.July2007. [45] R.Howes,C.Schroeder,andJ.M.Teran,AvirtualnodealgorithmforHodgedecomposi- tionsofinviscid˛owproblemswithirregulardomains, MethodsAppl.Anal. ,vol.20,no.4, pp.2013. 139 [46] J.Stam,wsonsurfacesofarbitrarytopology,in ACMSIGGRAPH2003Papers ,SIG- GRAPH'03,(NewYork,NY,USA),pp.ACM,2003. [47] O.Azencot,S.Weiÿmann,M.Ovsjanikov,M.Wardetzky,andM.Ben-Chen,unctional ˛uidsonsurfaces, ComputerGraphicsForum ,vol.33,no.5,pp.2014. [48] J.E.MarsdenandM.West,mechanicsandvariationalintegrators, ActaNumerica 2001 ,vol.10,pp.2001. [49] L.Kharevych,W.Yang,Y.Tong,E.Kanso,J.E.Marsden,P.Schröder,andM.Desbrun, ic,variationalintegratorsforcomputeranimation,in SymposiumonComputer animation ,pp.2006. [50] D.Pavlov,P.Mullen,Y.Tong,E.Kanso,J.Marsden,andM.Desbrun,tructure-preserving discretizationofincompressible˛uids, PhysicaD:NonlinearPhenomena ,vol.240,no.6, pp.2011. [51] J.StamandE.Fiume,Turbulentwind˝eldsforgaseousphenomena,in Proceedingsof ACMSIGGRAPH ,pp.1993. [52] T.Kim,N.Thürey,D.James,andM.Gross,aveletturbulencefor˛uidsimulation,in ACMTransactionsonGraphics(TOG) ,vol.27,p.50,ACM,2008. [53] Y.Gao,C.-F.Li,B.Ren,andS.-M.Hu,iew-dependentmultiscale˛uidsimulation, Vi- sualizationandComputerGraphics,IEEETransactionson ,vol.19,no.2,pp. 2013. [54] H.SchechterandR.Bridson,olvingsub-gridturbulenceforsmokeanimation,in Sym- posiumonComputeranimation ,pp.2008. [55] R.Narain,J.Sewall,M.Carlson,andM.C.Lin,astanimationofturbulenceusingen- ergytransportandproceduralsynthesis,in ACMTransactionsonGraphics(TOG) ,vol.27, p.166,ACM,2008. [56] Z.Yuan,F.Chen,andY.Zhao,attern-guidedsmokeanimationwithLagrangianCoherent Structure,in ACMTrans.Graph. ,vol.30,p.136,2011. [57] S.ElcottandP.Schröder,yourownDECathome,in DiscreteDi˙erentialGe- ometry ,ACMSIGGRAPHCourses,pp.2006. [58] J.B.FrankandP.S.Heckbert,Apliantmethodforanisotropicmeshgeneration,in Inter- nationalMeshingRoundtable ,pp.1996. [59] R.Narain,A.Samii,andJ.F.O'Brien,Adaptiveanisotropicremeshingforclothsimula- tion, ACMTrans.Graph. ,vol.31,pp.Nov.2012. [60] D.Panozzo,E.Puppo,M.Tarini,andO.Sorkine-Hornung,˝elds:Anisotropicand non-orthogonalcross˝elds, ACMTrans.Graph.(SIGGRAPH) ,vol.33,no.4,2014. 140 [61] P.Alliez,D.Cohen-Steiner,O.Devillers,B.Lévy,andM.Desbrun,Anisotropicpolygonal remeshing, ACMTrans.Graph. ,vol.22,no.3,2003. [62] G.Tewari,J.Snyder,P.V.Sander,S.J.Gortler,andH.Hoppe,pa- rameterizationforpiecewiselinearreconstruction,in SymposiumonGeometryProcessing , pp.2004. [63] R.Zayer,C.Rossl,andH.-P.Seidel,tensorialquasi-harmonicmaps,in Shape ModelingInternational2005 ,pp.2005. [64] H.N.IbenandJ.F.O'Brien,surfacecrackpatterns,in SymposiumonCom- puterAnimation ,pp.Sept2006. [65] D.N.Arnold,R.S.Falk,andR.Winther,initeelementexteriorcalculus,homological techniques,andapplications, ActaNumerica ,vol.15,pp.2006. [66] D.L.Meier,trainedtransportalgorithmsfornumericalrelativity.i.developmentofa ˝nite-di˙erencescheme, TheAstrophysicalJournal ,vol.595,pp.2003. [67] A.Kratz,C.Auer,M.Stommel,andI.Hotz,isualizationandanalysisofsecond-order tensors:Movingbeyondthesymmetricpositive-de˝nitecase,vol.32,no.1,pp. 2013. [68] G.AlessandriniandV.Nesi,Areaformulasfor ˙ -harmonicmappings,in NonlinearProb- lemsinMathematicalPhysicsandRelatedTopicsI ,vol.1of InternationalMathematical Series ,pp.SpringerUS,2002. [69] P.B.BochevandJ.M.Hyman,inciplesofMimeticDiscretizationsofDi˙erentialOper- ators, IMAVolumes ,vol.142,pp.2006. [70] J.M.Lee, IntroductiontoSmoothManifolds .Springer,2003. [71] M.Spivak, Acomprehensiveintroductiontodi˙erentialgeometry.Vol.II .Wilmington,Del.: PublishorPerishInc.,seconded.,1979. [72] R.Abraham,J.Marsden,andT.Ratiu, Manifolds,TensorAnalysis,andApplications:2nd Edition .Springer-Verlag,1988. [73] M.BergerandD.G.Ebin,decompositionsofthespaceofsymmetrictensorsona Riemannianmanifold, JournalofDi˙erentialGeometry ,vol.3,no.3-4,pp.1969. [74] P.Petersen, RiemannianGeometry ,vol.171of GraduateTextsinMathematics .Springer, 2006. [75] H.C.Hu,variationalprinciplesinelasticityandplasticity, ActaPhys.Sin. ,vol.10, no.3,pp.1954. [76] D.Kovacs,A.Myles,andD.Zorin,Anisotropicquadrangulation., ComputerAidedGeo- metricDesign ,vol.28,no.8,pp.2011. 141 [77] P.PeronaandJ.Malik,andedgedetectionusinganisotropicdi˙usion, IEEE Trans.PatternAnal.Mach.Intell. ,vol.12,no.7,pp.1990. [78] F.deGoes,P.Alliez,H.Owhadi,andM.Desbrun,theequilibriumofsimplicialmasonry structures, ACMTrans.Graph. ,vol.32,no.4,2013. [79] Y.Liu,P.Hao,J.Snyder,W.Wang,andB.Guo,self-supportingsurfacesby regulartriangulation, ACMTrans.Graph.(SIGGRAPH) ,vol.32,no.4,2013. [80] E.Praun,A.Finkelstein,andH.Hoppe,textures,in Proceedingsofthe27th annualconferenceonComputergraphicsandinteractivetechniques ,pp.ACM Press/Addison-WesleyPublishingCo.,2000. [81] G.Turk,Texturesynthesisonsurfaces,in Proceedingsofthe28thannualconferenceon Computergraphicsandinteractivetechniques ,pp.ACM,2001. [82] V.Kwatra,A.Schödl,I.Essa,G.Turk,andA.Bobick,textures:Imageandvideo synthesisusinggraphcuts, ACMTransactionsonGraphics,SIGGRAPH2003 ,vol.22, pp.July2003. [83] Q.WuandY.Yu,eaturematchinganddeformationfortexturesynthesis,in ACMSIG- GRAPH2004Papers ,SIGGRAPH'04,(NewYork,NY,USA),pp.ACM,2004. [84] C.Barnes,E.Shechtman,A.Finkelstein,andD.Goldman,atchmatch:arandomizedcor- respondencealgorithmforstructuralimageediting, ACMTransactionsonGraphics-TOG , vol.28,no.3,p.24,2009. [85] S.LefebvreandH.Hoppe,arallelcontrollabletexturesynthesis, ACMTrans.Graph. , vol.24,pp.July2005. [86] F.GonzálezandG.Patow,mappingformulti-charttextures, ACMTrans. Graph. ,vol.28,pp.Dec.2009. [87] G.Turk,artii:texturingsurfacesandgeometrycreation,in ACMSIGGRAPH2007 courses ,SIGGRAPH'07,(NewYork,NY,USA),ACM,2007. [88] L.-Y.Wei,S.Lefebvre,V.Kwatra,andG.Turk,tateoftheartinexample-basedtexture synthesis,in Eurographics2009,StateoftheArtReport,EG-STAR ,EurographicsAssoci- ation,2009. [89] H.Theisel,2dvector˝eldsofarbitrarytopology,vol.21,no.3,pp. 2002. [90] A.HertzmannandD.Zorin,tratingsmoothsurfaces,pp.2000. [91] N.Ray,B.Vallet,L.Alonso,andB.Levy,y-awaredirection˝eldprocessing, ACMTrans.Graph. ,vol.29,pp.Dec.2009. [92] D.Bommes,H.Zimmer,andL.Kobbelt,ed-integerquadrangulation, ACMTrans. Graph. ,vol.28,pp.July2009. 142 [93] D.Panozzo,Y.Lipman,E.Puppo,andD.Zorin,ieldsonsymmetricsurfaces, ACMTrans. Graph. ,vol.31,pp.July2012. [94] D.LaidlawandJ.Weickert, VisualizationandProcessingofTensorFields:Advancesand Perspectives .SpringerPublishingCompany,Incorporated,1sted.,2009. [95] T.DelmarcelleandL.Hesselink,Thetopologyofsymmetric,second-ordertensor˝elds, pp.1994. [96] X.ZhengandA.Pang,asymmetrictensoranalysis,pp.2005. [97] E.Zhang,H.Yeh,Z.Lin,andR.Laramee,Asymmetrictensoranalysisfor˛owvisualiza- tion,vol.15,no.1,pp.2009. [98] D.Palke,Z.Lin,G.Chen,H.Yeh,P.Vincent,R.Laramee,andE.Zhang,Asymmetric tensor˝eldvisualizationforsurfaces,vol.17,no.12,pp.2011. [99] T.Regge,relativitywithoutcoordinates, NuovoCim. ,vol.19,no.3,pp. 1961. [100] B.Springborn,P.Schröder,andU.Pinkall,ormalequivalenceoftrianglemeshes, ACMTrans.Graph. ,vol.27,no.3,2008. [101] F.Luo,ofpolyhedralsurfaces,III,2010.arXiv:1010.3284v1. [102] M.Campen,M.Heistermann,andL.Kobbelt,anisotropicgeodesy, Computer GraphicsForum ,vol.32,no.5,pp.2013. [103] F.deGoes,P.Memari,P.Mullen,andM.Desbrun,eightedtriangulationsforgeometry processing, ACMTrans.Graph. ,vol.33,2014. [104] D.N.Arnold,R.S.Falk,andR.Winther,complexesandstabilityof˝niteele- mentmethodsII:Theelasticitycomplex,in CompatibleSpatialDiscretizations (D.Arnold, P.Bochev,R.Lehoucq,R.Nicolaides,andM.Shashkov,eds.),vol.142of IMAVol.Math. Appl. ,pp.2006. [105] D.N.ArnoldandR.Winther,ed˝niteelementsforelasticity, Numer.Math. ,vol.92, no.3,pp.2002. [106] D.N.ArnoldandR.Winther,onconformingmixedelementsforelasticity, Math.Models MethodsAppl.Sci. ,vol.13,no.3,pp.2003. [107] D.N.Arnold,G.Awanou,andR.Winther,initeelementsforsymmetrictensorsinthree dimensions, Math.Comput. ,vol.77,pp.2008. [108] D.Arnold,G.Awanou,andR.Winther,onconformingtetrahedralmixed˝niteelements forelasticity, Math.ModelsMethodsAppl.Sci. ,vol.24,pp.2014. [109] E.Kanso,M.Arroyo,Y.Tong,A.Yavari,J.Marsden,andM.Desbrun,thegeometric characterofstress, ZAMP ,vol.58(5),pp.2007. 143 [110] A.GreenandW.Zerna, TheoreticalElasticity .Dover,2002. [111] J.R.Munkres, ElementsofAlgebraicTopology .Addison-Wesley,1984. [112] D.Cohen-SteinerandJ.-M.Morvan,estrictedDelaunaytriangulationsandnormalcycle, pp.2003. [113] E.Grinspun,Y.I.Gingold,J.Reisman,andD.Zorin,discreteshapeoperators ongeneralmeshes., Comput.Graph.Forum ,vol.25,no.3,pp.2006. [114] K.Wang,Weiwei,Y.Tong,M.Desbrun,andP.Schröder,esubdivisionschemesand theconstructionofsmoothvector˝elds, ACMTrans.Graph. ,vol.25,pp.July 2006. [115] A.BossavitandL.Kettunen,ee-schemesonatetrahedralmesh,withdiagonallumping, Int.J.Num.Model. ,vol.12,pp.1999. [116] U.PinkallandK.Polthier,discreteminimalsurfacesandtheirconjugates, Exp. Math. ,vol.2,no.1,pp.1993. [117] D.Glickenstein,ictriangulations&discreteLaplaciansonmanifolds,2005. arXiv.org:math/0508188. [118] P.Mullen,P.Memari,F.deGoes,andM.Desbrun,Hodge-optimizedtriangulations, ACMTrans.Graph.(SIGGRAPH) ,vol.30,2011. [119] G.Guennebaud,B.Jacob, etal. ,env3.http://eigen.tuxfamily.org,2010. [120] K.Hildebrandt,K.Polthier,andM.Wardetzky,theconvergenceofmetricandgeometric propertiesofpolyhedralsurfaces, GeometriaeDedicata ,vol.123,no.1,pp.2006. [121] A.Treuille,A.Lewis,andZ.Popovi¢,reductionforreal-time˛uids, ACMTrans. Graph. ,vol.25,pp.July2006. [122] I.Silberman,ywavesintheatmosphere, J.Meteor. ,vol.11,pp.1954. [123] V.Yudovich,on-stationary˛owofanidealincompressibleliquid, USSRComputational MathematicsandMathematicalPhysics ,vol.3,no.6,pp.1963. [124] S.A.Orszag,umericalmethodsforthesimulationofturbulence, PhysicsofFluids , vol.12,pp.II1969. [125] M.GuptaandS.G.Narasimhan,endre˛uids:Auni˝edframeworkforanalyticre- ducedspacemodelingandrenderingofparticipatingmedia,in SymposiumonComputer Animation ,pp.2007. [126] B.LongandE.Reinhard,eal-time˛uidsimulationusingdiscretesine/cosinetransforms, in SymposiumonInteractive3DGraphicsandGames ,pp.2009. 144 [127] M.Stanton,Y.Sheng,M.Wicke,F.Perazzi,A.Yuen,S.Narasimhan,andA.Treuille, on-polynomialGalerkinprojectionondeformingmeshes, ACMTrans.Graph. ,vol.32, pp.July2013. [128] J.M.Cohen,S.Tariq,andS.Green,e˛uid-particlesimulationusingtranslating Euleriangrids,in ACMSymp.onInteractive3DGraphicsandGames ,pp.2010. [129] S.An,T.Kim,andD.James,cubaturefore˚cientintegrationofsubspace deformations, ACMTrans.Graph. ,vol.27,no.5,p.Art.165,2008. [130] C.vonTycowicz,C.Schulz,H.-P.Seidel,andK.Hildebrandt,Ane˚cientconstructionof reduceddeformableobjects, ACMTrans.Graph. ,vol.32,no.6,p.Art.213,2013. [131] S.Li,J.Huang,F.deGoes,X.Jin,H.Bao,andM.Desbrun,editingofelastic motionthroughmaterialoptimizationandreduction, ACMTrans.Graph. ,vol.33,no.4, p.Art.108,2014. [132] T.KimandJ.Delaney,˛uidre-simulation, ACMTrans.Graph. ,vol.32,no.4, p.62,2013. [133] F.H.HarlowandJ.E.Welch,umericalcalculationoftime-dependentviscousincom- pressible˛owof˛uidwithfreesurface, PhysicsofFluids ,vol.8,pp.Dec. 1965. [134] M.Desbrun,E.Kanso,andY.Tong,di˙erentialformsforcomputationalmodel- ing,in ACMSIGGRAPH'06CourseNotesonDiscreteDi˙erentialGeometry ,ACMPress, 2006. [135] M.Desbrun,E.S.Gawlik,F.Gay-Balmaz,andV.Zeitlin,ariationaldiscretizationfor rotatingstrati˝ed˛uids, Disc.Cont.Dyn.S. ,vol.34,no.2,pp.2013. [136] N.BellandA.N.Hirani,:APythonlibraryforDiscreteExteriorCalculus,2008. GoogleCodeprojectat: http://code.google.com/p/pydec/ . [137] J.Stam,Asimple˛uidsolverbasedonthe˙t, J.Graph.Tools ,vol.6,pp.Sept. 2002. [138] K.Urban,aveletbasesfor H (div)and H (curl),in WaveletsinNumericalSimulation , vol.22of LectureNotesinComputationalScienceandEngineering ,pp.2002. [139] Y.Tong,P.Alliez,D.Cohen-Steiner,andM.Desbrun,quadrangulationswith discreteharmonicforms,in SymposiumonGeometryProcessing ,pp.2006. [140] A.ChorinandJ.Marsden, AMathematicalIntroductiontoFluidMechanics .Springer- Verlag,3rdeditioned.,1979. 145