Title: Introduction to Scientific Computing II
1Introduction to Scientific Computing II
2Recall Scientific Computing Pipeline
3Topic 1 SLE(numerical treatment,
implementation)
???
4Topic 2 Molecular Dynamics(entire pipeline
for one application)
5Prerequisites
- discretisation of PDEs
- linear algebra
- Gaussian elimination
- basics on iterative solvers
- Jacobi, Gauss-Seidel, SOR, MG
- matlab
6Organization
- lecture (90 min/week)
- theory
- methods
- simple examples
- tutorials (45 min/week)
- more examples
- make your own experiences
7What 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
8Course Material
- slides (short, only headwords)
- exercise sheets
- make your own lecture notes!
- find your own solutions!
- solutions presented in the tutorials
9Contact
- for questions contact us after the lectures
- or fix a date per emailMichael Bader
bader_at_in.tum.de Wolfgang Eckhardteckhardw_at_in.
tum.de
10Introduction to Scientific Computing II
- From Gaussian Elimination to Multigrid A
Recapitulation
11Whats the Problem to be Solved?
Application Scenario
Partial Differential Equations
Modelling Scientific Computing I
Finite Elements Finite Differences (Finite
Volumes) Scientific Computing I Numerical
Programming II
Systems of linear equations
LU, Richardson, Jacobi, Gauss-Seidel, SOR,
MG Scientific Computing I, Scientific Computing
Lab, Numerical Programming I
More on this!!!
12Example Equation
- two-dimensional Poisson equation
- heat equation
- diffusion
- membranes
grid finite differences
13Typical SLE
14Example
15Gaussian Elimination (LU)
16Gaussian Elimination (LU)
17Gaussian Elimination (LU)
18Gaussian Elimination (LU)
19Gaussian Elimination (LU)
20Gaussian Elimination (LU)
21Gaussian Elimination (LU)
22Gaussian Elimination (LU)
23Gaussian Elimination (LU)
24Gaussian Elimination Costs
- Storage (for an n-by-n grid)
- matrix has N n2 rows
- in L and U n new non-zeros per row
- therefore O(Nn) O(n3) bytes
- In 3D
- N n3 rows, n2 new non-zeros
- therefore O(Nn2) O(n5) bytes
25Gaussian Elimination Costs
- Operations
- matrix has N n2 rows
- for each row, eliminate n non-zeros in column
below - addition of rows requ. O(n) operations
- therefore O(Nn2) O(n4) operations
- In 3D
- N n3 rows, n2 new non-zeros
- therefore O(Nn4) O(n7) operations
26Gaussian Elimination Costs
- Storage (for an n-by-n grid)
- 2D O(Nn) O(n3) bytes
- 3D O(Nn2) O(n5) bytes
- Computation
- 2D O(Nn2) O(n4) operations
- 3D O(Nn4) O(n7) operations
- Even for problems of modest size (n 100-1000) ?
Gaussian Elimination is unfeasible
27Iterative Solvers Principle
- series of approximations
- costs per iteration?
- convergence?
- stopping criterion?
28Relaxation Methods
problem order an amount of peas on a straight
line (corresponds to solving uxx0)
29Relaxation Methods Gauss-Seidel
sequentially place peas on the line between two
neighbours
30Relaxation Methods Gauss-Seidel
sequentially place peas on the line between two
neighbours
31Relaxation Methods Gauss-Seidel
sequentially place peas on the line between two
neighbours
32Relaxation Methods Gauss-Seidel
sequentially place peas on the line between two
neighbours
33Relaxation Methods Gauss-Seidel
sequentially place peas on the line between two
neighbours
34Relaxation Methods Gauss-Seidel
sequentially place peas on the line between two
neighbours
35Relaxation Methods Gauss-Seidel
sequentially place peas on the line between two
neighbours
36Relaxation Methods Gauss-Seidel
sequentially place peas on the line between two
neighbours
37Relaxation Methods Gauss-Seidel
sequentially place peas on the line between two
neighbours
38Relaxation Methods Gauss-Seidel
sequentially place peas on the line between two
neighbours
39Relaxation Methods Gauss-Seidel
sequentially place peas on the line between two
neighbours
40Relaxation Methods Gauss-Seidel
sequentially place peas on the line between two
neighbours
41Relaxation Methods Gauss-Seidel
sequentially place peas on the line between two
neighbours
42Relaxation Methods Gauss-Seidel
sequentially place peas on the line between two
neighbours
43Relaxation Methods Gauss-Seidel
sequentially place peas on the line between two
neighbours
44Relaxation Methods Gauss-Seidel
sequentially place peas on the line between two
neighbours
45Relaxation Methods Gauss-Seidel
sequentially place peas on the line between two
neighbours
46Relaxation Methods Gauss-Seidel
sequentially place peas on the line between two
neighbours
47Relaxation Methods Gauss-Seidel
sequentially place peas on the line between two
neighbours
48Relaxation Methods Gauss-Seidel
sequentially place peas on the line between two
neighbours
49Relaxation Methods Gauss-Seidel
sequentially place peas on the line between two
neighbours
50Relaxation 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
51Relaxation Methods
problem order an amount of peas on a straight
line (corresponds to solving uxx0)
52Relaxation Methods Jacobi
place peas on the line between two neighbours in
parallel
53Relaxation Methods Jacobi
place peas on the line between two neighbours in
parallel
54Relaxation Methods Jacobi
place peas on the line between two neighbours in
parallel
55Relaxation 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
56Relaxation Methods
problem order an amount of peas on a straight
line (corresponds to solving uxx0)
57Relaxation Methods SOR
sequentially correct location of peas a little
more than to the line between two neighbours
58Relaxation Methods SOR
sequentially correct location of peas a little
more than to the line between two neighbours
59Relaxation Methods SOR
sequentially correct location of peas a little
more than to the line between two neighbours
60Relaxation Methods SOR
sequentially correct location of peas a little
more than to the line between two neighbours
61Relaxation Methods SOR
sequentially correct location of peas a little
more than to the line between two neighbours
62Relaxation Methods SOR
63Relaxation Methods SOR
sequentially correct location of peas a little
more than to the line between two neighbours
64Relaxation Methods SOR
sequentially correct location of peas a little
more than to the line between two neighbours
65Relaxation Methods SOR
sequentially correct location of peas a little
more than to the line between two neighbours
66Relaxation Methods SOR
sequentially correct location of peas a little
more than to the line between two neighbours
67Relaxation Methods SOR
sequentially correct location of peas a little
more than to the line between two neighbours
68Relaxation Methods SOR
sequentially correct location of peas a little
more than to the line between two neighbours
69Relaxation Methods SOR
sequentially correct location of peas a little
more than to the line between two neighbours
70Relaxation Methods SOR
sequentially correct location of peas a little
more than to the line between two neighbours
71Relaxation Methods SOR
sequentially correct location of peas a little
more than to the line between two neighbours
72Relaxation Methods SOR
sequentially correct location of peas a little
more than to the line between two neighbours
73Relaxation Methods SOR
sequentially correct location of peas a little
more than to the line between two neighbours
74Relaxation Methods SOR
sequentially correct location of peas a little
more than to the line between two neighbours
75Relaxation Methods SOR
sequentially correct location of peas a little
more than to the line between two neighbours
76Relaxation Methods SOR
sequentially correct location of peas a little
more than to the line between two neighbours
77Relaxation Methods SOR
sequentially correct location of peas a little
more than to the line between two neighbours
78Relaxation Methods SOR
sequentially correct location of peas a little
more than to the line between two neighbours
79Relaxation 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
80Relaxation Methods
problem order an amount of peas on a straight
line (corresponds to solving uxx0)
81Relaxation Methods Hierarchical
place peas on the line between two neighbours in
parallel, but in a hierarchical way from coarse
to smooth
82Relaxation Methods Hierarchical
place peas on the line between two neighbours in
parallel, but in a hierarchical way from coarse
to smooth
83Relaxation Methods Hierarchical
place peas on the line between two neighbours in
parallel, but in a hierarchical way from coarse
to smooth
84Relaxation 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 1D, 2D and 3D multigrid