An Efficient Multigrid Method for the Simulation of High-Resolution Elastic
Total Page:16
File Type:pdf, Size:1020Kb
An efficient multigrid method for the simulation of high-resolution elastic solids YONGNING ZHU, University of California Los Angeles EFTYCHIOS SIFAKIS, JOSEPH TERAN University of California Los Angeles – Walt Disney Animation Studios and ACHI BRANDT Weizmann Institute of Science We present a multigrid framework for the simulation of high resolution elas- the simulation of large models with hundreds of thousands of de- tic deformable models, designed to facilitate scalability on shared memory grees of freedom, and aim to create the ideal conditions for our multiprocessors. We incorporate several state-of-the-art techniques from method to scale favorably on shared memory multiprocessors with multigrid theory, while adapting them to the specific requirements of graph- a large number of cores. In addition, we accommodate models of ics and animation applications, such as the ability to handle elaborate ge- arbitrary geometry, and our solver is equally effective even on near- ometry and complex boundary conditions. Our method supports simula- incompressible materials. Although such issues have been individ- tion of linear elasticity and co-rotational linear elasticity. The efficiency of ually discussed in the graphics community, we jointly address the our solver is practically independent of material parameters, even for near- challenges of irregular geometry, near-incompressibilty and par- incompressible materials. We achieve simulation rates as high as 6 frames allel performance without limiting our scope to smaller problems per second for test models with 256K vertices on an 8-core SMP, and 1.6 which can achieve interactive performance with a broader variety frames per second for a 2M vertex object on a 16-core SMP. of techniques. Our solver accommodates the equations of 3D lin- ear (or co-rotational) elasticity as opposed to simpler elliptic sys- Categories and Subject Descriptors: I.3.5 [Computer Graphics]: Com- tems (e.g. Poisson problems), and performs well for either dynamic putational Geometry and Object Modeling—Physically based modeling; or quasistatic simulation. In order to extract the maximum perfor- G.1.8 [Numerical Analysis]: Finite difference methods—Multigrid and mance that multigrid formulations have to offer, we adopt some less multilevel methods common choices such as a staggered finite difference discretiza- tion and a mixed formulation of the elasticity equations. We be- Additional Key Words and Phrases: Deformable models, co-rotational lin- lieve these decisions are justified by the performance gains, scala- ear elasticity, near-incompressible solids, parallel simulation bility potential and resilience to incompressibility exhibited by our method. Our main contributions are: —We introduce a novel, symmetric boundary discretization, en- abling robust treatment of irregular geometry and efficient 1. INTRODUCTION smoothing of the boundary conditions. Simulation of deformable solids was introduced to computer graph- —We show how to accommodate both linear and co-rotational lin- ics by [Terzopoulos et al. 1987; Terzopoulos and Fleischer 1988]. ear elasticity within our framework, for the entire range of com- The quest for visual realism has spawned an ever growing interest pressible to highly incompressible materials. in simulation techniques capable of accommodating larger, more detailed models. Several researchers have explored approaches —We demonstrate the mapping and favorable scalability of our such as adaptivity [Debunne et al. 2001; Capell et al. 2002; Grin- framework on multi-threaded SMP platforms. spun et al. 2002], reduced models [James and Fatahalian 2003; Barbic and James 2005] or shape matching [Muller¨ et al. 2005; 2. BACKGROUND Rivers and James 2007] to accelerate the simulation of detailed de- formable models, while others used multi-core platforms [Hughes 2.1 Linear elasticity et al. 2007; Thomaszewski et al. 2007] to reduce simulation times. We represent the deformation of an elastic volumetric object using Multigrid methods [Trottenberg et al. 2001; Brandt 1977] are a deformation function φ which maps any material point X of the among the fastest numerical solvers for certain elliptic problems. undeformed configuration of the object, to its position x in the de- Due to their efficiency, multigrid methods have garnered attention formed configuration, i.e. x = φ(X). Deformation of an object in the graphics community for a diverse spectrum of applications, gives rise to elastic forces [Bonet and Wood 1997] which are ana- including deformable bodies and thin shell simulation [Green et al. lytically given (in divergence form) as f = rT P or, component- 2002; Wu and Tendick 2004; Georgii and Westermann 2006; 2008], wise f = P @ P where P is the first Piola-Kirchhoff stress ten- mesh deformation [Shi et al. 2006], image editing [Kazhdan and i j j ij sor. The stress tensor P is computed from the deformation map φ. Hoppe 2008], biomedical simulation [Dick et al. 2008], geometry This analytic expression is known as the elastic constitutive equa- processing [Ni et al. 2004] and in general purpose GPU solvers tion. We will henceforth adopt the common conventions of using [Bolz et al. 2003; Goodnight et al. 2003]. subscripts after a comma to denote partial derivatives, and omit We present a scalable framework for fast deformable model sim- certain summation symbols by implicitly summing over any right- ulation based on multigrid techniques. We particularly focus on hand side indices that do not appear on the left-hand side of a given ACM Transactions on Graphics, Vol. VV, No. N, Article XXX, Publication date: Month YYYY. 2 • Y. Zhu et al. equation. Consequently, the previous equation is compactly written Algorithm 1 Multigrid Correction Scheme – V(1,1) Cycle fi = Pij;j . The constitutive equation of linear elasticity is 1: procedure MULTIGRID(φ; f;L) . φ is the current estimate h h P = 2µ + λtr()I or Pij = 2µij + λkkδij (1) 2: u φ; b f . total of L+1 levels 3: for l = 0 to L−1 do In this equation, µ and λ are the Lame´ parameters of the linear 2lh 2lh 2lh material, and are computed from Young’s modulus E (a measure 4: Smooth(L ,u ,b ) l 2lh l l of material stiffness) and Poisson’s ratio ν (a measure of material 5: r2 h b − L2 hu2 h l+1 l l+1 incompressibility) as µ = E=(2+2ν); λ = Eν=((1+ν)(1−2ν)). 6: b2 h Restrict(r2 h), u2 h 0 Also, δ is the Kronecker delta, is the small strain tensor 7: end for ij L L L 8: Solve u2 h (L2 h)−1b2 h 1 T 1 = 2 (F + F ) − I or ij = 2 (φi;j + φj;i) − δij (2) 9: for l = L−1 down to 0 do l l l+1 10: u2 h u2 h+Prolongate(u2 h) and F is the deformation gradient tensor, defined as Fij = φi;j . l l l Using (1,2) we derive the governing equations 11: Smooth(L2 h,u2 h,b2 h) 12: end for f = µφ + (µ + λ)φ = L φ (3) i i;jj j;ij ij j 13: φ uh In this equation L = µ∆I + (µ + λ)rrT is the partial differen- 14: end procedure tial operator of linear elasticity. A static elasticity problem amounts to determining the deformation map φ that leads to an equilib- rium of the total forces, i.e. Lφ + fext = 0, where fext are the 3. DISCRETIZATION external forces applied on the object. For simplicity, we redefine f = −f and the static elasticity problem becomes equivalent to ext Our method uses a staggered finite difference discretization on the linear partial differential equation Lφ = f. uniform grids, a familiar practice in the field of computational fluid dynamics (e.g. [Harlow and Welch 1965]). Although far less 2.2 Multigrid correction scheme widespread for the simulation of solids, this formulation was se- lected for reasons of efficiency and numerical stability. Multigrid methods are based on the concept of a smoother which is a procedure designed to reduce the residual r=f−Lφ of the differ- ential equation. For example, in a discretized system, Gauss-Seidel Use of regular grids. We discretize the elasticity problem on a or Jacobi iteration are common smoothers. An inherent property of regular Cartesian lattice. Our deformable model is embedded in elliptic systems is that when the magnitude of the residual is small, this lattice, similar to the approach of [Rivers and James 2007]. the error e = φ − φexact is expected to be smooth [Brandt 1986]. Although an unstructured mesh provides more flexibility, we opted Smoothers are typically simple, local and relatively inexpensive for a regular grid for economy of storage. For example, storing the routines, which are efficient at reducing large values of the residual topology of a tetrahedral lattice could easily require 4-5 times more (and, as a consequence, eliminating high frequences in the error). than the storage required for the vertex positions, taking up valu- Nevertheless, once the high frequency component of the error has able memory bandwidth. Additionally, the discrete PDE and trans- been eliminated, subsequent iterations are characterized by rapidly fer operators are uniform across regular grids, eliminating the need decelerated convergence. Multigrid methods seek to remediate this for explicit storage. Although not used in this paper, adaptivity can stagnation by using the smoother as a building block in a multi- also be combined with regular grids, see e.g. [Brandt 1977]. level solver that achieves constant rate of convergence, regardless of the prevailing frequencies of the error. This is accomplished by observing that any persistent lower frequency error will appear to Use of finite differences. Finite elements are arguably the most be higher frequency if the problem is resampled using a coarser common discretization method for elasticity applications in graph- discretization. By transitioning to ever coarser discretizations the ics (see e.g. [O’Brien and Hodgins 1999]). Finite elements have smoother retains the ability to make progress towards convergence.