Iterative Solvers for Linear Systems



Similar documents
Yousef Saad University of Minnesota Computer Science and Engineering. CRM Montreal - April 30, 2008

Introduction to the Finite Element Method

Chapter 9 Partial Differential Equations

MPI Hands-On List of the exercises

FRIEDRICH-ALEXANDER-UNIVERSITÄT ERLANGEN-NÜRNBERG

1 Finite difference example: 1D implicit heat equation

ME6130 An introduction to CFD 1-1

Numerical Methods For Image Restoration

Hash-Storage Techniques for Adaptive Multilevel Solvers and Their Domain Decomposition Parallelization

Part II: Finite Difference/Volume Discretisation for CFD

CUDA for Real Time Multigrid Finite Element Simulation of

Numerical Methods for Differential Equations

TESLA Report

Computational fluid dynamics (CFD) 9 th SIMLAB Course

The Application of a Black-Box Solver with Error Estimate to Different Systems of PDEs

Express Introductory Training in ANSYS Fluent Lecture 1 Introduction to the CFD Methodology

6.3 Multigrid Methods

AN INTRODUCTION TO NUMERICAL METHODS AND ANALYSIS

Simulation of Fluid-Structure Interactions in Aeronautical Applications

Course Outline for the Masters Programme in Computational Engineering

Numerical Methods I Solving Linear Systems: Sparse Matrices, Iterative Methods and Non-Square Systems

Proposal 1: Model-Based Control Method for Discrete-Parts machining processes

CFD simulations using an AMR-like approach in the PDE Framework Peano

Modeling of Earth Surface Dynamics and Related Problems Using OpenFOAM

How High a Degree is High Enough for High Order Finite Elements?

Multigrid preconditioning for nonlinear (degenerate) parabolic equations with application to monument degradation

Fast Multipole Method for particle interactions: an open source parallel library component

POISSON AND LAPLACE EQUATIONS. Charles R. O Neill. School of Mechanical and Aerospace Engineering. Oklahoma State University. Stillwater, OK 74078

Large-Scale Reservoir Simulation and Big Data Visualization

SIXTY STUDY QUESTIONS TO THE COURSE NUMERISK BEHANDLING AV DIFFERENTIALEKVATIONER I

HPC enabling of OpenFOAM R for CFD applications

APPENDIX 3 CFD CODE - PHOENICS

OpenFOAM Optimization Tools

From CFD to computational finance (and back again?)

Customer Training Material. Lecture 2. Introduction to. Methodology ANSYS FLUENT. ANSYS, Inc. Proprietary 2010 ANSYS, Inc. All rights reserved.

Giorgio Bornia. Research statement. Primary interests

FEM Software Automation, with a case study on the Stokes Equations

AeroFluidX: A Next Generation GPU-Based CFD Solver for Engineering Applications

Finite Element Formulation for Beams - Handout 2 -

HPC Deployment of OpenFOAM in an Industrial Setting

Vista: A Multi-field Object Oriented CFD-package

The Basics of FEA Procedure

AN INTERFACE STRIP PRECONDITIONER FOR DOMAIN DECOMPOSITION METHODS

Poisson Equation Solver Parallelisation for Particle-in-Cell Model

Linear Equations in Linear Algebra

Numerical Methods for Engineers

Dynamic Process Modeling. Process Dynamics and Control

Heavy Parallelization of Alternating Direction Schemes in Multi-Factor Option Valuation Models. Cris Doloc, Ph.D.

An asynchronous Oneshot method with Load Balancing

Towards real-time image processing with Hierarchical Hybrid Grids

Experiences Extending the CFD Solver of the PDE Framework Peano

Simple Methods and Procedures Used in Forecasting

A Load Balancing Tool for Structured Multi-Block Grid CFD Applications

Optimization of Supply Chain Networks

Design and Optimization of OpenFOAM-based CFD Applications for Hybrid and Heterogeneous HPC Platforms

A Multi-layered Domain-specific Language for Stencil Computations

TWO-DIMENSIONAL FINITE ELEMENT ANALYSIS OF FORCED CONVECTION FLOW AND HEAT TRANSFER IN A LAMINAR CHANNEL FLOW

Sampling based sensitivity analysis: a case study in aerospace engineering

SOLVING LINEAR SYSTEMS

ABSTRACT FOR THE 1ST INTERNATIONAL WORKSHOP ON HIGH ORDER CFD METHODS

Computational Optical Imaging - Optique Numerique. -- Deconvolution --

Performance of Dynamic Load Balancing Algorithms for Unstructured Mesh Calculations

An Additive Neumann-Neumann Method for Mortar Finite Element for 4th Order Problems

