• Keine Ergebnisse gefunden

x, Vector &amp

N/A
N/A
Protected

Academic year: 2021

Aktie "x, Vector &amp"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Numerical Simulation of Transport Processes in Porous Media WS 13/14

Dr. Olaf Ippisch, Ole Klein IWR, Universit¨at Heidelberg

Exercise Sheet No.5 Deadline: 26. Nov 2013

EXERCISE5 PRECONDITIONEDCONJUGATEGRADIENTMETHOD

In the lecture we introduced the Conjugate Gradient Method for solving systems of linear equations corresponding to symmetric positive definite matrices. The effectiveness of this method may be improved by employing a preconditioner.

In this exercise you will implement both the Conjugate Gradient (CG) method and the Conjugate Gradient method with a symmetric SOR (CG SSOR) preconditioner. Therefore you will extend the interface of yourCRSMatrixclass by adding the functions

bool CRSMatrix::cgssor_solve(Vector & x, Vector & b)

bool CRSMatrix::cg_solve(Vector & x, Vector & b)

which solve the systemA~x=~b.

The algorithm for the CG methodwithoutpreconditioning is given in the following listing:

~v=d~=~b−A~x d0 =d~Td;~ dk=d0

while(dk ≥ε2·d0) {

~t=A~v α=dk/ ~vT~t

~

x=~x+α~v d~=d~−α~t dkold =dk; dk=d~Td~ β =dk/dkold v=d~+β~v }

(2)

The algorithm for the CG methodwithpreconditioning reads:

d~=~b−A~x

solveM ~z=d~

~v=~z

ρk0 =d~T~z while(ρk ≥ε2·ρ0) {

~t=A~v α=ρk/ ~vT~t

~

x=~x+α~v d~=d~−α~t

solveM ~z=d~ ρkoldk ρk=d~T~z β =ρkkold

~

v=~z+β~v }

HereM denotes the preconditioner matrix. For the SOR method it was given byM =L+ Dω where Lis the lower left submatrix ofAandDholds only the diagonal entries ofA. Within the context of the CG method we require the preconditioner to be symmetric. Hence, we employ the SSOR method corresponding to a matrix

M = D

ω +L ω

2−ωD−1 D

ω +LT

.

For the SSOR-preconditioner the stepsolveM ~z=d~may be computed by:

~v= 0

for(i= 0;i < n; ++i)

vi

di−X

j<i

aijvj

/aii

~

τ =d~−A~v

~ σ= 0

for(i=n−1;i >= 0;−−i)

σi

τi−X

j>i

aijσj

/aii

~

z=~v+~σ

Apply both the CG method and the CG SSOR method to the test problems inmain.ccand compare their performance. Also compare to the SSOR solver from the last exercise (set the solver through the macros at the beginning ofmain.cc). Increase the resolution of the groundwater problem until the time required for solving the resulting system with the CG SSOR method exceeds three minutes.

How many degrees of freedom (in this case: grid cells) correspond to this problem?

5 Points

Referenzen

ÄHNLICHE DOKUMENTE

But, a block diagonal matrix is positive definite iff each diagonal block is positive definite, which concludes the proof.. (2) This is because for any symmetric matrix, T , and

In order to reveal the solution structure, the partial radial distribution functions have to be determined by using isotope substitution technique yielding different diffraction

In this problem finding more it- erations of He’s variational iteration method is very time consuming, so modification of the initial guess can provide an accurate and

A scheme of generating efficient methods for solving non- linear equations and optimization problems which is based on a combined application of the computation methods of

Thus, when the advanced starting basis was used together with a feasible initial solution, the number of iterations for finding an optimal solution by the reduced gradient method is

• This implies that no vector in the set can be represented as a linear combination of the remaining vectors in the set.. • In other words: A set of vectors is linearly independent

In this section the objective function J is analyzed, then gradient based methods to solve opti- mization problems are presented and finally a fast and accurate way to calculate

AN EFFICIENT POSlTIYE DEFINITE METHOD FOR THE NUMERICAL SOLUTION OF THE ADVECTION EQUATION..