Israel-Korea Conference Numerical Methods for Digital Geometry Processing Bruno Lévy INRIA, ALICE...

Post on 27-Dec-2015

223 views 0 download

Tags:

Transcript of Israel-Korea Conference Numerical Methods for Digital Geometry Processing Bruno Lévy INRIA, ALICE...

Israel-Korea Conference Israel-Korea Conference

Numerical MethodsNumerical Methodsfor Digital Geometry for Digital Geometry

ProcessingProcessing

Bruno LévyBruno Lévy

INRIA, ALICEINRIA, ALICE

OverviewOverview

1. Numerical Problems in DGP1. Numerical Problems in DGP

2. Linear and Quadratic DGP 2. Linear and Quadratic DGP

3. Non-linear DGP3. Non-linear DGP

Motivations:Motivations:

1970’s1970’s

2000’s2000’s

Need for Need for scalabilityscalability in DGP in DGP

1. Numerical Problems in 1. Numerical Problems in DGPDGP

Mesh ParameterizationMesh Parameterization

ii

jj11

jj22jj……

UUii = = a ai,ji,jUUjj

j j N Nii

i,j ai,j > 0i,j ai,j > 0

The border is mapped toThe border is mapped toa convex polygona convex polygon

[Tutte], [Floater][Tutte], [Floater]

1. Numerical Problems in 1. Numerical Problems in DGPDGP

Discrete FairingDiscrete Fairing

ii

jj11

jj22jj……

F(p)=F(p)= ppii - - a ai,ji,jppjj

22

j j N Niiii

[Mallet], [Kobbelt], …[Mallet], [Kobbelt], …

1. Numerical Problems in 1. Numerical Problems in DGPDGP

StencilsStencils

F = sum of terms, attached to neighborhoodsF = sum of terms, attached to neighborhoods

Discrete fairingDiscrete fairing[Kobbelt98, Mallet95][Kobbelt98, Mallet95]ParameterizationParameterization[Desbrun02][Desbrun02]DeformationsDeformations[CohenOr], [Sorkine][CohenOr], [Sorkine]

Curv. EstimationCurv. Estimation[Cohen-Steiner 03][Cohen-Steiner 03]Texture mappingTexture mapping[Levy01][Levy01]Discrete fairingDiscrete fairing[Levy03][Levy03]

ParameterizationParameterization[Haker00][Haker00][Levy02][Levy02]

[Eck][Eck]

2. Linear and Quadratic DGP2. Linear and Quadratic DGPRemoving degrees of freedomRemoving degrees of freedom

F(xf) = F(xf) = xfxf

xlxl

[ Af [ Af AlAl] - b] - b

22

F(x) = A x - bF(x) = A x - b22

2. Linear and Quadratic DGP2. Linear and Quadratic DGPRemoving degrees of freedomRemoving degrees of freedom

F(xf) = A.x - d = Al.xl + Af.xf - d F(xf) = A.x - d = Al.xl + Af.xf - d2 2

F(xf) minimumF(xf) minimum Aft.Af.xf = Af

t.d - AftAl.xl Af

t.Af.xf = Aft.d - Af

tAl.xl

M.x = b M.x = b

}} }}

The problem: (1) construct a linear system (2) solve a linear system

2. Linear and Quadratic DGP2. Linear and Quadratic DGPThe OpenNL approach The OpenNL approach