High-fidelity electromagnetic modeling of large multi-scale naval structures

Introduction to the Finite Element Method (FEM)

Introduction to CFD Analysis

440 Geophysics: Heat flow with finite differences

Finite Difference Approach to Option Pricing

Paper Pulp Dewatering

A PARALLEL GEOMETRIC MULTIGRID METHOD FOR FINITE ELEMENTS ON OCTREE MESHES

CFD Application on Food Industry; Energy Saving on the Bread Oven

CONVERGE Features, Capabilities and Applications

CBE 6333, R. Levicky 1 Review of Fluid Mechanics Terminology

Mean value theorem, Taylors Theorem, Maxima and Minima.

Finite Element Method (ENGC 6321) Syllabus. Second Semester

FUNDAMENTAL FINITE ELEMENT ANALYSIS AND APPLICATIONS

Lecture Notes to Accompany. Scientific Computing An Introductory Survey. by Michael T. Heath. Chapter 10

GAM for large datasets and load forecasting

Turbomachinery CFD on many-core platforms experiences and strategies

Advanced CFD Methods 1

Real-Time Fluid Dynamics for Games. Jos Stam Research Alias wavefront

Does Black-Scholes framework for Option Pricing use Constant Volatilities and Interest Rates? New Solution for a New Problem

How To Write A Program For The Pd Framework

Pricing Options with Discrete Dividends by High Order Finite Differences and Grid Stretching

Dimensionless form of equations

Moving Least Squares Approximation

Høgskolen i Narvik Sivilingeniørutdanningen STE6237 ELEMENTMETODER. Oppgaver

Which strategy to move the mesh in the Computational Fluid Dynamic code OpenFOAM

Feature Commercial codes In-house codes

Mesh Generation and Load Balancing

Monifysikaalisten ongelmien simulointi Elmer-ohjelmistolla. Simulation of Multiphysical Problems with Elmer Software

Solving NP Hard problems in practice lessons from Computer Vision and Computational Biology

CIVL 7/8117 Chapter 3a - Development of Truss Equations 1/80

Scalable Distributed Schur Complement Solvers for Internal and External Flow Computations on Many-Core Architectures

FINITE DIFFERENCE METHODS

Hardware-Aware Analysis and. Presentation Date: Sep 15 th 2009 Chrissie C. Cui

Transcription:

9th SimLab Course on Parallel Numerical Simulation, 4.10 8.10.2010 Iterative Solvers for Linear Systems Bernhard Gatzhammer Chair of Scientific Computing in Computer Science Technische Universität München Germany

Outline Poisson-Equation: From the Model to an Equation System Direct Solvers vs. Iterative Solvers Jacobi and Gauss-Seidel Method Residual and Smoothness Multigrid Solver

Outline Poisson-Equation: From the Model to an Equation System Direct Solvers vs. Iterative Solvers Jacobi and Gauss-Seidel Method Residual and Smoothness Multigrid Solver

The Poisson Equation An Elliptic PDE General: 2 R d, ± 2 R d 1, u :! R u = f in ( = r 2 = r r) @ 2 u @ 2 1 + @2 u @ 2 2 + : : : + @2 u @ 2 d = f in u = g on ± 1D: 2 R, @ 2 u @ 2 = f in 2D: 2 R 2, @ 2 u @ 2 1 + @2 u @ 2 2 = f in

Why the Poisson Equation is of Importance The Laplace operator is part of many important PDEs: Heat equation: diffusion of heat

Why the Poisson Equation is of Importance The Laplace operator is part of many important PDEs: Flow dynamics: friction between molecules

Why the Poisson Equation is of Importance The Laplace operator is part of many important PDEs: Structural mechanics: displacement of membrane structures

Why the Poisson Equation is of Importance The Laplace operator is part of many important PDEs: Electrics: electric-, magnetic potentials

Why the Poisson Equation is of Importance The Laplace operator is part of many important PDEs: Financial mathematics: Diffusive process for option pricing

Why the Poisson Equation is of Importance The Laplace operator is part of many important PDEs: Heat equation: diffusion of heat Flow dynamics: friction between molecules Structural mechanics: displacement of membrane structures Electrics: electric-, magnetic potentials Financial mathematics: Diffusive process for option pricing...

Discretization with Finite Differences I Find solution to Poisson equation numerically on a computer: Computer has only a finite amount of memory/power discretization Finite Differences as simple discretization Idea: Replace derivative by difference u( + h) u() h h!0! @u @ + h u() u( h) h h!0! @u @ h

