Biconjugate gradient method
From CFD-Wiki
Biconjugate gradient method
Biconjugate gradient method could be summarized as follows
System of equation
For the given system of equation
Ax = b ;
b = source vector
x = solution variable for which we seek the solution
A = coefficient matrix
M = the precondioning matrix constructued by matrix A
Algorithm
- Allocate temperary vectors r,z,p,q, rtilde,ztilde,qtilde
- Allocate temerary reals rho_1, rho_2 , alpha, beta
-
- r := b - A
x
- rtilde = r
-
- for i := 1 step 1 until max_itr do
- solve (M
z = r )
- solve (MT
ztilde = rtilde )
- rho_1 = z
rtilde
- if i = 1 then
- p := z
- ptilde := ztilde
- p := z
- else
- beta = (rho_1/rho_2)
- p = z + beta * p
- ptilde = ztilde + beta * ptilde
- beta = (rho_1/rho_2)
- end if
- q := A
p
- qtilde := AT
ptilde
- alpha = rho_1 / (ptilde
q)
- x = x + alpha * p
- r = r - alpha * q
- rtilde = rtilde - alpha * qtilde
- rho_2 = rho_1
- solve (M
- end (i-loop)
-
- deallocate all temp memory
- return TRUE