Introduction to Scientific Computing II Overview Michael Bader
Introduction to Scientific Computing II Overview Michael Bader
Recall: Scientific Computing “Pipeline”
Topic #1 – SLE (numerical treatment, implementation) ? ? ?
Topic #2 – Molecular Dynamics (entire pipeline for one application)
Prerequisites • discretisation of PDEs • linear algebra • Gaussian elimination • basics on iterative solvers • Jacobi, Gauss-Seidel, SOR, MG • matlab
Organization • lecture (90 min/week) – theory – methods – simple examples • tutorials (45 min/week) – more examples – make your own experiences
What Determines the Grading? • written exam at the end of the semester • no weighting of tutorials however: solving tutorials is essential - for understanding and remembering subjects - for your success in the exam
Course Material • slides (short, only headwords) • exercise sheets make your own lecture notes! find your own solutions! solutions presented in the tutorials
Contact • for questions contact us after the lectures • or fix a date per email Michael Bader: bader@in. tum. de Wolfgang Eckhardt: eckhardw@in. tum. de
Introduction to Scientific Computing II From Gaussian Elimination to Multigrid – A Recapitulation
What’s the Problem to be Solved? Application Scenario Partial Differential Equations Modelling Scientific Computing I Systems of linear equations ! ! ! his LU, Richardson, Jacobi, Gauss-Seidel, SOR, MG Scientific Computing I, Scientific Computing Lab, Numerical Programming I t n o e r o M Finite Elements Finite Differences (Finite Volumes) Scientific Computing I Numerical Programming II
Example Equation two-dimensional Poisson equation heat equation diffusion membranes … v v v v grid + finite differences
Typical SLE sparse band structure
Example
Gaussian Elimination (LU)
Gaussian Elimination (LU)
Gaussian Elimination (LU)
Gaussian Elimination (LU)
Gaussian Elimination (LU)
Gaussian Elimination (LU)
Gaussian Elimination (LU)
Gaussian Elimination (LU)
Gaussian Elimination (LU)
Gaussian Elimination – Costs Storage: (for an n-by-n grid) • matrix has N = n 2 rows • in L and U: n new non-zeros per row • therefore: O(Nn) = O(n 3) bytes In 3 D: • N = n 3 rows, n 2 new non-zeros • therefore: O(Nn 2) = O(n 5) bytes
Gaussian Elimination – Costs Operations: • matrix has N = n 2 rows • for each row, eliminate n non-zeros in column below • addition of rows requ. O(n) operations • therefore: O(Nn 2) = O(n 4) operations In 3 D: • N = n 3 rows, n 2 new non-zeros • therefore: O(Nn 4) = O(n 7) operations
Gaussian Elimination – Costs Storage: (for an n-by-n grid) • 2 D: O(Nn) = O(n 3) bytes • 3 D: O(Nn 2) = O(n 5) bytes Computation: • 2 D: O(Nn 2) = O(n 4) operations • 3 D: O(Nn 4) = O(n 7) operations Even for problems of modest size (n = 100 -1000) Gaussian Elimination is unfeasible
Iterative Solvers – Principle series of approximations costs per iteration? convergence? stopping criterion?
Relaxation Methods problem: order an amount of peas on a straight line (corresponds to solving uxx=0)
Relaxation Methods – Gauss-Seidel sequentially place peas on the line between two neighbours
Relaxation Methods – Gauss-Seidel sequentially place peas on the line between two neighbours
Relaxation Methods – Gauss-Seidel sequentially place peas on the line between two neighbours
Relaxation Methods – Gauss-Seidel sequentially place peas on the line between two neighbours
Relaxation Methods – Gauss-Seidel sequentially place peas on the line between two neighbours
Relaxation Methods – Gauss-Seidel sequentially place peas on the line between two neighbours
Relaxation Methods – Gauss-Seidel sequentially place peas on the line between two neighbours
Relaxation Methods – Gauss-Seidel sequentially place peas on the line between two neighbours
Relaxation Methods – Gauss-Seidel sequentially place peas on the line between two neighbours
Relaxation Methods – Gauss-Seidel sequentially place peas on the line between two neighbours
Relaxation Methods – Gauss-Seidel sequentially place peas on the line between two neighbours
Relaxation Methods – Gauss-Seidel sequentially place peas on the line between two neighbours
Relaxation Methods – Gauss-Seidel sequentially place peas on the line between two neighbours
Relaxation Methods – Gauss-Seidel sequentially place peas on the line between two neighbours
Relaxation Methods – Gauss-Seidel sequentially place peas on the line between two neighbours
Relaxation Methods – Gauss-Seidel sequentially place peas on the line between two neighbours
Relaxation Methods – Gauss-Seidel sequentially place peas on the line between two neighbours
Relaxation Methods – Gauss-Seidel sequentially place peas on the line between two neighbours
Relaxation Methods – Gauss-Seidel sequentially place peas on the line between two neighbours
Relaxation Methods – Gauss-Seidel sequentially place peas on the line between two neighbours
Relaxation Methods – Gauss-Seidel sequentially place peas on the line between two neighbours
Relaxation Methods – Gauss-Seidel sequentially place peas on the line between two neighbours we get a smooth curve instead of a straight line global error is locally (almost) invisible
Relaxation Methods problem: order an amount of peas on a straight line (corresponds to solving uxx=0)
Relaxation Methods – Jacobi place peas on the line between two neighbours in parallel
Relaxation Methods – Jacobi place peas on the line between two neighbours in parallel
Relaxation Methods – Jacobi place peas on the line between two neighbours in parallel
Relaxation Methods – Jacobi place peas on the line between two neighbours in parallel we get a high plus a low frequency oscillation these fequencies are locally (almost) invisible
Relaxation Methods problem: order an amount of peas on a straight line (corresponds to solving uxx=0)
Relaxation Methods – SOR sequentially correct location of peas a little more than to the line between two neighbours
Relaxation Methods – SOR sequentially correct location of peas a little more than to the line between two neighbours
Relaxation Methods – SOR sequentially correct location of peas a little more than to the line between two neighbours
Relaxation Methods – SOR sequentially correct location of peas a little more than to the line between two neighbours
Relaxation Methods – SOR sequentially correct location of peas a little more than to the line between two neighbours
Relaxation Methods – SOR
Relaxation Methods – SOR sequentially correct location of peas a little more than to the line between two neighbours
Relaxation Methods – SOR sequentially correct location of peas a little more than to the line between two neighbours
Relaxation Methods – SOR sequentially correct location of peas a little more than to the line between two neighbours
Relaxation Methods – SOR sequentially correct location of peas a little more than to the line between two neighbours
Relaxation Methods – SOR sequentially correct location of peas a little more than to the line between two neighbours
Relaxation Methods – SOR sequentially correct location of peas a little more than to the line between two neighbours
Relaxation Methods – SOR sequentially correct location of peas a little more than to the line between two neighbours
Relaxation Methods – SOR sequentially correct location of peas a little more than to the line between two neighbours
Relaxation Methods – SOR sequentially correct location of peas a little more than to the line between two neighbours
Relaxation Methods – SOR sequentially correct location of peas a little more than to the line between two neighbours
Relaxation Methods – SOR sequentially correct location of peas a little more than to the line between two neighbours
Relaxation Methods – SOR sequentially correct location of peas a little more than to the line between two neighbours
Relaxation Methods – SOR sequentially correct location of peas a little more than to the line between two neighbours
Relaxation Methods – SOR sequentially correct location of peas a little more than to the line between two neighbours
Relaxation Methods – SOR sequentially correct location of peas a little more than to the line between two neighbours
Relaxation Methods – SOR sequentially correct location of peas a little more than to the line between two neighbours
Relaxation Methods – SOR sequentially correct location of peas a little more than to the line between two neighbours better than GS and J, but still not optimal
Relaxation Methods problem: order an amount of peas on a straight line (corresponds to solving uxx=0)
Relaxation Methods – Hierarchical place peas on the line between two neighbours in parallel, but in a hierarchical way from coarse to smooth
Relaxation Methods – Hierarchical place peas on the line between two neighbours in parallel, but in a hierarchical way from coarse to smooth
Relaxation Methods – Hierarchical place peas on the line between two neighbours in parallel, but in a hierarchical way from coarse to smooth
Relaxation Methods – Hierarchical place peas on the line between two neighbours in parallel, but in a hierarchical way from coarse to smooth exact solution in one step unfortunately only in 1 D, 2 D and 3 D: multigrid
- Slides: 84