Discretization with Finite Differences II Use forward and backward differences for 2 nd derivatives: forward diff.: backward diff.: @ 2 u @ = @ 2 @ ¼ @ @ ¼ = @u @ u( + h) u() h u( + h) u() h u( + h) 2u() + u( h) h 2 u( + h h) u( h) h h

Grid, Stencil, and Matri 1D Regular Cartesian grid: Nodal equation: Stencil: h 1 2 3 i = ih u i 1 2u i + u i+1 = h 2 f i 1 2 1 i 1 i i+1 System matri: A = 1 h 2 0 @ 2 1 0 1 1 2 1 A 2

Grid, Stencil, and Matri 2D Regular Cartesian grid: Nodal equation: h h u i 1;j + u i+1;j + u i;j 1 + u i;j+1 4u i;j = h 2 f i;j i;j = (ih; jh) Stencil: 1 i;j+1 1 4 1 i 1;j i;j 1 i;j 1 i+1;j

Grid, Stencil, and Matri 2D System matri: 1 1 4 1 1 h h A = 1 h 2 0 1 4 1 1 1 4 1 1 1 4 1 1 4 1 1 1 1 4 1 1 1 1 4 1 B 1 4 1 C @ 1 1 4 1 A 1 1 4

Discretized Poisson Equation We obtain a system of equations to be solved: Au = f, A 2 R N N, u; f 2 R N N is the number of grid unknowns, i.e. equations f contains sink/source terms and boundary influences We want to obtain u = A 1 f

Outline Poisson-Equation: From the Model to an Equation System Direct Solvers vs. Iterative Solvers Jacobi and Gauss-Seidel Method Residual and Smoothness Multigrid Solver

Direct Solvers of Systems of Linear Equations Popular direct solvers for Au = f : U = Gaussian elimination LU decomposition Cholesky factorization T N ::: T 2 Au = T N ::: T 2 f, Uu = f 0 A = LU, LUu = f, Uu = L 1 f A = U T U compute u = A 1 f directly up to numerical accuracy computational compleity of GEM in 2D: O(h 6 ), in 3D: O(h 9 ) GEM optimized for band-structure: in 2D: O(h 4 ), in 3D: O(h 7 )

Runtime of GEM for Solving Poisson 2D h N runtime (33 TFlop/s) 2-8 65.536 0.5 sec 2-9 262.144 8.3 sec 16 2-1.048.576 2 min 23 sec 2-11 4.194.304 35 min 32 sec 2-12 16.777.216 9 h 28 min 38 sec 2-13 67.108.864 6 d 7 h 28 min 10 sec

Runtime of GEM for Solving Poisson 3D h N runtime (33 TFlop/s) 2-6 262.144 8 min 53 sec 2-7 2.097.152 18 h 57 min 26 sec 128 2-8 16.777.216 100 d 26 h 10 min 53 sec 2-9 134.217.728 35 a 156 d 57 h 53 min 04 sec

Iterative Solvers of Systems of Linear Equations In contrast to direct solvers, iterative solvers Compute approimate solutions u k ¼ A 1 f Improve the approimation in an iterative process One iteration is cheap to compute, in 2D O(h 2 ), in 3D O(h 3 ) Fipoint iteration: Types of methods: u k+1 = F(u k ) k!1! u = F(u) Splitting methods, Krylov-subspace methods, Multigrid methods

Outline Poisson-Equation: From the Model to an Equation System Direct Solvers vs. Iterative Solvers Jacobi and Gauss-Seidel Method Residual and Smoothness Multigrid Solver

Splitting Methods Split up matri A: Update rule: Au = f (S + T )u = f Su k+1 = f T u k u k+1 = S 1 (f T u k ) u k+1 = F (u k ) Matri S has to be of simple form to to get u k+1

The Jacobi Method Choose: Splitting: Update rule: S = diag(a) := D A A = S + T = D A + (A D A ) Au = f (D A + (A D A ))u = f D A u k+1 = (f (A D A )u k ) u k+1 = D 1 A (f (A D A)u k ) u k+1 i = 1 a ii (f i NX a ij u k j ) j=1 j6=i

Jacobi Method Eample 1D Heat Equation Stationary heat equation with u as temperature: Boundaries have zero temperature, no sources: @ 2 u @ 2 = f in f = 0 Solution is known: u = 0 u k+1 i = 1 a ii (f i NX j=1 j6=i a ij u j ) =) u k+1 i = 1 2 (uk i 1 + u k i+1)

Jacobi Method Eample 1D Heat Equation Unit domain: := [0; 1]; h = 1 8 ; N = 7 0 1 2 1 1 2 1 1 2 1 A = 1 2 1 B 1 2 1 C @ 1 2 1 A 1 2

Jacobi Method Eample 1D Heat Equation Random initial value u 0 = rand(n)