(http://www.loria.fr/~levy/software)(http://www.loria.fr/~levy/software)

The problem: (1) construct a linear system (2) solve a linear system

NlLockVariable(i1, val1)NlLockVariable(i1, val1)NlLockVariable(i2, val2)NlLockVariable(i2, val2)……For each stencil instance (one-rings):For each stencil instance (one-rings): NlBeginRow();NlBeginRow(); NlAddCoefficient(i, a);NlAddCoefficient(i, a); … … NlEndRow();NlEndRow();

NlSolve()NlSolve()

Need forNeed for• Dynamic Matrix DSDynamic Matrix DS• Updating formulaUpdating formula

2. Linear and Quadratic DGP2. Linear and Quadratic DGPDirect Solvers (LU)Direct Solvers (LU)

A Textbook solver: LU factorization (and Cholesky)

M =M =UL

UL x = b

L Y = b (1) solve

U x = Y(2) solve

a ‘small’ problem: O(n3) !!n=100 0.01 sn=106 10 centuries

2. Linear and Quadratic DGP2. Linear and Quadratic DGPSuccessive Over-Relaxation (Gauss-Seidel)Successive Over-Relaxation (Gauss-Seidel)

=

….

ci

….

xfnf

xf1

mi,jmi,1 mi,n… …

m1,jm1,1 m1,n… …

mn,jmn,1 mn,n… …

….

….

….

….

….

….

xfi

….

….

xfixfimi,imi,i

xfi xfi +j = ij = i mi,j xfjmi,j xfjci-ci-(( )) [Taubin95][Taubin95]

[Levy98][Levy98]……

2. Linear and Quadratic DGP2. Linear and Quadratic DGPSuccessive Over-Relaxation (Gauss-Seidel)Successive Over-Relaxation (Gauss-Seidel)

1000 iterations S.O.R.

2. Linear and Quadratic DGP2. Linear and Quadratic DGPWhite Magic: White Magic: The Conjugate GradientThe Conjugate Gradient

Demo (Constrained Tex Map, Demo (Constrained Tex Map, Siggraph01)Siggraph01)

inline int solve_conjugate_gradient(inline int solve_conjugate_gradient( const SparseMatrix &A, const Vector& b, Vector& const SparseMatrix &A, const Vector& b, Vector& x, x, double eps, int max_iterdouble eps, int max_iter ){ ){ int N = A.n() ;int N = A.n() ; double t, tau, sig, rho, gam;double t, tau, sig, rho, gam; double bnorm2 = BLAS::ddot(N,b,1,b,1) ; double bnorm2 = BLAS::ddot(N,b,1,b,1) ; double err=eps*eps*bnorm2 ; double err=eps*eps*bnorm2 ; mult(A,x,g);mult(A,x,g); BLAS::daxpy(N,-1.,b,1,g,1);BLAS::daxpy(N,-1.,b,1,g,1); BLAS::dscal(N,-1.,g,1);BLAS::dscal(N,-1.,g,1); BLAS::dcopy(N,g,1,r,1);BLAS::dcopy(N,g,1,r,1); while ( BLAS::ddot(N,g,1,g,1)>err && its < while ( BLAS::ddot(N,g,1,g,1)>err && its < max_iter) { max_iter) { mult(A,r,p);mult(A,r,p); rho=BLAS::ddot(N,p,1,p,1);rho=BLAS::ddot(N,p,1,p,1); sig=BLAS::ddot(N,r,1,p,1);sig=BLAS::ddot(N,r,1,p,1); tau=BLAS::ddot(N,g,1,r,1);tau=BLAS::ddot(N,g,1,r,1); t=tau/sig;t=tau/sig; BLAS::daxpy(N,t,r,1,x,1);BLAS::daxpy(N,t,r,1,x,1); BLAS::daxpy(N,-t,p,1,g,1);BLAS::daxpy(N,-t,p,1,g,1); gam=(t*t*rho-tau)/tau;gam=(t*t*rho-tau)/tau; BLAS::dscal(N,gam,r,1);BLAS::dscal(N,gam,r,1); BLAS::daxpy(N,1.,g,1,r,1);BLAS::daxpy(N,1.,g,1,r,1); ++its;++its; }} return its ;return its ;}}

Only simpleOnly simplevector ops (BLAS)vector ops (BLAS)

Complicated ops:Complicated ops:Matrix x vectorMatrix x vector(see paper)(see paper)

2. Linear and Quadratic DGP2. Linear and Quadratic DGPBlack Magic: Black Magic: Sparse Direct SolversSparse Direct Solvers

Demo: Free-form modeling with meshesDemo: Free-form modeling with meshes

Direct method’s revenge: Super-Nodal data structure

M =M =UL

j, gi,j

Super-nodal: [Demmel et.al 96]Multi-frontal:[Lexcellent et.al 98] [Toledo et.al]

2. Linear and Quadratic DGP2. Linear and Quadratic DGPOpenNL architectureOpenNL architecture

NlLockVariables(i,a)NlLockVariables(i,a)……

NlBeginRow()NlBeginRow()NlAddCoefficient(i,a)NlAddCoefficient(i,a)……NlEndRow()NlEndRow()

NlSolve()NlSolve()

j, gi,j

LS with LS with reducedreduceddegrees ofdegrees offreedomfreedom

•Built-in (CG, GMRES, BICGSTAB)Built-in (CG, GMRES, BICGSTAB)•SuperLUSuperLU•MUMPSMUMPS•TAUCSTAUCS•……

2. Linear and Quadratic DGP2. Linear and Quadratic DGPApplicationsApplications

Gocad:Gocad:Meshing forMeshing foroil-explorationoil-exploration

MayaMaya

VSP-TechnologyVSP-TechnologyATARI-InfogrammesATARI-Infogrammes

Blender Blender (OpenSource)(OpenSource)

3. Non-Linear DGP3. Non-Linear DGP

MIPS MIPS [Hormann], Stretch [Sander][Hormann], Stretch [Sander] ABF ABF [Sheffer][Sheffer], ABF++ , ABF++ [Sheffer & Lévy][Sheffer & Lévy] PGP [Ray,Levy,Li,Sheffer,Alliez]PGP [Ray,Levy,Li,Sheffer,Alliez] Circle Packings Circle Packings [Bobenko], [Bobenko],

[Schroeder][Schroeder]

Finite elements with dynamic Finite elements with dynamic function basesfunction bases

3. Non-Linear DGP3. Non-Linear DGPGalerkin Finite Elements (linear)Galerkin Finite Elements (linear)

•Operator equation: Lf = gOperator equation: Lf = g e.g. L = ∆ = ∂e.g. L = ∆ = ∂22./∂x./∂x22 + ∂ + ∂22./∂y./∂y22

without rhs (g = 0): Laplacewithout rhs (g = 0): Laplace with rhs (g = arbitrary function): Poissonwith rhs (g = arbitrary function): Poisson

•Function basis (Function basis (i): f = i): f = ii ii

•Scalar Product: <f,g> = ∫ f(x) g(x) dxScalar Product: <f,g> = ∫ f(x) g(x) dx

i, <Lf, i, <Lf, ii> = <g, > = <g, ii>>

3. Non-Linear DGP3. Non-Linear DGPGalerkin Finite Elements (linear)Galerkin Finite Elements (linear)

<L<Lii, , jj>>

<L<L11, , 11>> <L<L11, , nn>>

<L<Lnn, , 11>> <L<Lnn, , nn>>

<g, <g, 11>>

<g, <g, nn>>

…………

…………

11

nn

==

3. Non-Linear DGP3. Non-Linear DGPFrustation withFrustation with Galerkin FEMGalerkin FEM

Fixed function basisFixed function basis DFBDFB (demo)(demo)

3. Non-Linear DGP3. Non-Linear DGPDynamic Function BasesDynamic Function Bases

p = (xp = (x11,y,y11, …, x, …, xmm, y, ymm)) ii( x( x,,y)y)pp,,

ii

3. Non-Linear DGP3. Non-Linear DGPDynamic Function BasesDynamic Function Bases

f = f = ii ii((pp11, p, p22, …, p, …, pmm, x,y), x,y)

= = ii ii((pp,,xx))

Galerkin: Galerkin: i, <Lf, i, <Lf, ii> = <g, > = <g, ii>>

DFB: minimize F(p,DFB: minimize F(p,)) |Lf – g| |Lf – g|22

Solve for f [Solve for f [] and for ] and for its sampling [p]its sampling [p]

3. Non-Linear DGP3. Non-Linear DGPOptimization with DFB: general algorithmOptimization with DFB: general algorithm

While |While | F | > F | >

22 F F 22 ,p,p F F F F

22 p,p, F F 22 p,pp,p F F p p pp F F= -= -solvesolve

p p p + p + pp

End whileEnd while

3. Non-Linear DGP3. Non-Linear DGP Instancing the general algorithmInstancing the general algorithm

Lf = g operator L, rhs g, basis (Lf = g operator L, rhs g, basis (ii)) Numerical estimation of Numerical estimation of F and F and 22F F

∂ ∂./∂. ∫ L./∂. ∫ Li i x L x Ljj ∂./∂. ∫ L ∂./∂. ∫ Li i x gx g

(smoothness of Lloyd, Wenping Wang)(smoothness of Lloyd, Wenping Wang)

First example: L = Identity, f = gFirst example: L = Identity, f = g

(ARDECO (ARDECO approximationapproximation with DFP) with DFP)

3. Non-Linear DGP3. Non-Linear DGPARDECO (Bitmap ARDECO (Bitmap SVG) SVG)

3. Non-Linear DGP3. Non-Linear DGPARDECO (Bitmap ARDECO (Bitmap SVG)SVG)

3. Non-Linear DGP3. Non-Linear DGPARDECO (Bitmap ARDECO (Bitmap SVG)SVG)

3. Non-Linear DGP3. Non-Linear DGPARDECO (Bitmap ARDECO (Bitmap SVG)SVG)

300 postcript gradients300 postcript gradients (original: 1M pixels)(original: 1M pixels)

3. Non-Linear DGP3. Non-Linear DGPARDECO (Bitmap ARDECO (Bitmap SVG)SVG)

3. Non-Linear DGP3. Non-Linear DGPDFB research programDFB research program

2D: Laplace Eqn, Poisson Eqn2D: Laplace Eqn, Poisson Eqn 1D+t: Heat eqn (sugg. by F. Durand)1D+t: Heat eqn (sugg. by F. Durand) 2D: ARDECO2D: ARDECO 2D+t: Navier-Stokes2D+t: Navier-Stokes 3D: Light Simulation, Mesh-to-splines3D: Light Simulation, Mesh-to-splines 3D+t: Misc. physics3D+t: Misc. physics

Available tools: Available tools: mixed symbolic/numeric solvermixed symbolic/numeric solver

3. Non-Linear DGP3. Non-Linear DGPFinding a good control meshFinding a good control mesh

3. Non-Linear DGP3. Non-Linear DGPFinding a good control meshFinding a good control mesh

ConclusionsConclusions

The DGP community can directly The DGP community can directly benefit from the advances done by benefit from the advances done by the NA communitythe NA community

Solving for the approximation Solving for the approximation and and the samplingthe sampling seems to be an seems to be an interresting research avenueinterresting research avenue

AknowledgemesAknowledgemes

IK organizing comitteeIK organizing comittee AIM@ShapeAIM@Shape INRIA/GEOREPINRIA/GEOREP Fench ministry of research/ACI SHOWFench ministry of research/ACI SHOW

Wenping Wang (HKU)Wenping Wang (HKU) Fredo Durand, Matthias Zwicker (MIT)Fredo Durand, Matthias Zwicker (MIT) Students: B. Vallet, N. Ray, W.C. Li, G. LecotStudents: B. Vallet, N. Ray, W.C. Li, G. Lecot