340 likes | 462 Views
Israel-Korea Conference Numerical Methods for Digital Geometry Processing Bruno Lévy INRIA, ALICE. Overview. 1. Numerical Problems in DGP 2. Linear and Quadratic DGP 3. Non-linear DGP. 1970’s. 2000’s. Motivations:. Need for scalability in DGP.
E N D
Israel-Korea Conference Numerical Methodsfor Digital Geometry ProcessingBruno LévyINRIA, ALICE
Overview 1. Numerical Problems in DGP 2. Linear and Quadratic DGP 3. Non-linear DGP
1970’s 2000’s Motivations: Need for scalability in DGP
1. Numerical Problems in DGPMesh Parameterization Ui = S ai,jUj j Ni i i,j ai,j > 0 j1 The border is mapped to a convex polygon j… j2 [Tutte], [Floater]
1. Numerical Problems in DGPDiscrete Fairing 2 F(p)=Spi - S ai,jpj i j Ni i j1 j… j2 [Mallet], [Kobbelt], …
1. Numerical Problems in DGPStencils F = sum of terms, attached to neighborhoods Parameterization [Haker00] [Levy02] Curv. Estimation [Cohen-Steiner 03] Texture mapping [Levy01] Discrete fairing [Levy03] Discrete fairing [Kobbelt98, Mallet95] Parameterization [Desbrun02] Deformations [CohenOr], [Sorkine] [Eck]
2. Linear and Quadratic DGPRemoving degrees of freedom 2 F(x) = A x - b 2 xf xl [ Af Al] - b F(xf) =
2 2 F(xf) = A.x - d = Al.xl + Af.xf - d F(xf) minimum Aft.Af.xf = Aft.d - AftAl.xl } } M.x = b 2. Linear and Quadratic DGPRemoving degrees of freedom The problem: (1) construct a linear system (2) solve a linear system
NlSolve() 2. Linear and Quadratic DGPThe OpenNL approach (http://www.loria.fr/~levy/software) The problem: (1) construct a linear system (2) solve a linear system NlLockVariable(i1, val1) NlLockVariable(i2, val2) … For each stencil instance (one-rings): NlBeginRow(); NlAddCoefficient(i, a); … NlEndRow(); • Need for • Dynamic Matrix DS • Updating formula
U M = n=106 10 centuries n=100 0.01 s (1) solve U x = b Y = b L L L U x = Y (2) solve 2. Linear and Quadratic DGPDirect Solvers (LU) A Textbook solver: LU factorization (and Cholesky) a ‘small’ problem: O(n3) !!
mi,j xfj … … … mn,1 mi,1 m1,1 … … … mn,j m1,j mi,j mi,n m1,n mn,n j = i ) ( w ci- xfi (1-w).xfi + mi,i 2. Linear and Quadratic DGPSuccessive Over-Relaxation (Gauss-Seidel) xf1 …. …. …. …. …. = xfi ci …. …. …. …. …. xfnf [Taubin95] [Levy98] …
2. Linear and Quadratic DGPSuccessive Over-Relaxation (Gauss-Seidel) 1000 iterations S.O.R.
Complicated ops: Matrix x vector (see paper) 2. Linear and Quadratic DGPWhite Magic: The Conjugate Gradient inline int solve_conjugate_gradient( const SparseMatrix &A, const Vector& b, Vector& x, double eps, int max_iter ){ int N = A.n() ; double t, tau, sig, rho, gam; double bnorm2 = BLAS::ddot(N,b,1,b,1) ; double err=eps*eps*bnorm2 ; mult(A,x,g); BLAS::daxpy(N,-1.,b,1,g,1); BLAS::dscal(N,-1.,g,1); BLAS::dcopy(N,g,1,r,1); while ( BLAS::ddot(N,g,1,g,1)>err && its < max_iter) { mult(A,r,p); rho=BLAS::ddot(N,p,1,p,1); sig=BLAS::ddot(N,r,1,p,1); tau=BLAS::ddot(N,g,1,r,1); t=tau/sig; BLAS::daxpy(N,t,r,1,x,1); BLAS::daxpy(N,-t,p,1,g,1); gam=(t*t*rho-tau)/tau; BLAS::dscal(N,gam,r,1); BLAS::daxpy(N,1.,g,1,r,1); ++its; } return its ; } Only simple vector ops (BLAS) Demo (Constrained Tex Map, Siggraph01)
U M = L j, gi,j 2. Linear and Quadratic DGPBlack Magic: Sparse Direct Solvers Super-nodal: [Demmel et.al 96] Multi-frontal:[Lexcellent et.al 98] [Toledo et.al] Direct method’s revenge: Super-Nodal data structure Demo: Free-form modeling with meshes
LS with reduced degrees of freedom • Built-in (CG, GMRES, BICGSTAB) • SuperLU • MUMPS • TAUCS • … j, gi,j 2. Linear and Quadratic DGPOpenNL architecture NlLockVariables(i,a) … NlBeginRow() NlAddCoefficient(i,a) … NlEndRow() NlSolve()
2. Linear and Quadratic DGPApplications Maya Gocad: Meshing for oil-exploration Blender (OpenSource) VSP-Technology ATARI-Infogrammes
3. Non-Linear DGP • MIPS [Hormann], Stretch [Sander] • ABF [Sheffer], ABF++ [Sheffer & Lévy] • PGP [Ray,Levy,Li,Sheffer,Alliez] • Circle Packings [Bobenko], [Schroeder] • Finite elements with dynamic function bases
3. Non-Linear DGPGalerkin Finite Elements (linear) • Operator equation: Lf = g • e.g. L = ∆ = ∂2./∂x2 + ∂2./∂y2 • without rhs (g = 0): Laplace • with rhs (g = arbitrary function): Poisson • Function basis (fi): f = Saifi • Scalar Product: <f,g> = ∫ f(x) g(x) dx • i, <Lf, fi> = <g, fi>
3. Non-Linear DGPGalerkin Finite Elements (linear) …… <Lf1, f1> <Lf1, fn> a1 <g, f1> <Lfi, fj> = <Lfn, f1> …… an <g, fn> <Lfn, fn>
3. Non-Linear DGPFrustation withGalerkin FEM (demo) Fixed function basis DFB
3. Non-Linear DGPDynamic Function Bases i p, fi( x,y) p = (x1,y1, …, xm, ym)
3. Non-Linear DGPDynamic Function Bases • f = Saifi(p1, p2, …, pm, x,y) = Saifi(p,x) • Galerkin: i, <Lf, fi> = <g, fi> • DFB: minimize F(p,a) = |Lf – g|2 • Solve for f [a] and for its sampling [p]
3. Non-Linear DGPOptimization with DFB: general algorithm While | F | > e 2a,a F 2a,p F da a F 2p,a F 2p,p F dp p F solve = - a a + da p p + dp End while
3. Non-Linear DGPInstancing the general algorithm • Lf = g operator L, rhs g, basis (fi) • Numerical estimation of F and 2F ∂./∂. ∫ Lfi x Lfj ∂./∂. ∫ Lfi x g (smoothness of Lloyd, Wenping Wang) • First example: L = Identity, f = g (ARDECO approximation with DFP)
3. Non-Linear DGPARDECO (Bitmap SVG) (original: 1M pixels) 300 postcript gradients
3. Non-Linear DGPDFB research program • 2D: Laplace Eqn, Poisson Eqn • 1D+t: Heat eqn (sugg. by F. Durand) • 2D: ARDECO • 2D+t: Navier-Stokes • 3D: Light Simulation, Mesh-to-splines • 3D+t: Misc. physics Available tools: mixed symbolic/numeric solver
Conclusions • The DGP community can directly benefit from the advances done by the NA community • Solving for the approximation and the sampling seems to be an interresting research avenue
Aknowledgemes • IK organizing comittee • AIM@Shape • INRIA/GEOREP • Fench ministry of research/ACI SHOW • Wenping Wang (HKU) • Fredo Durand, Matthias Zwicker (MIT) • Students: B. Vallet, N. Ray, W.C. Li, G. Lecot