Jacobi Method Eample 1D Heat Equation k = 0 0 u k+1 = 1 1 2 (uk i 1 + u k i+1) i

Jacobi Method Eample 1D Heat Equation k = 1

Jacobi Method Eample 1D Heat Equation k = 2

Jacobi Method Eample 1D Heat Equation k = 3

Jacobi Method Eample 1D Heat Equation k = 4

Jacobi Method Eample 1D Heat Equation k = 5

Jacobi Method Eample 1D Heat Equation k = 6

Jacobi Method Eample 1D Heat Equation k = 7

Jacobi Method Eample 1D Heat Equation k = 8

Jacobi Method Eample 1D Heat Equation k = 8 Initial values

The Gauss-Seidel Method Choose: Splitting: Update rule: S = L(A) := L A A = S + T = L A + (A L A ) Au = f (L A + (A L A ))u = f L A u k+1 = (f (A L A )u k ) u k+1 = L 1 A (f (A L A)u k ) u k+1 i = 1 a ii (f i Xi 1 j=1 a ij u k+1 j NX j=i+1 a ij u k j )

Gauss-Seidel Method Eample 1D Heat Equation Stationary heat equation with u as temperature: Boundaries have zero temperature, no sources: @ 2 u @ 2 = f in f = 0 Solution is known: u = 0 u k+1 i = 1 a ii (f i Xi 1 j=1 a ij u k+1 j NX j=i+1 a ij u k j ) =) u k+1 i = 1 2 (uk+1 i 1 + uk i+1)

Gauss-Seidel Method Eample 1D Heat Equation Random initial value u 0 = rand(n)

Gauss-Seidel Method Eample 1D Heat Equation k = 0

Gauss-Seidel Method Eample 1D Heat Equation k = 0

Gauss-Seidel Method Eample 1D Heat Equation k = 0

Gauss-Seidel Method Eample 1D Heat Equation k = 0

Gauss-Seidel Method Eample 1D Heat Equation k = 0

Gauss-Seidel Method Eample 1D Heat Equation k = 0

Gauss-Seidel Method Eample 1D Heat Equation k = 0

Gauss-Seidel Method Eample 1D Heat Equation k = 1

Gauss-Seidel Method Eample 1D Heat Equation k = 2

Gauss-Seidel Method Eample 1D Heat Equation k = 3

Gauss-Seidel Method Eample 1D Heat Equation k = 4

Gauss-Seidel Method Eample 1D Heat Equation k = 5

Gauss-Seidel Method Eample 1D Heat Equation k = 6

Gauss-Seidel Method Eample 1D Heat Equation k = 7

Gauss-Seidel Method Eample 1D Heat Equation k = 8

Gauss-Seidel Method Eample 1D Heat Equation k = 8 Initial values

Gauss-Seidel Method Eample 1D Heat Equation k = 8 Jacobi after 8 iterations

Outline Poisson-Equation: From the Model to an Equation System Direct Solvers vs. Iterative Solvers Jacobi and Gauss-Seidel Method Residual and Smoothness Multigrid Solver

Residual Residual: Au = f Au k 6= f f Au k = res k Splitting: Au = (S + T )u = f u k+1 = S 1 (f T u k ) u k+1 = S 1 (f (A S)u k ) u k+1 = S 1 (f Au k ) + u k u k+1 = u k + S 1 res k

Residual for 1D Heat Equation Eample Local influences form residual: u i 1 2u i + u i+1 = 0 u k i 1 2u k i + u k i+1 = res k i GS k = 0: high residual oscillatory error/fct values GS k = 8: low residual smooth error/fct values

Smoothness Observation Smoothnes depends on grid resolution h : Error reduction h = 1 : 8 h = 1 : 4 k! k + 1 h = 1 : 2

Outline Poisson-Equation: From the Model to an Equation System Direct Solvers vs. Iterative Solvers Jacobi and Gauss-Seidel Method Residual and Smoothness Multigrid Solver

Geometric Multigrid Idea Only high error frequencies are removed effectively Frequencies depend on grid resolution Idea: Use several grid levels Use splitting method to smooth error on each grid level

Multigrid Eample 1D Heat Equation Random initial value u 0 = rand(n)

Multigrid Eample 1D Heat Equation k = 0, N = 1

Multigrid Eample 1D Heat Equation k = 0, N = 1

Multigrid Eample 1D Heat Equation k = 0, N = 3

Multigrid Eample 1D Heat Equation k = 0, N = 3

Multigrid Eample 1D Heat Equation k = 0, N = 7

Multigrid Eample 1D Heat Equation k = 1

Thank you for your attention!